repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_documentation_string stringlengths 1 47.2k | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.user_identity_make_primary | def user_identity_make_primary(self, user_id, id, data, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/user_identities#make-identity-primary"
api_path = "/api/v2/users/{user_id}/identities/{id}/make_primary"
api_path = api_path.format(user_id=user_id, id=id)
return self.cal... | python | def user_identity_make_primary(self, user_id, id, data, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/user_identities#make-identity-primary"
api_path = "/api/v2/users/{user_id}/identities/{id}/make_primary"
api_path = api_path.format(user_id=user_id, id=id)
return self.cal... | https://developer.zendesk.com/rest_api/docs/core/user_identities#make-identity-primary | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L3942-L3946 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.user_identity_show | def user_identity_show(self, user_id, id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/user_identities#show-identity"
api_path = "/api/v2/users/{user_id}/identities/{id}.json"
api_path = api_path.format(user_id=user_id, id=id)
return self.call(api_path, **kwargs) | python | def user_identity_show(self, user_id, id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/user_identities#show-identity"
api_path = "/api/v2/users/{user_id}/identities/{id}.json"
api_path = api_path.format(user_id=user_id, id=id)
return self.call(api_path, **kwargs) | https://developer.zendesk.com/rest_api/docs/core/user_identities#show-identity | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L3954-L3958 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.user_organization_membership_create | def user_organization_membership_create(self, user_id, data, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/organization_memberships#create-membership"
api_path = "/api/v2/users/{user_id}/organization_memberships.json"
api_path = api_path.format(user_id=user_id)
return self... | python | def user_organization_membership_create(self, user_id, data, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/organization_memberships#create-membership"
api_path = "/api/v2/users/{user_id}/organization_memberships.json"
api_path = api_path.format(user_id=user_id)
return self... | https://developer.zendesk.com/rest_api/docs/core/organization_memberships#create-membership | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L3978-L3982 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.user_organization_membership_make_default | def user_organization_membership_make_default(self, id, membership_id, data, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/organization_memberships#set-membership-as-default"
api_path = "/api/v2/users/{id}/organization_memberships/{membership_id}/make_default.json"
api_path = api_... | python | def user_organization_membership_make_default(self, id, membership_id, data, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/organization_memberships#set-membership-as-default"
api_path = "/api/v2/users/{id}/organization_memberships/{membership_id}/make_default.json"
api_path = api_... | https://developer.zendesk.com/rest_api/docs/core/organization_memberships#set-membership-as-default | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L3990-L3994 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.user_organization_membership_show | def user_organization_membership_show(self, user_id, id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/organization_memberships#show-membership"
api_path = "/api/v2/users/{user_id}/organization_memberships/{id}.json"
api_path = api_path.format(user_id=user_id, id=id)
retur... | python | def user_organization_membership_show(self, user_id, id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/organization_memberships#show-membership"
api_path = "/api/v2/users/{user_id}/organization_memberships/{id}.json"
api_path = api_path.format(user_id=user_id, id=id)
retur... | https://developer.zendesk.com/rest_api/docs/core/organization_memberships#show-membership | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L3996-L4000 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.user_organization_memberships | def user_organization_memberships(self, user_id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/organization_memberships#list-memberships"
api_path = "/api/v2/users/{user_id}/organization_memberships.json"
api_path = api_path.format(user_id=user_id)
return self.call(api_pat... | python | def user_organization_memberships(self, user_id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/organization_memberships#list-memberships"
api_path = "/api/v2/users/{user_id}/organization_memberships.json"
api_path = api_path.format(user_id=user_id)
return self.call(api_pat... | https://developer.zendesk.com/rest_api/docs/core/organization_memberships#list-memberships | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L4002-L4006 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.user_organization_subscriptions | def user_organization_subscriptions(self, user_id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/organization_subscriptions#list-organization-subscriptions"
api_path = "/api/v2/users/{user_id}/organization_subscriptions.json"
api_path = api_path.format(user_id=user_id)
ret... | python | def user_organization_subscriptions(self, user_id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/organization_subscriptions#list-organization-subscriptions"
api_path = "/api/v2/users/{user_id}/organization_subscriptions.json"
api_path = api_path.format(user_id=user_id)
ret... | https://developer.zendesk.com/rest_api/docs/core/organization_subscriptions#list-organization-subscriptions | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L4008-L4012 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.user_organizations | def user_organizations(self, user_id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/organizations#list-organizations"
api_path = "/api/v2/users/{user_id}/organizations.json"
api_path = api_path.format(user_id=user_id)
return self.call(api_path, **kwargs) | python | def user_organizations(self, user_id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/organizations#list-organizations"
api_path = "/api/v2/users/{user_id}/organizations.json"
api_path = api_path.format(user_id=user_id)
return self.call(api_path, **kwargs) | https://developer.zendesk.com/rest_api/docs/core/organizations#list-organizations | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L4014-L4018 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.user_password_requirements | def user_password_requirements(self, user_id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/users#get-a-list-of-password-requirements"
api_path = "/api/v2/users/{user_id}/password/requirements.json"
api_path = api_path.format(user_id=user_id)
return self.call(api_path, **k... | python | def user_password_requirements(self, user_id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/users#get-a-list-of-password-requirements"
api_path = "/api/v2/users/{user_id}/password/requirements.json"
api_path = api_path.format(user_id=user_id)
return self.call(api_path, **k... | https://developer.zendesk.com/rest_api/docs/core/users#get-a-list-of-password-requirements | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L4026-L4030 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.user_related | def user_related(self, id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/users#user-related-information"
api_path = "/api/v2/users/{id}/related.json"
api_path = api_path.format(id=id)
return self.call(api_path, **kwargs) | python | def user_related(self, id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/users#user-related-information"
api_path = "/api/v2/users/{id}/related.json"
api_path = api_path.format(id=id)
return self.call(api_path, **kwargs) | https://developer.zendesk.com/rest_api/docs/core/users#user-related-information | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L4038-L4042 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.user_requests | def user_requests(self, id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/requests#list-requests"
api_path = "/api/v2/users/{id}/requests.json"
api_path = api_path.format(id=id)
return self.call(api_path, **kwargs) | python | def user_requests(self, id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/requests#list-requests"
api_path = "/api/v2/users/{id}/requests.json"
api_path = api_path.format(id=id)
return self.call(api_path, **kwargs) | https://developer.zendesk.com/rest_api/docs/core/requests#list-requests | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L4044-L4048 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.user_session_show | def user_session_show(self, user_id, id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/sessions#show-session"
api_path = "/api/v2/users/{user_id}/sessions/{id}.json"
api_path = api_path.format(user_id=user_id, id=id)
return self.call(api_path, **kwargs) | python | def user_session_show(self, user_id, id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/sessions#show-session"
api_path = "/api/v2/users/{user_id}/sessions/{id}.json"
api_path = api_path.format(user_id=user_id, id=id)
return self.call(api_path, **kwargs) | https://developer.zendesk.com/rest_api/docs/core/sessions#show-session | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L4056-L4060 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.user_sessions | def user_sessions(self, user_id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/sessions#list-sessions"
api_path = "/api/v2/users/{user_id}/sessions.json"
api_path = api_path.format(user_id=user_id)
return self.call(api_path, **kwargs) | python | def user_sessions(self, user_id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/sessions#list-sessions"
api_path = "/api/v2/users/{user_id}/sessions.json"
api_path = api_path.format(user_id=user_id)
return self.call(api_path, **kwargs) | https://developer.zendesk.com/rest_api/docs/core/sessions#list-sessions | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L4062-L4066 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.user_sessions_delete | def user_sessions_delete(self, user_id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/sessions#bulk-deleting-sessions"
api_path = "/api/v2/users/{user_id}/sessions.json"
api_path = api_path.format(user_id=user_id)
return self.call(api_path, method="DELETE", **kwargs) | python | def user_sessions_delete(self, user_id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/sessions#bulk-deleting-sessions"
api_path = "/api/v2/users/{user_id}/sessions.json"
api_path = api_path.format(user_id=user_id)
return self.call(api_path, method="DELETE", **kwargs) | https://developer.zendesk.com/rest_api/docs/core/sessions#bulk-deleting-sessions | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L4068-L4072 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.user_show | def user_show(self, id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/users#show-user"
api_path = "/api/v2/users/{id}.json"
api_path = api_path.format(id=id)
return self.call(api_path, **kwargs) | python | def user_show(self, id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/users#show-user"
api_path = "/api/v2/users/{id}.json"
api_path = api_path.format(id=id)
return self.call(api_path, **kwargs) | https://developer.zendesk.com/rest_api/docs/core/users#show-user | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L4074-L4078 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.user_skips | def user_skips(self, user_id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/ticket_skips#list-skips-for-the-current-account"
api_path = "/api/v2/users/{user_id}/skips.json"
api_path = api_path.format(user_id=user_id)
return self.call(api_path, **kwargs) | python | def user_skips(self, user_id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/ticket_skips#list-skips-for-the-current-account"
api_path = "/api/v2/users/{user_id}/skips.json"
api_path = api_path.format(user_id=user_id)
return self.call(api_path, **kwargs) | https://developer.zendesk.com/rest_api/docs/core/ticket_skips#list-skips-for-the-current-account | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L4080-L4084 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.user_tags | def user_tags(self, id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/tags#show-tags"
api_path = "/api/v2/users/{id}/tags.json"
api_path = api_path.format(id=id)
return self.call(api_path, **kwargs) | python | def user_tags(self, id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/tags#show-tags"
api_path = "/api/v2/users/{id}/tags.json"
api_path = api_path.format(id=id)
return self.call(api_path, **kwargs) | https://developer.zendesk.com/rest_api/docs/core/tags#show-tags | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L4092-L4096 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.user_tags_delete | def user_tags_delete(self, id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/tags#remove-tags"
api_path = "/api/v2/users/{id}/tags.json"
api_path = api_path.format(id=id)
return self.call(api_path, method="DELETE", **kwargs) | python | def user_tags_delete(self, id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/tags#remove-tags"
api_path = "/api/v2/users/{id}/tags.json"
api_path = api_path.format(id=id)
return self.call(api_path, method="DELETE", **kwargs) | https://developer.zendesk.com/rest_api/docs/core/tags#remove-tags | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L4098-L4102 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.user_tickets_assigned | def user_tickets_assigned(self, user_id, external_id=None, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/tickets#allowed-for"
api_path = "/api/v2/users/{user_id}/tickets/assigned.json"
api_path = api_path.format(user_id=user_id)
api_query = {}
if "query" in kwargs.... | python | def user_tickets_assigned(self, user_id, external_id=None, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/tickets#allowed-for"
api_path = "/api/v2/users/{user_id}/tickets/assigned.json"
api_path = api_path.format(user_id=user_id)
api_query = {}
if "query" in kwargs.... | https://developer.zendesk.com/rest_api/docs/core/tickets#allowed-for | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L4110-L4122 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.users_autocomplete | def users_autocomplete(self, name=None, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/users#autocomplete-users"
api_path = "/api/v2/users/autocomplete.json"
api_query = {}
if "query" in kwargs.keys():
api_query.update(kwargs["query"])
del kwargs["qu... | python | def users_autocomplete(self, name=None, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/users#autocomplete-users"
api_path = "/api/v2/users/autocomplete.json"
api_query = {}
if "query" in kwargs.keys():
api_query.update(kwargs["query"])
del kwargs["qu... | https://developer.zendesk.com/rest_api/docs/core/users#autocomplete-users | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L4158-L4169 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.users_create_many | def users_create_many(self, data, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/users#create-many-users"
api_path = "/api/v2/users/create_many.json"
return self.call(api_path, method="POST", data=data, **kwargs) | python | def users_create_many(self, data, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/users#create-many-users"
api_path = "/api/v2/users/create_many.json"
return self.call(api_path, method="POST", data=data, **kwargs) | https://developer.zendesk.com/rest_api/docs/core/users#create-many-users | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L4171-L4174 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.users_create_or_update | def users_create_or_update(self, data, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/users#create-or-update-user"
api_path = "/api/v2/users/create_or_update.json"
return self.call(api_path, method="POST", data=data, **kwargs) | python | def users_create_or_update(self, data, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/users#create-or-update-user"
api_path = "/api/v2/users/create_or_update.json"
return self.call(api_path, method="POST", data=data, **kwargs) | https://developer.zendesk.com/rest_api/docs/core/users#create-or-update-user | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L4176-L4179 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.users_create_or_update_many | def users_create_or_update_many(self, data, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/users#create-or-update-many-users"
api_path = "/api/v2/users/create_or_update_many.json"
return self.call(api_path, method="POST", data=data, **kwargs) | python | def users_create_or_update_many(self, data, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/users#create-or-update-many-users"
api_path = "/api/v2/users/create_or_update_many.json"
return self.call(api_path, method="POST", data=data, **kwargs) | https://developer.zendesk.com/rest_api/docs/core/users#create-or-update-many-users | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L4181-L4184 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.users_destroy_many | def users_destroy_many(self, external_ids=None, ids=None, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/users#bulk-deleting-users"
api_path = "/api/v2/users/destroy_many.json"
api_query = {}
if "query" in kwargs.keys():
api_query.update(kwargs["query"])
... | python | def users_destroy_many(self, external_ids=None, ids=None, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/users#bulk-deleting-users"
api_path = "/api/v2/users/destroy_many.json"
api_query = {}
if "query" in kwargs.keys():
api_query.update(kwargs["query"])
... | https://developer.zendesk.com/rest_api/docs/core/users#bulk-deleting-users | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L4186-L4201 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.users_list | def users_list(self, permission_set=None, role=None, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/users#list-users"
api_path = "/api/v2/users.json"
api_query = {}
if "query" in kwargs.keys():
api_query.update(kwargs["query"])
del kwargs["query"]
... | python | def users_list(self, permission_set=None, role=None, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/users#list-users"
api_path = "/api/v2/users.json"
api_query = {}
if "query" in kwargs.keys():
api_query.update(kwargs["query"])
del kwargs["query"]
... | https://developer.zendesk.com/rest_api/docs/core/users#list-users | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L4203-L4218 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.users_me | def users_me(self, include=None, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/users#show-the-currently-authenticated-user"
api_path = "/api/v2/users/me.json"
api_query = {}
if "query" in kwargs.keys():
api_query.update(kwargs["query"])
del kwargs["... | python | def users_me(self, include=None, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/users#show-the-currently-authenticated-user"
api_path = "/api/v2/users/me.json"
api_query = {}
if "query" in kwargs.keys():
api_query.update(kwargs["query"])
del kwargs["... | https://developer.zendesk.com/rest_api/docs/core/users#show-the-currently-authenticated-user | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L4220-L4231 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.users_me_merge | def users_me_merge(self, data, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/users#merge-self-with-another-user"
api_path = "/api/v2/users/me/merge.json"
return self.call(api_path, method="PUT", data=data, **kwargs) | python | def users_me_merge(self, data, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/users#merge-self-with-another-user"
api_path = "/api/v2/users/me/merge.json"
return self.call(api_path, method="PUT", data=data, **kwargs) | https://developer.zendesk.com/rest_api/docs/core/users#merge-self-with-another-user | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L4238-L4241 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.users_request_create | def users_request_create(self, data, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/users#request-user-create"
api_path = "/api/v2/users/request_create.json"
return self.call(api_path, method="POST", data=data, **kwargs) | python | def users_request_create(self, data, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/users#request-user-create"
api_path = "/api/v2/users/request_create.json"
return self.call(api_path, method="POST", data=data, **kwargs) | https://developer.zendesk.com/rest_api/docs/core/users#request-user-create | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L4258-L4261 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.users_update_many | def users_update_many(self, data, external_ids=None, ids=None, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/users#update-many-users"
api_path = "/api/v2/users/update_many.json"
api_query = {}
if "query" in kwargs.keys():
api_query.update(kwargs["query"])
... | python | def users_update_many(self, data, external_ids=None, ids=None, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/users#update-many-users"
api_path = "/api/v2/users/update_many.json"
api_query = {}
if "query" in kwargs.keys():
api_query.update(kwargs["query"])
... | https://developer.zendesk.com/rest_api/docs/core/users#update-many-users | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L4297-L4312 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.view_count | def view_count(self, id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/views#get-view-count"
api_path = "/api/v2/views/{id}/count.json"
api_path = api_path.format(id=id)
return self.call(api_path, **kwargs) | python | def view_count(self, id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/views#get-view-count"
api_path = "/api/v2/views/{id}/count.json"
api_path = api_path.format(id=id)
return self.call(api_path, **kwargs) | https://developer.zendesk.com/rest_api/docs/core/views#get-view-count | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L4314-L4318 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.view_create | def view_create(self, data, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/views#create-view"
api_path = "/api/v2/views.json"
return self.call(api_path, method="POST", data=data, **kwargs) | python | def view_create(self, data, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/views#create-view"
api_path = "/api/v2/views.json"
return self.call(api_path, method="POST", data=data, **kwargs) | https://developer.zendesk.com/rest_api/docs/core/views#create-view | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L4320-L4323 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.view_delete | def view_delete(self, id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/views#delete-view"
api_path = "/api/v2/views/{id}.json"
api_path = api_path.format(id=id)
return self.call(api_path, method="DELETE", **kwargs) | python | def view_delete(self, id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/views#delete-view"
api_path = "/api/v2/views/{id}.json"
api_path = api_path.format(id=id)
return self.call(api_path, method="DELETE", **kwargs) | https://developer.zendesk.com/rest_api/docs/core/views#delete-view | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L4325-L4329 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.view_execute | def view_execute(self, id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/views#execute-view"
api_path = "/api/v2/views/{id}/execute.json"
api_path = api_path.format(id=id)
return self.call(api_path, **kwargs) | python | def view_execute(self, id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/views#execute-view"
api_path = "/api/v2/views/{id}/execute.json"
api_path = api_path.format(id=id)
return self.call(api_path, **kwargs) | https://developer.zendesk.com/rest_api/docs/core/views#execute-view | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L4331-L4335 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.view_export | def view_export(self, id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/views#export-view"
api_path = "/api/v2/views/{id}/export.json"
api_path = api_path.format(id=id)
return self.call(api_path, **kwargs) | python | def view_export(self, id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/views#export-view"
api_path = "/api/v2/views/{id}/export.json"
api_path = api_path.format(id=id)
return self.call(api_path, **kwargs) | https://developer.zendesk.com/rest_api/docs/core/views#export-view | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L4337-L4341 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.view_show | def view_show(self, id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/views#show-view"
api_path = "/api/v2/views/{id}.json"
api_path = api_path.format(id=id)
return self.call(api_path, **kwargs) | python | def view_show(self, id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/views#show-view"
api_path = "/api/v2/views/{id}.json"
api_path = api_path.format(id=id)
return self.call(api_path, **kwargs) | https://developer.zendesk.com/rest_api/docs/core/views#show-view | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L4343-L4347 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.view_tickets | def view_tickets(self, id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/views#list-tickets-from-a-view"
api_path = "/api/v2/views/{id}/tickets.json"
api_path = api_path.format(id=id)
return self.call(api_path, **kwargs) | python | def view_tickets(self, id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/views#list-tickets-from-a-view"
api_path = "/api/v2/views/{id}/tickets.json"
api_path = api_path.format(id=id)
return self.call(api_path, **kwargs) | https://developer.zendesk.com/rest_api/docs/core/views#list-tickets-from-a-view | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L4349-L4353 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.views_preview | def views_preview(self, data, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/views#previewing-views"
api_path = "/api/v2/views/preview.json"
return self.call(api_path, method="POST", data=data, **kwargs) | python | def views_preview(self, data, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/views#previewing-views"
api_path = "/api/v2/views/preview.json"
return self.call(api_path, method="POST", data=data, **kwargs) | https://developer.zendesk.com/rest_api/docs/core/views#previewing-views | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L4394-L4397 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.views_preview_count | def views_preview_count(self, data, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/views#preview-count"
api_path = "/api/v2/views/preview/count.json"
return self.call(api_path, method="POST", data=data, **kwargs) | python | def views_preview_count(self, data, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/views#preview-count"
api_path = "/api/v2/views/preview/count.json"
return self.call(api_path, method="POST", data=data, **kwargs) | https://developer.zendesk.com/rest_api/docs/core/views#preview-count | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L4399-L4402 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.views_show_many | def views_show_many(self, ids=None, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/views#list-views-by-id"
api_path = "/api/v2/views/show_many.json"
api_query = {}
if "query" in kwargs.keys():
api_query.update(kwargs["query"])
del kwargs["query"]
... | python | def views_show_many(self, ids=None, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/views#list-views-by-id"
api_path = "/api/v2/views/show_many.json"
api_query = {}
if "query" in kwargs.keys():
api_query.update(kwargs["query"])
del kwargs["query"]
... | https://developer.zendesk.com/rest_api/docs/core/views#list-views-by-id | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L4409-L4420 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.views_update_many | def views_update_many(self, data, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/views#update-many-views"
api_path = "/api/v2/views/update_many.json"
return self.call(api_path, method="PUT", data=data, **kwargs) | python | def views_update_many(self, data, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/views#update-many-views"
api_path = "/api/v2/views/update_many.json"
return self.call(api_path, method="PUT", data=data, **kwargs) | https://developer.zendesk.com/rest_api/docs/core/views#update-many-views | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L4422-L4425 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.visitor_create | def visitor_create(self, data, **kwargs):
"https://developer.zendesk.com/rest_api/docs/chat/visitors#create-visitor"
api_path = "/api/v2/visitors"
return self.call(api_path, method="POST", data=data, **kwargs) | python | def visitor_create(self, data, **kwargs):
"https://developer.zendesk.com/rest_api/docs/chat/visitors#create-visitor"
api_path = "/api/v2/visitors"
return self.call(api_path, method="POST", data=data, **kwargs) | https://developer.zendesk.com/rest_api/docs/chat/visitors#create-visitor | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L4427-L4430 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.visitor_show | def visitor_show(self, visitor_id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/chat/visitors#get-a-visitor"
api_path = "/api/v2/visitors/{visitor_id}"
api_path = api_path.format(visitor_id=visitor_id)
return self.call(api_path, **kwargs) | python | def visitor_show(self, visitor_id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/chat/visitors#get-a-visitor"
api_path = "/api/v2/visitors/{visitor_id}"
api_path = api_path.format(visitor_id=visitor_id)
return self.call(api_path, **kwargs) | https://developer.zendesk.com/rest_api/docs/chat/visitors#get-a-visitor | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L4432-L4436 |
fprimex/zdesk | zdesk/zdesk_api.py | ZendeskAPI.visitor_update | def visitor_update(self, visitor_id, data, **kwargs):
"https://developer.zendesk.com/rest_api/docs/chat/visitors#update-visitor"
api_path = "/api/v2/visitors/{visitor_id}"
api_path = api_path.format(visitor_id=visitor_id)
return self.call(api_path, method="PUT", data=data, **kwargs) | python | def visitor_update(self, visitor_id, data, **kwargs):
"https://developer.zendesk.com/rest_api/docs/chat/visitors#update-visitor"
api_path = "/api/v2/visitors/{visitor_id}"
api_path = api_path.format(visitor_id=visitor_id)
return self.call(api_path, method="PUT", data=data, **kwargs) | https://developer.zendesk.com/rest_api/docs/chat/visitors#update-visitor | https://github.com/fprimex/zdesk/blob/851611c13b4d530e9df31390b3ec709baf0a0188/zdesk/zdesk_api.py#L4438-L4442 |
v1k45/django-notify-x | notify/templatetags/notification_tags.py | include_notify_js_variables | def include_notify_js_variables(context):
"""
Inclusion template tag to include all JS variables required by the
notify.js file on the HTML page around <script> tags.
Example::
{% include_notify_js_variables %}
:return: Prepares context for rendering in the inclusion file.
"""
ctx ... | python | def include_notify_js_variables(context):
"""
Inclusion template tag to include all JS variables required by the
notify.js file on the HTML page around <script> tags.
Example::
{% include_notify_js_variables %}
:return: Prepares context for rendering in the inclusion file.
"""
ctx ... | Inclusion template tag to include all JS variables required by the
notify.js file on the HTML page around <script> tags.
Example::
{% include_notify_js_variables %}
:return: Prepares context for rendering in the inclusion file. | https://github.com/v1k45/django-notify-x/blob/b4aa03039759126889666a59117e83dcd4cdb374/notify/templatetags/notification_tags.py#L92-L123 |
v1k45/django-notify-x | notify/templatetags/notification_tags.py | RenderNotificationsNode.generate_html | def generate_html(self, notifications):
"""
Generates rendered HTML content using supplied notifications.
:param notifications: Notification QuerySet Object
:return: Rendered HTML.
"""
html_chunks = []
for nf in notifications:
extra = nf.as_json() if s... | python | def generate_html(self, notifications):
"""
Generates rendered HTML content using supplied notifications.
:param notifications: Notification QuerySet Object
:return: Rendered HTML.
"""
html_chunks = []
for nf in notifications:
extra = nf.as_json() if s... | Generates rendered HTML content using supplied notifications.
:param notifications: Notification QuerySet Object
:return: Rendered HTML. | https://github.com/v1k45/django-notify-x/blob/b4aa03039759126889666a59117e83dcd4cdb374/notify/templatetags/notification_tags.py#L46-L60 |
v1k45/django-notify-x | notify/templatetags/notification_tags.py | RenderNotificationsNode.render | def render(self, context):
"""
Render method of the template tag, returns generated html content to
the parent template where it was called.
:param context: Template context.
:return: Generated HTML content using notification queryset object.
"""
notifications = s... | python | def render(self, context):
"""
Render method of the template tag, returns generated html content to
the parent template where it was called.
:param context: Template context.
:return: Generated HTML content using notification queryset object.
"""
notifications = s... | Render method of the template tag, returns generated html content to
the parent template where it was called.
:param context: Template context.
:return: Generated HTML content using notification queryset object. | https://github.com/v1k45/django-notify-x/blob/b4aa03039759126889666a59117e83dcd4cdb374/notify/templatetags/notification_tags.py#L62-L70 |
v1k45/django-notify-x | notify/models.py | NotificationQueryset.unread_all | def unread_all(self, user=None):
"""
Marks all notifications as unread for a user (if supplied)
:param user: Notification recipient.
:return: Updates QuerySet as unread.
"""
qs = self.read()
if user:
qs = qs.filter(recipient=user)
qs.update(r... | python | def unread_all(self, user=None):
"""
Marks all notifications as unread for a user (if supplied)
:param user: Notification recipient.
:return: Updates QuerySet as unread.
"""
qs = self.read()
if user:
qs = qs.filter(recipient=user)
qs.update(r... | Marks all notifications as unread for a user (if supplied)
:param user: Notification recipient.
:return: Updates QuerySet as unread. | https://github.com/v1k45/django-notify-x/blob/b4aa03039759126889666a59117e83dcd4cdb374/notify/models.py#L71-L82 |
v1k45/django-notify-x | notify/models.py | NotificationQueryset.read_all | def read_all(self, user=None):
"""
Marks all notifications as read for a user (if supplied)
:param user: Notification recipient.
:return: Updates QuerySet as read.
"""
qs = self.unread()
if user:
qs = qs.filter(recipient=user)
qs.update(read=... | python | def read_all(self, user=None):
"""
Marks all notifications as read for a user (if supplied)
:param user: Notification recipient.
:return: Updates QuerySet as read.
"""
qs = self.unread()
if user:
qs = qs.filter(recipient=user)
qs.update(read=... | Marks all notifications as read for a user (if supplied)
:param user: Notification recipient.
:return: Updates QuerySet as read. | https://github.com/v1k45/django-notify-x/blob/b4aa03039759126889666a59117e83dcd4cdb374/notify/models.py#L84-L95 |
v1k45/django-notify-x | notify/models.py | NotificationQueryset.delete_all | def delete_all(self, user=None):
"""
Method to soft-delete all notifications of a User (if supplied)
:param user: Notification recipient.
:return: Updates QuerySet as soft-deleted.
"""
qs = self.active()
if user:
qs = qs.filter(recipient=user)
... | python | def delete_all(self, user=None):
"""
Method to soft-delete all notifications of a User (if supplied)
:param user: Notification recipient.
:return: Updates QuerySet as soft-deleted.
"""
qs = self.active()
if user:
qs = qs.filter(recipient=user)
... | Method to soft-delete all notifications of a User (if supplied)
:param user: Notification recipient.
:return: Updates QuerySet as soft-deleted. | https://github.com/v1k45/django-notify-x/blob/b4aa03039759126889666a59117e83dcd4cdb374/notify/models.py#L97-L114 |
v1k45/django-notify-x | notify/models.py | NotificationQueryset.active_all | def active_all(self, user=None):
"""
Method to soft-delete all notifications of a User (if supplied)
:param user: Notification recipient.
:return: Updates QuerySet as soft-deleted.
"""
qs = self.deleted()
if user:
qs = qs.filter(recipient=user)
... | python | def active_all(self, user=None):
"""
Method to soft-delete all notifications of a User (if supplied)
:param user: Notification recipient.
:return: Updates QuerySet as soft-deleted.
"""
qs = self.deleted()
if user:
qs = qs.filter(recipient=user)
... | Method to soft-delete all notifications of a User (if supplied)
:param user: Notification recipient.
:return: Updates QuerySet as soft-deleted. | https://github.com/v1k45/django-notify-x/blob/b4aa03039759126889666a59117e83dcd4cdb374/notify/models.py#L116-L127 |
v1k45/django-notify-x | notify/utils.py | prefetch_relations | def prefetch_relations(weak_queryset):
"""
FROM: https://djangosnippets.org/snippets/2492/
Consider such a model class::
class Action(models.Model):
actor_content_type = models.ForeignKey(ContentType,related_name='actor')
actor_object_id = models.PositiveIntegerField()
... | python | def prefetch_relations(weak_queryset):
"""
FROM: https://djangosnippets.org/snippets/2492/
Consider such a model class::
class Action(models.Model):
actor_content_type = models.ForeignKey(ContentType,related_name='actor')
actor_object_id = models.PositiveIntegerField()
... | FROM: https://djangosnippets.org/snippets/2492/
Consider such a model class::
class Action(models.Model):
actor_content_type = models.ForeignKey(ContentType,related_name='actor')
actor_object_id = models.PositiveIntegerField()
actor = GenericForeignKey('actor_content_ty... | https://github.com/v1k45/django-notify-x/blob/b4aa03039759126889666a59117e83dcd4cdb374/notify/utils.py#L22-L121 |
v1k45/django-notify-x | notify/views.py | notification_redirect | def notification_redirect(request, ctx):
"""
Helper to handle HTTP response after an action is performed on notification
:param request: HTTP request context of the notification
:param ctx: context to be returned when a AJAX call is made.
:returns: Either JSON for AJAX or redirects to the calcula... | python | def notification_redirect(request, ctx):
"""
Helper to handle HTTP response after an action is performed on notification
:param request: HTTP request context of the notification
:param ctx: context to be returned when a AJAX call is made.
:returns: Either JSON for AJAX or redirects to the calcula... | Helper to handle HTTP response after an action is performed on notification
:param request: HTTP request context of the notification
:param ctx: context to be returned when a AJAX call is made.
:returns: Either JSON for AJAX or redirects to the calculated next page. | https://github.com/v1k45/django-notify-x/blob/b4aa03039759126889666a59117e83dcd4cdb374/notify/views.py#L20-L39 |
v1k45/django-notify-x | notify/views.py | notifications | def notifications(request):
"""
Returns a rendered page of all notifications for the logged-in user.
Uses ``notification.nf_type`` as the template for individual notification.
Each notification type is expected to have a render template
at ``notifications/includes/NOTIFICATION_TYPE.html``.
:par... | python | def notifications(request):
"""
Returns a rendered page of all notifications for the logged-in user.
Uses ``notification.nf_type`` as the template for individual notification.
Each notification type is expected to have a render template
at ``notifications/includes/NOTIFICATION_TYPE.html``.
:par... | Returns a rendered page of all notifications for the logged-in user.
Uses ``notification.nf_type`` as the template for individual notification.
Each notification type is expected to have a render template
at ``notifications/includes/NOTIFICATION_TYPE.html``.
:param request: HTTP request context.
:... | https://github.com/v1k45/django-notify-x/blob/b4aa03039759126889666a59117e83dcd4cdb374/notify/views.py#L43-L56 |
v1k45/django-notify-x | notify/views.py | mark | def mark(request):
"""
Handles marking of individual notifications as read or unread.
Takes ``notification id`` and mark ``action`` as POST data.
:param request: HTTP request context.
:returns: Response to mark action of supplied notification ID.
"""
notification_id = request.POST.get('id'... | python | def mark(request):
"""
Handles marking of individual notifications as read or unread.
Takes ``notification id`` and mark ``action`` as POST data.
:param request: HTTP request context.
:returns: Response to mark action of supplied notification ID.
"""
notification_id = request.POST.get('id'... | Handles marking of individual notifications as read or unread.
Takes ``notification id`` and mark ``action`` as POST data.
:param request: HTTP request context.
:returns: Response to mark action of supplied notification ID. | https://github.com/v1k45/django-notify-x/blob/b4aa03039759126889666a59117e83dcd4cdb374/notify/views.py#L61-L96 |
v1k45/django-notify-x | notify/views.py | mark_all | def mark_all(request):
"""
Marks notifications as either read or unread depending of POST parameters.
Takes ``action`` as POST data, it can either be ``read`` or ``unread``.
:param request: HTTP Request context.
:return: Response to mark_all action.
"""
action = request.POST.get('action', ... | python | def mark_all(request):
"""
Marks notifications as either read or unread depending of POST parameters.
Takes ``action`` as POST data, it can either be ``read`` or ``unread``.
:param request: HTTP Request context.
:return: Response to mark_all action.
"""
action = request.POST.get('action', ... | Marks notifications as either read or unread depending of POST parameters.
Takes ``action`` as POST data, it can either be ``read`` or ``unread``.
:param request: HTTP Request context.
:return: Response to mark_all action. | https://github.com/v1k45/django-notify-x/blob/b4aa03039759126889666a59117e83dcd4cdb374/notify/views.py#L101-L125 |
v1k45/django-notify-x | notify/views.py | delete | def delete(request):
"""
Deletes notification of supplied notification ID.
Depending on project settings, if ``NOTIFICATIONS_SOFT_DELETE``
is set to ``False``, the notifications will be deleted from DB.
If not, a soft delete will be performed.
By default, notifications are deleted softly.
... | python | def delete(request):
"""
Deletes notification of supplied notification ID.
Depending on project settings, if ``NOTIFICATIONS_SOFT_DELETE``
is set to ``False``, the notifications will be deleted from DB.
If not, a soft delete will be performed.
By default, notifications are deleted softly.
... | Deletes notification of supplied notification ID.
Depending on project settings, if ``NOTIFICATIONS_SOFT_DELETE``
is set to ``False``, the notifications will be deleted from DB.
If not, a soft delete will be performed.
By default, notifications are deleted softly.
:param request: HTTP request con... | https://github.com/v1k45/django-notify-x/blob/b4aa03039759126889666a59117e83dcd4cdb374/notify/views.py#L130-L167 |
v1k45/django-notify-x | notify/views.py | notification_update | def notification_update(request):
"""
Handles live updating of notifications, follows ajax-polling approach.
Read more: http://stackoverflow.com/a/12855533/4726598
Required URL parameters: ``flag``.
Explanation:
- The ``flag`` parameter carries the last notification ID \
received... | python | def notification_update(request):
"""
Handles live updating of notifications, follows ajax-polling approach.
Read more: http://stackoverflow.com/a/12855533/4726598
Required URL parameters: ``flag``.
Explanation:
- The ``flag`` parameter carries the last notification ID \
received... | Handles live updating of notifications, follows ajax-polling approach.
Read more: http://stackoverflow.com/a/12855533/4726598
Required URL parameters: ``flag``.
Explanation:
- The ``flag`` parameter carries the last notification ID \
received by the user's browser.
- This ``flag... | https://github.com/v1k45/django-notify-x/blob/b4aa03039759126889666a59117e83dcd4cdb374/notify/views.py#L171-L264 |
v1k45/django-notify-x | notify/views.py | read_and_redirect | def read_and_redirect(request, notification_id):
"""
Marks the supplied notification as read and then redirects
to the supplied URL from the ``next`` URL parameter.
**IMPORTANT**: This is CSRF - unsafe method.
Only use it if its okay for you to mark notifications \
as read without a robust chec... | python | def read_and_redirect(request, notification_id):
"""
Marks the supplied notification as read and then redirects
to the supplied URL from the ``next`` URL parameter.
**IMPORTANT**: This is CSRF - unsafe method.
Only use it if its okay for you to mark notifications \
as read without a robust chec... | Marks the supplied notification as read and then redirects
to the supplied URL from the ``next`` URL parameter.
**IMPORTANT**: This is CSRF - unsafe method.
Only use it if its okay for you to mark notifications \
as read without a robust check.
:param request: HTTP request context.
:param noti... | https://github.com/v1k45/django-notify-x/blob/b4aa03039759126889666a59117e83dcd4cdb374/notify/views.py#L268-L296 |
mezz64/pyHik | pyhik/hikvision.py | HikCamera.get_motion_detection | def get_motion_detection(self):
"""Fetch current motion state from camera"""
url = ('%s/ISAPI/System/Video/inputs/'
'channels/1/motionDetection') % self.root_url
try:
response = self.hik_request.get(url, timeout=CONNECT_TIMEOUT)
except (requests.exceptions.Req... | python | def get_motion_detection(self):
"""Fetch current motion state from camera"""
url = ('%s/ISAPI/System/Video/inputs/'
'channels/1/motionDetection') % self.root_url
try:
response = self.hik_request.get(url, timeout=CONNECT_TIMEOUT)
except (requests.exceptions.Req... | Fetch current motion state from camera | https://github.com/mezz64/pyHik/blob/1e7afca926e2b045257a43cbf8b1236a435493c2/pyhik/hikvision.py#L141-L179 |
mezz64/pyHik | pyhik/hikvision.py | HikCamera._set_motion_detection | def _set_motion_detection(self, enable):
"""Set desired motion detection state on camera"""
url = ('%s/ISAPI/System/Video/inputs/'
'channels/1/motionDetection') % self.root_url
enabled = self._motion_detection_xml.find(self.element_query('enabled'))
if enabled is None:
... | python | def _set_motion_detection(self, enable):
"""Set desired motion detection state on camera"""
url = ('%s/ISAPI/System/Video/inputs/'
'channels/1/motionDetection') % self.root_url
enabled = self._motion_detection_xml.find(self.element_query('enabled'))
if enabled is None:
... | Set desired motion detection state on camera | https://github.com/mezz64/pyHik/blob/1e7afca926e2b045257a43cbf8b1236a435493c2/pyhik/hikvision.py#L189-L218 |
mezz64/pyHik | pyhik/hikvision.py | HikCamera.add_update_callback | def add_update_callback(self, callback, sensor):
"""Register as callback for when a matching device sensor changes."""
self._updateCallbacks.append([callback, sensor])
_LOGGING.debug('Added update callback to %s on %s', callback, sensor) | python | def add_update_callback(self, callback, sensor):
"""Register as callback for when a matching device sensor changes."""
self._updateCallbacks.append([callback, sensor])
_LOGGING.debug('Added update callback to %s on %s', callback, sensor) | Register as callback for when a matching device sensor changes. | https://github.com/mezz64/pyHik/blob/1e7afca926e2b045257a43cbf8b1236a435493c2/pyhik/hikvision.py#L220-L223 |
mezz64/pyHik | pyhik/hikvision.py | HikCamera._do_update_callback | def _do_update_callback(self, msg):
"""Call registered callback functions."""
for callback, sensor in self._updateCallbacks:
if sensor == msg:
_LOGGING.debug('Update callback %s for sensor %s',
callback, sensor)
callback(msg) | python | def _do_update_callback(self, msg):
"""Call registered callback functions."""
for callback, sensor in self._updateCallbacks:
if sensor == msg:
_LOGGING.debug('Update callback %s for sensor %s',
callback, sensor)
callback(msg) | Call registered callback functions. | https://github.com/mezz64/pyHik/blob/1e7afca926e2b045257a43cbf8b1236a435493c2/pyhik/hikvision.py#L225-L231 |
mezz64/pyHik | pyhik/hikvision.py | HikCamera.initialize | def initialize(self):
"""Initialize deviceInfo and available events."""
device_info = self.get_device_info()
if device_info is None:
self.name = None
self.cam_id = None
self.event_states = None
return
for key in device_info:
i... | python | def initialize(self):
"""Initialize deviceInfo and available events."""
device_info = self.get_device_info()
if device_info is None:
self.name = None
self.cam_id = None
self.event_states = None
return
for key in device_info:
i... | Initialize deviceInfo and available events. | https://github.com/mezz64/pyHik/blob/1e7afca926e2b045257a43cbf8b1236a435493c2/pyhik/hikvision.py#L237-L274 |
mezz64/pyHik | pyhik/hikvision.py | HikCamera.get_event_triggers | def get_event_triggers(self):
"""
Returns dict of supported events.
Key = Event Type
List = Channels that have that event activated
"""
events = {}
nvrflag = False
event_xml = []
url = '%s/ISAPI/Event/triggers' % self.root_url
try:
... | python | def get_event_triggers(self):
"""
Returns dict of supported events.
Key = Event Type
List = Channels that have that event activated
"""
events = {}
nvrflag = False
event_xml = []
url = '%s/ISAPI/Event/triggers' % self.root_url
try:
... | Returns dict of supported events.
Key = Event Type
List = Channels that have that event activated | https://github.com/mezz64/pyHik/blob/1e7afca926e2b045257a43cbf8b1236a435493c2/pyhik/hikvision.py#L276-L369 |
mezz64/pyHik | pyhik/hikvision.py | HikCamera.get_device_info | def get_device_info(self):
"""Parse deviceInfo into dictionary."""
device_info = {}
url = '%s/ISAPI/System/deviceInfo' % self.root_url
using_digest = False
try:
response = self.hik_request.get(url, timeout=CONNECT_TIMEOUT)
if response.status_code == reque... | python | def get_device_info(self):
"""Parse deviceInfo into dictionary."""
device_info = {}
url = '%s/ISAPI/System/deviceInfo' % self.root_url
using_digest = False
try:
response = self.hik_request.get(url, timeout=CONNECT_TIMEOUT)
if response.status_code == reque... | Parse deviceInfo into dictionary. | https://github.com/mezz64/pyHik/blob/1e7afca926e2b045257a43cbf8b1236a435493c2/pyhik/hikvision.py#L371-L428 |
mezz64/pyHik | pyhik/hikvision.py | HikCamera.watchdog_handler | def watchdog_handler(self):
"""Take care of threads if wachdog expires."""
_LOGGING.debug('%s Watchdog expired. Resetting connection.', self.name)
self.watchdog.stop()
self.reset_thrd.set() | python | def watchdog_handler(self):
"""Take care of threads if wachdog expires."""
_LOGGING.debug('%s Watchdog expired. Resetting connection.', self.name)
self.watchdog.stop()
self.reset_thrd.set() | Take care of threads if wachdog expires. | https://github.com/mezz64/pyHik/blob/1e7afca926e2b045257a43cbf8b1236a435493c2/pyhik/hikvision.py#L430-L434 |
mezz64/pyHik | pyhik/hikvision.py | HikCamera.disconnect | def disconnect(self):
"""Disconnect from event stream."""
_LOGGING.debug('Disconnecting from stream: %s', self.name)
self.kill_thrd.set()
self.thrd.join()
_LOGGING.debug('Event stream thread for %s is stopped', self.name)
self.kill_thrd.clear() | python | def disconnect(self):
"""Disconnect from event stream."""
_LOGGING.debug('Disconnecting from stream: %s', self.name)
self.kill_thrd.set()
self.thrd.join()
_LOGGING.debug('Event stream thread for %s is stopped', self.name)
self.kill_thrd.clear() | Disconnect from event stream. | https://github.com/mezz64/pyHik/blob/1e7afca926e2b045257a43cbf8b1236a435493c2/pyhik/hikvision.py#L436-L442 |
mezz64/pyHik | pyhik/hikvision.py | HikCamera.alert_stream | def alert_stream(self, reset_event, kill_event):
"""Open event stream."""
_LOGGING.debug('Stream Thread Started: %s, %s', self.name, self.cam_id)
start_event = False
parse_string = ""
fail_count = 0
url = '%s/ISAPI/Event/notification/alertStream' % self.root_url
... | python | def alert_stream(self, reset_event, kill_event):
"""Open event stream."""
_LOGGING.debug('Stream Thread Started: %s, %s', self.name, self.cam_id)
start_event = False
parse_string = ""
fail_count = 0
url = '%s/ISAPI/Event/notification/alertStream' % self.root_url
... | Open event stream. | https://github.com/mezz64/pyHik/blob/1e7afca926e2b045257a43cbf8b1236a435493c2/pyhik/hikvision.py#L449-L531 |
mezz64/pyHik | pyhik/hikvision.py | HikCamera.process_stream | def process_stream(self, tree):
"""Process incoming event stream packets."""
try:
etype = SENSOR_MAP[tree.find(
self.element_query('eventType')).text.lower()]
estate = tree.find(
self.element_query('eventState')).text
echid = tree.find(... | python | def process_stream(self, tree):
"""Process incoming event stream packets."""
try:
etype = SENSOR_MAP[tree.find(
self.element_query('eventType')).text.lower()]
estate = tree.find(
self.element_query('eventState')).text
echid = tree.find(... | Process incoming event stream packets. | https://github.com/mezz64/pyHik/blob/1e7afca926e2b045257a43cbf8b1236a435493c2/pyhik/hikvision.py#L533-L571 |
mezz64/pyHik | pyhik/hikvision.py | HikCamera.update_stale | def update_stale(self):
"""Update stale active statuses"""
# Some events don't post an inactive XML, only active.
# If we don't get an active update for 5 seconds we can
# assume the event is no longer active and update accordingly.
for etype, echannels in self.event_states.items... | python | def update_stale(self):
"""Update stale active statuses"""
# Some events don't post an inactive XML, only active.
# If we don't get an active update for 5 seconds we can
# assume the event is no longer active and update accordingly.
for etype, echannels in self.event_states.items... | Update stale active statuses | https://github.com/mezz64/pyHik/blob/1e7afca926e2b045257a43cbf8b1236a435493c2/pyhik/hikvision.py#L573-L590 |
mezz64/pyHik | pyhik/hikvision.py | HikCamera.publish_changes | def publish_changes(self, etype, echid):
"""Post updates for specified event type."""
_LOGGING.debug('%s Update: %s, %s',
self.name, etype, self.fetch_attributes(etype, echid))
signal = 'ValueChanged.{}'.format(self.cam_id)
sender = '{}.{}'.format(etype, echid)
... | python | def publish_changes(self, etype, echid):
"""Post updates for specified event type."""
_LOGGING.debug('%s Update: %s, %s',
self.name, etype, self.fetch_attributes(etype, echid))
signal = 'ValueChanged.{}'.format(self.cam_id)
sender = '{}.{}'.format(etype, echid)
... | Post updates for specified event type. | https://github.com/mezz64/pyHik/blob/1e7afca926e2b045257a43cbf8b1236a435493c2/pyhik/hikvision.py#L592-L601 |
mezz64/pyHik | pyhik/hikvision.py | HikCamera.fetch_attributes | def fetch_attributes(self, event, channel):
"""Returns attribute list for a given event/channel."""
try:
for sensor in self.event_states[event]:
if sensor[1] == int(channel):
return sensor
except KeyError:
return None | python | def fetch_attributes(self, event, channel):
"""Returns attribute list for a given event/channel."""
try:
for sensor in self.event_states[event]:
if sensor[1] == int(channel):
return sensor
except KeyError:
return None | Returns attribute list for a given event/channel. | https://github.com/mezz64/pyHik/blob/1e7afca926e2b045257a43cbf8b1236a435493c2/pyhik/hikvision.py#L603-L610 |
mezz64/pyHik | pyhik/hikvision.py | HikCamera.update_attributes | def update_attributes(self, event, channel, attr):
"""Update attribute list for current event/channel."""
try:
for i, sensor in enumerate(self.event_states[event]):
if sensor[1] == int(channel):
self.event_states[event][i] = attr
except KeyError:
... | python | def update_attributes(self, event, channel, attr):
"""Update attribute list for current event/channel."""
try:
for i, sensor in enumerate(self.event_states[event]):
if sensor[1] == int(channel):
self.event_states[event][i] = attr
except KeyError:
... | Update attribute list for current event/channel. | https://github.com/mezz64/pyHik/blob/1e7afca926e2b045257a43cbf8b1236a435493c2/pyhik/hikvision.py#L612-L620 |
mezz64/pyHik | pyhik/watchdog.py | Watchdog.start | def start(self):
""" Starts the watchdog timer. """
self._timer = Timer(self.time, self.handler)
self._timer.daemon = True
self._timer.start()
return | python | def start(self):
""" Starts the watchdog timer. """
self._timer = Timer(self.time, self.handler)
self._timer.daemon = True
self._timer.start()
return | Starts the watchdog timer. | https://github.com/mezz64/pyHik/blob/1e7afca926e2b045257a43cbf8b1236a435493c2/pyhik/watchdog.py#L21-L26 |
mezz64/pyHik | examples/basic_usage.py | main | def main():
"""Main function"""
cam = HikCamObject('http://XXX.XXX.XXX.XXX', 80, 'user', 'password')
entities = []
for sensor, channel_list in cam.sensors.items():
for channel in channel_list:
entities.append(HikSensor(sensor, channel[1], cam)) | python | def main():
"""Main function"""
cam = HikCamObject('http://XXX.XXX.XXX.XXX', 80, 'user', 'password')
entities = []
for sensor, channel_list in cam.sensors.items():
for channel in channel_list:
entities.append(HikSensor(sensor, channel[1], cam)) | Main function | https://github.com/mezz64/pyHik/blob/1e7afca926e2b045257a43cbf8b1236a435493c2/examples/basic_usage.py#L97-L105 |
mezz64/pyHik | examples/basic_usage.py | HikCamObject.flip_motion | def flip_motion(self, value):
"""Toggle motion detection"""
if value:
self.cam.enable_motion_detection()
else:
self.cam.disable_motion_detection() | python | def flip_motion(self, value):
"""Toggle motion detection"""
if value:
self.cam.enable_motion_detection()
else:
self.cam.disable_motion_detection() | Toggle motion detection | https://github.com/mezz64/pyHik/blob/1e7afca926e2b045257a43cbf8b1236a435493c2/examples/basic_usage.py#L47-L52 |
mezz64/pyHik | examples/basic_usage.py | HikSensor.update_callback | def update_callback(self, msg):
""" get updates. """
print('Callback: {}'.format(msg))
print('{}:{} @ {}'.format(self.name, self._sensor_state(), self._sensor_last_update())) | python | def update_callback(self, msg):
""" get updates. """
print('Callback: {}'.format(msg))
print('{}:{} @ {}'.format(self.name, self._sensor_state(), self._sensor_last_update())) | get updates. | https://github.com/mezz64/pyHik/blob/1e7afca926e2b045257a43cbf8b1236a435493c2/examples/basic_usage.py#L91-L94 |
mbr/flask-nav | flask_nav/elements.py | NavigationItem.render | def render(self, renderer=None, **kwargs):
"""Render the navigational item using a renderer.
:param renderer: An object implementing the :class:`~.Renderer`
interface.
:return: A markupsafe string with the rendered result.
"""
return Markup(get_renderer(... | python | def render(self, renderer=None, **kwargs):
"""Render the navigational item using a renderer.
:param renderer: An object implementing the :class:`~.Renderer`
interface.
:return: A markupsafe string with the rendered result.
"""
return Markup(get_renderer(... | Render the navigational item using a renderer.
:param renderer: An object implementing the :class:`~.Renderer`
interface.
:return: A markupsafe string with the rendered result. | https://github.com/mbr/flask-nav/blob/06f3b5b2addad29c2fc531a7e8e74958e9e4b793/flask_nav/elements.py#L16-L24 |
mbr/flask-nav | flask_nav/renderers.py | Renderer.visit_object | def visit_object(self, node):
"""Fallback rendering for objects.
If the current application is in debug-mode
(``flask.current_app.debug`` is ``True``), an ``<!-- HTML comment
-->`` will be rendered, indicating which class is missing a visitation
function.
Outside of deb... | python | def visit_object(self, node):
"""Fallback rendering for objects.
If the current application is in debug-mode
(``flask.current_app.debug`` is ``True``), an ``<!-- HTML comment
-->`` will be rendered, indicating which class is missing a visitation
function.
Outside of deb... | Fallback rendering for objects.
If the current application is in debug-mode
(``flask.current_app.debug`` is ``True``), an ``<!-- HTML comment
-->`` will be rendered, indicating which class is missing a visitation
function.
Outside of debug-mode, returns an empty string. | https://github.com/mbr/flask-nav/blob/06f3b5b2addad29c2fc531a7e8e74958e9e4b793/flask_nav/renderers.py#L13-L27 |
mbr/flask-nav | flask_nav/__init__.py | register_renderer | def register_renderer(app, id, renderer, force=True):
"""Registers a renderer on the application.
:param app: The :class:`~flask.Flask` application to register the renderer
on
:param id: Internal id-string for the renderer
:param renderer: Renderer to register
:param force: Whether ... | python | def register_renderer(app, id, renderer, force=True):
"""Registers a renderer on the application.
:param app: The :class:`~flask.Flask` application to register the renderer
on
:param id: Internal id-string for the renderer
:param renderer: Renderer to register
:param force: Whether ... | Registers a renderer on the application.
:param app: The :class:`~flask.Flask` application to register the renderer
on
:param id: Internal id-string for the renderer
:param renderer: Renderer to register
:param force: Whether or not to overwrite the renderer if a different one
... | https://github.com/mbr/flask-nav/blob/06f3b5b2addad29c2fc531a7e8e74958e9e4b793/flask_nav/__init__.py#L6-L21 |
mbr/flask-nav | flask_nav/__init__.py | get_renderer | def get_renderer(app, id):
"""Retrieve a renderer.
:param app: :class:`~flask.Flask` application to look ``id`` up on
:param id: Internal renderer id-string to look up
"""
renderer = app.extensions.get('nav_renderers', {})[id]
if isinstance(renderer, tuple):
mod_name, cls_name = render... | python | def get_renderer(app, id):
"""Retrieve a renderer.
:param app: :class:`~flask.Flask` application to look ``id`` up on
:param id: Internal renderer id-string to look up
"""
renderer = app.extensions.get('nav_renderers', {})[id]
if isinstance(renderer, tuple):
mod_name, cls_name = render... | Retrieve a renderer.
:param app: :class:`~flask.Flask` application to look ``id`` up on
:param id: Internal renderer id-string to look up | https://github.com/mbr/flask-nav/blob/06f3b5b2addad29c2fc531a7e8e74958e9e4b793/flask_nav/__init__.py#L24-L42 |
mbr/flask-nav | flask_nav/__init__.py | Nav.init_app | def init_app(self, app):
"""Initialize an application.
:param app: A :class:`~flask.Flask` app.
"""
if not hasattr(app, 'extensions'):
app.extensions = {}
app.extensions['nav'] = self
app.add_template_global(self.elems, 'nav')
# register some render... | python | def init_app(self, app):
"""Initialize an application.
:param app: A :class:`~flask.Flask` app.
"""
if not hasattr(app, 'extensions'):
app.extensions = {}
app.extensions['nav'] = self
app.add_template_global(self.elems, 'nav')
# register some render... | Initialize an application.
:param app: A :class:`~flask.Flask` app. | https://github.com/mbr/flask-nav/blob/06f3b5b2addad29c2fc531a7e8e74958e9e4b793/flask_nav/__init__.py#L99-L112 |
mbr/flask-nav | flask_nav/__init__.py | Nav.navigation | def navigation(self, id=None):
"""Function decorator for navbar registration.
Convenience function, calls :meth:`.register_element` with ``id`` and
the decorated function as ``elem``.
:param id: ID to pass on. If ``None``, uses the decorated functions
name.
"... | python | def navigation(self, id=None):
"""Function decorator for navbar registration.
Convenience function, calls :meth:`.register_element` with ``id`` and
the decorated function as ``elem``.
:param id: ID to pass on. If ``None``, uses the decorated functions
name.
"... | Function decorator for navbar registration.
Convenience function, calls :meth:`.register_element` with ``id`` and
the decorated function as ``elem``.
:param id: ID to pass on. If ``None``, uses the decorated functions
name. | https://github.com/mbr/flask-nav/blob/06f3b5b2addad29c2fc531a7e8e74958e9e4b793/flask_nav/__init__.py#L114-L128 |
mbr/flask-nav | flask_nav/__init__.py | Nav.renderer | def renderer(self, id=None, force=True):
"""Class decorator for Renderers.
The decorated class will be added to the list of renderers kept by this
instance that will be registered on the app upon app initialization.
:param id: Id for the renderer, defaults to the class name in snake
... | python | def renderer(self, id=None, force=True):
"""Class decorator for Renderers.
The decorated class will be added to the list of renderers kept by this
instance that will be registered on the app upon app initialization.
:param id: Id for the renderer, defaults to the class name in snake
... | Class decorator for Renderers.
The decorated class will be added to the list of renderers kept by this
instance that will be registered on the app upon app initialization.
:param id: Id for the renderer, defaults to the class name in snake
case.
:param force: Whether... | https://github.com/mbr/flask-nav/blob/06f3b5b2addad29c2fc531a7e8e74958e9e4b793/flask_nav/__init__.py#L148-L166 |
tonyseek/openvpn-status | openvpn_status/utils.py | parse_time | def parse_time(time):
"""Parses date and time from input string in OpenVPN logging format."""
if isinstance(time, datetime.datetime):
return time
return datetime.datetime.strptime(time, DATETIME_FORMAT_OPENVPN) | python | def parse_time(time):
"""Parses date and time from input string in OpenVPN logging format."""
if isinstance(time, datetime.datetime):
return time
return datetime.datetime.strptime(time, DATETIME_FORMAT_OPENVPN) | Parses date and time from input string in OpenVPN logging format. | https://github.com/tonyseek/openvpn-status/blob/b8f5ec5f79933605af2301c42e4e7ec230334237/openvpn_status/utils.py#L19-L23 |
jieter/python-lora | lora/payload.py | LoRaPayload.decrypt | def decrypt(self, key, dev_addr):
"""
Decrypt the actual payload in this LoraPayload.
key: 16-byte hex-encoded AES key. (i.e. AABBCCDDEEFFAABBCCDDEEFFAABBCCDD)
dev_addr: 4-byte hex-encoded DevAddr (i.e. AABBCCDD)
"""
sequence_counter = int(self.FCntUp)
return lo... | python | def decrypt(self, key, dev_addr):
"""
Decrypt the actual payload in this LoraPayload.
key: 16-byte hex-encoded AES key. (i.e. AABBCCDDEEFFAABBCCDDEEFFAABBCCDD)
dev_addr: 4-byte hex-encoded DevAddr (i.e. AABBCCDD)
"""
sequence_counter = int(self.FCntUp)
return lo... | Decrypt the actual payload in this LoraPayload.
key: 16-byte hex-encoded AES key. (i.e. AABBCCDDEEFFAABBCCDDEEFFAABBCCDD)
dev_addr: 4-byte hex-encoded DevAddr (i.e. AABBCCDD) | https://github.com/jieter/python-lora/blob/0edb8dbad771da1e2b455571c7a9b064ba67fbcd/lora/payload.py#L38-L47 |
jieter/python-lora | lora/payload.py | LoRaPayload.Lrr_location | def Lrr_location(self):
"""
Return the location of the LRR (Wireless base station/Gateway)
"""
return WKT_POINT_FMT.format(lng=float(self.LrrLON), lat=float(self.LrrLAT)) | python | def Lrr_location(self):
"""
Return the location of the LRR (Wireless base station/Gateway)
"""
return WKT_POINT_FMT.format(lng=float(self.LrrLON), lat=float(self.LrrLAT)) | Return the location of the LRR (Wireless base station/Gateway) | https://github.com/jieter/python-lora/blob/0edb8dbad771da1e2b455571c7a9b064ba67fbcd/lora/payload.py#L49-L53 |
jieter/python-lora | lora/crypto.py | to_bytes | def to_bytes(s):
"""
PY2/PY3 compatible way to convert to something cryptography understands
"""
if sys.version_info < (3,):
return "".join(map(chr, s))
else:
return bytes(s) | python | def to_bytes(s):
"""
PY2/PY3 compatible way to convert to something cryptography understands
"""
if sys.version_info < (3,):
return "".join(map(chr, s))
else:
return bytes(s) | PY2/PY3 compatible way to convert to something cryptography understands | https://github.com/jieter/python-lora/blob/0edb8dbad771da1e2b455571c7a9b064ba67fbcd/lora/crypto.py#L12-L19 |
jieter/python-lora | lora/crypto.py | loramac_decrypt | def loramac_decrypt(payload_hex, sequence_counter, key, dev_addr, direction=UP_LINK):
"""
LoraMac decrypt
Which is actually encrypting a predefined 16-byte block (ref LoraWAN
specification 4.3.3.1) and XORing that with each block of data.
payload_hex: hex-encoded payload (FRMPayload)
sequence_... | python | def loramac_decrypt(payload_hex, sequence_counter, key, dev_addr, direction=UP_LINK):
"""
LoraMac decrypt
Which is actually encrypting a predefined 16-byte block (ref LoraWAN
specification 4.3.3.1) and XORing that with each block of data.
payload_hex: hex-encoded payload (FRMPayload)
sequence_... | LoraMac decrypt
Which is actually encrypting a predefined 16-byte block (ref LoraWAN
specification 4.3.3.1) and XORing that with each block of data.
payload_hex: hex-encoded payload (FRMPayload)
sequence_counter: integer, sequence counter (FCntUp)
key: 16-byte hex-encoded AES key. (i.e. AABBCCDDEE... | https://github.com/jieter/python-lora/blob/0edb8dbad771da1e2b455571c7a9b064ba67fbcd/lora/crypto.py#L22-L105 |
tonyseek/openvpn-status | openvpn_status/parser.py | LogParser.parse | def parse(self):
"""Parses the status log.
:raises ParsingError: if syntax error found in the log.
:return: The :class:`.models.Status` with filled data.
"""
status = Status()
self.expect_line(Status.client_list.label)
status.updated_at = self.expect_tuple(Statu... | python | def parse(self):
"""Parses the status log.
:raises ParsingError: if syntax error found in the log.
:return: The :class:`.models.Status` with filled data.
"""
status = Status()
self.expect_line(Status.client_list.label)
status.updated_at = self.expect_tuple(Statu... | Parses the status log.
:raises ParsingError: if syntax error found in the log.
:return: The :class:`.models.Status` with filled data. | https://github.com/tonyseek/openvpn-status/blob/b8f5ec5f79933605af2301c42e4e7ec230334237/openvpn_status/parser.py#L77-L98 |
tonyseek/openvpn-status | openvpn_status/shortcuts.py | parse_status | def parse_status(status_log, encoding='utf-8'):
"""Parses the status log of OpenVPN.
:param status_log: The content of status log.
:type status_log: :class:`str`
:param encoding: Optional. The encoding of status log.
:type encoding: :class:`str`
:return: The instance of :class:`.models.Status`
... | python | def parse_status(status_log, encoding='utf-8'):
"""Parses the status log of OpenVPN.
:param status_log: The content of status log.
:type status_log: :class:`str`
:param encoding: Optional. The encoding of status log.
:type encoding: :class:`str`
:return: The instance of :class:`.models.Status`
... | Parses the status log of OpenVPN.
:param status_log: The content of status log.
:type status_log: :class:`str`
:param encoding: Optional. The encoding of status log.
:type encoding: :class:`str`
:return: The instance of :class:`.models.Status` | https://github.com/tonyseek/openvpn-status/blob/b8f5ec5f79933605af2301c42e4e7ec230334237/openvpn_status/shortcuts.py#L6-L18 |
vfilimonov/pydatastream | pydatastream/pydatastream.py | Datastream.version | def version(self):
"""Return version of the TR DWE."""
res = self.client.service.Version()
return '.'.join([ustr(x) for x in res[0]]) | python | def version(self):
"""Return version of the TR DWE."""
res = self.client.service.Version()
return '.'.join([ustr(x) for x in res[0]]) | Return version of the TR DWE. | https://github.com/vfilimonov/pydatastream/blob/15d2adac1c83501715db1542373fa8428542816e/pydatastream/pydatastream.py#L119-L122 |
vfilimonov/pydatastream | pydatastream/pydatastream.py | Datastream.system_info | def system_info(self):
"""Return system information."""
res = self.client.service.SystemInfo()
res = {ustr(x[0]): x[1] for x in res[0]}
to_str = lambda arr: '.'.join([ustr(x) for x in arr[0]])
res['OSVersion'] = to_str(res['OSVersion'])
res['RuntimeVersion'] = to_str(res... | python | def system_info(self):
"""Return system information."""
res = self.client.service.SystemInfo()
res = {ustr(x[0]): x[1] for x in res[0]}
to_str = lambda arr: '.'.join([ustr(x) for x in arr[0]])
res['OSVersion'] = to_str(res['OSVersion'])
res['RuntimeVersion'] = to_str(res... | Return system information. | https://github.com/vfilimonov/pydatastream/blob/15d2adac1c83501715db1542373fa8428542816e/pydatastream/pydatastream.py#L124-L139 |
vfilimonov/pydatastream | pydatastream/pydatastream.py | Datastream.sources | def sources(self):
"""Return available sources of data."""
res = self.client.service.Sources(self.userdata, 0)
return [ustr(x[0]) for x in res[0]] | python | def sources(self):
"""Return available sources of data."""
res = self.client.service.Sources(self.userdata, 0)
return [ustr(x[0]) for x in res[0]] | Return available sources of data. | https://github.com/vfilimonov/pydatastream/blob/15d2adac1c83501715db1542373fa8428542816e/pydatastream/pydatastream.py#L141-L144 |
vfilimonov/pydatastream | pydatastream/pydatastream.py | Datastream.request | def request(self, query, source='Datastream',
fields=None, options=None, symbol_set=None, tag=None):
"""General function to retrieve one record in raw format.
query - query string for DWE system. This may be a simple instrument name
or more complicated request. Ref... | python | def request(self, query, source='Datastream',
fields=None, options=None, symbol_set=None, tag=None):
"""General function to retrieve one record in raw format.
query - query string for DWE system. This may be a simple instrument name
or more complicated request. Ref... | General function to retrieve one record in raw format.
query - query string for DWE system. This may be a simple instrument name
or more complicated request. Refer to the documentation for the
format.
source - The name of datasource (default: "Datastream")
... | https://github.com/vfilimonov/pydatastream/blob/15d2adac1c83501715db1542373fa8428542816e/pydatastream/pydatastream.py#L146-L184 |
vfilimonov/pydatastream | pydatastream/pydatastream.py | Datastream.request_many | def request_many(self, queries, source='Datastream',
fields=None, options=None, symbol_set=None, tag=None):
"""General function to retrieve one record in raw format.
query - list of query strings for DWE system.
source - The name of datasource (default: "Datastream")
... | python | def request_many(self, queries, source='Datastream',
fields=None, options=None, symbol_set=None, tag=None):
"""General function to retrieve one record in raw format.
query - list of query strings for DWE system.
source - The name of datasource (default: "Datastream")
... | General function to retrieve one record in raw format.
query - list of query strings for DWE system.
source - The name of datasource (default: "Datastream")
fields - Fields to be retrieved (used when the requester does not want all
fields to be delivered).
... | https://github.com/vfilimonov/pydatastream/blob/15d2adac1c83501715db1542373fa8428542816e/pydatastream/pydatastream.py#L186-L227 |
vfilimonov/pydatastream | pydatastream/pydatastream.py | Datastream.status | def status(self, record=None):
"""Extract status from the retrieved data and save it as a property of an object.
If record with data is not specified then the status of previous operation is
returned.
status - dictionary with data source, string with request and status type,
... | python | def status(self, record=None):
"""Extract status from the retrieved data and save it as a property of an object.
If record with data is not specified then the status of previous operation is
returned.
status - dictionary with data source, string with request and status type,
... | Extract status from the retrieved data and save it as a property of an object.
If record with data is not specified then the status of previous operation is
returned.
status - dictionary with data source, string with request and status type,
code and message.
... | https://github.com/vfilimonov/pydatastream/blob/15d2adac1c83501715db1542373fa8428542816e/pydatastream/pydatastream.py#L230-L259 |
vfilimonov/pydatastream | pydatastream/pydatastream.py | Datastream.parse_record | def parse_record(self, raw, indx=0):
"""Parse raw data (that is retrieved by "request") and return pandas.DataFrame.
Returns tuple (data, metadata)
data - pandas.DataFrame with retrieved data.
metadata - pandas.DataFrame with info about symbol, currency, frequency,
... | python | def parse_record(self, raw, indx=0):
"""Parse raw data (that is retrieved by "request") and return pandas.DataFrame.
Returns tuple (data, metadata)
data - pandas.DataFrame with retrieved data.
metadata - pandas.DataFrame with info about symbol, currency, frequency,
... | Parse raw data (that is retrieved by "request") and return pandas.DataFrame.
Returns tuple (data, metadata)
data - pandas.DataFrame with retrieved data.
metadata - pandas.DataFrame with info about symbol, currency, frequency,
displayname and status of given reques... | https://github.com/vfilimonov/pydatastream/blob/15d2adac1c83501715db1542373fa8428542816e/pydatastream/pydatastream.py#L277-L354 |
vfilimonov/pydatastream | pydatastream/pydatastream.py | Datastream.parse_record_static | def parse_record_static(self, raw):
"""Parse raw data (that is retrieved by static request) and return pandas.DataFrame.
Returns tuple (data, metadata)
data - pandas.DataFrame with retrieved data.
metadata - pandas.DataFrame with info about symbol, currency, frequency,
... | python | def parse_record_static(self, raw):
"""Parse raw data (that is retrieved by static request) and return pandas.DataFrame.
Returns tuple (data, metadata)
data - pandas.DataFrame with retrieved data.
metadata - pandas.DataFrame with info about symbol, currency, frequency,
... | Parse raw data (that is retrieved by static request) and return pandas.DataFrame.
Returns tuple (data, metadata)
data - pandas.DataFrame with retrieved data.
metadata - pandas.DataFrame with info about symbol, currency, frequency,
displayname and status of given r... | https://github.com/vfilimonov/pydatastream/blob/15d2adac1c83501715db1542373fa8428542816e/pydatastream/pydatastream.py#L356-L409 |
vfilimonov/pydatastream | pydatastream/pydatastream.py | Datastream.construct_request | def construct_request(ticker, fields=None, date=None,
date_from=None, date_to=None, freq=None):
"""Construct a request string for querying TR DWE.
tickers - ticker or symbol
fields - list of fields.
date - date for a single-date query
da... | python | def construct_request(ticker, fields=None, date=None,
date_from=None, date_to=None, freq=None):
"""Construct a request string for querying TR DWE.
tickers - ticker or symbol
fields - list of fields.
date - date for a single-date query
da... | Construct a request string for querying TR DWE.
tickers - ticker or symbol
fields - list of fields.
date - date for a single-date query
date_from, date_to - date range (used only if "date" is not specified)
freq - frequency of data: daily('D'), weekly('W') ... | https://github.com/vfilimonov/pydatastream/blob/15d2adac1c83501715db1542373fa8428542816e/pydatastream/pydatastream.py#L413-L462 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.