text stringlengths 0 1.05M | meta dict |
|---|---|
# apis_v1/documentation_source/organizations_followed_retrieve_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def organizations_followed_retrieve_doc_template_values(url_root):
"""
Show documentation about organizationsFollowedRetrieve
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
]
optional_query_parameter_list = [
{
'name': 'auto_followed_from_twitter_suggestion',
'value': 'boolean', # boolean, integer, long, string
'description': 'True default retrieve auto followed endorsers.'
'If False, retrieve all endorsers followed by voter'
'(includes twitter auto followed endorsers)',
},
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. A valid voter_id was not found.',
},
# {
# 'code': '',
# 'description': '',
# },
]
try_now_link_variables_dict = {
'auto_followed_from_twitter_suggestion': 'False',
}
# Changes made here should also be made in organizations_retrieve
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "organization_list": list\n' \
' [\n' \
' "organization_id": integer (the id of the organization found),\n' \
' "organization_we_vote_id": string (the organization ' \
'identifier that moves server-to-server),\n' \
' "organization_name": string (value from Google),\n' \
' "organization_website": string (website address),\n' \
' "organization_twitter_handle": string (twitter address),\n' \
' "twitter_followers_count": integer,\n' \
' "twitter_description": string,\n' \
' "organization_email": string,\n' \
' "organization_facebook": string,\n' \
' "organization_photo_url_large": string,\n' \
' "organization_photo_url_medium": string,\n' \
' "organization_photo_url_tiny": string,\n' \
' ],\n' \
'}'
template_values = {
'api_name': 'organizationsFollowedRetrieve',
'api_slug': 'organizationsFollowedRetrieve',
'api_introduction':
"A list of all endorsers followed by this voter includes automatically followed from twitter. "
"(Or show the endorsers this voter is following automatically from twitter only "
"if auto_followed_from_twitter_suggestion is True.)",
'try_now_link': 'apis_v1:organizationsFollowedRetrieveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/organizations_followed_retrieve_doc.py",
"copies": "1",
"size": "4155",
"license": "mit",
"hash": -164006730060369150,
"line_mean": 44.1630434783,
"line_max": 115,
"alpha_frac": 0.5321299639,
"autogenerated": false,
"ratio": 4.175879396984925,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.5208009360884925,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/organizations_found_on_url_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def organizations_found_on_url_doc_template_values(url_root):
"""
Show documentation about organizationsFoundOnUrl
"""
required_query_parameter_list = [
{
'name': 'url_to_scan',
'value': 'string', # boolean, integer, long, string
'description': 'The URL we want to scan for endorsers (typically for endorsements).',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
]
optional_query_parameter_list = [
{
'name': 'state_code',
'value': 'string', # boolean, integer, long, string
'description': 'Limit the search to endorsers in this state.',
},
]
potential_status_codes_list = [
]
try_now_link_variables_dict = {
# 'organization_id': '1',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "url_to_scan": string,\n' \
' "organization_count": integer,\n' \
' "organization_list": list\n' \
' [\n' \
' "organization_id": integer,\n' \
' "organization_we_vote_id": string,\n' \
' "organization_name": string,\n' \
' "organization_twitter_handle": string,\n' \
' "organization_facebook": string,\n' \
' "organization_email": string,\n' \
' "organization_website": string,\n' \
' "organization_photo_url_medium": string,\n' \
' "organization_photo_url_tiny": string,\n' \
' ],\n' \
'}'
template_values = {
'api_name': 'organizationsFoundOnUrl',
'api_slug': 'organizationsFoundOnUrl',
'api_introduction':
"Call this to find all endorsers that have a Twitter handle, Facebook page, or name on this page.",
'try_now_link': 'apis_v1:organizationsFoundOnUrlView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/organizations_found_on_url_doc.py",
"copies": "1",
"size": "2897",
"license": "mit",
"hash": -8642823396511818000,
"line_mean": 39.2361111111,
"line_max": 115,
"alpha_frac": 0.5150155333,
"autogenerated": false,
"ratio": 3.9201623815967523,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.49351779148967523,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/organizations_sync_out_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def organizations_sync_out_doc_template_values(url_root):
"""
Show documentation about organizationsSyncOut
"""
optional_query_parameter_list = [
{
'name': 'state_served_code',
'value': 'string', # boolean, integer, long, string
'description': 'Limit the results to just the state requested.',
},
]
potential_status_codes_list = [
]
try_now_link_variables_dict = {
'format': 'json',
}
api_response = '[{\n' \
' "we_vote_id": string,\n' \
' "vote_smart_id": integer,\n' \
' "ballotpedia_page_title": string,\n' \
' "ballotpedia_photo_url": string,\n' \
' "organization_address": string,\n' \
' "organization_city": string,\n' \
' "organization_contact_form_url": string,\n' \
' "organization_contact_name": string,\n' \
' "organization_description": string,\n' \
' "organization_email": string,\n' \
' "organization_facebook": string,\n' \
' "organization_name": string,\n' \
' "organization_image": string,\n' \
' "organization_phone1": string,\n' \
' "organization_phone2": string,\n' \
' "organization_fax": string,\n' \
' "organization_state": string,\n' \
' "organization_type": string,\n' \
' "organization_twitter_handle": string,\n' \
' "organization_website": string,\n' \
' "organization_zip": string,\n' \
' "state_served_code": string,\n' \
' "twitter_description": string,\n' \
' "twitter_followers_count": integer,\n' \
' "twitter_location": string,\n' \
' "twitter_name": string,\n' \
' "twitter_profile_background_image_url_https": string,\n' \
' "twitter_profile_banner_url_https": string,\n' \
' "twitter_profile_image_url_https": string,\n' \
' "twitter_user_id": integer,\n' \
' "wikipedia_page_id": string,\n' \
' "wikipedia_page_title": string,\n' \
' "wikipedia_photo_url": string,\n' \
' "wikipedia_thumbnail_height": string,\n' \
' "wikipedia_thumbnail_url": string,\n' \
' "wikipedia_thumbnail_width": string,\n' \
'}]'
template_values = {
'api_name': 'organizationsSyncOut',
'api_slug': 'organizationsSyncOut',
'api_introduction':
"",
'try_now_link': 'apis_v1:organizationsSyncOutView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/organizations_sync_out_doc.py",
"copies": "1",
"size": "3431",
"license": "mit",
"hash": 2942407270419684400,
"line_mean": 42.4303797468,
"line_max": 80,
"alpha_frac": 0.4844068785,
"autogenerated": false,
"ratio": 3.8988636363636364,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.9882489142774247,
"avg_score": 0.0001562744178777934,
"num_lines": 79
} |
# apis_v1/documentation_source/organization_stop_following_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def organization_stop_following_doc_template_values(url_root):
"""
Show documentation about organizationStopFollowing
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'organization_id',
'value': 'integer', # boolean, integer, long, string
'description': 'Internal database unique identifier for organization',
},
{
'name': 'organization_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'The unique identifier for this organization across all networks '
'(either organization_id OR organization_we_vote_id required -- not both.) '
'NOTE: In the future we '
'might support other identifiers used in the industry.',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
]
optional_query_parameter_list = [
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'A valid voter_device_id parameter was not included. Cannot proceed.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'A valid voter_id was not found from voter_device_id. Cannot proceed.',
},
{
'code': 'VALID_ORGANIZATION_ID_MISSING',
'description': 'A valid organization_id was not found. Cannot proceed.',
},
{
'code': 'ORGANIZATION_NOT_FOUND_ON_CREATE STOP_FOLLOWING',
'description': 'An organization with that organization_id was not found. Cannot proceed.',
},
{
'code': 'STOPPED_FOLLOWING',
'description': 'Successfully stopped following this organization',
},
]
try_now_link_variables_dict = {
'organization_id': '1',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "organization_id": integer,\n' \
' "organization_we_vote_id": string,\n' \
'}'
template_values = {
'api_name': 'organizationStopFollowing',
'api_slug': 'organizationStopFollowing',
'api_introduction':
"Call this to save that the voter has decided to stop following this organization. Logically equivalent"
"to never following in the first place, but leaves a record in the database.",
'try_now_link': 'apis_v1:organizationStopFollowingView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/organization_stop_following_doc.py",
"copies": "3",
"size": "3799",
"license": "mit",
"hash": -3791641081528379000,
"line_mean": 41.2111111111,
"line_max": 116,
"alpha_frac": 0.5475125033,
"autogenerated": false,
"ratio": 4.221111111111111,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.6268623614411111,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/organization_stop_ignoring_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def organization_stop_ignoring_doc_template_values(url_root):
"""
Show documentation about organizationStopIgnoring
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'organization_id',
'value': 'integer', # boolean, integer, long, string
'description': 'Internal database unique identifier for organization',
},
{
'name': 'organization_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'The unique identifier for this organization across all networks '
'(either organization_id OR organization_we_vote_id required -- not both.) '
'NOTE: In the future we '
'might support other identifiers used in the industry.',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
]
optional_query_parameter_list = [
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'A valid voter_device_id parameter was not included. Cannot proceed.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'A valid voter_id was not found from voter_device_id. Cannot proceed.',
},
{
'code': 'VALID_ORGANIZATION_ID_MISSING',
'description': 'A valid organization_id was not found. Cannot proceed.',
},
{
'code': 'ORGANIZATION_NOT_FOUND_ON_CREATE STOP_FOLLOWING',
'description': 'An organization with that organization_id was not found. Cannot proceed.',
},
{
'code': 'STOPPED_FOLLOWING',
'description': 'Successfully stopped following this organization',
},
]
try_now_link_variables_dict = {
'organization_id': '1',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "organization_id": integer,\n' \
' "organization_we_vote_id": string,\n' \
'}'
template_values = {
'api_name': 'organizationStopIgnoring',
'api_slug': 'organizationStopIgnoring',
'api_introduction':
"Call this to save that the voter has decided to stop ignoring this organization. Logically equivalent"
"to never ignoring in the first place, but leaves a record in the database.",
'try_now_link': 'apis_v1:organizationStopIgnoringView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/organization_stop_ignoring_doc.py",
"copies": "1",
"size": "3791",
"license": "mit",
"hash": 3478079909184571000,
"line_mean": 41.1222222222,
"line_max": 115,
"alpha_frac": 0.5465576365,
"autogenerated": false,
"ratio": 4.221603563474387,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.5268161199974387,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/organization_suggestion_tasks_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def organization_suggestion_tasks_doc_template_values(url_root):
"""
Show documentation about organizationSuggestionTask
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'kind_of_suggestion_task',
'value': 'string', # boolean, integer, long, string
'description': 'Default is UPDATE_SUGGESTIONS_FROM_TWITTER_IDS_I_FOLLOW. '
'Other options include UPDATE_SUGGESTIONS_FROM_WHAT_FRIENDS_FOLLOW, '
'UPDATE_SUGGESTIONS_FROM_WHAT_FRIENDS_FOLLOW_ON_TWITTER, '
'UPDATE_SUGGESTIONS_FROM_WHAT_FRIEND_FOLLOWS, '
'UPDATE_SUGGESTIONS_FROM_WHAT_FRIEND_FOLLOWS_ON_TWITTER or UPDATE_SUGGESTIONS_ALL',
},
]
optional_query_parameter_list = [
{
'name': 'kind_of_follow_task',
'value': 'string', # boolean, integer, long, string
'description': 'Default is FOLLOW_SUGGESTIONS_FROM_TWITTER_IDS_I_FOLLOW. '
'Other options include FOLLOW_SUGGESTIONS_FROM_FRIENDS, '
'or FOLLOW_SUGGESTIONS_FROM_FRIENDS_ON_TWITTER, ',
},
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. A valid voter_id was not found.',
},
]
try_now_link_variables_dict = {
# 'organization_we_vote_id': 'wv85org1',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
'}'
template_values = {
'api_name': 'organizationSuggestionTasks',
'api_slug': 'organizationSuggestionTasks',
'api_introduction':
"This will provide list of suggested endorsers to follow. "
"These suggestions are generated from twitter ids i follow, or organization of my friends follow",
'try_now_link': 'apis_v1:organizationSuggestionTasksView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/organization_suggestion_tasks_doc.py",
"copies": "1",
"size": "3436",
"license": "mit",
"hash": -5913783995273597000,
"line_mean": 42.4936708861,
"line_max": 115,
"alpha_frac": 0.5570430733,
"autogenerated": false,
"ratio": 3.7841409691629955,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.9834093098356448,
"avg_score": 0.0014181888213096003,
"num_lines": 79
} |
# apis_v1/documentation_source/pdf_to_html_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def pdf_to_html_retrieve_view(url_root):
"""
Show documentation about pdfToHtmlRetrieve
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'pdf_url',
'value': 'string', # boolean, integer, long, string
'description': 'The valid URL, from which to load the PDF to be converted',
},
]
optional_query_parameter_list = [
]
potential_status_codes_list = [
{
'code': 'PDF_URL_MISSING',
'description': 'The URL to the PDF is either missing or invalid.',
},
{
'code': 'PDF_URL_RETURNED',
'description': 'The API call has returned a URL to a new HTML page in S3',
},
]
try_now_link_variables_dict = {
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "output_from_subprocess": string,\n' \
' "s3_url_for_html": string (a public url to a new or reused HTML page in S3),\n' \
'}'
template_values = {
'api_name': 'pdfToHtmlRetrieve',
'api_slug': 'pdfToHtmlRetrieve',
'api_introduction':
"Convert a PDF to an HTML file in S3, and return the URL",
'try_now_link': 'apis_v1:pdfToHtmlRetrieve',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/pdf_to_html_doc.py",
"copies": "1",
"size": "2170",
"license": "mit",
"hash": -4162279339353380400,
"line_mean": 34,
"line_max": 103,
"alpha_frac": 0.535483871,
"autogenerated": false,
"ratio": 3.754325259515571,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.47898091305155704,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/pledge_to_vote_with_voter_guide_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def pledge_to_vote_with_voter_guide_doc_template_values(url_root):
"""
Show documentation about pledgeToVoteWithVoterGuide
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'voter_guide_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'Pledge to support or oppose all of the things listed on this voter guide',
},
{
'name': 'delete_pledge',
'value': 'boolean', # boolean, integer, long, string
'description': 'Remove this pledge',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
]
optional_query_parameter_list = [
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'A valid voter_device_id parameter was not included. Cannot proceed.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'A valid voter_id was not found from voter_device_id. Cannot proceed.',
},
]
try_now_link_variables_dict = {
# 'voter_guide_we_vote_id': '1',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "organization_we_vote_id": string,\n' \
' "voter_guide_we_vote_id": string,\n' \
' "google_civic_election_id": integer,\n' \
' "pledge_statistics_found": boolean,\n' \
' "pledge_goal": integer,\n' \
' "pledge_count": integer,\n' \
' "voter_has_pledged": boolean,\n' \
' "delete_pledge": boolean,\n' \
'}'
template_values = {
'api_name': 'pledgeToVoteWithVoterGuide',
'api_slug': 'pledgeToVoteWithVoterGuide',
'api_introduction':
"Call this to save that the voter is pledging to vote as the voter guide recommends.",
'try_now_link': 'apis_v1:pledgeToVoteWithVoterGuideView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/documentation_source/pledge_to_vote_with_voter_guide_doc.py",
"copies": "2",
"size": "3263",
"license": "mit",
"hash": 6903294604950982000,
"line_mean": 39.7875,
"line_max": 115,
"alpha_frac": 0.5289610788,
"autogenerated": false,
"ratio": 3.6828442437923252,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.5211805322592326,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/politicians_sync_out_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def politicians_sync_out_doc_template_values(url_root):
"""
Show documentation about politiciansSyncOut
"""
optional_query_parameter_list = [
{
'name': 'politician_search',
'value': 'string', # boolean, integer, long, string
'description': 'Limit the politicians retrieved to those found by this search string.',
},
{
'name': 'state_code',
'value': 'string', # boolean, integer, long, string
'description': 'Limit the politicians entries retrieved to those in a particular state.',
},
]
potential_status_codes_list = [
]
try_now_link_variables_dict = {
'state_code': 'ca',
}
api_response = '[{\n' \
' "we_vote_id": string,\n' \
' "first_name": string,\n' \
' "middle_name": string,\n' \
' "last_name": string,\n' \
' "politician_name": string,\n' \
' "google_civic_candidate_name": string,\n' \
' "full_name_assembled": string,\n' \
' "gender": string,\n' \
' "birth_date": string,\n' \
' "bioguide_id": string,\n' \
' "thomas_id": string,\n' \
' "lis_id": string,\n' \
' "govtrack_id": string,\n' \
' "opensecrets_id": string,\n' \
' "vote_smart_id": string,\n' \
' "fec_id": string,\n' \
' "cspan_id": string,\n' \
' "wikipedia_id": string,\n' \
' "ballotpedia_id": string,\n' \
' "house_history_id": string,\n' \
' "maplight_id": string,\n' \
' "washington_post_id": string,\n' \
' "icpsr_id": string,\n' \
' "political_party": string,\n' \
' "state_code": string,\n' \
' "politician_url": string,\n' \
' "politician_twitter_handle": string,\n' \
' "we_vote_hosted_profile_image_url_large": string,\n' \
' "we_vote_hosted_profile_image_url_medium": string,\n' \
' "we_vote_hosted_profile_image_url_tiny": string,\n' \
' "ctcl_uuid": string,\n' \
' "politician_facebook_id": string,\n' \
' "politician_phone_number": string,\n' \
' "politician_googleplus_id": string,\n' \
' "politician_youtube_id": string,\n' \
' "politician_email_address": string,\n' \
'}]'
template_values = {
'api_name': 'politiciansSyncOut',
'api_slug': 'politiciansSyncOut',
'api_introduction':
"",
'try_now_link': 'apis_v1:politiciansSyncOutView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/documentation_source/politicians_sync_out_doc.py",
"copies": "2",
"size": "3510",
"license": "mit",
"hash": 2429484334873578000,
"line_mean": 40.7857142857,
"line_max": 102,
"alpha_frac": 0.4612535613,
"autogenerated": false,
"ratio": 3.5454545454545454,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.5006708106754546,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/polling_locations_sync_out_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def polling_locations_sync_out_doc_template_values(url_root):
"""
Show documentation about pollingLocationsSyncOut
"""
optional_query_parameter_list = [
{
'name': 'state',
'value': 'string', # boolean, integer, long, string
'description': 'Limit the polling_locations retrieved to those from one state. Entered as a state code.',
},
]
potential_status_codes_list = [
]
try_now_link_variables_dict = {
'format': 'json',
}
api_response = '[{\n' \
' "we_vote_id": string,\n' \
' "city": string,\n' \
' "directions_text": string,\n' \
' "line1": string,\n' \
' "line2": string,\n' \
' "location_name": string,\n' \
' "polling_hours_text": string,\n' \
' "state": string,\n' \
' "zip_long": string,\n' \
'}]'
template_values = {
'api_name': 'pollingLocationsSyncOut',
'api_slug': 'pollingLocationsSyncOut',
'api_introduction':
"",
'try_now_link': 'apis_v1:pollingLocationsSyncOutView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/polling_locations_sync_out_doc.py",
"copies": "2",
"size": "1763",
"license": "mit",
"hash": -8359853451974087000,
"line_mean": 32.9038461538,
"line_max": 118,
"alpha_frac": 0.5138967669,
"autogenerated": false,
"ratio": 3.735169491525424,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.5249066258425423,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/position_like_count.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def position_like_count_doc_template_values(url_root):
"""
Show documentation about positionLikeCount
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'position_entered_id',
'value': 'integer', # boolean, integer, long, string
'description': 'The position that the voter is liking.',
},
]
optional_query_parameter_list = [
{
'name': 'limit_to_voters_network',
'value': 'boolean', # boolean, integer, long, string
'description': 'If you want the number of Likes returned to *only* be from people in the voter\'s '
'network, pass the value True.',
},
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. A valid voter_id was not found.',
},
{
'code': 'POSITION_LIKE_ALL_COUNT_RETRIEVED',
'description': '',
},
{
'code': 'POSITION_LIKE_VOTER_NETWORK_COUNT_RETRIEVED',
'description': '',
},
]
try_now_link_variables_dict = {
'position_entered_id': '5655',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "position_entered_id": integer,\n' \
' "type_of_count": string, (is this a count based on ALL or VOTER_NETWORK)\n' \
' "number_of_likes": integer, (will be same count as all_likes and voter_network_likes values-' \
' is provided if the front end would rather work with a type_of_count switch)\n' \
' "all_likes": integer,\n' \
' "voter_network_likes": integer,\n' \
'}'
template_values = {
'api_name': 'positionLikeCount',
'api_slug': 'positionLikeCount',
'api_introduction':
"The total number of Likes that a position has received, either from the perspective of "
"your network of friends, or the entire network.",
'try_now_link': 'apis_v1:positionLikeCountView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WebAppPublic",
"path": "apis_v1/documentation_source/position_like_count_doc.py",
"copies": "2",
"size": "3610",
"license": "bsd-3-clause",
"hash": -6554096321267503000,
"line_mean": 40.0227272727,
"line_max": 117,
"alpha_frac": 0.5274238227,
"autogenerated": false,
"ratio": 3.936750272628135,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.5464174095328136,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/position_list_for_ballot_item_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def position_list_for_ballot_item_doc_template_values(url_root):
"""
Show documentation about positionListForBallotItem
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'kind_of_ballot_item',
'value': 'string', # boolean, integer, long, string
'description': 'The kind of ballot item we want positions for. '
'(kind_of_ballot_item is either "OFFICE", "CANDIDATE", "POLITICIAN" or "MEASURE")',
},
{
'name': 'ballot_item_id',
'value': 'integer', # boolean, integer, long, string
'description': 'The unique internal identifier of the ballot item we want positions for. '
'(either ballot_item_id OR ballot_item_we_vote_id required -- not both. '
'If it exists, ballot_item_id is used instead of ballot_item_we_vote_id)',
},
{
'name': 'ballot_item_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'The unique identifier for this ballot_item across all networks '
'(either ballot_item_id OR ballot_item_we_vote_id required -- not both. '
'NOTE: In the future we might support other identifiers used in the industry.',
},
]
optional_query_parameter_list = [
{
'name': 'stance',
'value': 'string', # boolean, integer, long, string
'description': 'Default is ANY_STANCE. '
'Other options include SUPPORT, STILL_DECIDING, INFO_ONLY, NO_STANCE, OPPOSE, '
'PERCENT_RATING',
},
{
'name': 'friends_vs_public',
'value': 'string', # boolean, integer, long, string
'description': 'Default is FRIENDS_AND_PUBLIC. '
'Other options include FRIENDS_ONLY, PUBLIC_ONLY, FRIENDS_AND_PUBLIC',
},
{
'name': 'private_citizens_only',
'value': 'boolean', # boolean, integer, long, string
'description': 'Defaults to False. '
'If False, only retrieve positions from groups and public figures. '
'If True, only return positions from private citizens.',
},
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. A valid voter_id was not found.',
},
{
'code': 'UNABLE_TO_RETRIEVE-CANDIDATE_ID_AND_MEASURE_ID_MISSING',
'description': 'Cannot proceed. Neither candidate_id nor measure_id were included.',
},
{
'code': 'SUCCESSFUL_RETRIEVE_OF_POSITIONS',
'description': 'The number of opposes for this ballot item was retrieved.',
},
{
'code': 'SUCCESSFUL_RETRIEVE_OF_POSITIONS_NOT_FOLLOWED',
'description': 'The number of endorsers that oppose this ballot item that voter is NOT following.',
},
]
try_now_link_variables_dict = {
'kind_of_ballot_item': 'CANDIDATE',
'ballot_item_id': '5655',
'show_positions_this_voter_follows': 'False',
'stance': 'ANY_STANCE',
'friends_vs_public': 'FRIENDS_AND_PUBLIC',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "count": integer,\n' \
' "kind_of_ballot_item": string (CANDIDATE, MEASURE), ' \
' (One of these: \'CANDIDATE\', \'MEASURE\', \'OFFICE\', \'UNKNOWN\',)\n' \
' "ballot_item_id": integer,\n' \
' "ballot_item_we_vote_id": string,\n' \
' "position_list": list\n' \
' [\n' \
' "ballot_item_display_name": string (either measure name or candidate name),\n' \
' "ballot_item_image_url_https_large": string,\n' \
' "ballot_item_image_url_https_medium": string,\n' \
' "ballot_item_image_url_https_tiny": string,\n' \
' "ballot_item_we_vote_id": string,\n' \
' "is_support": boolean,\n' \
' "is_positive_rating": boolean,\n' \
' "is_support_or_positive_rating": boolean,\n' \
' "is_oppose": boolean,\n' \
' "is_negative_rating": boolean,\n' \
' "is_oppose_or_negative_rating": boolean,\n' \
' "is_information_only": boolean,\n' \
' "is_public_position": boolean,\n' \
' "last_updated": string (time in this format %Y-%m-%d %H:%M:%S),\n' \
' "more_info_url": string,\n' \
' "position_we_vote_id": string (the position identifier that moves server-to-server),\n' \
' "position_ultimate_election_date": integer,\n' \
' "position_year": integer,\n' \
' "speaker_display_name": string,\n' \
' "speaker_image_url_https_large": string,\n' \
' "speaker_image_url_https_medium": string,\n' \
' "speaker_image_url_https_tiny": string,\n' \
' "speaker_twitter_handle": string,\n' \
' "speaker_type": string, ' \
' (One of these: \'ORGANIZATION\', \'VOTER\', \'PUBLIC_FIGURE\', \'UNKNOWN\',)\n' \
' "speaker_id": integer,\n' \
' "speaker_we_vote_id": string,\n' \
' "statement_text": string,\n' \
' "twitter_followers_count": integer,\n' \
' ],\n' \
'}'
template_values = {
'api_name': 'positionListForBallotItem',
'api_slug': 'positionListForBallotItem',
'api_introduction':
"A list of all positions (support/oppose/info) for this Ballot Item (Office, Candidate or Measure) "
"from endorsers, friends, and public figures this voter follows. "
"(Or show the positions the voter is NOT following if show_positions_this_voter_follows is False.)",
'try_now_link': 'apis_v1:positionListForBallotItemView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/position_list_for_ballot_item_doc.py",
"copies": "1",
"size": "7943",
"license": "mit",
"hash": -4657441304351793000,
"line_mean": 49.9166666667,
"line_max": 115,
"alpha_frac": 0.4995593604,
"autogenerated": false,
"ratio": 3.8727450024378354,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.9864125156550726,
"avg_score": 0.0016358412574217867,
"num_lines": 156
} |
# apis_v1/documentation_source/position_list_for_ballot_item_from_friends_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def position_list_for_ballot_item_from_friends_doc_template_values(url_root):
"""
Show documentation about positionListForBallotItemFromFriends
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'kind_of_ballot_item',
'value': 'string', # boolean, integer, long, string
'description': 'The kind of ballot item we want positions for. '
'(kind_of_ballot_item is either "OFFICE", "CANDIDATE", "POLITICIAN" or "MEASURE")',
},
{
'name': 'ballot_item_id',
'value': 'integer', # boolean, integer, long, string
'description': 'The unique internal identifier of the ballot item we want positions for. '
'(either ballot_item_id OR ballot_item_we_vote_id required -- not both. '
'If it exists, ballot_item_id is used instead of ballot_item_we_vote_id)',
},
{
'name': 'ballot_item_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'The unique identifier for this ballot_item across all networks '
'(either ballot_item_id OR ballot_item_we_vote_id required -- not both. '
'NOTE: In the future we might support other identifiers used in the industry.',
},
]
optional_query_parameter_list = [
{
'name': 'stance',
'value': 'string', # boolean, integer, long, string
'description': 'Default is ANY_STANCE. '
'Other options include SUPPORT, STILL_DECIDING, INFO_ONLY, NO_STANCE, OPPOSE, '
'PERCENT_RATING',
},
{
'name': 'friends_vs_public',
'value': 'string', # boolean, integer, long, string
'description': 'Default is FRIENDS_AND_PUBLIC. '
'Other options include FRIENDS_ONLY, PUBLIC_ONLY, FRIENDS_AND_PUBLIC',
},
{
'name': 'private_citizens_only',
'value': 'boolean', # boolean, integer, long, string
'description': 'Defaults to False. '
'If False, only retrieve positions from groups and public figures. '
'If True, only return positions from private citizens.',
},
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. A valid voter_id was not found.',
},
{
'code': 'UNABLE_TO_RETRIEVE-CANDIDATE_ID_AND_MEASURE_ID_MISSING',
'description': 'Cannot proceed. Neither candidate_id nor measure_id were included.',
},
{
'code': 'SUCCESSFUL_RETRIEVE_OF_POSITIONS',
'description': 'The number of opposes for this ballot item was retrieved.',
},
{
'code': 'SUCCESSFUL_RETRIEVE_OF_POSITIONS_NOT_FOLLOWED',
'description': 'The number of endorsers that oppose this ballot item that voter is NOT following.',
},
]
try_now_link_variables_dict = {
'kind_of_ballot_item': 'CANDIDATE',
'ballot_item_id': '5655',
'stance': 'ANY_STANCE',
'friends_vs_public': 'FRIENDS_AND_PUBLIC',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "count": integer,\n' \
' "kind_of_ballot_item": string (CANDIDATE, MEASURE), ' \
' (One of these: \'CANDIDATE\', \'MEASURE\', \'OFFICE\', \'UNKNOWN\',)\n' \
' "ballot_item_id": integer,\n' \
' "ballot_item_we_vote_id": string,\n' \
' "position_list": list\n' \
' [\n' \
' "position_we_vote_id": string,\n' \
' "ballot_item_display_name": string (either measure name or candidate name),\n' \
' "ballot_item_image_url_https_large": string,\n' \
' "ballot_item_image_url_https_medium": string,\n' \
' "ballot_item_image_url_https_tiny": string,\n' \
' "ballot_item_we_vote_id": string,\n' \
' "speaker_display_name": string,\n' \
' "speaker_image_url_https_large": string,\n' \
' "speaker_image_url_https_medium": string,\n' \
' "speaker_image_url_https_tiny": string,\n' \
' "speaker_twitter_handle": string,\n' \
' "twitter_followers_count": integer,\n' \
' "speaker_type": string, ' \
' (One of these: \'ORGANIZATION\', \'VOTER\', \'PUBLIC_FIGURE\', \'UNKNOWN\',)\n' \
' "speaker_id": integer,\n' \
' "speaker_we_vote_id": string,\n' \
' "is_support": boolean,\n' \
' "is_positive_rating": boolean,\n' \
' "is_support_or_positive_rating": boolean,\n' \
' "is_oppose": boolean,\n' \
' "is_negative_rating": boolean,\n' \
' "is_oppose_or_negative_rating": boolean,\n' \
' "is_information_only": boolean,\n' \
' "is_public_position": boolean,\n' \
' "more_info_url": string,\n' \
' "statement_text": string,\n' \
' "last_updated": string (time in this format %Y-%m-%d %H:%M:%S),\n' \
' ],\n' \
'}'
template_values = {
'api_name': 'positionListForBallotItemFromFriends',
'api_slug': 'positionListForBallotItemFromFriends',
'api_introduction':
"A list of all positions (support/oppose/info) for this Ballot Item (Office, Candidate or Measure) "
"from friends of this voter (including both public and friends only). ",
'try_now_link': 'apis_v1:positionListForBallotItemFromFriendsView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/position_list_for_ballot_item_from_friends_doc.py",
"copies": "1",
"size": "7668",
"license": "mit",
"hash": -888347250076028000,
"line_mean": 49.4473684211,
"line_max": 115,
"alpha_frac": 0.4988262911,
"autogenerated": false,
"ratio": 3.8688193743693238,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.9859441365063268,
"avg_score": 0.001640860081211281,
"num_lines": 152
} |
# apis_v1/documentation_source/position_list_for_opinion_maker_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def position_list_for_opinion_maker_doc_template_values(url_root):
"""
Show documentation about positionListForOpinionMaker
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'kind_of_opinion_maker',
'value': 'string', # boolean, integer, long, string
'description': 'The kind of ballot item we want positions for. '
' (One of these: \'ORGANIZATION\', \'PUBLIC_FIGURE\')\n'
},
{
'name': 'opinion_maker_id',
'value': 'integer', # boolean, integer, long, string
'description': 'The unique internal identifier of the ballot item we want positions for. '
'(either opinion_maker_id OR opinion_maker_we_vote_id required -- not both. '
'If it exists, opinion_maker_id is used instead of opinion_maker_we_vote_id)',
},
{
'name': 'opinion_maker_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'The unique identifier for this opinion_maker across all networks '
'(either opinion_maker_id OR opinion_maker_we_vote_id required -- not both. '
'NOTE: In the future we might support other identifiers used in the industry.',
},
]
optional_query_parameter_list = [
{
'name': 'stance',
'value': 'string', # boolean, integer, long, string
'description': 'Default is ANY_STANCE. '
'Other options include SUPPORT, STILL_DECIDING, INFO_ONLY, NO_STANCE, OPPOSE, '
'PERCENT_RATING',
},
{
'name': 'friends_vs_public',
'value': 'string', # boolean, integer, long, string
'description': 'Default is FRIENDS_AND_PUBLIC. '
'Other options include FRIENDS_ONLY, PUBLIC_ONLY, FRIENDS_AND_PUBLIC',
},
{
'name': 'google_civic_election_id',
'value': 'integer', # boolean, integer, long, string
'description': 'The unique identifier for a particular election. If not provided, return positions'
' for the election that the server thinks the voter is looking at. '
' If this variable is included, state_code will be ignored.',
},
{
'name': 'state_code',
'value': 'string', # boolean, integer, long, string
'description': 'The us state we want ballot item positions for. '
},
{
'name': 'filter_for_voter',
'value': 'boolean', # boolean, integer, long, string
'description': 'The default is \'True\'. If we can figure out (on API server) what the current '
'google_civic_election_id is, only show positions about things on the current ballot. '
'If not, figure out the state_code and only show positions about items in this state.',
},
{
'name': 'filter_out_voter',
'value': 'boolean', # boolean, integer, long, string
'description': 'The default is \'False\'. Show the positions for this ballot item that are NOT on this '
'voter\'s ballot.',
},
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. A valid voter_id was not found.',
},
{
'code': 'UNABLE_TO_RETRIEVE-CANDIDATE_ID_AND_MEASURE_ID_MISSING',
'description': 'Cannot proceed. Neither candidate_id nor measure_id were included.',
},
{
'code': 'SUCCESSFUL_RETRIEVE_OF_POSITIONS',
'description': 'The number of opposes for this ballot item was retrieved.',
},
{
'code': 'SUCCESSFUL_RETRIEVE_OF_POSITIONS_NOT_FOLLOWED',
'description': 'The number of organizations that oppose this ballot item that voter is NOT following.',
},
]
try_now_link_variables_dict = {
'kind_of_opinion_maker': 'ORGANIZATION',
'opinion_maker_id': '145',
'opinion_maker_we_vote_id': '',
'stance': 'ANY_STANCE',
'friends_vs_public': 'FRIENDS_AND_PUBLIC',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "count": integer,\n' \
' "kind_of_opinion_maker": string ' \
' (One of these: \'ORGANIZATION\', \'PUBLIC_FIGURE\', \'UNKNOWN\'),\n' \
' "friends_vs_public": string ' \
' (One of these: \'FRIENDS_ONLY\', \'PUBLIC_ONLY\', \'FRIENDS_AND_PUBLIC\'),\n' \
' "opinion_maker_id": integer,\n' \
' "opinion_maker_we_vote_id": string,\n' \
' "opinion_maker_display_name": string,\n' \
' "opinion_maker_image_url_https_large": string,\n' \
' "opinion_maker_image_url_https_medium": string,\n' \
' "opinion_maker_image_url_https_tiny": string,\n' \
' "is_following": boolean (Is this voter following this org/public_figure?),\n' \
' "is_ignoring": boolean (Is this voter ignoring this org/public_figure?),\n' \
' "position_list": list\n' \
' [\n' \
' "position_we_vote_id": string,\n' \
' "ballot_item_display_name": string (either measure name or candidate name),\n' \
' "ballot_item_id": integer,\n' \
' "ballot_item_image_url_https_large": string,\n' \
' "ballot_item_image_url_https_medium": string,\n' \
' "ballot_item_image_url_https_tiny": string,\n' \
' "ballot_item_twitter_handle": string,\n' \
' "ballot_item_we_vote_id": string,\n' \
' "ballot_item_political_party": string,\n' \
' "ballot_item_state_code": string,\n' \
' "contest_office_id": integer,\n' \
' "contest_office_we_vote_id": string,\n' \
' "contest_office_name": string (The name of the office if kind_of_ballot_item is CANDIDATE),\n' \
' "kind_of_ballot_item": string, ' \
' (One of these: \'CANDIDATE\', \'MEASURE\', \'OFFICE\', \'UNKNOWN\')\n' \
' "is_support": boolean,\n' \
' "is_positive_rating": boolean,\n' \
' "is_support_or_positive_rating": boolean,\n' \
' "is_oppose": boolean,\n' \
' "is_negative_rating": boolean,\n' \
' "is_oppose_or_negative_rating": boolean,\n' \
' "is_information_only": boolean,\n' \
' "more_info_url": string,\n' \
' "statement_text": string,\n' \
' "statement_html": string,\n' \
' "google_civic_election_id": integer,\n' \
' "vote_smart_rating": string,\n' \
' "vote_smart_time_span": string,\n' \
' "last_updated": string,\n' \
' ],\n' \
' "filter_for_voter": boolean (True if only returning positions for voter\'s ballot),\n' \
' "filter_out_voter": boolean (True if returning positions NOT on voter\'s ballot,\n' \
'}'
template_values = {
'api_name': 'positionListForOpinionMaker',
'api_slug': 'positionListForOpinionMaker',
'api_introduction':
"A list of all positions (support/oppose/info) held by this opinion maker "
"(an organization, friend, or public figure). ",
'try_now_link': 'apis_v1:positionListForOpinionMakerView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/documentation_source/position_list_for_opinion_maker_doc.py",
"copies": "1",
"size": "9658",
"license": "mit",
"hash": -3574465110859862000,
"line_mean": 51.7759562842,
"line_max": 121,
"alpha_frac": 0.4986539656,
"autogenerated": false,
"ratio": 3.870941883767535,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.9860558842123948,
"avg_score": 0.0018074014487175374,
"num_lines": 183
} |
# apis_v1/documentation_source/position_list_for_voter_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def position_list_for_voter_doc_template_values(url_root):
"""
Show documentation about positionListForVoter
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
]
optional_query_parameter_list = [
{
'name': 'stance',
'value': 'string', # boolean, integer, long, string
'description': 'Default is ANY_STANCE. '
'Other options include SUPPORT, STILL_DECIDING, INFO_ONLY, NO_STANCE, OPPOSE, '
'PERCENT_RATING',
},
{
'name': 'friends_vs_public',
'value': 'string', # boolean, integer, long, string
'description': 'Default is FRIENDS_AND_PUBLIC. '
'Other options include FRIENDS_ONLY, PUBLIC_ONLY, FRIENDS_AND_PUBLIC',
},
{
'name': 'google_civic_election_id',
'value': 'integer', # boolean, integer, long, string
'description': 'The unique identifier for a particular election. If not provided, return all positions'
' for this organization. If this variable is included, state_code will be ignored.',
},
{
'name': 'state_code',
'value': 'string', # boolean, integer, long, string
'description': 'The us state we want ballot item positions for. '
},
{
'name': 'show_only_this_election',
'value': 'boolean', # boolean, integer, long, string
'description': 'The default is \'True\'. Only show positions about things on the current ballot. ',
},
{
'name': 'show_all_other_elections',
'value': 'boolean', # boolean, integer, long, string
'description': 'The default is \'False\'. Show the positions for this ballot item that are NOT on this '
'voter\'s ballot.',
},
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. A valid voter_id was not found.',
},
{
'code': 'UNABLE_TO_RETRIEVE-CANDIDATE_ID_AND_MEASURE_ID_MISSING',
'description': 'Cannot proceed. Neither candidate_id nor measure_id were included.',
},
{
'code': 'SUCCESSFUL_RETRIEVE_OF_POSITIONS',
'description': 'The number of opposes for this ballot item was retrieved.',
},
{
'code': 'SUCCESSFUL_RETRIEVE_OF_POSITIONS_NOT_FOLLOWED',
'description': 'The number of organizations that oppose this ballot item that voter is NOT following.',
},
]
try_now_link_variables_dict = {
'stance': 'ANY_STANCE',
'friends_vs_public': 'FRIENDS_AND_PUBLIC',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "count": integer,\n' \
' "friends_vs_public": string ' \
' (One of these: \'FRIENDS_ONLY\', \'PUBLIC_ONLY\', \'FRIENDS_AND_PUBLIC\'),\n' \
' "voter_we_vote_id": string,\n' \
' "voter_display_name": string,\n' \
' "voter_image_url_https_large": string,\n' \
' "voter_image_url_https_medium": string,\n' \
' "voter_image_url_https_tiny": string,\n' \
' "google_civic_election_id": integer,\n' \
' "state_code": string,\n' \
' "position_list": list\n' \
' "show_only_this_election": boolean (True if only returning positions for voter\'s ballot),\n' \
' "show_all_other_elections": boolean (True if returning positions NOT on voter\'s ballot,\n' \
' [\n' \
' "position_we_vote_id": string,\n' \
' "ballot_item_display_name": string (either measure name or candidate name),\n' \
' "ballot_item_id": integer,\n' \
' "ballot_item_image_url_https_large": string,\n' \
' "ballot_item_image_url_https_medium": string,\n' \
' "ballot_item_image_url_https_tiny": string,\n' \
' "ballot_item_twitter_handle": string,\n' \
' "ballot_item_we_vote_id": string,\n' \
' "ballot_item_political_party": string,\n' \
' "ballot_item_state_code": string,\n' \
' "contest_office_id": integer,\n' \
' "contest_office_we_vote_id": string,\n' \
' "contest_office_name": string (The name of the office if kind_of_ballot_item is CANDIDATE),\n' \
' "kind_of_ballot_item": string, ' \
' (One of these: \'CANDIDATE\', \'MEASURE\', \'OFFICE\', \'UNKNOWN\')\n' \
' "is_support": boolean,\n' \
' "is_positive_rating": boolean,\n' \
' "is_support_or_positive_rating": boolean,\n' \
' "is_oppose": boolean,\n' \
' "is_negative_rating": boolean,\n' \
' "is_oppose_or_negative_rating": boolean,\n' \
' "is_information_only": boolean,\n' \
' "more_info_url": string,\n' \
' "statement_text": string,\n' \
' "statement_html": string,\n' \
' "google_civic_election_id": integer,\n' \
' "last_updated": string,\n' \
' ],\n' \
'}'
template_values = {
'api_name': 'positionListForVoter',
'api_slug': 'positionListForVoter',
'api_introduction':
"A list of all positions (support/oppose/info) held by this voter. ",
'try_now_link': 'apis_v1:positionListForVoterView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/documentation_source/position_list_for_voter_doc.py",
"copies": "1",
"size": "7468",
"license": "mit",
"hash": -3075350332595958000,
"line_mean": 48.4569536424,
"line_max": 121,
"alpha_frac": 0.4911622924,
"autogenerated": false,
"ratio": 3.85146982980918,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.48426321222091795,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/position_oppose_count_for_ballot_item_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def position_oppose_count_for_ballot_item_doc_template_values(url_root):
"""
Show documentation about positionOpposeCountForBallotItem
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'kind_of_ballot_item',
'value': 'string', # boolean, integer, long, string
'description': 'The kind of ballot item we want the oppose count for. '
'(kind_of_ballot_item is either "CANDIDATE", "POLITICIAN" or "MEASURE")',
},
{
'name': 'ballot_item_id',
'value': 'integer', # boolean, integer, long, string
'description': 'The unique internal identifier of the ballot item we want the oppose count for. '
'(either ballot_item_id OR ballot_item_we_vote_id required -- not both. '
'If it exists, ballot_item_id is used instead of ballot_item_we_vote_id)',
},
{
'name': 'ballot_item_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'The unique identifier for this ballot_item across all networks '
'(either ballot_item_id OR ballot_item_we_vote_id required -- not both.) '
'NOTE: In the future we might support other identifiers used in the industry.',
},
]
optional_query_parameter_list = [
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. A valid voter_id was not found.',
},
{
'code': 'UNABLE_TO_RETRIEVE-CANDIDATE_ID_AND_MEASURE_ID_MISSING',
'description': 'Cannot proceed. Neither candidate_id nor measure_id were included.',
},
{
'code': 'SUCCESSFUL_RETRIEVE_OF_POSITIONS',
'description': 'The number of opposes for this ballot item was retrieved.',
},
{
'code': 'SUCCESSFUL_RETRIEVE_OF_POSITIONS_NOT_FOLLOWED',
'description': 'The number of organizations that oppose this ballot item that voter is NOT following.',
},
]
try_now_link_variables_dict = {
'kind_of_ballot_item': 'CANDIDATE',
'ballot_item_id': '5655',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "count": integer,\n' \
' "ballot_item_id": integer,\n' \
' "ballot_item_we_vote_id": string,\n' \
' "kind_of_ballot_item": string (CANDIDATE, MEASURE),\n' \
'}'
template_values = {
'api_name': 'positionOpposeCountForBallotItem',
'api_slug': 'positionOpposeCountForBallotItem',
'api_introduction':
"A single number showing the total that oppose this Ballot Item (Candidate or Measure) from "
"organizations, friends, and public figures this voter follows.",
'try_now_link': 'apis_v1:positionOpposeCountForBallotItemView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/documentation_source/position_oppose_count_for_ballot_item_doc.py",
"copies": "2",
"size": "4494",
"license": "mit",
"hash": 6609848023912499000,
"line_mean": 44.3939393939,
"line_max": 116,
"alpha_frac": 0.546506453,
"autogenerated": false,
"ratio": 3.844311377245509,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.5390817830245509,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/position_public_oppose_count_for_ballot_item_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def position_public_oppose_count_for_ballot_item_doc_template_values(url_root):
"""
Show documentation about positionPublicOpposeCountForBallotItem
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'kind_of_ballot_item',
'value': 'string', # boolean, integer, long, string
'description': 'The kind of ballot item we want the oppose count for. '
'(kind_of_ballot_item is either "CANDIDATE", "POLITICIAN" or "MEASURE")',
},
{
'name': 'ballot_item_id',
'value': 'integer', # boolean, integer, long, string
'description': 'The unique internal identifier of the ballot item we want the oppose count for. '
'(either ballot_item_id OR ballot_item_we_vote_id required -- not both. '
'If it exists, ballot_item_id is used instead of ballot_item_we_vote_id)',
},
{
'name': 'ballot_item_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'The unique identifier for this ballot_item across all networks '
'(either ballot_item_id OR ballot_item_we_vote_id required -- not both. '
'NOTE: In the future we might support other identifiers used in the industry.',
},
]
optional_query_parameter_list = [
# {
# 'name': '',
# 'value': '', # boolean, integer, long, string
# 'description': '',
# },
]
potential_status_codes_list = [
{
'code': 'UNABLE_TO_RETRIEVE-CANDIDATE_ID_AND_MEASURE_ID_MISSING',
'description': 'Cannot proceed. Neither candidate_id nor measure_id were included.',
},
{
'code': 'SUCCESSFUL_RETRIEVE_OF_POSITIONS',
'description': 'The number of opposes for this ballot item was retrieved.',
},
{
'code': 'SUCCESSFUL_RETRIEVE_OF_POSITIONS_NOT_FOLLOWED',
'description': 'The number of endorsers that oppose this ballot item that voter is NOT following.',
},
]
try_now_link_variables_dict = {
'kind_of_ballot_item': 'CANDIDATE',
'ballot_item_id': '5655',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "count": integer,\n' \
'}'
template_values = {
'api_name': 'positionPublicOpposeCountForBallotItem',
'api_slug': 'positionPublicOpposeCountForBallotItem',
'api_introduction':
"A single number showing the total that oppose this Ballot Item (Candidate or Measure) from "
"any organizations and public figures. (Not just the ones a voter follows.)",
'try_now_link': 'apis_v1:positionPublicOpposeCountForBallotItemView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/position_public_oppose_count_for_ballot_item_doc.py",
"copies": "1",
"size": "3927",
"license": "mit",
"hash": 8213912755439188000,
"line_mean": 43.625,
"line_max": 115,
"alpha_frac": 0.551566081,
"autogenerated": false,
"ratio": 3.8424657534246576,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.988490775620448,
"avg_score": 0.0018248156440356217,
"num_lines": 88
} |
# apis_v1/documentation_source/position_public_support_count_for_ballot_item_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def position_public_support_count_for_ballot_item_doc_template_values(url_root):
"""
Show documentation about positionPublicSupportCountForBallotItem
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'kind_of_ballot_item',
'value': 'string', # boolean, integer, long, string
'description': 'The kind of ballot item we want the support count for. '
'(kind_of_ballot_item is either "CANDIDATE", "POLITICIAN" or "MEASURE")',
},
{
'name': 'ballot_item_id',
'value': 'integer', # boolean, integer, long, string
'description': 'The unique internal identifier of the ballot item we want the support count for. '
'(either ballot_item_id OR ballot_item_we_vote_id required -- not both. '
'If it exists, ballot_item_id is used instead of ballot_item_we_vote_id)',
},
{
'name': 'ballot_item_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'The unique identifier for this ballot_item across all networks '
'(either ballot_item_id OR ballot_item_we_vote_id required -- not both. '
'NOTE: In the future we might support other identifiers used in the industry.',
},
]
optional_query_parameter_list = [
# {
# 'name': '',
# 'value': '', # boolean, integer, long, string
# 'description': '',
# },
]
potential_status_codes_list = [
{
'code': 'UNABLE_TO_RETRIEVE-CANDIDATE_ID_AND_MEASURE_ID_MISSING',
'description': 'Cannot proceed. Neither candidate_id nor measure_id were included.',
},
{
'code': 'SUCCESSFUL_RETRIEVE_OF_POSITIONS',
'description': 'The number of supports for this ballot item was retrieved.',
},
{
'code': 'SUCCESSFUL_RETRIEVE_OF_POSITIONS_NOT_FOLLOWED',
'description': 'The number of endorsers that support this ballot item that voter is NOT following.',
},
]
try_now_link_variables_dict = {
'kind_of_ballot_item': 'CANDIDATE',
'ballot_item_id': '5655',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "count": integer,\n' \
'}'
template_values = {
'api_name': 'positionPublicSupportCountForBallotItem',
'api_slug': 'positionPublicSupportCountForBallotItem',
'api_introduction':
"A single number showing the total supporters for this Ballot Item (Candidate or Measure) from "
"any organizations and public figures. (Not just the ones a voter follows.)",
'try_now_link': 'apis_v1:positionPublicSupportCountForBallotItemView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/position_public_support_count_for_ballot_item_doc.py",
"copies": "1",
"size": "3940",
"license": "mit",
"hash": -2625678952600062500,
"line_mean": 43.7727272727,
"line_max": 115,
"alpha_frac": 0.5530456853,
"autogenerated": false,
"ratio": 3.8932806324110674,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.9936539380368951,
"avg_score": 0.00195738746842338,
"num_lines": 88
} |
# apis_v1/documentation_source/position_retrieve_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def position_retrieve_doc_template_values(url_root):
"""
Show documentation about positionRetrieve
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
]
optional_query_parameter_list = [
{
'name': 'position_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'We Vote unique identifier so we can move positions from server-to-server.',
},
# We also want to retrieve a position with the following sets of variables:
# organization_we_vote_id, google_civic_election_id, office_we_vote_id
# organization_we_vote_id, google_civic_election_id, candidate_we_vote_id
# organization_we_vote_id, google_civic_election_id, measure_we_vote_id
# public_figure_we_vote_id, google_civic_election_id, office_we_vote_id
# public_figure_we_vote_id, google_civic_election_id, candidate_we_vote_id
# public_figure_we_vote_id, google_civic_election_id, measure_we_vote_id
# NOTE: With voter we need ability to store private version and public version - maybe distinction between
# private and public is voter_we_vote_id vs. public_figure_we_vote_id?
# voter_we_vote_id, google_civic_election_id, office_we_vote_id
# voter_we_vote_id, google_civic_election_id, candidate_we_vote_id
# voter_we_vote_id, google_civic_election_id, measure_we_vote_id
#
# {
# 'name': '',
# 'value': '', # boolean, integer, long, string
# 'description': '',
# },
]
potential_status_codes_list = [
{
'code': 'RETRIEVE_POSITION_FOUND_WITH_POSITION_ID',
'description': 'The position was found using the internal id',
},
{
'code': 'RETRIEVE_POSITION_FOUND_WITH_WE_VOTE_ID',
'description': 'The position was found using the we_vote_id',
},
{
'code': 'POSITION_RETRIEVE_BOTH_IDS_MISSING',
'description': 'One identifier required. Neither provided.',
},
{
'code': 'POSITION_NOT_FOUND_WITH_ID',
'description': 'The position was not found with internal id.',
},
{
'code': 'ERROR_<specifics here>',
'description': 'An internal description of what error prevented the retrieve of the position.',
},
]
try_now_link_variables_dict = {
'position_we_vote_id': 'wv01pos7',
}
api_response = '{\n' \
' "success": boolean,\n' \
' "status": string,\n' \
' "ballot_item_display_name": string (either measure name or candidate name),\n' \
' "position_we_vote_id": string (the position identifier that moves server-to-server),\n' \
' "speaker_display_name": string,\n' \
' "speaker_image_url_https": string,\n' \
' "speaker_twitter_handle": string,\n' \
' "is_support": boolean,\n' \
' "is_positive_rating": boolean,\n' \
' "is_support_or_positive_rating": boolean,\n' \
' "is_oppose": boolean,\n' \
' "is_negative_rating": boolean,\n' \
' "is_oppose_or_negative_rating": boolean,\n' \
' "is_information_only": boolean,\n' \
' "organization_we_vote_id": string (the organization identifier that moves server-to-server),\n' \
' "google_civic_election_id": integer,\n' \
' "voter_id": integer,\n' \
' "vote_smart_rating": string,\n' \
' "vote_smart_time_span": string,\n' \
' "candidate_we_vote_id": string,\n' \
' "measure_we_vote_id": string,\n' \
' "office_we_vote_id": string,\n' \
' "stance": string (support/oppose/info only),\n' \
' "statement_text": string,\n' \
' "statement_html": string,\n' \
' "more_info_url": string,\n' \
' "last_updated": string,\n' \
'}'
template_values = {
'api_name': 'positionRetrieve',
'api_slug': 'positionRetrieve',
'api_introduction':
"Retrieve the position using we_vote_id. (In the future we will add the"
"ability to retrieve via a set of variables like "
"(organization_we_vote_id, google_civic_election_id, candidate_we_vote_id)",
'try_now_link': 'apis_v1:positionRetrieveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WebAppPublic",
"path": "apis_v1/documentation_source/position_retrieve_doc.py",
"copies": "1",
"size": "5850",
"license": "bsd-3-clause",
"hash": 726960238416913500,
"line_mean": 46.5609756098,
"line_max": 119,
"alpha_frac": 0.5362393162,
"autogenerated": false,
"ratio": 3.7572254335260116,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.47934647497260113,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/position_save_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def apple_sign_in_save_doc_view_template_values(url_root):
"""
Show documentation about appleSignInSave
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'email',
'value': 'string', # boolean, integer, long, string
'description': 'The email address used to establish an Apple ID, can be an alias (aliases complicate '
'matching)',
},
{
'name': 'first_name', # 'givenName' in the Apple API response
'value': 'string', # boolean, integer, long, string
'description': 'The first name (given name) of the Apple ID user.',
},
{
'name': 'middle_name', # 'middleName' in the Apple API response
'value': 'string', # boolean, integer, long, string
'description': 'The middle name of the Apple ID user. This field can be an empty string',
},
{
'name': 'last_name', # 'familyName' in the Apple API response
'value': 'string', # boolean, integer, long, string
'description': 'The last name (family name) of the Apple ID user.',
},
{
'name': 'user_code', # 'user' in the Apple API response
'value': 'string', # boolean, integer, long, string
'description': 'The hash that Sign in with Apple returns for a successful sign in for a given '
'Apple ID',
},
]
optional_query_parameter_list = [
{
'name': 'apple_platform', # apple calls it platform
'value': 'string', # boolean, integer, long, string
'description': 'iOS, or iPadOS',
},
{
'name': 'apple_os_version', # apple calls it version
'value': 'string', # boolean, integer, long, string
'description': '13.5 for example',
},
{
'name': 'apple_model', # apple calls it model
'value': 'string', # boolean, integer, long, string
'description': '"iPhone12,3" is an "iPhone 11 Pro" for example',
},
{
'name': 'voter_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'The unique identifier for the voter. It would be unusual to know this in advance.',
},
]
potential_status_codes_list = [
{
'code': 'APPLE_USER_ID_RECORD_CREATED_OR_UPDATED',
'description': 'Success. Mormal operation.',
},
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'ERROR_APPLE_USER_NOT_CREATED_OR_NOT_UPDATED',
'description': 'Cannot proceed. The record was not created or updated, due to a bug or a system issue.',
},
]
try_now_link_variables_dict = {
'organization_we_vote_id': 'wv85org1',
'ballot_item_display_name': 'Test Ballot Item Label',
'candidate_we_vote_id': 'wv01cand1755',
'stance': 'SUPPORT',
'statement_text': 'This is what I believe...',
'google_civic_election_id': '4162',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
'}'
template_values = {
'api_name': 'appleSignInSave',
'api_slug': 'appleSignInSave',
'api_introduction':
"Save the Apple 'user' code, returned by the <em>Sign In With Apple</em> api response for a given Apple ID "
" -- the Apple ID is phone owner's email address and password used to sign into iCloud.<br>"
"WeVote code never 'sees' the Apple ID password, only the 'user' code returned by the API and the user's "
"email address (which unfortunately can be an Apple aliased email address).",
'try_now_link': 'apis_v1:appleSignInSaveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/apple_sign_in_save_doc.py",
"copies": "1",
"size": "5336",
"license": "mit",
"hash": -8689186991334812000,
"line_mean": 42.737704918,
"line_max": 120,
"alpha_frac": 0.5327961019,
"autogenerated": false,
"ratio": 4.021100226073851,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 1,
"avg_score": 0.0009863967336335067,
"num_lines": 122
} |
# apis_v1/documentation_source/position_save_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def position_save_doc_template_values(url_root):
"""
Show documentation about positionSave
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'google_civic_election_id',
'value': 'integer', # boolean, integer, long, string
'description': 'ID of the election this position is related to.',
},
]
optional_query_parameter_list = [
{
'name': 'position_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'The unique identifier for this position across all networks. ',
},
{
'name': 'ballot_item_display_name',
'value': 'string', # boolean, integer, long, string
'description': 'Text we display for the name of this office, candidate or measure. '
'If missing, we look it up internally and fill it in.',
},
{
'name': 'office_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'The unique identifier for the office that the position is commenting on. '
'(One and only one of these is required: '
'office_we_vote_id, candidate_we_vote_id, measure_we_vote_id)',
},
{
'name': 'candidate_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'The unique identifier for the candidate that the position is commenting on. '
'(One and only one of these is required: '
'office_we_vote_id, candidate_we_vote_id, measure_we_vote_id)',
},
{
'name': 'measure_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'The unique identifier for the measure that the position is commenting on. '
'(One and only one of these is required: '
'office_we_vote_id, candidate_we_vote_id, measure_we_vote_id)',
},
{
'name': 'organization_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'The organization that is taking the position.'
' (One and only one of these is required: '
'organization_we_vote_id, public_figure_we_vote_id, voter_we_vote_id)',
},
{
'name': 'public_figure_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'The public figure (or voter) that is publicly taking the position.'
' (One and only one of these is required: '
'organization_we_vote_id, public_figure_we_vote_id, voter_we_vote_id)',
},
{
'name': 'voter_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'The voter that is privately taking the position.'
' (One and only one of these is required: '
'organization_we_vote_id, public_figure_we_vote_id, voter_we_vote_id)',
},
{
'name': 'stance',
'value': 'string', # boolean, integer, long, string
'description': 'SUPPORT, OPPOSE, INFORMATION_ONLY (future: STILL_DECIDING, NO_STANCE)',
},
{
'name': 'set_as_public_position',
'value': 'boolean', # boolean, integer, long, string
'description': 'Should this position be saved so it can be seen by anyone in the public, '
'or only for friends',
},
{
'name': 'statement_text',
'value': 'string', # boolean, integer, long, string
'description': 'A text description of this stance.',
},
{
'name': 'statement_html',
'value': 'string', # boolean, integer, long, string
'description': 'An HTML description of this stance.',
},
{
'name': 'more_info_url',
'value': 'string', # boolean, integer, long, string
'description': 'The URL of the website where this stance can either be verified, '
'or pursued in more depth.',
},
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. A valid voter_id was not found.',
},
{
'code': 'POSITION_REQUIRED_UNIQUE_IDENTIFIER_VARIABLES_MISSING',
'description': 'Cannot proceed. Missing sufficient unique identifiers for either save new or update.',
},
{
'code': 'NEW_ORGANIZATION_REQUIRED_VARIABLES_MISSING',
'description': 'Cannot proceed. This is a new entry and there are not sufficient variables.',
},
{
'code': 'CREATE_POSITION_SUCCESSFUL',
'description': 'Position created.',
},
{
'code': 'POSITION_SAVED_WITH_POSITION_ID',
'description': '',
},
{
'code': 'POSITION_SAVED_WITH_POSITION_WE_VOTE_ID',
'description': '',
},
{
'code': 'POSITION_CHANGES_SAVED',
'description': '',
},
{
'code': 'NO_POSITION_CHANGES_SAVED_WITH_POSITION_ID',
'description': '',
},
{
'code': 'NO_POSITION_CHANGES_SAVED_WITH_POSITION_WE_VOTE_ID',
'description': '',
},
{
'code': 'NO_POSITION_CHANGES_SAVED',
'description': '',
},
{
'code': 'POSITION_COULD_NOT_BE_FOUND_WITH_POSITION_ID_OR_WE_VOTE_ID',
'description': '',
},
]
try_now_link_variables_dict = {
'organization_we_vote_id': 'wv85org1',
'ballot_item_display_name': 'Test Ballot Item Label',
'candidate_we_vote_id': 'wv01cand1755',
'stance': 'SUPPORT',
'set_as_public_position': 'true',
'statement_text': 'This is what I believe...',
'google_civic_election_id': '4162',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "new_position_created": boolean,\n' \
' "ballot_item_display_name": string (either measure name or candidate name),\n' \
' "speaker_display_name": string,\n' \
' "speaker_image_url_https": string,\n' \
' "speaker_twitter_handle": string,\n' \
' "is_support": boolean,\n' \
' "is_positive_rating": boolean,\n' \
' "is_support_or_positive_rating": boolean,\n' \
' "is_oppose": boolean,\n' \
' "is_negative_rating": boolean,\n' \
' "is_oppose_or_negative_rating": boolean,\n' \
' "is_information_only": boolean,\n' \
' "is_public_position": boolean,\n' \
' "organization_we_vote_id": string (the organization identifier that moves server-to-server),\n' \
' "position_we_vote_id": string (the position identifier that moves server-to-server),\n' \
' "position_ultimate_election_date": integer,\n' \
' "position_year": integer,\n' \
' "public_figure_we_vote_id": string,\n' \
' "voter_we_vote_id": string,\n' \
' "google_civic_election_id": integer,\n' \
' "voter_id": integer,\n' \
' "office_we_vote_id": string,\n' \
' "candidate_we_vote_id": string,\n' \
' "measure_we_vote_id": string,\n' \
' "stance": string (support/oppose/info only),\n' \
' "statement_text": string,\n' \
' "statement_html": string,\n' \
' "more_info_url": string,\n' \
' "last_updated": string (time in this format %Y-%m-%d %H:%M:%S),\n' \
'}'
template_values = {
'api_name': 'positionSave',
'api_slug': 'positionSave',
'api_introduction':
"Save a new position or update an existing position. Note that passing in a blank value does not "
"delete an existing value. We may want to come up with a variable we pass if we want to clear a value.",
'try_now_link': 'apis_v1:positionSaveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/position_save_doc.py",
"copies": "1",
"size": "10445",
"license": "mit",
"hash": 9096329826224015000,
"line_mean": 45.8385650224,
"line_max": 119,
"alpha_frac": 0.4903781714,
"autogenerated": false,
"ratio": 4.065784351887894,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 1,
"avg_score": 0.001393706062887718,
"num_lines": 223
} |
# apis_v1/documentation_source/positions_count_for_all_ballot_items_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def positions_count_for_all_ballot_items_doc_template_values(url_root):
"""
Show documentation about positionsCountForAllBallotItems
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
]
optional_query_parameter_list = [
{
'name': 'google_civic_election_id',
'value': 'integer', # boolean, integer, long, string
'description': 'The unique identifier for a particular election. If not provided, return all positions'
' for this voter.',
},
]
potential_status_codes_list = [
]
try_now_link_variables_dict = {
}
api_response = '{\n' \
' "success": boolean,\n' \
' "status": string,\n' \
' "google_civic_election_id: integer,\n' \
' "ballot_item_list": list\n' \
' [\n' \
' "ballot_item_we_vote_id": string,\n' \
' "support_count": integer,\n' \
' "oppose_count": integer,\n' \
' "support_we_vote_id_list": list\n' \
' [\n' \
' "organization or friend we_vote_id": string,\n' \
' ],\n' \
' "support_name_list": list\n' \
' [\n' \
' "Speaker Display Name": string,\n' \
' ],\n' \
' "oppose_we_vote_list": list\n' \
' [\n' \
' "organization or friend we_vote_id": string,\n' \
' ],\n' \
' "oppose_name_list": list\n' \
' [\n' \
' "Speaker Display Name": string,\n' \
' ],\n' \
' ],\n' \
'}'
template_values = {
'api_name': 'positionsCountForAllBallotItems',
'api_slug': 'positionsCountForAllBallotItems',
'api_introduction':
"Retrieve all positions held by this voter in one list.",
'try_now_link': 'apis_v1:positionsCountForAllBallotItemsView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/documentation_source/positions_count_for_all_ballot_items_doc.py",
"copies": "2",
"size": "3344",
"license": "mit",
"hash": -6738365274505563000,
"line_mean": 40.2839506173,
"line_max": 116,
"alpha_frac": 0.4727870813,
"autogenerated": false,
"ratio": 3.911111111111111,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 1,
"avg_score": 0.00045051630471164506,
"num_lines": 81
} |
# apis_v1/documentation_source/positions_count_for_one_ballot_item_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def positions_count_for_one_ballot_item_doc_template_values(url_root):
"""
Show documentation about positionsCountForOneBallotItem
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'ballot_item_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'The unique identifier for one ballot item.',
},
]
optional_query_parameter_list = [
]
potential_status_codes_list = [
]
try_now_link_variables_dict = {
}
api_response = '{\n' \
' "success": boolean,\n' \
' "status": string,\n' \
' "ballot_item_we_vote_id: string,\n' \
' "ballot_item_list": list ' \
'(we return a list so this API can be consumed like positionsCountForAllBallotItems)\n' \
' [\n' \
' "ballot_item_we_vote_id": string,\n' \
' "support_count": integer,\n' \
' "oppose_count": integer,\n' \
' "support_we_vote_id_list": list\n' \
' [\n' \
' "organization or friend we_vote_id": string,\n' \
' ],\n' \
' "support_name_list": list\n' \
' [\n' \
' "Speaker Display Name": string,\n' \
' ],\n' \
' "oppose_we_vote_list": list\n' \
' [\n' \
' "organization or friend we_vote_id": string,\n' \
' ],\n' \
' "oppose_name_list": list\n' \
' [\n' \
' "Speaker Display Name": string,\n' \
' ],\n' \
' ],\n' \
'}'
template_values = {
'api_name': 'positionsCountForOneBallotItem',
'api_slug': 'positionsCountForOneBallotItem',
'api_introduction':
"Retrieve all positions held by this voter in one list.",
'try_now_link': 'apis_v1:positionsCountForOneBallotItemView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/positions_count_for_one_ballot_item_doc.py",
"copies": "2",
"size": "3349",
"license": "mit",
"hash": 1702754168284435200,
"line_mean": 40.3456790123,
"line_max": 115,
"alpha_frac": 0.4741713944,
"autogenerated": false,
"ratio": 3.85385500575374,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.532802640015374,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/positions_sync_out_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def positions_sync_out_doc_template_values(url_root):
"""
Show documentation about positionsSyncOut
"""
required_query_parameter_list = [
{
'name': 'format',
'value': 'string', # boolean, integer, long, string
'description': 'Currently must be \'json\' to work.',
},
{
'name': 'google_civic_election_id',
'value': 'integer', # boolean, integer, long, string
'description': 'The election for which we want positions.',
},
]
optional_query_parameter_list = [
]
potential_status_codes_list = [
]
try_now_link_variables_dict = {
'format': 'json',
'google_civic_election_id': '1000000',
}
api_response = '[{\n' \
' "we_vote_id": string,\n' \
' "ballot_item_display_name": string,\n' \
' "ballot_item_image_url_https": string,\n' \
' "candidate_campaign_we_vote_id": string,\n' \
' "contest_measure_we_vote_id": string,\n' \
' "contest_office_we_vote_id": string,\n' \
' "date_entered": string,\n' \
' "date_last_changed": string,\n' \
' "from_scraper": string,\n' \
' "google_civic_candidate_name": string,\n' \
' "google_civic_election_id": string,\n' \
' "more_info_url": string,\n' \
' "organization_certified": string,\n' \
' "organization_we_vote_id": string,\n' \
' "politician_we_vote_id": string,\n' \
' "public_figure_we_vote_id": string,\n' \
' "speaker_display_name": string,\n' \
' "speaker_image_url_https": string,\n' \
' "speaker_twitter_handle": string,\n' \
' "stance": string,\n' \
' "state_code": string,\n' \
' "statement_text": string,\n' \
' "statement_html": string,\n' \
' "tweet_source_id": string,\n' \
' "twitter_user_entered_position": string,\n' \
' "volunteer_certified": string,\n' \
' "vote_smart_rating": string,\n' \
' "vote_smart_rating_id": string,\n' \
' "vote_smart_rating_name": string,\n' \
' "vote_smart_time_span": string,\n' \
' "voter_entering_position": string,\n' \
' "voter_we_vote_id": string,\n' \
'}]'
template_values = {
'api_name': 'positionsSyncOut',
'api_slug': 'positionsSyncOut/?format=json',
'api_introduction':
"",
'try_now_link': 'apis_v1:positionsSyncOutView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WebAppPublic",
"path": "apis_v1/documentation_source/positions_sync_out_doc.py",
"copies": "1",
"size": "3507",
"license": "bsd-3-clause",
"hash": 836569679917968400,
"line_mean": 40.75,
"line_max": 72,
"alpha_frac": 0.4779013402,
"autogenerated": false,
"ratio": 3.653125,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.96310263402,
"avg_score": 0,
"num_lines": 84
} |
# apis_v1/documentation_source/position_support_count_for_ballot_item_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def position_support_count_for_ballot_item_doc_template_values(url_root):
"""
Show documentation about positionSupportCountForBallotItem
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'kind_of_ballot_item',
'value': 'string', # boolean, integer, long, string
'description': 'The kind of ballot item we want the support count for. '
'(kind_of_ballot_item is either "CANDIDATE", "POLITICIAN" or "MEASURE")',
},
{
'name': 'ballot_item_id',
'value': 'integer', # boolean, integer, long, string
'description': 'The unique internal identifier of the ballot item we want the support count for. '
'(either ballot_item_id OR ballot_item_we_vote_id required -- not both. '
'If it exists, ballot_item_id is used instead of ballot_item_we_vote_id)',
},
{
'name': 'ballot_item_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'The unique identifier for this ballot_item across all networks '
'(either ballot_item_id OR ballot_item_we_vote_id required -- not both.) '
'NOTE: In the future we might support other identifiers used in the industry.',
},
]
optional_query_parameter_list = [
# {
# 'name': '',
# 'value': '', # boolean, integer, long, string
# 'description': '',
# },
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. A valid voter_id was not found.',
},
{
'code': 'UNABLE_TO_RETRIEVE-CANDIDATE_ID_AND_MEASURE_ID_MISSING',
'description': 'Cannot proceed. Neither candidate_id nor measure_id were included.',
},
{
'code': 'SUCCESSFUL_RETRIEVE_OF_POSITIONS',
'description': 'The number of supports for this ballot item was retrieved.',
},
{
'code': 'SUCCESSFUL_RETRIEVE_OF_POSITIONS_NOT_FOLLOWED',
'description': 'The number of organizations that support this ballot item that voter is NOT following.',
},
]
try_now_link_variables_dict = {
'kind_of_ballot_item': 'CANDIDATE',
'ballot_item_id': '5655',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "count": integer,\n' \
' "ballot_item_id": integer,\n' \
' "ballot_item_we_vote_id": string,\n' \
' "kind_of_ballot_item": string (CANDIDATE, MEASURE),\n' \
'}'
template_values = {
'api_name': 'positionSupportCountForBallotItem',
'api_slug': 'positionSupportCountForBallotItem',
'api_introduction':
"A single number showing the total supporters for this Ballot Item (Candidate or Measure) from "
"organizations, friends, and public figures this voter follows.",
'try_now_link': 'apis_v1:positionSupportCountForBallotItemView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WebAppPublic",
"path": "apis_v1/documentation_source/position_support_count_for_ballot_item_doc.py",
"copies": "2",
"size": "4668",
"license": "bsd-3-clause",
"hash": -1000169323703240100,
"line_mean": 43.8846153846,
"line_max": 117,
"alpha_frac": 0.5383461868,
"autogenerated": false,
"ratio": 3.8964941569282137,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 1,
"avg_score": 0.0016165111976564482,
"num_lines": 104
} |
# apis_v1/documentation_source/quick_info_retrieve_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def quick_info_retrieve_doc_template_values(url_root):
"""
Show documentation about quickInfoRetrieve
"""
required_query_parameter_list = [
{
'name': 'kind_of_ballot_item',
'value': 'string', # boolean, integer, long, string
'description': 'What is the type of ballot item that we want quick information for (for use in a popup)? '
'(Either "OFFICE", "CANDIDATE", "POLITICIAN" or "MEASURE")',
},
{
'name': 'ballot_item_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'The we_vote_id for the ballot item we want quick information for. ',
},
]
optional_query_parameter_list = [
# {
# 'name': '',
# 'value': '', # boolean, integer, long, string
# 'description': '',
# },
]
potential_status_codes_list = [
# {
# 'code': '',
# 'description': '',
# },
]
try_now_link_variables_dict = {
# 'organization_we_vote_id': 'wv85org1',
}
api_response = '{\n' \
' "success": boolean,\n' \
' "status": string,\n' \
' "quick_info_found": boolean,\n' \
' "quick_info_id": integer,\n' \
' "quick_info_we_vote_id": string,\n' \
' "kind_of_ballot_item": string (CANDIDATE, MEASURE),\n' \
' "incoming_ballot_item_we_vote_id": string,\n' \
' "language": string,\n' \
' "info_text": string,\n' \
' "info_html": string,\n' \
' "ballot_item_display_name": string,\n' \
' "more_info_url": string,\n' \
' "more_info_credit_text": string,\n' \
' "last_updated": string,\n' \
' "last_editor_we_vote_id": string,\n' \
' "office_we_vote_id": string,\n' \
' "candidate_we_vote_id": string,\n' \
' "politician_we_vote_id": string,\n' \
' "measure_we_vote_id": string,\n' \
' "quick_info_master_we_vote_id": string,\n' \
' "google_civic_election_id": integer,\n' \
'}'
template_values = {
'api_name': 'quickInfoRetrieve',
'api_slug': 'quickInfoRetrieve',
'api_introduction':
"Information necessary to populate a bubble next to a ballot item.",
'try_now_link': 'apis_v1:quickInfoRetrieveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/documentation_source/quick_info_retrieve_doc.py",
"copies": "2",
"size": "3299",
"license": "mit",
"hash": -2793609581593582000,
"line_mean": 39.2317073171,
"line_max": 119,
"alpha_frac": 0.4798423765,
"autogenerated": false,
"ratio": 3.6252747252747253,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 1,
"avg_score": 0.0005136469394452664,
"num_lines": 82
} |
# apis_v1/documentation_source/reaction_like_count.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def reaction_like_count_doc_template_values(url_root):
"""
Show documentation about reactionLikeCount
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'liked_item_we_vote_id',
'value': 'integer', # boolean, integer, long, string
'description': 'The position that the voter is liking.',
},
]
optional_query_parameter_list = [
{
'name': 'limit_to_voters_network',
'value': 'boolean', # boolean, integer, long, string
'description': 'If you want the number of Likes returned to *only* be from people in the voter\'s '
'network, pass the value True.',
},
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. A valid voter_id was not found.',
},
{
'code': 'REACTION_LIKE_ALL_COUNT_RETRIEVED',
'description': '',
},
{
'code': 'REACTION_LIKE_VOTER_NETWORK_COUNT_RETRIEVED',
'description': '',
},
]
try_now_link_variables_dict = {
'liked_item_we_vote_id': '5655',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "liked_item_we_vote_id": integer,\n' \
' "type_of_count": string, (is this a count based on ALL or VOTER_NETWORK)\n' \
' "number_of_likes": integer, (will be same count as all_likes and voter_network_likes values-' \
' is provided if the front end would rather work with a type_of_count switch)\n' \
' "all_likes": integer,\n' \
' "voter_network_likes": integer,\n' \
'}'
template_values = {
'api_name': 'reactionLikeCount',
'api_slug': 'reactionLikeCount',
'api_introduction':
"The total number of Likes that a position has received, either from the perspective of "
"your network of friends, or the entire network.",
'try_now_link': 'apis_v1:reactionLikeCountView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/reaction_like_count_doc.py",
"copies": "1",
"size": "3616",
"license": "mit",
"hash": 1992380914171372000,
"line_mean": 40.0909090909,
"line_max": 117,
"alpha_frac": 0.5265486726,
"autogenerated": false,
"ratio": 3.8839957035445756,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.49105443761445755,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/reaction_like_status_retrieve_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def reaction_like_status_retrieve_doc_template_values(url_root):
"""
Show documentation about reactionLikeStatusRetrieve
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'liked_item_we_vote_id_list[]',
'value': 'stringlist', # boolean, integer, long, string
'description': 'Get all of the likes for all liked_item_we_vote_id\'s in this list.',
},
]
optional_query_parameter_list = [
# {
# 'name': '',
# 'value': '', # boolean, integer, long, string
# 'description': '',
# },
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. A valid voter_id was not found.',
},
{
'code': 'REACTION_LIKE_FOUND_WITH_VOTER_ID_AND_POSITION_ID',
'description': '',
},
{
'code': 'UNABLE_TO_RETRIEVE-LIKED_ITEM_WE_VOTE_ID_MISSING',
'description': '',
},
]
try_now_link_variables_dict = {
'liked_item_we_vote_id': '5655',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "reaction_like_list": list\n' \
' [\n' \
' "liked_item_we_vote_id": string,\n' \
' "voter_display_name": string,\n' \
' "voter_id": number,\n' \
' "voter_we_vote_id": string,\n' \
' ],\n' \
'}'
template_values = {
'api_name': 'reactionLikeStatusRetrieve',
'api_slug': 'reactionLikeStatusRetrieve',
'api_introduction':
"The likes from voters associated with various items requested.",
'try_now_link': 'apis_v1:reactionLikeStatusRetrieveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/reaction_like_status_retrieve_doc.py",
"copies": "1",
"size": "3269",
"license": "mit",
"hash": 186660302260755970,
"line_mean": 37.011627907,
"line_max": 115,
"alpha_frac": 0.5044356072,
"autogenerated": false,
"ratio": 3.7879490150637314,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.4792384622263731,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/save_analytics_action_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def save_analytics_action_doc_template_values(url_root):
"""
Show documentation about saveAnalyticsAction
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'action_constant',
'value': 'integer', # boolean, integer, long, string
'description': 'There is a constant for each kind of action:\n'
'ACTION_VOTER_GUIDE_VISIT = 1\n'
'ACTION_VOTER_GUIDE_ENTRY = 2\n'
'ACTION_ORGANIZATION_FOLLOW = 3\n'
'ACTION_ORGANIZATION_AUTO_FOLLOW = 4\n'
'ACTION_ISSUE_FOLLOW = 5\n'
'ACTION_BALLOT_VISIT = 6\n'
'ACTION_POSITION_TAKEN = 7\n'
'ACTION_VOTER_TWITTER_AUTH = 8\n'
'ACTION_VOTER_FACEBOOK_AUTH = 9\n'
'ACTION_WELCOME_ENTRY = 10\n'
'ACTION_FRIEND_ENTRY = 11',
},
]
optional_query_parameter_list = [
{
'name': 'organization_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'The unique identifier for this organization across all networks ',
},
{
'name': 'google_civic_election_id',
'value': 'integer', # boolean, integer, long, string
'description': 'The unique identifier for a particular election.',
},
{
'name': 'ballot_item_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'The we_vote_id for the ballot item we are storing analytics for. ',
},
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. A valid voter_id was not found.',
},
]
try_now_link_variables_dict = {
# 'organization_we_vote_id': 'wv85org1',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "action_constant": integer,\n' \
' "state_code": string,\n' \
' "is_signed_in": boolean,\n' \
' "google_civic_election_id": integer,\n' \
' "organization_we_vote_id": string,\n' \
' "organization_id": integer,\n' \
' "ballot_item_we_vote_id": string,\n' \
' "date_as_integer": integer,\n' \
'}'
template_values = {
'api_name': 'saveAnalyticsAction',
'api_slug': 'saveAnalyticsAction',
'api_introduction':
"",
'try_now_link': 'apis_v1:saveAnalyticsActionView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/documentation_source/save_analytics_action_doc.py",
"copies": "1",
"size": "4267",
"license": "mit",
"hash": -4761500498531608000,
"line_mean": 41.2475247525,
"line_max": 115,
"alpha_frac": 0.4923834075,
"autogenerated": false,
"ratio": 3.9327188940092164,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.4925102301509216,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/search_all_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def search_all_doc_template_values(url_root):
"""
Show documentation about searchAll
"""
required_query_parameter_list = [
{
'name': 'text_from_search_field',
'value': 'string', # boolean, integer, long, string
'description': 'The string of text for which we want to search',
},
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
]
optional_query_parameter_list = [
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. A valid voter_id was not found.',
},
]
try_now_link_variables_dict = {
'text_from_search_field': 'kamala',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "text_from_search_field": string,\n' \
' "search_results_found": boolean,\n' \
' "search_results": list\n' \
' [{\n' \
' "result_title": string,\n' \
' "result_image": string,\n' \
' "result_subtitle": string,\n' \
' "result_summary": string,\n' \
' "result_score": integer,\n' \
' "link_internal": string,\n' \
' "kind_of_owner": string,\n' \
' "google_civic_election_id": integer,\n' \
' "state_code": string,\n' \
' "twitter_handle": string,\n' \
' "we_vote_id": string,\n' \
' "local_id": integer,\n' \
' },]\n' \
'}'
template_values = {
'api_name': 'searchAll',
'api_slug': 'searchAll',
'api_introduction':
"",
'try_now_link': 'apis_v1:searchAllView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WebAppPublic",
"path": "apis_v1/documentation_source/search_all_doc.py",
"copies": "3",
"size": "3272",
"license": "bsd-3-clause",
"hash": -306275195950259500,
"line_mean": 37.9523809524,
"line_max": 115,
"alpha_frac": 0.4755501222,
"autogenerated": false,
"ratio": 3.876777251184834,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 1,
"avg_score": 0.00045292645518624767,
"num_lines": 84
} |
# apis_v1/documentation_source/shared_item_retrieve_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def shared_item_retrieve_doc_template_values(url_root):
"""
Show documentation about sharedItemRetrieve
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'shared_item_code',
'value': 'string', # boolean, integer, long, string
'description': 'The code coming from the URL that we need to look up the final destination.',
},
]
optional_query_parameter_list = [
{
'name': 'shared_item_clicked',
'value': 'boolean', # boolean, integer, long, string
'description': 'Is this retrieve because of this voter clicking?',
},
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. A valid voter_id was not found.',
},
]
try_now_link_variables_dict = {
# 'organization_we_vote_id': 'wv85org1',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "destination_full_url": string,\n' \
' "shared_item_code_no_opinions": string,\n' \
' "shared_item_code_all_opinions": string,\n' \
' "url_with_shared_item_code_no_opinions": string,\n' \
' "url_with_shared_item_code_all_opinions": string,\n' \
' "is_ballot_share": boolean,\n' \
' "is_candidate_share": boolean,\n' \
' "is_measure_share": boolean,\n' \
' "is_office_share": boolean,\n' \
' "is_organization_share": boolean,\n' \
' "is_ready_share": boolean,\n' \
' "google_civic_election_id": integer,\n' \
' "site_owner_organization_we_vote_id": string,\n' \
' "shared_by_voter_we_vote_id": string,\n' \
' "shared_by_organization_type": string,\n' \
' "shared_by_organization_we_vote_id": string,\n' \
' "candidate_we_vote_id": string,\n' \
' "measure_we_vote_id": string,\n' \
' "office_we_vote_id": string,\n' \
' "date_first_shared": datetime,\n' \
'}'
template_values = {
'api_name': 'sharedItemRetrieve',
'api_slug': 'sharedItemRetrieve',
'api_introduction':
"",
'try_now_link': 'apis_v1:sharedItemRetrieveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/shared_item_retrieve_doc.py",
"copies": "1",
"size": "3864",
"license": "mit",
"hash": -3929339777995229000,
"line_mean": 41.4615384615,
"line_max": 115,
"alpha_frac": 0.5054347826,
"autogenerated": false,
"ratio": 3.7734375,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.47788722825999996,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/shared_item_save_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def shared_item_save_doc_template_values(url_root):
"""
Show documentation about sharedItemSave
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'destination_full_url',
'value': 'string', # boolean, integer, long, string
'description': 'The full URL with the final destination.',
},
]
optional_query_parameter_list = [
{
'name': 'ballot_item_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'The we_vote_id for the ballot item being shared.',
},
{
'name': 'google_civic_election_id',
'value': 'integer', # boolean, integer, long, string
'description': 'The unique identifier for a particular election.',
},
{
'name': 'is_ballot_share',
'value': 'boolean', # boolean, integer, long, string
'description': 'The kind of destination shared: Ballot page',
},
{
'name': 'is_candidate_share',
'value': 'boolean', # boolean, integer, long, string
'description': 'The kind of destination shared: Candidate page',
},
{
'name': 'is_measure_share',
'value': 'boolean', # boolean, integer, long, string
'description': 'The kind of destination shared: Measure page',
},
{
'name': 'is_office_share',
'value': 'boolean', # boolean, integer, long, string
'description': 'The kind of destination shared: Office page',
},
{
'name': 'is_organization_share',
'value': 'boolean', # boolean, integer, long, string
'description': 'The kind of destination shared: Voter Guide page',
},
{
'name': 'is_ready_share',
'value': 'boolean', # boolean, integer, long, string
'description': 'The kind of destination shared: Ready page',
},
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. A valid voter_id was not found.',
},
]
try_now_link_variables_dict = {
# 'organization_we_vote_id': 'wv85org1',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "destination_full_url": string,\n' \
' "shared_item_code_no_opinions": string,\n' \
' "shared_item_code_all_opinions": string,\n' \
' "url_with_shared_item_code_no_opinions": string,\n' \
' "url_with_shared_item_code_all_opinions": string,\n' \
' "is_ballot_share": boolean,\n' \
' "is_candidate_share": boolean,\n' \
' "is_measure_share": boolean,\n' \
' "is_office_share": boolean,\n' \
' "is_organization_share": boolean,\n' \
' "is_ready_share": boolean,\n' \
' "google_civic_election_id": integer,\n' \
' "site_owner_organization_we_vote_id": string,\n' \
' "shared_by_voter_we_vote_id": string,\n' \
' "shared_by_organization_type": string,\n' \
' "shared_by_organization_we_vote_id": string,\n' \
' "candidate_we_vote_id": string,\n' \
' "measure_we_vote_id": string,\n' \
' "office_we_vote_id": string,\n' \
' "date_first_shared": datetime,\n' \
'}'
template_values = {
'api_name': 'sharedItemSave',
'api_slug': 'sharedItemSave',
'api_introduction':
"",
'try_now_link': 'apis_v1:sharedItemSaveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/shared_item_save_doc.py",
"copies": "1",
"size": "5354",
"license": "mit",
"hash": 7948741940453685000,
"line_mean": 41.4920634921,
"line_max": 115,
"alpha_frac": 0.4917818453,
"autogenerated": false,
"ratio": 3.9051787016776074,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.9895450792126986,
"avg_score": 0.0003019509701241651,
"num_lines": 126
} |
# apis_v1/documentation_source/sitewide_daily_metrics_sync_out_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def sitewide_daily_metrics_sync_out_doc_template_values(url_root):
"""
Show documentation about sitewideDailyMetricsSyncOut
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server. '
'If not provided, a new voter_device_id (and voter entry) '
'will be generated, and the voter_device_id will be returned.',
},
]
optional_query_parameter_list = [
{
'name': 'starting_date_as_integer',
'value': 'integer', # boolean, integer, long, string
'description': 'The earliest date for the batch we are retrieving. Format: YYYYMMDD (ex/ 20200131) '
'(Default is 3 months ago)',
},
{
'name': 'ending_date_as_integer',
'value': 'integer', # boolean, integer, long, string
'description': 'Retrieve data through this date. Format: YYYYMMDD (ex/ 20200228) (Default is right now.)'
},
{
'name': 'return_csv_format',
'value': 'boolean', # boolean, integer, long, string
'description': 'If set to true, return results in CSV format instead of JSON.'
},
]
potential_status_codes_list = [
]
try_now_link_variables_dict = {
}
api_response = '[{\n' \
' "id": integer,\n' \
' "authenticated_visitors_today": integer, Number of visitors, today\n' \
' "authenticated_visitors_total": integer, Number of visitors, all time\n' \
' "ballot_views_today": integer: ' \
'The number of voters that viewed at least one ballot on one day,\n' \
' "date_as_integer": integer, YYYYMMDD of the action \n' \
' "entered_full_address": integer, \n' \
' "friend_entrants_today": integer, first touch, response to friend \n' \
' "friends_only_positions": integer,\n' \
' "individuals_with_friends_only_positions": integer,\n' \
' "individuals_with_positions": integer,\n' \
' "individuals_with_public_positions": integer,\n' \
' "issue_follows_today": integer,one follow for one issue, today \n' \
' "issue_follows_total": integer: description, one follow for one issue, all time\n' \
' "issues_followed_today": integer, issues followed today, today \n' \
' "issues_followed_total": integer, number of issues followed, all time \n' \
' "issues_linked_today": integer,\n' \
' "issues_linked_total": integer,\n' \
' "new_visitors_today": integer,\n' \
' "organization_public_positions": integer,\n' \
' "organizations_auto_followed_today": integer,auto_follow organizations, today \n' \
' "organizations_auto_followed_total": integer,auto_follow organizations, all time \n' \
' "organizations_followed_today": integer, voter follow organizations, today\n' \
' "organizations_followed_total": integer, voter follow organizations, all \n' \
' "organizations_signed_in_total": organizations signed in, all time integer,\n' \
' "organizations_with_linked_issues": integer, organizations linked to issues, all \n' \
' "organizations_with_new_positions_today": integer, today \n' \
' "organizations_with_positions": integer,\n' \
' "visitors_today": integer, number of visitors, today \n' \
' "visitors_total": integer, number of visitors, all time \n' \
' "voter_guide_entrants_today": integer, first touch, voter guide \n' \
' "voter_guides_viewed_today": integer, number of voter guides viewed, today\n' \
' "voter_guides_viewed_total": integer, number of voter guides viewed, today\n' \
' "welcome_page_entrants_today": integer,first touch, welcome page\n' \
'}]'
template_values = {
'api_name': 'sitewideDailyMetricsSyncOut',
'api_slug': 'sitewideDailyMetricsSyncOut',
'api_introduction':
"Allow people with Analytics Admin authority to retrieve daily metrics information "
"for data analysis purposes.",
'try_now_link': 'apis_v1:sitewideDailyMetricsSyncOutView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/sitewide_daily_metrics_sync_out_doc.py",
"copies": "1",
"size": "5691",
"license": "mit",
"hash": -2651528092391121000,
"line_mean": 54.2524271845,
"line_max": 118,
"alpha_frac": 0.5552626955,
"autogenerated": false,
"ratio": 3.9356846473029043,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.49909473428029044,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/sitewide_election_metrics_sync_out_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def sitewide_election_metrics_sync_out_doc_template_values(url_root):
"""
Show documentation about sitewideElectionMetricsSyncOut
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server. '
'If not provided, a new voter_device_id (and voter entry) '
'will be generated, and the voter_device_id will be returned.',
},
]
optional_query_parameter_list = [
{
'name': 'starting_date_as_integer',
'value': 'integer', # boolean, integer, long, string
'description': 'The earliest date for the batch we are retrieving. Format: YYYYMMDD (ex/ 20200131) '
'(Default is 3 months ago)',
},
{
'name': 'ending_date_as_integer',
'value': 'integer', # boolean, integer, long, string
'description': 'Retrieve data through this date. Format: YYYYMMDD (ex/ 20200228) (Default is right now.)'
},
{
'name': 'return_csv_format',
'value': 'boolean', # boolean, integer, long, string
'description': 'If set to true, return results in CSV format instead of JSON.'
},
]
potential_status_codes_list = [
]
try_now_link_variables_dict = {
}
api_response = '[{\n' \
' "id": integer,\n' \
' "authenticated_visitors_total": integer,\n' \
' "date_as_integer": integer,\n' \
' "election_day_text": integer,\n' \
' "entered_full_address": integer,\n' \
' "friends_only_positions": integer,\n' \
' "friends_only_positions_with_comments": integer,\n' \
' "google_civic_election_id": integer,\n' \
' "individuals_with_friends_only_positions": integer,\n' \
' "individuals_with_positions": integer,\n' \
' "individuals_with_public_positions": integer,\n' \
' "issues_followed": integer,\n' \
' "organization_public_positions": integer,\n' \
' "organizations_auto_followed": integer,\n' \
' "organizations_followed": integer,\n' \
' "organizations_signed_in": integer,\n' \
' "organizations_with_positions": integer,\n' \
' "public_positions": integer,\n' \
' "public_positions_with_comments": integer,\n' \
' "unique_voters_that_auto_followed_organizations": integer,\n' \
' "unique_voters_that_followed_organizations": integer,\n' \
' "visitors_total": integer,\n' \
' "voter_guide_entries": integer,\n' \
' "voter_guide_views": integer,\n' \
' "voter_guides_viewed": integer,\n' \
'}]'
template_values = {
'api_name': 'sitewideElectionMetricsSyncOut',
'api_slug': 'sitewideElectionMetricsSyncOut',
'api_introduction':
"Allow people with Analytics Admin authority to retrieve raw election metrics information "
"for data analysis purposes.",
'try_now_link': 'apis_v1:sitewideElectionMetricsSyncOutView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/sitewide_election_metrics_sync_out_doc.py",
"copies": "1",
"size": "4462",
"license": "mit",
"hash": -5090710324156018000,
"line_mean": 46.4680851064,
"line_max": 118,
"alpha_frac": 0.5316001793,
"autogenerated": false,
"ratio": 3.9626998223801064,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.9988339262159459,
"avg_score": 0.0011921479041295095,
"num_lines": 94
} |
# apis_v1/documentation_source/sitewide_voter_metrics_sync_out_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def sitewide_voter_metrics_sync_out_doc_template_values(url_root):
"""
Show documentation about sitewideVoterMetricsSyncOut
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server. '
'If not provided, a new voter_device_id (and voter entry) '
'will be generated, and the voter_device_id will be returned.',
},
]
optional_query_parameter_list = [
{
'name': 'starting_date_as_integer',
'value': 'integer', # boolean, integer, long, string
'description': 'The earliest date for the batch we are retrieving. Format: YYYYMMDD (ex/ 20200131) '
'(Default is 3 months ago)',
},
{
'name': 'ending_date_as_integer',
'value': 'integer', # boolean, integer, long, string
'description': 'Retrieve data through this date. Format: YYYYMMDD (ex/ 20200228) (Default is right now.)'
},
{
'name': 'return_csv_format',
'value': 'boolean', # boolean, integer, long, string
'description': 'If set to true, return results in CSV format instead of JSON.'
},
]
potential_status_codes_list = [
]
try_now_link_variables_dict = {
}
api_response = '[{\n' \
' "id": integer,\n' \
' "actions_count": integer,\n' \
' "ballot_visited": integer,\n' \
' "comments_entered_friends_only": integer,\n' \
' "comments_entered_public": integer,\n' \
' "days_visited": integer,\n' \
' "elections_viewed": integer,\n' \
' "entered_full_address": integer,\n' \
' "issues_followed": integer,\n' \
' "last_action_date": integer,\n' \
' "last_calculated_date_as_integer": integer,\n' \
' "organizations_followed": integer,\n' \
' "positions_entered_friends_only": integer,\n' \
' "positions_entered_public": integer,\n' \
' "seconds_on_site": integer,\n' \
' "signed_in_facebook": integer,\n' \
' "signed_in_twitter": integer,\n' \
' "signed_in_with_email": integer,\n' \
' "signed_in_with_sms_phone_number": integer,\n' \
' "time_until_sign_in": integer,\n' \
' "voter_guides_viewed": integer,\n' \
' "voter_we_vote_id": integer,\n' \
' "welcome_visited": integer,\n' \
'}]'
template_values = {
'api_name': 'sitewideVoterMetricsSyncOut',
'api_slug': 'sitewideVoterMetricsSyncOut',
'api_introduction':
"Allow people with Analytics Admin authority to retrieve voter metrics information "
"for data analysis purposes.",
'try_now_link': 'apis_v1:sitewideVoterMetricsSyncOutView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/sitewide_voter_metrics_sync_out_doc.py",
"copies": "1",
"size": "4185",
"license": "mit",
"hash": 5278764327938945000,
"line_mean": 44.4891304348,
"line_max": 118,
"alpha_frac": 0.5182795699,
"autogenerated": false,
"ratio": 3.8821892393320963,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.9895643689083498,
"avg_score": 0.000965024029719727,
"num_lines": 92
} |
# apis_v1/documentation_source/twitter_identity_retrieve_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def twitter_identity_retrieve_doc_template_values(url_root):
"""
Show documentation about twitterIdentityRetrieve
"""
required_query_parameter_list = [
{
'name': 'twitter_handle',
'value': 'string', # boolean, integer, long, string
'description': 'Find the kind of owner and unique id of this twitter handle.',
},
]
optional_query_parameter_list = [
]
potential_status_codes_list = [
]
try_now_link_variables_dict = {
'twitter_handle': 'RepBarbaraLee',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "twitter_handle": string,\n' \
' "owner_found": boolean,\n' \
' "kind_of_owner": string, (POLITICIAN, CANDIDATE, ORGANIZATION,' \
' TWITTER_HANDLE_NOT_FOUND_IN_WE_VOTE, TWITTER_HANDLE_DOES_NOT_EXIST)\n' \
' "owner_we_vote_id": string,\n' \
' "owner_id": integer,\n' \
' "google_civic_election_id": integer,\n' \
' "twitter_description": string, (ONLY RETURNED FOR kind_of_owner ==' \
' TWITTER_HANDLE_NOT_FOUND_IN_WE_VOTE)\n' \
' "twitter_followers_count": string, (ONLY RETURNED FOR kind_of_owner ==' \
' TWITTER_HANDLE_NOT_FOUND_IN_WE_VOTE)\n' \
' "twitter_photo_url": string, (ONLY RETURNED FOR kind_of_owner ==' \
' TWITTER_HANDLE_NOT_FOUND_IN_WE_VOTE)\n' \
' "we_vote_hosted_profile_image_url_large": string, (ONLY RETURNED FOR kind_of_owner ==' \
' TWITTER_HANDLE_NOT_FOUND_IN_WE_VOTE)\n' \
' "we_vote_hosted_profile_image_url_medium": string, (ONLY RETURNED FOR kind_of_owner ==' \
' TWITTER_HANDLE_NOT_FOUND_IN_WE_VOTE)\n' \
' "we_vote_hosted_profile_image_url_tiny": string, (ONLY RETURNED FOR kind_of_owner ==' \
' TWITTER_HANDLE_NOT_FOUND_IN_WE_VOTE)\n' \
' "twitter_user_website": string, (ONLY RETURNED FOR kind_of_owner ==' \
' TWITTER_HANDLE_NOT_FOUND_IN_WE_VOTE)\n' \
' "twitter_name": string, (ONLY RETURNED FOR kind_of_owner ==' \
' TWITTER_HANDLE_NOT_FOUND_IN_WE_VOTE)\n' \
'}'
template_values = {
'api_name': 'twitterIdentityRetrieve',
'api_slug': 'twitterIdentityRetrieve',
'api_introduction':
"Find the kind of owner and unique id of this twitter handle, whether it be a candidate, organization, or "
"individual voter. We use this to take an incoming URI like "
"https://wevote.guide/RepBarbaraLee and return the owner of \'RepBarbaraLee\'.",
'try_now_link': 'apis_v1:twitterIdentityRetrieveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/documentation_source/twitter_identity_retrieve_doc.py",
"copies": "2",
"size": "3549",
"license": "mit",
"hash": 7216329022285254000,
"line_mean": 47.6164383562,
"line_max": 119,
"alpha_frac": 0.5480417019,
"autogenerated": false,
"ratio": 3.496551724137931,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.5044593426037931,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/twitter_retrieve_ids_i_follow_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def twitter_retrieve_ids_i_follow_doc_template_values(url_root):
"""
Show documentation about twitterRetrieveIDsIFollow
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
]
optional_query_parameter_list = [
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'MISSING_VOTER_ID_OR_ADDRESS_TYPE',
'description': 'Cannot proceed. Missing variables voter_id or address_type while trying to save.',
},
]
try_now_link_variables_dict = {
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "twitter_ids_i_follow": list, \n' \
'}'
template_values = {
'api_name': 'twitterRetrieveIdsIFollow',
'api_slug': 'twitterRetrieveIdsIFollow',
'api_introduction':
"Retrieve the Twitter ids i follow based on voter_device_id.",
'try_now_link': 'apis_v1:twitterRetrieveIdsIFollowView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/twitter_retrieve_ids_i_follow_doc.py",
"copies": "2",
"size": "2367",
"license": "mit",
"hash": 1523098663233393200,
"line_mean": 37.1774193548,
"line_max": 115,
"alpha_frac": 0.5610477398,
"autogenerated": false,
"ratio": 3.8363047001620747,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.5397352439962075,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/twitter_sign_in_request_access_token_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def twitter_sign_in_request_access_token_doc_template_values(url_root):
"""
Show documentation about twitterSignInRequestAccessToken
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'return_url',
'value': 'string', # boolean, integer, long, string
'description': 'The URL where the browser should be redirected once authenticated. '
'Usually https://wevote.me/more/sign_in',
},
{
'name': 'incoming_request_token',
'value': 'string', # boolean, integer, long, string
'description': 'Needed by Twitter Auth',
},
{
'name': 'incoming_oauth_verifier',
'value': 'string', # boolean, integer, long, string
'description': 'Needed by Twitter Auth',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
]
optional_query_parameter_list = [
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. A valid voter_id was not found.',
},
]
try_now_link_variables_dict = {
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "return_url": string, (This is the final url to return to once authentication is complete. ' \
'If set, the twitterSignInRequestAccessToken api redirects to the twitterSignInRequestVoterInfo ' \
'api before redirecting to the value in return_url)\n' \
' "access_token_and_secret_returned": boolean,\n' \
'}'
template_values = {
'api_name': 'twitterSignInRequestAccessToken',
'api_slug': 'twitterSignInRequestAccessToken',
'api_introduction':
"Flow chart showing entire process here: "
"https://docs.google.com/drawings/d/1WdVFsPZl3aLM9wxGuPTW3veqP-5EmZKv36KWjTz5pbU/edit",
'try_now_link': 'apis_v1:twitterSignInRequestAccessTokenView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WebAppPublic",
"path": "apis_v1/documentation_source/twitter_sign_in_request_access_token_doc.py",
"copies": "1",
"size": "3474",
"license": "bsd-3-clause",
"hash": -3763788639764694000,
"line_mean": 41.3658536585,
"line_max": 118,
"alpha_frac": 0.552964882,
"autogenerated": false,
"ratio": 3.925423728813559,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.4978388610813559,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/twitter_sign_in_request_voter_info_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def twitter_sign_in_request_voter_info_doc_template_values(url_root):
"""
Show documentation about twitterSignInRequestVoterInfo
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'return_url',
'value': 'string', # boolean, integer, long, string
'description': 'The URL where the browser should be redirected once authenticated. '
'Usually https://wevote.me/more/sign_in',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
]
optional_query_parameter_list = [
{
'name': 'switch_accounts_if_needed',
'value': 'boolean', # boolean, integer, long, string
'description': 'If a We Vote account already exists for this Twitter handle, create new session tied to'
' that account. If this variable not passed in, defaults to true.',
},
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. A valid voter_id was not found.',
},
]
try_now_link_variables_dict = {
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "twitter_handle": string,\n' \
' "twitter_handle_found": boolean,\n' \
' "voter_info_retrieved": boolean,\n' \
' "switch_accounts": boolean,\n' \
' "return_url": string, (This is the final url to return to once authentication is complete. ' \
'If set, the twitterSignInRequestAccessToken api redirects to the twitterSignInRequestVoterInfo ' \
'api before redirecting to the value in return_url)\n' \
'}'
template_values = {
'api_name': 'twitterSignInRequestVoterInfo',
'api_slug': 'twitterSignInRequestVoterInfo',
'api_introduction':
"Flow chart showing entire process here: "
"https://docs.google.com/drawings/d/1WdVFsPZl3aLM9wxGuPTW3veqP-5EmZKv36KWjTz5pbU/edit",
'try_now_link': 'apis_v1:twitterSignInRequestVoterInfoView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WebAppPublic",
"path": "apis_v1/documentation_source/twitter_sign_in_request_voter_info_doc.py",
"copies": "1",
"size": "3563",
"license": "bsd-3-clause",
"hash": 580199414823435900,
"line_mean": 42.987654321,
"line_max": 118,
"alpha_frac": 0.5562728038,
"autogenerated": false,
"ratio": 3.893989071038251,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.4950261874838251,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/twitter_sign_in_retrieve_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def twitter_sign_in_retrieve_doc_template_values(url_root):
"""
Show documentation about twitterSignInRetrieve
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
]
optional_query_parameter_list = [
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'MISSING_VOTER_ID_OR_ADDRESS_TYPE',
'description': 'Cannot proceed. Missing variables voter_id or address_type while trying to save.',
},
]
try_now_link_variables_dict = {
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "voter_we_vote_id_attached_to_twitter": string,\n' \
' "voter_we_vote_id_attached_to_twitter_email": string,\n' \
' "twitter_retrieve_attempted": boolean,\n' \
' "twitter_sign_in_found": boolean,\n' \
' "twitter_sign_in_verified": boolean,\n' \
' "twitter_access_token": string,\n' \
' "twitter_signed_request": string,\n' \
' "twitter_user_id": string,\n' \
' "twitter_email": string,\n' \
' "twitter_first_name": string,\n' \
' "twitter_middle_name": string,\n' \
' "twitter_last_name": string,\n' \
' "twitter_profile_image_url_https": string,\n' \
' "we_vote_hosted_profile_image_url_large": string,\n' \
' "we_vote_hosted_profile_image_url_medium": string,\n' \
' "we_vote_hosted_profile_image_url_tny": string,\n' \
'}'
template_values = {
'api_name': 'twitterSignInRetrieve',
'api_slug': 'twitterSignInRetrieve',
'api_introduction':
"Retrieve the Twitter Sign In status based on voter_device_id.",
'try_now_link': 'apis_v1:twitterSignInRetrieveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/twitter_sign_in_retrieve_doc.py",
"copies": "2",
"size": "3329",
"license": "mit",
"hash": 4482917215280319000,
"line_mean": 42.2337662338,
"line_max": 115,
"alpha_frac": 0.5286872935,
"autogenerated": false,
"ratio": 3.77437641723356,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 1,
"avg_score": 0.0007703905542410637,
"num_lines": 77
} |
# apis_v1/documentation_source/twitter_sign_in_start_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def twitter_sign_in_start_doc_template_values(url_root):
"""
Show documentation about twitterSignInStart
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'return_url',
'value': 'string', # boolean, integer, long, string
'description': 'The URL where the browser should be redirected once authenticated. '
'Usually https://wevote.me/more/sign_in',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
]
optional_query_parameter_list = [
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. A valid voter_id was not found.',
},
]
try_now_link_variables_dict = {
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "twitter_redirect_url": string, ' \
'(Where twitter wants We Vote to redirect the browser, with variables)\n' \
' "voter_info_retrieved": boolean, ' \
'(if handled without redirect, was voter info retrieved from Twitter?)\n' \
' "switch_accounts": boolean, (Was there an existing account for this Twitter account? ' \
'If true, a new voter_device_id is returned that links to this other We Vote account.)\n' \
'}'
template_values = {
'api_name': 'twitterSignInStart',
'api_slug': 'twitterSignInStart',
'api_introduction':
"Flow chart showing entire process here: "
"https://docs.google.com/drawings/d/1WdVFsPZl3aLM9wxGuPTW3veqP-5EmZKv36KWjTz5pbU/edit",
'try_now_link': 'apis_v1:twitterSignInStartView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WebAppPublic",
"path": "apis_v1/documentation_source/twitter_sign_in_start_doc.py",
"copies": "1",
"size": "3134",
"license": "bsd-3-clause",
"hash": -4544135072422946300,
"line_mean": 41.3513513514,
"line_max": 115,
"alpha_frac": 0.5513720485,
"autogenerated": false,
"ratio": 3.845398773006135,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.4896770821506135,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/voter_address_retrieve_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_address_retrieve_doc_template_values(url_root):
"""
Show documentation about voterAddressRetrieve
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
]
optional_query_parameter_list = [
{
'name': 'guess_if_no_address_saved',
'value': 'boolean', # boolean, integer, long, string
'description': 'Default = True. If True and the address is blank, make a guess at the voter\'s address '
'based on IP address, save it, then reach out to Google Civic to get the fresh ballot, and'
'finally, return the address.',
},
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'A valid voter_device_id parameter was not included. Cannot proceed.',
},
{
'code': 'VOTER_NOT_FOUND_FROM_VOTER_DEVICE_ID',
'description': 'No voter could be found from the voter_device_id',
},
{
'code': 'VOTER_ADDRESS_NOT_RETRIEVED',
'description': 'retrieve_ballot_address_from_voter_id failed.',
},
]
try_now_link_variables_dict = {
# 'voter_device_id': '',
}
api_response = '{\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "text_for_map_search": string (the value submitted and saved),\n' \
' "address_type": string (one char: B = Ballot address),\n' \
' "google_civic_election_id": integer,\n' \
' "guess_if_no_address_saved": boolean,\n' \
' "address_found": boolean,\n' \
' "latitude": string (value from Google),\n' \
' "longitude": string (value from Google),\n' \
' "normalized_line1": string (value from Google),\n' \
' "normalized_line2": string (value from Google),\n' \
' "normalized_city": string (value from Google),\n' \
' "normalized_state": string (value from Google),\n' \
' "normalized_zip": string (value from Google),\n' \
'}'
template_values = {
'api_name': 'voterAddressRetrieve',
'api_slug': 'voterAddressRetrieve',
'api_introduction':
"Retrieve the voter address for voter using voter_device_id.",
'try_now_link': 'apis_v1:voterAddressRetrieveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WebAppPublic",
"path": "apis_v1/documentation_source/voter_address_retrieve_doc.py",
"copies": "3",
"size": "3703",
"license": "bsd-3-clause",
"hash": -2926279670884305000,
"line_mean": 42.5647058824,
"line_max": 119,
"alpha_frac": 0.5311909263,
"autogenerated": false,
"ratio": 3.9143763213530653,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.5945567247653065,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/voter_address_save_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_address_save_doc_template_values(url_root):
"""
Show documentation about voterAddressSave
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'text_for_map_search',
'value': 'string', # boolean, integer, long, string
'description': 'The address text a voter enters to identify the location tied to their ballot. '
'(Not mailing address.)',
},
{
'name': 'simple_save',
'value': 'boolean', # boolean, integer, long, string
'description': 'Just save the address without returning a ballot with the results.',
},
]
optional_query_parameter_list = [
# {
# 'name': '',
# 'value': '', # boolean, integer, long, string
# 'description': '',
# },
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'MISSING_VOTER_ID_OR_ADDRESS_TYPE',
'description': 'Cannot proceed. Missing variables voter_id or address_type while trying to save.',
},
{
'code': 'VOTER_ADDRESS_SAVED',
'description': 'Successfully saved',
},
{
'code': 'MULTIPLE_MATCHING_ADDRESSES_FOUND',
'description': 'Could not save. Multiple entries already saved.',
},
{
'code': 'MISSING_POST_VARIABLE-ADDRESS',
'description': 'Could not save. POST variable \'address\' is required.',
},
]
try_now_link_variables_dict = {
# 'organization_we_vote_id': 'wv85org1',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "google_civic_election_id": integer,\n' \
' "text_for_map_search": string,\n' \
' "simple_save": boolean,\n' \
' "substituted_address_nearby": string,\n' \
' "ballot_found": boolean,\n' \
' "ballot_caveat": string,\n' \
' "is_from_substituted_address": boolean,\n' \
' "is_from_test_ballot": boolean,\n' \
' "ballot_item_list": list\n' \
' [\n' \
' "ballot_item_display_name": string,\n' \
' "voter_id": integer,\n' \
' "google_civic_election_id": integer,\n' \
' "google_ballot_placement": integer,\n' \
' "local_ballot_order": integer,\n' \
' "kind_of_ballot_item": string (CANDIDATE, MEASURE),\n' \
' "id": integer,\n' \
' "we_vote_id": string,\n' \
' "candidate_list": list\n' \
' [\n' \
' "id": integer,\n' \
' "we_vote_id": string,\n' \
' "ballot_item_display_name": string,\n' \
' "candidate_photo_url": string,\n' \
' "party": string,\n' \
' "order_on_ballot": integer,\n' \
' ],\n' \
' ],\n' \
'}'
template_values = {
'api_name': 'voterAddressSave',
'api_slug': 'voterAddressSave',
'api_introduction':
"Save or create an address for the current voter. Then return the same results as we return with "
"voterBallotItemsRetrieve.",
'try_now_link': 'apis_v1:voterAddressSaveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/documentation_source/voter_address_save_doc.py",
"copies": "2",
"size": "5074",
"license": "mit",
"hash": -4325937699817617400,
"line_mean": 41.6386554622,
"line_max": 115,
"alpha_frac": 0.4710287741,
"autogenerated": false,
"ratio": 3.933333333333333,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.5404362107433333,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/voter_all_bookmarks_status_retrieve_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_all_bookmarks_status_retrieve_doc_template_values(url_root):
"""
Show documentation about voterAllBookmarksStatusRetrieve
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
]
optional_query_parameter_list = [
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. A valid voter_id was not found.',
},
]
try_now_link_variables_dict = {
}
api_response = '{\n' \
' "success": boolean,\n' \
' "status": string,\n' \
' "bookmark_list": list\n' \
' [\n' \
' "ballot_item_we_vote_id": string,\n' \
' "bookmark_on": boolean,\n' \
' ],\n' \
'}'
template_values = {
'api_name': 'voterAllBookmarksStatusRetrieve',
'api_slug': 'voterAllBookmarksStatusRetrieve',
'api_introduction':
"A list of the office, candidate, or measure bookmark status for this voter.",
'try_now_link': 'apis_v1:voterAllBookmarksStatusRetrieveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/documentation_source/voter_all_bookmarks_status_retrieve_doc.py",
"copies": "2",
"size": "2471",
"license": "mit",
"hash": 453553744139125600,
"line_mean": 37.0153846154,
"line_max": 115,
"alpha_frac": 0.543504654,
"autogenerated": false,
"ratio": 3.8310077519379844,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 1,
"avg_score": 0.0007543820496100891,
"num_lines": 65
} |
# apis_v1/documentation_source/voter_all_positions_retrieve_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_all_positions_retrieve_doc_template_values(url_root):
"""
Show documentation about voterAllPositionsRetrieve
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
]
optional_query_parameter_list = [
{
'name': 'google_civic_election_id',
'value': 'integer', # boolean, integer, long, string
'description': 'The unique identifier for a particular election. If not provided, return all positions'
' for this voter.',
},
]
potential_status_codes_list = [
]
try_now_link_variables_dict = {
}
# Don't need is_positive_rating, is_support_or_positive_rating, is_negative_rating or is_oppose_or_negative_rating
api_response = '{\n' \
' "success": boolean,\n' \
' "status": string,\n' \
' "position_list": list\n' \
' [\n' \
' "ballot_item_we_vote_id": string,\n' \
' "is_support": boolean,\n' \
' "is_oppose": boolean,\n' \
' ],\n' \
'}'
template_values = {
'api_name': 'voterAllPositionsRetrieve',
'api_slug': 'voterAllPositionsRetrieve',
'api_introduction':
"Retrieve all positions held by this voter in one list.",
'try_now_link': 'apis_v1:voterAllPositionsRetrieveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WebAppPublic",
"path": "apis_v1/documentation_source/voter_all_positions_retrieve_doc.py",
"copies": "1",
"size": "2562",
"license": "bsd-3-clause",
"hash": 2760127721898354700,
"line_mean": 38.4153846154,
"line_max": 118,
"alpha_frac": 0.5413739266,
"autogenerated": false,
"ratio": 3.8642533936651584,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.9902173844724683,
"avg_score": 0.0006906951080950933,
"num_lines": 65
} |
# apis_v1/documentation_source/voter_all_stars_status_retrieve_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_all_stars_status_retrieve_doc_template_values(url_root):
"""
Show documentation about voterAllStarsStatusRetrieve
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
]
optional_query_parameter_list = [
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. A valid voter_id was not found.',
},
]
try_now_link_variables_dict = {
}
api_response = '{\n' \
' "success": boolean,\n' \
' "status": string,\n' \
' "star_list": list\n' \
' [\n' \
' "ballot_item_we_vote_id": string,\n' \
' "star_on": boolean,\n' \
' ],\n' \
'}'
template_values = {
'api_name': 'voterAllStarsStatusRetrieve',
'api_slug': 'voterAllStarsStatusRetrieve',
'api_introduction':
"A list of the office, candidate, or measure star status for this voter.",
'try_now_link': 'apis_v1:voterAllStarsStatusRetrieveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WebAppPublic",
"path": "apis_v1/documentation_source/voter_all_stars_status_retrieve_doc.py",
"copies": "1",
"size": "2435",
"license": "bsd-3-clause",
"hash": -5617691475166116000,
"line_mean": 36.4615384615,
"line_max": 115,
"alpha_frac": 0.5367556468,
"autogenerated": false,
"ratio": 3.7635239567233385,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.48002796035233386,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/voter_ballot_items_retrieve_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_ballot_items_retrieve_doc_template_values(url_root):
"""
Show documentation about voterBallotItemsRetrieve
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
]
optional_query_parameter_list = [
{
'name': 'google_civic_election_id',
'value': 'integer', # boolean, integer, long, string
'description': 'The unique identifier for a particular election. If not provided, use the most recent '
'ballot for the voter\'s address.',
},
{
'name': 'ballot_returned_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'The unique identifier for the ballot at one address.',
},
{
'name': 'ballot_location_shortcut',
'value': 'string', # boolean, integer, long, string
'description': 'The unique identifier for one ballot, identified by a string url.',
},
{
'name': 'use_test_election',
'value': 'boolean', # boolean, integer, long, string
'description': 'If you need to request a test election, pass this with the value \'True\'. Note that '
'text_for_map_search (either passed into this API endpoint as a value, or previously saved '
'with voterAddressSave) is required with every election, including the test election.',
},
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'A valid voter_device_id parameter was not included. Cannot proceed.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'A valid voter_id was not found from voter_device_id. Cannot proceed.',
},
{
'code': 'MISSING_GOOGLE_CIVIC_ELECTION_ID',
'description': 'A valid google_civic_election_id not found. Cannot proceed.',
},
{
'code': 'VOTER_BALLOT_ITEMS_RETRIEVED',
'description': 'Ballot items were found.',
},
]
try_now_link_variables_dict = {
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "google_civic_election_id": integer,\n' \
' "text_for_map_search": string,\n' \
' "substituted_address_nearby": string,\n' \
' "ballot_found": boolean,\n' \
' "ballot_caveat": string,\n' \
' "is_from_substituted_address": boolean,\n' \
' "is_from_test_ballot": boolean,\n' \
' "ballot_item_list": list\n' \
' [\n' \
' "id": integer,\n' \
' "we_vote_id": string,\n' \
' "ballot_item_display_name": string,\n' \
' "google_civic_election_id": integer,\n' \
' "google_ballot_placement": integer,\n' \
' "local_ballot_order": integer,\n' \
' "kind_of_ballot_item": string (CANDIDATE, MEASURE),\n' \
' "measure_subtitle": string (if kind_of_ballot_item is MEASURE)\n' \
' "measure_text": string (if kind_of_ballot_item is MEASURE)\n' \
' "measure_url": string (if kind_of_ballot_item is MEASURE)\n' \
' "yes_vote_description": string (if kind_of_ballot_item is MEASURE)\n' \
' "no_vote_description": string (if kind_of_ballot_item is MEASURE)\n' \
' "candidate_list": list (if kind_of_ballot_item is CANDIDATE)\n' \
' [\n' \
' "id": integer,\n' \
' "we_vote_id": string,\n' \
' "ballot_item_display_name": string,\n' \
' "candidate_photo_url_large": string,\n' \
' "candidate_photo_url_medium": string,\n' \
' "candidate_photo_url_tiny": string,\n' \
' "party": string,\n' \
' "order_on_ballot": integer,\n' \
' "kind_of_ballot_item": string,\n' \
' "twitter_handle": string,\n' \
' "twitter_description": string,\n' \
' "twitter_followers_count": integer,\n' \
' ],\n' \
' ],\n' \
'}'
template_values = {
'api_name': 'voterBallotItemsRetrieve',
'api_slug': 'voterBallotItemsRetrieve',
'api_introduction':
"Request a skeleton of ballot data for this voter location, so that the web_app has all of the ids "
"it needs to make more requests for data about each ballot item.",
'try_now_link': 'apis_v1:voterBallotItemsRetrieveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/documentation_source/voter_ballot_items_retrieve_doc.py",
"copies": "1",
"size": "6356",
"license": "mit",
"hash": 1195287757038631200,
"line_mean": 47.8923076923,
"line_max": 120,
"alpha_frac": 0.4911894273,
"autogenerated": false,
"ratio": 3.8803418803418803,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.48715313076418804,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/voter_ballot_items_retrieve_from_google_civic_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_ballot_items_retrieve_from_google_civic_doc_template_values(url_root):
"""
Show documentation about voterBallotItemsRetrieveFromGoogleCivic
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
]
optional_query_parameter_list = [
{
'name': 'text_for_map_search',
'value': 'string', # boolean, integer, long, string
'description': 'The voter\'s address we want to look up in the Google Civic API. If blank, we look this '
'value up from the database.',
},
{
'name': 'use_test_election',
'value': 'boolean', # boolean, integer, long, string
'description': 'If you need to request a test election, pass this with the value \'True\'. Note that '
'text_for_map_search (either passed into this API endpoint as a value, or previously saved '
'with voterAddressSave) is required with every election, including the test election.',
},
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'A valid voter_device_id parameter was not included. Cannot proceed.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'A valid voter_id was not found from voter_device_id. Cannot proceed.',
},
{
'code': 'RETRIEVED_FROM_GOOGLE_CIVIC_AND_STORED_BALLOT_FOR_VOTER',
'description': 'Ballot items were found and saved.',
},
{
'code': 'MISSING_ADDRESS_TEXT_FOR_BALLOT_SEARCH',
'description': 'A voter address was not passed in.',
},
{
'code': 'GOOGLE_CIVIC_API_ERROR: Election unknown',
'description': 'There is no upcoming election for this address. Or, the election has passed and the '
'election data is no longer available.',
},
{
'code': 'GOOGLE_CIVIC_API_ERROR: Election is over',
'description': 'The ballot data for this election is not being hosted by Google Civic any more.',
},
]
try_now_link_variables_dict = {
# 'organization_we_vote_id': 'wv85org1',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "google_civic_election_id": integer,\n' \
' "state_code": string,\n' \
' "election_day_text": string,\n' \
' "election_description_text": string,\n' \
' "election_data_retrieved": boolean,\n' \
' "text_for_map_search": string,\n' \
' "polling_location_retrieved": boolean,\n' \
' "contests_retrieved": boolean,\n' \
' "ballot_location_display_name": string,\n' \
' "ballot_location_shortcut": string,\n' \
' "ballot_returned_we_vote_id": string,\n' \
'}'
template_values = {
'api_name': 'voterBallotItemsRetrieveFromGoogleCivic',
'api_slug': 'voterBallotItemsRetrieveFromGoogleCivic',
'api_introduction':
"Tell the We Vote server to reach out to the Google Civic API and retrieve a list of "
"ballot items for the current voter (based on the address saved with voterAddressSave), "
"and store them in the We Vote database so we can display them with voterBallotItemsRetrieve, "
"and other API calls.",
'try_now_link': 'apis_v1:voterBallotItemsRetrieveFromGoogleCivicView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"If the google_civic_election_id is 2000 then we are looking at test election data.",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/documentation_source/voter_ballot_items_retrieve_from_google_civic_doc.py",
"copies": "2",
"size": "5079",
"license": "mit",
"hash": 1623151421813771800,
"line_mean": 46.9150943396,
"line_max": 120,
"alpha_frac": 0.5497145107,
"autogenerated": false,
"ratio": 3.9280742459396754,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.5477788756639675,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/voter_ballot_list_retrieve_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_ballot_list_retrieve_doc_template_values(url_root):
"""
Show documentation about voterBallotListRetrieve
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
]
optional_query_parameter_list = [
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'A valid voter_device_id parameter was not included. Cannot proceed.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'A valid voter_id was not found from voter_device_id. Cannot proceed.',
},
]
try_now_link_variables_dict = {
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "voter_ballot_list": list\n' \
' [\n' \
' "ballot_returned_we_vote_id": string,\n' \
' "ballot_location_shortcut": string,\n' \
' "election_description_text": string,\n' \
' "election_day_text": string,\n' \
' "google_civic_election_id": integer,\n' \
' "original_text_for_map_search": string,\n' \
' "state_code_list": list\n' \
' [],\n' \
' ],\n' \
'}'
template_values = {
'api_name': 'voterBallotListRetrieve',
'api_slug': 'voterBallotListRetrieve',
'api_introduction':
"Retrieve a list of ballots per voter_id",
'try_now_link': 'apis_v1:voterBallotListRetrieveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/voter_ballot_list_retrieve_doc.py",
"copies": "1",
"size": "2803",
"license": "mit",
"hash": 664672768825246300,
"line_mean": 37.9305555556,
"line_max": 108,
"alpha_frac": 0.5240813414,
"autogenerated": false,
"ratio": 3.752342704149933,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.9773021818946255,
"avg_score": 0.000680445320735747,
"num_lines": 72
} |
# apis_v1/documentation_source/voter_bookmark_off_save_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_bookmark_off_save_doc_template_values(url_root):
"""
Show documentation about voterBookmarkOffSave
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'kind_of_ballot_item',
'value': 'string', # boolean, integer, long, string
'description': 'What is the type of ballot item for which we are saving the \'off\' status? '
'(kind_of_ballot_item is either "OFFICE", "CANDIDATE", "POLITICIAN" or "MEASURE")',
},
{
'name': 'ballot_item_id',
'value': 'integer', # boolean, integer, long, string
'description': 'The unique internal identifier for this ballot_item '
'(either ballot_item_id OR ballot_item_we_vote_id required -- not both. '
'If it exists, ballot_item_id is used instead of ballot_item_we_vote_id)',
},
{
'name': 'ballot_item_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'The unique identifier for this ballot_item across all networks '
'(either ballot_item_id OR ballot_item_we_vote_id required -- not both. '
'NOTE: In the future we might support other identifiers used in the industry.',
},
]
optional_query_parameter_list = [
# {
# 'name': '',
# 'value': '', # boolean, integer, long, string
# 'description': '',
# },
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. Missing voter_id while trying to save.',
},
{
'code': 'BOOKMARK_OFF_OFFICE CREATE/UPDATE ITEM_BOOKMARKED',
'description': '',
},
{
'code': 'BOOKMARK_OFF_CANDIDATE CREATE/UPDATE ITEM_BOOKMARKED',
'description': '',
},
{
'code': 'BOOKMARK_OFF_MEASURE CREATE/UPDATE ITEM_BOOKMARKED',
'description': '',
},
]
try_now_link_variables_dict = {
'kind_of_ballot_item': 'CANDIDATE',
'ballot_item_id': '5655',
}
api_response = '{\n' \
' "status": string (description of what happened),\n' \
' "success": boolean (did the save happen?),\n' \
' "ballot_item_id": integer,\n' \
' "ballot_item_we_vote_id": string,\n' \
' "kind_of_ballot_item": string (CANDIDATE, MEASURE),\n' \
'}'
template_values = {
'api_name': 'voterBookmarkOffSave',
'api_slug': 'voterBookmarkOffSave',
'api_introduction':
"Save or create private 'bookmark off' state for the current voter for a measure, an office or candidate.",
'try_now_link': 'apis_v1:voterBookmarkOffSaveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/documentation_source/voter_bookmark_off_save_doc.py",
"copies": "2",
"size": "4346",
"license": "mit",
"hash": -7293415064465983000,
"line_mean": 41.6078431373,
"line_max": 119,
"alpha_frac": 0.5209387943,
"autogenerated": false,
"ratio": 3.8562555456965395,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.5377194339996539,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/voter_bookmark_on_save_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_bookmark_on_save_doc_template_values(url_root):
"""
Show documentation about voterBookmarkOnSave
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'kind_of_ballot_item',
'value': 'string', # boolean, integer, long, string
'description': 'What is the type of ballot item for which we are saving the \'on\' status? '
'(kind_of_ballot_item is either "OFFICE", "CANDIDATE", "POLITICIAN" or "MEASURE")',
},
{
'name': 'ballot_item_id',
'value': 'integer', # boolean, integer, long, string
'description': 'The unique internal identifier for this ballot_item '
'(either ballot_item_id OR ballot_item_we_vote_id required -- not both. '
'If it exists, ballot_item_id is used instead of ballot_item_we_vote_id)',
},
{
'name': 'ballot_item_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'The unique identifier for this ballot_item across all networks '
'(either ballot_item_id OR ballot_item_we_vote_id required -- not both. '
'NOTE: In the future we might support other identifiers used in the industry.',
},
]
optional_query_parameter_list = [
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. Missing voter_id while trying to save.',
},
{
'code': 'BOOKMARK_ON_OFFICE CREATE/UPDATE ITEM_BOOKMARKED',
'description': '',
},
{
'code': 'BOOKMARK_ON_CANDIDATE CREATE/UPDATE ITEM_BOOKMARKED',
'description': '',
},
{
'code': 'BOOKMARK_ON_MEASURE CREATE/UPDATE ITEM_BOOKMARKED',
'description': '',
},
]
try_now_link_variables_dict = {
'kind_of_ballot_item': 'CANDIDATE',
'ballot_item_id': '5655',
}
api_response = '{\n' \
' "status": string (description of what happened),\n' \
' "success": boolean (did the save happen?),\n' \
' "ballot_item_id": integer,\n' \
' "ballot_item_we_vote_id": string,\n' \
' "kind_of_ballot_item": string (CANDIDATE, MEASURE),\n' \
'}'
template_values = {
'api_name': 'voterBookmarkOnSave',
'api_slug': 'voterBookmarkOnSave',
'api_introduction':
"Save or create private 'bookmark on' state for the current voter for a measure, an office or candidate.",
'try_now_link': 'apis_v1:voterBookmarkOnSaveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/voter_bookmark_on_save_doc.py",
"copies": "2",
"size": "4174",
"license": "mit",
"hash": 4558129968420918000,
"line_mean": 42.0309278351,
"line_max": 118,
"alpha_frac": 0.5292285577,
"autogenerated": false,
"ratio": 3.8363970588235294,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.5365625616523529,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/voter_bookmark_status_retrieve_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_bookmark_status_retrieve_doc_template_values(url_root):
"""
Show documentation about voterBookmarkStatusRetrieve
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'kind_of_ballot_item',
'value': 'string', # boolean, integer, long, string
'description': 'What is the type of ballot item for which we are retrieving the status? '
'(kind_of_ballot_item is either "OFFICE", "CANDIDATE", "POLITICIAN" or "MEASURE")',
},
{
'name': 'ballot_item_id',
'value': 'integer', # boolean, integer, long, string
'description': 'The unique internal identifier for this ballot_item '
'(either ballot_item_id OR ballot_item_we_vote_id required -- not both. '
'If it exists, ballot_item_id is used instead of ballot_item_we_vote_id)',
},
{
'name': 'ballot_item_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'The unique identifier for this ballot_item across all networks '
'(either ballot_item_id OR ballot_item_we_vote_id required -- not both. '
'NOTE: In the future we might support other identifiers used in the industry.',
},
]
optional_query_parameter_list = [
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. A valid voter_id was not found.',
},
]
try_now_link_variables_dict = {
'kind_of_ballot_item': 'CANDIDATE',
'ballot_item_id': '5655',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "is_bookmarked": boolean,\n' \
' "office_id": integer,\n' \
' "candidate_id": integer,\n' \
' "measure_id": integer,\n' \
' "ballot_item_id": integer,\n' \
' "ballot_item_we_vote_id": string,\n' \
' "kind_of_ballot_item": string (CANDIDATE, MEASURE),\n' \
'}'
template_values = {
'api_name': 'voterBookmarkStatusRetrieve',
'api_slug': 'voterBookmarkStatusRetrieve',
'api_introduction':
"Is the bookmark next to this office, candidate, or measure bookmarked for this voter?",
'try_now_link': 'apis_v1:voterBookmarkStatusRetrieveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/documentation_source/voter_bookmark_status_retrieve_doc.py",
"copies": "2",
"size": "4016",
"license": "mit",
"hash": -8193582770876726000,
"line_mean": 43.6222222222,
"line_max": 115,
"alpha_frac": 0.53062749,
"autogenerated": false,
"ratio": 3.854126679462572,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.5384754169462571,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/voter_count_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_count_doc_template_values(url_root):
"""
Show documentation about voterCount
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
# {
# 'name': '',
# 'value': '', # string, long, boolean
# 'description': '',
# },
]
optional_query_parameter_list = [
# {
# 'name': '',
# 'value': '', # string, long, boolean
# 'description': '',
# },
]
potential_status_codes_list = [
# {
# 'code': '',
# 'description': '',
# },
]
try_now_link_variables_dict = {
# 'organization_we_vote_id': 'wv85org1',
}
api_response = '{\n' \
' "voter_count": integer,\n' \
' "success": boolean,\n' \
'}'
template_values = {
'api_name': 'voterCount',
'api_slug': 'voterCount',
'api_introduction':
"Return the number of voters in the database.",
'try_now_link': 'apis_v1:voterCountView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/voter_count_doc.py",
"copies": "3",
"size": "1953",
"license": "mit",
"hash": 936801565833809300,
"line_mean": 30.5,
"line_max": 115,
"alpha_frac": 0.4935995904,
"autogenerated": false,
"ratio": 3.7058823529411766,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 1,
"avg_score": 0.00029563592772984004,
"num_lines": 62
} |
# apis_v1/documentation_source/voter_create_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_create_doc_template_values(url_root):
"""
Show documentation about voterCreate
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
]
optional_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server. '
'If you do not pass in a voter_device_id, generate one, link '
'it to the newly created voter, and return it.',
},
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'A valid voter_device_id parameter was not included. Cannot proceed.',
},
{
'code': 'VOTER_ALREADY_EXISTS',
'description': 'A voter account is already linked with that voter_device_id',
},
{
'code': 'VOTER_CREATED',
'description': 'A voter account was successfully created',
},
{
'code': 'VOTER_NOT_CREATED',
'description': 'A voter account could not be created',
},
]
try_now_link_variables_dict = {
# 'organization_we_vote_id': 'wv85org1',
}
api_response = '{\n' \
' "success": boolean,\n' \
' "status": status string,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "voter_id": integer,\n' \
' "voter_we_vote_id": string,\n' \
'}'
template_values = {
'api_name': 'voterCreate',
'api_slug': 'voterCreate',
'api_introduction':
"Generate a voter account for this voter_device_id",
'try_now_link': 'apis_v1:voterCreateView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/documentation_source/voter_create_doc.py",
"copies": "3",
"size": "2734",
"license": "mit",
"hash": -8232183229783126000,
"line_mean": 36.9722222222,
"line_max": 115,
"alpha_frac": 0.5281638625,
"autogenerated": false,
"ratio": 3.856135401974612,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.5884299264474612,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/voter_email_address_retrieve_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_email_address_retrieve_doc_template_values(url_root):
"""
Show documentation about voterEmailAddressRetrieve
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
]
optional_query_parameter_list = [
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'A valid voter_device_id parameter was not included. Cannot proceed.',
},
{
'code': 'VOTER_NOT_FOUND_FROM_VOTER_DEVICE_ID',
'description': 'No voter could be found from the voter_device_id',
},
]
try_now_link_variables_dict = {
# 'voter_device_id': '',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "email_address_list_found": boolean,\n' \
' "email_address_list": list\n' \
' [\n' \
' "normalized_email_address": string,\n' \
' "primary_email_address": boolean,\n' \
' "email_permanent_bounce": boolean,\n' \
' "email_ownership_is_verified": boolean,\n' \
' "voter_we_vote_id": string,\n' \
' "email_we_vote_id": string,\n' \
' ],\n' \
'}'
template_values = {
'api_name': 'voterEmailAddressRetrieve',
'api_slug': 'voterEmailAddressRetrieve',
'api_introduction':
"Retrieve a list of all of the email addresses for voter using voter_device_id.",
'try_now_link': 'apis_v1:voterEmailAddressRetrieveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/voter_email_address_retrieve_doc.py",
"copies": "2",
"size": "2892",
"license": "mit",
"hash": -2027013041213239000,
"line_mean": 38.6164383562,
"line_max": 115,
"alpha_frac": 0.5248962656,
"autogenerated": false,
"ratio": 3.8153034300791555,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.5340199695679155,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/voter_email_address_save_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_email_address_save_doc_template_values(url_root):
"""
Show documentation about voterEmailAddressSave
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'text_for_email_address',
'value': 'string', # boolean, integer, long, string
'description': 'The address text a voter enters to identify the location tied to their ballot. '
'(Not mailing address.)',
},
{
'name': 'email_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'The unique identifier for this email across all networks ',
},
{
'name': 'email_secret_key',
'value': 'string', # boolean, integer, long, string
'description': 'We can pass in the secret key as an identifier.',
},
]
optional_query_parameter_list = [
{
'name': 'delete_email',
'value': 'boolean', # boolean, integer, long, string
'description': 'When this variable is passed in as true, mark this email as deleted.',
},
{
'name': 'make_primary_email',
'value': 'boolean', # boolean, integer, long, string
'description': 'When this variable is passed in as true, change this (verified) email to be the primary.',
},
{
'name': 'verify_email',
'value': 'boolean', # boolean, integer, long, string
'description': 'When this variable is passed in as true, change this email to verified.',
},
{
'name': 'resend_verification_email',
'value': 'boolean', # boolean, integer, long, string
'description': 'Send the a verification email to this address again.',
},
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'MISSING_VOTER_ID_OR_ADDRESS_TYPE',
'description': 'Cannot proceed. Missing variables voter_id or address_type while trying to save.',
},
]
try_now_link_variables_dict = {
# 'organization_we_vote_id': 'wv85org1',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "text_for_email_address": string,\n' \
' "make_primary_email": boolean,\n' \
' "delete_email": boolean,\n' \
' "email_address_saved_we_vote_id": string,\n' \
' "email_address_created": boolean,\n' \
' "email_address_deleted": boolean,\n' \
' "email_address_not_valid": boolean,\n' \
' "verification_email_sent": boolean,\n' \
' "email_address_already_owned_by_other_voter": boolean,\n' \
' "email_address_found": boolean,\n' \
' "email_address_list_found": boolean,\n' \
' "email_address_list": list\n' \
' [\n' \
' "normalized_email_address": string,\n' \
' "primary_email_address": boolean,\n' \
' "email_permanent_bounce": boolean,\n' \
' "email_ownership_is_verified": boolean,\n' \
' "voter_we_vote_id": string,\n' \
' "email_we_vote_id": string,\n' \
' ],\n' \
'}'
template_values = {
'api_name': 'voterEmailAddressSave',
'api_slug': 'voterEmailAddressSave',
'api_introduction':
"Save or create an email address for the current voter.",
'try_now_link': 'apis_v1:voterEmailAddressSaveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/voter_email_address_save_doc.py",
"copies": "1",
"size": "5255",
"license": "mit",
"hash": 9206480099927533000,
"line_mean": 43.5338983051,
"line_max": 119,
"alpha_frac": 0.5033301618,
"autogenerated": false,
"ratio": 4.029907975460123,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 1,
"avg_score": 0.0010122306174974365,
"num_lines": 118
} |
# apis_v1/documentation_source/voter_email_address_sign_in_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_email_address_sign_in_doc_template_values(url_root):
"""
Show documentation about voterEmailAddressSignIn
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'email_secret_key',
'value': 'string', # boolean, integer, long, string
'description': 'We can pass in the secret key as an identifier.',
},
]
optional_query_parameter_list = [
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'MISSING_VOTER_ID_OR_ADDRESS_TYPE',
'description': 'Cannot proceed. Missing variables voter_id or address_type while trying to save.',
},
]
try_now_link_variables_dict = {
# 'organization_we_vote_id': 'wv85org1',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "email_ownership_is_verified": boolean,\n' \
' "email_secret_key_belongs_to_this_voter": boolean,\n' \
' "email_address_found": boolean,\n' \
'}'
template_values = {
'api_name': 'voterEmailAddressSignIn',
'api_slug': 'voterEmailAddressSignIn',
'api_introduction':
"Sign in based on an email_secret_key that get's emailed to voter.",
'try_now_link': 'apis_v1:voterEmailAddressSignInView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/documentation_source/voter_email_address_sign_in_doc.py",
"copies": "2",
"size": "2776",
"license": "mit",
"hash": -4724372738975648000,
"line_mean": 38.6571428571,
"line_max": 115,
"alpha_frac": 0.5486311239,
"autogenerated": false,
"ratio": 3.782016348773842,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 1,
"avg_score": 0.00084742960966517,
"num_lines": 70
} |
# apis_v1/documentation_source/voter_email_address_verify_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_email_address_verify_doc_template_values(url_root):
"""
Show documentation about voterEmailAddressVerify
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'email_secret_key',
'value': 'string', # boolean, integer, long, string
'description': 'We can pass in the secret key as an identifier.',
},
]
optional_query_parameter_list = [
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'MISSING_VOTER_ID_OR_ADDRESS_TYPE',
'description': 'Cannot proceed. Missing variables voter_id or address_type while trying to save.',
},
]
try_now_link_variables_dict = {
# 'organization_we_vote_id': 'wv85org1',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "email_verify_attempted": boolean,\n' \
' "email_ownership_is_verified": boolean,\n' \
' "email_secret_key_belongs_to_this_voter": boolean,\n' \
' "email_address_found": boolean,\n' \
'}'
template_values = {
'api_name': 'voterEmailAddressVerify',
'api_slug': 'voterEmailAddressVerify',
'api_introduction':
"Verify an email address based on a secret key.",
'try_now_link': 'apis_v1:voterEmailAddressVerifyView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/documentation_source/voter_email_address_verify_doc.py",
"copies": "2",
"size": "2817",
"license": "mit",
"hash": -8924070657443414000,
"line_mean": 38.676056338,
"line_max": 115,
"alpha_frac": 0.5456159034,
"autogenerated": false,
"ratio": 3.853625170998632,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.5399241074398632,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/voter_facebook_save_to_current_account_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_facebook_save_to_current_account_doc_template_values(url_root):
"""
Show documentation about voterFacebookSaveToCurrentAccount
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'facebook_secret_key',
'value': 'string', # boolean, integer, long, string
'description': 'The secret key we use to find the record in the facebook_auth_response table.',
},
]
optional_query_parameter_list = [
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. A valid voter_id was not found.',
},
]
try_now_link_variables_dict = {
# 'organization_we_vote_id': 'wv85org1',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
'}'
template_values = {
'api_name': 'voterFacebookSaveToCurrentAccount',
'api_slug': 'voterFacebookSaveToCurrentAccount',
'api_introduction':
"",
'try_now_link': 'apis_v1:voterFacebookSaveToCurrentAccountView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/voter_facebook_save_to_current_account_doc.py",
"copies": "2",
"size": "2559",
"license": "mit",
"hash": -7443097570566524000,
"line_mean": 37.1940298507,
"line_max": 115,
"alpha_frac": 0.5572489254,
"autogenerated": false,
"ratio": 3.8308383233532934,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.5388087248753294,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/voter_facebook_sign_in_retrieve_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_facebook_sign_in_retrieve_doc_template_values(url_root):
"""
Show documentation about voterFacebookSignInRetrieve
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
]
optional_query_parameter_list = [
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'MISSING_VOTER_ID_OR_ADDRESS_TYPE',
'description': 'Cannot proceed. Missing variables voter_id or address_type while trying to save.',
},
]
try_now_link_variables_dict = {
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "voter_we_vote_id_attached_to_facebook": string,\n' \
' "voter_we_vote_id_attached_to_facebook_email": string,\n' \
' "facebook_retrieve_attempted": boolean,\n' \
' "facebook_sign_in_found": boolean,\n' \
' "facebook_sign_in_verified": boolean,\n' \
' "facebook_access_token": string,\n' \
' "facebook_signed_request": string,\n' \
' "facebook_user_id": string,\n' \
' "facebook_email": string,\n' \
' "facebook_first_name": string,\n' \
' "facebook_middle_name": string,\n' \
' "facebook_last_name": string,\n' \
' "facebook_profile_image_url_https": string,\n' \
' "we_vote_hosted_profile_image_url_large": string,\n' \
' "we_vote_hosted_profile_image_url_medium": string,\n' \
' "we_vote_hosted_profile_image_url_tiny": string,\n' \
'}'
template_values = {
'api_name': 'voterFacebookSignInRetrieve',
'api_slug': 'voterFacebookSignInRetrieve',
'api_introduction':
"Retrieve the Facebook Sign In status based on voter_device_id.",
'try_now_link': 'apis_v1:voterFacebookSignInRetrieveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/voter_facebook_sign_in_retrieve_doc.py",
"copies": "2",
"size": "3382",
"license": "mit",
"hash": 9161062212043112000,
"line_mean": 42.9220779221,
"line_max": 115,
"alpha_frac": 0.5354819633,
"autogenerated": false,
"ratio": 3.7619577308120133,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.5297439694112013,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/voter_facebook_sign_in_save_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_facebook_sign_in_save_doc_template_values(url_root):
"""
Show documentation about voterFacebookSignInSave
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'save_auth_data',
'value': 'boolean', # boolean, integer, long, string
'description': 'Listen for facebook authentication data.',
},
{
'name': 'facebook_access_token', # Comes with save_auth_data
'value': 'string', # boolean, integer, long, string
'description': 'The Facebook accessToken',
},
{
'name': 'facebook_user_id', # Comes with save_auth_data
'value': 'string', # boolean, integer, long, string
'description': 'The Facebook big integer id',
},
{
'name': 'facebook_expires_in', # Comes with save_auth_data
'value': 'string', # boolean, integer, long, string
'description': 'The Facebook expiresIn',
},
{
'name': 'facebook_signed_request', # Comes with save_auth_data
'value': 'string', # boolean, integer, long, string
'description': 'The Facebook signedRequest',
},
# ##########################
{
'name': 'save_profile_data',
'value': 'boolean', # boolean, integer, long, string
'description': 'Listen for facebook profile data.',
},
{
'name': 'facebook_email', # Comes with save_profile_data
'value': 'string', # boolean, integer, long, string
'description': 'Email address from Facebook',
},
{
'name': 'facebook_first_name', # Comes with save_profile_data
'value': 'string', # boolean, integer, long, string
'description': 'First name from Facebook',
},
{
'name': 'facebook_middle_name', # Comes with save_profile_data
'value': 'string', # boolean, integer, long, string
'description': 'Middle name from Facebook',
},
{
'name': 'facebook_last_name', # Comes with save_profile_data
'value': 'string', # boolean, integer, long, string
'description': 'Last name from Facebook',
},
{
'name': 'facebook_profile_image_url_https', # Comes with save_profile_data
'value': 'string', # boolean, integer, long, string
'description': 'Email address from Facebook',
},
]
optional_query_parameter_list = [
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'MISSING_VOTER_ID_OR_ADDRESS_TYPE',
'description': 'Cannot proceed. Missing variables voter_id or address_type while trying to save.',
},
]
try_now_link_variables_dict = {
# 'organization_we_vote_id': 'wv85org1',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "facebook_save_attempted": boolean,\n' \
' "facebook_sign_in_saved": boolean,\n' \
'}'
template_values = {
'api_name': 'voterFacebookSignInSave',
'api_slug': 'voterFacebookSignInSave',
'api_introduction':
"Save the results of Facebook sign in authentication.",
'try_now_link': 'apis_v1:voterFacebookSignInSaveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/voter_facebook_sign_in_save_doc.py",
"copies": "2",
"size": "5017",
"license": "mit",
"hash": -2170304465302401500,
"line_mean": 40.8083333333,
"line_max": 115,
"alpha_frac": 0.5148495117,
"autogenerated": false,
"ratio": 4.026484751203852,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.5541334262903852,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/voter_follow_all_organizations_followed_by_organization_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_follow_all_organizations_followed_by_organization_doc_template_values(url_root):
"""
Show documentation about voterFollowAllOrganizationsFollowedByOrganization
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'organization_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'The we vote id for the endorser',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
]
optional_query_parameter_list = [
{
'name': 'maximum_number_to_follow',
'value': 'integer', # boolean, integer, long, string
'description': 'Defaults to 40 voter guides. Enter a value to set your own limit.',
},
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. A valid voter_id was not found.',
},
# {
# 'code': '',
# 'description': '',
# },
]
try_now_link_variables_dict = {
# 'organization_we_vote_id': 'wv85org1',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "organizations_follow_all_results": list\n' \
' [\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "organization_id": integer,\n' \
' "organization_we_vote_id": string,\n' \
' "voter_linked_organization_we_vote_id": string,\n' \
' "organization_follow_based_on_issue": boolean,\n' \
' ],\n' \
' "organization_we_vote_id": integer,\n' \
' "maximum_number_to_follow": integer,\n' \
'}\n'
template_values = {
'api_name': 'voterFollowAllOrganizationsFollowedByOrganization',
'api_slug': 'voterFollowAllOrganizationsFollowedByOrganization',
'api_introduction':
"",
'try_now_link': 'apis_v1:voterFollowAllOrganizationsFollowedByOrganizationView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/voter_follow_all_organizations_followed_by_organization_doc.py",
"copies": "1",
"size": "3651",
"license": "mit",
"hash": -7814750077494543000,
"line_mean": 40.4886363636,
"line_max": 115,
"alpha_frac": 0.5228704465,
"autogenerated": false,
"ratio": 3.875796178343949,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.4898666624843949,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/voter_guide_followers_retrieve_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_guide_followers_retrieve_doc_template_values(url_root):
"""
Show documentation about voterGuideFollowersRetrieve
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
]
optional_query_parameter_list = [
{
'name': 'maximum_number_to_retrieve',
'value': 'integer', # boolean, integer, long, string
'description': 'Defaults to 20 voter guides. Enter a value to set your own limit.',
},
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. A valid voter_id was not found.',
},
# {
# 'code': '',
# 'description': '',
# },
]
try_now_link_variables_dict = {
# 'organization_we_vote_id': 'wv85org1',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "voter_guides": list\n' \
' [\n' \
' "voter_guide_display_name": string (Name of this org or person),\n' \
' "voter_guide_owner_type": ORGANIZATION, PUBLIC_FIGURE, VOTER),\n' \
' "we_vote_id": string (We Vote ID of the voter guide),\n' \
' "organization_we_vote_id": string (We Vote ID for the org that owns the voter guide),\n' \
' "public_figure_we_vote_id": string (We Vote ID for the person that owns the voter guide),\n' \
' "voter_guide_image_url_large": string ' \
'(We Vote ID for the person that owns the voter guide),\n' \
' "voter_guide_image_url_medium": string ' \
'(We Vote ID for the person that owns the voter guide),\n' \
' "voter_guide_image_url_tiny": string ' \
'(We Vote ID for the person that owns the voter guide),\n' \
' "last_updated": string (time in this format %Y-%m-%d %H:%M),\n' \
' "google_civic_election_id": integer,\n' \
' "twitter_description": string,\n' \
' "twitter_followers_count": integer,\n' \
' "twitter_handle": integer,\n' \
' "owner_voter_id": integer TO BE DEPRECATED,\n' \
' ],\n' \
' "google_civic_election_id": integer,\n' \
' "maximum_number_to_retrieve": integer,\n' \
'}\n'
template_values = {
'api_name': 'voterGuideFollowersRetrieve',
'api_slug': 'voterGuideFollowersRetrieve',
'api_introduction':
"",
'try_now_link': 'apis_v1:voterGuideFollowersRetrieveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/documentation_source/voter_guide_followers_retrieve_doc.py",
"copies": "1",
"size": "4214",
"license": "mit",
"hash": 3262500158426011000,
"line_mean": 44.311827957,
"line_max": 119,
"alpha_frac": 0.5075937352,
"autogenerated": false,
"ratio": 3.7827648114901256,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.9784472423011096,
"avg_score": 0.0011772247358059742,
"num_lines": 93
} |
# apis_v1/documentation_source/voter_guide_possibility_highlights_retrieve_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_guide_possibility_highlights_retrieve_doc_template_values(url_root):
"""
Show documentation about voterGuidePossibilityHighlightsRetrieve
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
]
optional_query_parameter_list = [
{
'name': 'url_to_scan',
'value': 'string', # boolean, integer, long, string
'description': 'The url of the list of endorsements that the voter is viewing.',
},
{
'name': 'pdf_url',
'value': 'string', # boolean, integer, long, string
'description': 'The url of the list of endorsements, if the endorsement was originally on a pdf.',
},
{
'name': 'google_civic_election_id',
'value': 'integer', # boolean, integer, long, string
'description': 'The Google civic election ID. Provide a value, only if you want data for a prior election.',
},
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. A valid voter_id was not found.',
},
{
'code': 'VOTER_GUIDE_POSSIBILITY_NOT_FOUND',
'description': 'A voter guide possibility was not found at that URL.',
},
{
'code': 'VOTER_GUIDE_POSSIBILITY_FOUND_WITH_URL',
'description': 'A voter guide possibility entry was found.',
},
# {
# 'code': '',
# 'description': '',
# },
]
try_now_link_variables_dict = {
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "url_to_scan": string,\n' \
' "pdf_url": string,\n' \
' "highlight_list": list [\n' \
' {\n' \
' "name": string,\n' \
' "we_vote_id": string,\n' \
' "display": string, (\'STORED\', \'DELETED\', \'POSSIBILITY\', or \'DEFAULT\')\n' \
' "stance": string, (\'SUPPORT\', \'OPPOSED\', or \'INFO_ONLY\')\n'\
' "prior": integer, (\'1\' if from a prior election)\n'\
' }\n' \
' ],\n' \
' "never_highlight_on": list [\n' \
' "*.wevote.us",\n' \
' "api.wevoteusa.org",\n' \
' "localhost"\n' \
' ]\n' \
'}'
template_values = {
'api_name': 'voterGuidePossibilityHighlightsRetrieve',
'api_slug': 'voterGuidePossibilityHighlightsRetrieve',
'api_introduction':
"Retrieve all of the candidates that might be highlighted on an endorsement guide. "
"DEFAULT = there is no entry in this organization's Voter Guide Possibility yet.",
'try_now_link': 'apis_v1:voterGuidePossibilityHighlightsRetrieveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/voter_guide_possibility_highlights_retrieve_doc.py",
"copies": "1",
"size": "4413",
"license": "mit",
"hash": -5424694285857908000,
"line_mean": 41.4326923077,
"line_max": 121,
"alpha_frac": 0.5003399048,
"autogenerated": false,
"ratio": 3.9366636931311327,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.9926343427791091,
"avg_score": 0.002132034028008348,
"num_lines": 104
} |
# apis_v1/documentation_source/voter_guide_possibility_position_save_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_guide_possibility_position_save_doc_template_values(url_root):
"""
Show documentation about voterGuidePossibilityPositionSave
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'voter_guide_possibility_id',
'value': 'integer', # boolean, integer, long, string
'description': 'This id of the VoterGuidePossibility is required.',
},
{
'name': 'voter_guide_possibility_position_id',
'value': 'integer', # boolean, integer, long, string
'description': 'The voter_guide_possibility_position to be updated, or if set to 0, create new.',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
]
optional_query_parameter_list = [
{
'name': 'ballot_item_name',
'value': 'string', # boolean, integer, long, string
'description': 'The candidate or measure name shown on the web page.',
},
{
'name': 'position_stance',
'value': 'string', # boolean, integer, long, string
'description': 'SUPPORT, OPPOSE or INFORMATION_ONLY',
},
{
'name': 'statement_text',
'value': 'string', # boolean, integer, long, string
'description': 'A written description of why the endorsement is what it is.',
},
{
'name': 'more_info_url',
'value': 'string', # boolean, integer, long, string
'description': 'The URL a voter can go to for more information about the endorsement.',
},
{
'name': 'possibility_should_be_deleted',
'value': 'boolean', # boolean, integer, long, string
'description': 'Permanent delete of the VoterGuidePossibilityPosition entry.',
},
{
'name': 'possibility_should_be_ignored',
'value': 'boolean', # boolean, integer, long, string
'description': 'Soft delete. Stop analyzing this entry.',
},
{
'name': 'candidate_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': '',
},
{
'name': 'measure_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': '',
},
{
'name': 'organization_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': '',
},
{
'name': 'position_should_be_removed',
'value': 'boolean', # boolean, integer, long, string
'description': 'Delete saved position from PositionEntered table.',
},
{
'name': 'google_civic_election_id_list[]',
'value': 'integerlist', # boolean, integer, long, string
'description': 'The election ids we care about.',
},
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. A valid voter_id was not found.',
},
{
'code': 'VOTER_GUIDE_POSSIBILITY_NOT_FOUND',
'description': 'A voter guide possibility was not found at that URL.',
},
{
'code': 'VOTER_GUIDE_POSSIBILITY_FOUND_WITH_URL',
'description': 'A voter guide possibility entry was found.',
},
# {
# 'code': '',
# 'description': '',
# },
]
try_now_link_variables_dict = {
'voter_guide_possibility_id':
'8',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_guide_possibility_id": integer,\n' \
' "possible_position_list": list [\n' \
' {\n' \
' "possibility_position_id": integer,\n' \
' "possibility_position_number": integer,\n' \
' "ballot_item_name": string,\n' \
' "candidate_twitter_handle": string,\n' \
' "candidate_we_vote_id": string,\n' \
' "edit_position_url": string,\n' \
' "google_civic_election_id": string,\n'\
' "measure_we_vote_id": string,\n' \
' "more_info_url": string,\n' \
' "more_info_url_stored": string,\n' \
' "office_we_vote_id": string,\n' \
' "organization_name": string,\n' \
' "organization_twitter_handle": string,\n' \
' "organization_we_vote_id": string,\n' \
' "office_name": string,\n' \
' "position_should_be_removed": boolean,\n' \
' "position_stance": string,\n' \
' "position_stance_stored": string,\n' \
' "position_we_vote_id": string,\n' \
' "possibility_should_be_deleted": boolean,\n' \
' "possibility_should_be_ignored": boolean,\n' \
' "statement_text": string,\n' \
' "statement_text_stored": string,\n' \
' "state_code": string,\n' \
' }' \
' ],\n' \
'}'
template_values = {
'api_name': 'voterGuidePossibilityPositionSave',
'api_slug': 'voterGuidePossibilityPositionSave',
'api_introduction':
"Save one possible endorsement from one particular web page.",
'try_now_link': 'apis_v1:voterGuidePossibilityPositionSaveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/voter_guide_possibility_position_save_doc.py",
"copies": "1",
"size": "7298",
"license": "mit",
"hash": -5157921075267757000,
"line_mean": 42.7005988024,
"line_max": 115,
"alpha_frac": 0.479994519,
"autogenerated": false,
"ratio": 4.068004459308807,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.5047998978308808,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/voter_guide_possibility_positions_retrieve_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_guide_possibility_positions_retrieve_doc_template_values(url_root):
"""
Show documentation about voterGuidePossibilityPositionsRetrieve
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'voter_guide_possibility_id',
'value': 'integer', # boolean, integer, long, string
'description': 'This id of the VoterGuidePossibility is required.',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
]
optional_query_parameter_list = [
{
'name': 'voter_guide_possibility_position_id',
'value': 'integer', # boolean, integer, long, string
'description': 'If you enter voter_guide_possibility_position_id the query will be limited '
'to just this entry.',
},
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. A valid voter_id was not found.',
},
{
'code': 'VOTER_GUIDE_POSSIBILITY_NOT_FOUND',
'description': 'A voter guide possibility was not found at that URL.',
},
{
'code': 'VOTER_GUIDE_POSSIBILITY_FOUND_WITH_URL',
'description': 'A voter guide possibility entry was found.',
},
# {
# 'code': '',
# 'description': '',
# },
]
try_now_link_variables_dict = {
'voter_guide_possibility_id':
'8',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_guide_possibility_id": integer,\n' \
' "possible_position_list": list [\n' \
' {\n' \
' "possibility_position_id": integer,\n' \
' "possibility_position_number": integer,\n' \
' "ballot_item_name": string,\n' \
' "ballot_item_image_url_https_medium": string,\n' \
' "candidate_twitter_handle": string,\n' \
' "candidate_we_vote_id": string,\n' \
' "edit_position_url": string,\n' \
' "google_civic_election_id": string,\n'\
' "measure_we_vote_id": string,\n' \
' "more_info_url_stored": string,\n' \
' "more_info_url": string,\n' \
' "office_we_vote_id": string,\n' \
' "organization_name": string,\n' \
' "organization_twitter_handle": string,\n' \
' "organization_we_vote_id": string,\n' \
' "political_party": string,\n' \
' "position_should_be_removed": boolean,\n' \
' "position_stance": string,\n' \
' "position_stance_stored": string,\n' \
' "position_we_vote_id": string,\n' \
' "possibility_should_be_deleted": boolean,\n' \
' "possibility_should_be_ignored": boolean,\n' \
' "statement_text": string,\n' \
' "statement_text_stored": string,\n' \
' "state_code": string,\n' \
' "withdrawn_from_election": boolean,\n' \
' "withdrawal_date": date,\n' \
' }],\n' \
'}'
template_values = {
'api_name': 'voterGuidePossibilityPositionsRetrieve',
'api_slug': 'voterGuidePossibilityPositionsRetrieve',
'api_introduction':
"Retrieve all of the possible endorsements scraped from this particular page.",
'try_now_link': 'apis_v1:voterGuidePossibilityPositionsRetrieveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/voter_guide_possibility_positions_retrieve_doc.py",
"copies": "1",
"size": "5186",
"license": "mit",
"hash": 807680191535945600,
"line_mean": 43.7068965517,
"line_max": 115,
"alpha_frac": 0.4934438874,
"autogenerated": false,
"ratio": 3.955758962623951,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.4949202850023951,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/voter_guide_possibility_retrieve_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_guide_possibility_retrieve_doc_template_values(url_root):
"""
Show documentation about voterGuidePossibilityRetrieve
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'voter_guide_possibility_url',
'value': 'string', # boolean, integer, long, string
'description': 'The url where a voter guide can be found.',
},
]
optional_query_parameter_list = [
# {
# 'name': '',
# 'value': '', # boolean, integer, long, string
# 'description': '',
# },
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. A valid voter_id was not found.',
},
{
'code': 'VOTER_GUIDE_POSSIBILITY_NOT_FOUND',
'description': 'A voter guide possibility was not found at that URL.',
},
{
'code': 'VOTER_GUIDE_POSSIBILITY_FOUND_WITH_URL',
'description': 'A voter guide possibility entry was found.',
},
# {
# 'code': '',
# 'description': '',
# },
]
try_now_link_variables_dict = {
'voter_guide_possibility_url':
'http://ww2.kqed.org/news/2015/10/25/guide-to-san-francisco-2015-ballot-propositions-a-to-k',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "voter_guide_possibility_url": string,\n' \
' "voter_guide_possibility_id": integer,\n' \
' "organization_we_vote_id": string,\n' \
' "public_figure_we_vote_id": string,\n' \
' "owner_we_vote_id": string,\n' \
'}'
template_values = {
'api_name': 'voterGuidePossibilityRetrieve',
'api_slug': 'voterGuidePossibilityRetrieve',
'api_introduction':
"Has a particular web page URL been captured as a possible voter guide?",
'try_now_link': 'apis_v1:voterGuidePossibilityRetrieveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/documentation_source/voter_guide_possibility_retrieve_doc.py",
"copies": "2",
"size": "3570",
"license": "mit",
"hash": 3916452491624082400,
"line_mean": 38.6666666667,
"line_max": 115,
"alpha_frac": 0.5229691877,
"autogenerated": false,
"ratio": 3.781779661016949,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.5304748848716949,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/voter_guide_possibility_save_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_guide_possibility_save_doc_template_values(url_root):
"""
Show documentation about voterGuidePossibilitySave
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'voter_guide_possibility_id',
'value': 'integer', # boolean, integer, long, string
'description': 'The id of the voterGuidePossibility to be saved.',
},
]
optional_query_parameter_list = [
{
'name': 'candidate_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'The we_vote_id of the candidate these endorsements are about.',
},
{
'name': 'candidates_missing_from_we_vote',
'value': 'boolean', # boolean, integer, long, string
'description': 'Are there candidates endorsed on this page that we do not have in our Candidate table?',
},
{
'name': 'capture_detailed_comments',
'value': 'boolean', # boolean, integer, long, string
'description': 'Are there comments that go along with endorsements that remain to be captured?',
},
{
'name': 'clear_organization_options',
'value': 'boolean', # boolean, integer, long, string
'description': 'Is the organization this endorsement linked to incorrect, that should be unlinked?',
},
{
'name': 'contributor_comments',
'value': 'string', # boolean, integer, long, string
'description': 'Comments from the person saving this VoterGuidePossibility.',
},
{
'name': 'contributor_email',
'value': 'string', # boolean, integer, long, string
'description': 'The email address (unverified) of the person submitting this VoterGuidePossibility.',
},
{
'name': 'hide_from_active_review',
'value': 'boolean', # boolean, integer, long, string
'description': 'We are done reviewing and processing this VoterGuidePossibility.',
},
{
'name': 'ignore_this_source',
'value': 'boolean', # boolean, integer, long, string
'description': 'This web page does not have endorsements and should be ignored.',
},
{
'name': 'internal_notes',
'value': 'string', # boolean, integer, long, string
'description': 'Internal notes from a We Vote political data manager.',
},
{
'name': 'limit_to_this_state_code',
'value': 'string', # boolean, integer, long, string
'description': 'All of these endorsements relate to candidates or ballot items in this state.',
},
{
'name': 'organization_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'The we_vote_id of the organization making these endorsements.',
},
{
'name': 'possible_candidate_name',
'value': 'string', # boolean, integer, long, string
'description': 'The name of the candidate these endorsements are about,, '
'for possible matching with candidate in We Vote database.',
},
{
'name': 'possible_candidate_twitter_handle',
'value': 'string', # boolean, integer, long, string
'description': 'The Twitter handle of the candidate these endorsements are about, '
'for possible matching with candidate in We Vote database.',
},
{
'name': 'possible_organization_name',
'value': 'string', # boolean, integer, long, string
'description': 'The name of the organization making these endorsements, '
'for possible matching with organization in We Vote database.',
},
{
'name': 'possible_organization_twitter_handle',
'value': 'string', # boolean, integer, long, string
'description': 'The Twitter handle of the organization making these endorsements, '
'for possible matching with organization in We Vote database.',
},
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. A valid voter_id was not found.',
},
{
'code': 'VOTER_GUIDE_POSSIBILITY_SAVED',
'description': 'URL saved.',
},
]
try_now_link_variables_dict = {
'voter_guide_possibility_id': '8',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "candidate": dict\n' \
' {\n' \
' "candidate_we_vote_id": string,\n' \
' "candidate_name": string,\n' \
' "candidate_website": string,\n' \
' "candidate_twitter_handle": string,\n' \
' "candidate_email": string,\n' \
' "candidate_facebook": string,\n' \
' "we_vote_hosted_profile_image_url_medium": string,\n'\
' "we_vote_hosted_profile_image_url_tiny": string,\n' \
' },\n' \
' "candidates_missing_from_we_vote": boolean,\n' \
' "cannot_find_endorsements": boolean,\n' \
' "capture_detailed_comments": boolean,\n' \
' "contributor_comments": string,\n' \
' "contributor_email": string,\n' \
' "hide_from_active_review": boolean,\n' \
' "ignore_this_source": boolean,\n' \
' "internal_notes": string,\n' \
' "organization": dict\n' \
' {\n' \
' "organization_we_vote_id": string,\n' \
' "organization_name": string,\n' \
' "organization_website": string,\n' \
' "organization_twitter_handle": string,\n' \
' "organization_email": string,\n' \
' "organization_facebook": string,\n' \
' "we_vote_hosted_profile_image_url_medium": string,\n'\
' "we_vote_hosted_profile_image_url_tiny": string,\n' \
' },\n' \
' "possible_candidate_name": string,\n' \
' "possible_candidate_twitter_handle": string,\n' \
' "possible_owner_of_website_candidates_list": list,\n' \
' [\n' \
' {\n' \
' "candidate_we_vote_id": string,\n' \
' "candidate_name": string,\n' \
' "candidate_website": string,\n' \
' "candidate_twitter_handle": string,\n' \
' "candidate_email": string,\n' \
' "candidate_facebook": string,\n' \
' "candidate_photo_url_medium": string,\n'\
' "candidate_photo_url_tiny": string,\n' \
' },\n' \
' ]\n' \
' "possible_organization_name": string,\n' \
' "possible_organization_twitter_handle": string,\n' \
' "possible_owner_of_website_organizations_list": list,\n' \
' [\n' \
' {\n' \
' "organization_id": integer,\n' \
' "organization_we_vote_id": string,\n' \
' "organization_name": string,\n' \
' "organization_website": string,\n' \
' "organization_twitter_handle": string,\n' \
' "organization_email": string,\n' \
' "organization_facebook": string,\n' \
' "organization_photo_url_medium": string,\n'\
' "organization_photo_url_tiny": string,\n' \
' },\n' \
' ]\n' \
' "limit_to_this_state_code": string,\n' \
' "url_to_scan": string,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "voter_guide_possibility_edit": string,\n' \
' "voter_guide_possibility_id": integer,\n' \
' "voter_guide_possibility_type": string,\n' \
'}'
template_values = {
'api_name': 'voterGuidePossibilitySave',
'api_slug': 'voterGuidePossibilitySave',
'api_introduction':
"Update existing VoterGuidePossibility with altered data.",
'try_now_link': 'apis_v1:voterGuidePossibilitySaveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/voter_guide_possibility_save_doc.py",
"copies": "1",
"size": "10607",
"license": "mit",
"hash": -5562539000198277000,
"line_mean": 48.1064814815,
"line_max": 117,
"alpha_frac": 0.4809088338,
"autogenerated": false,
"ratio": 4.232641660015962,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.5213550493815962,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/voter_guide_save_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_guide_save_doc_template_values(url_root):
"""
Show documentation about voterGuideSave
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
]
optional_query_parameter_list = [
{
'name': 'voter_guide_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'The unique identifier for this voter guide. If not passed in, create a new '
'voter guide for this voter\'s linked_organization_we_vote_id for this election.',
},
{
'name': 'google_civic_election_id',
'value': 'integer', # boolean, integer, long, string
'description': '',
},
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. A valid voter_id was not found.',
},
]
try_now_link_variables_dict = {
# 'organization_we_vote_id': 'wv85org1',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_guide_display_name": string (Name of this org or person),\n' \
' "voter_guide_owner_type": ORGANIZATION, PUBLIC_FIGURE, VOTER),\n' \
' "we_vote_id": string (We Vote ID of the voter guide),\n' \
' "organization_we_vote_id": string (We Vote ID for the org that owns the voter guide),\n' \
' "public_figure_we_vote_id": string (We Vote ID for the person that owns the voter guide),\n' \
' "voter_guide_image_url_large": string ' \
'(We Vote ID for the person that owns the voter guide),\n' \
' "voter_guide_image_url_medium": string ' \
'(We Vote ID for the person that owns the voter guide),\n' \
' "voter_guide_image_url_tiny": string ' \
'(We Vote ID for the person that owns the voter guide),\n' \
' "last_updated": string (time in this format %Y-%m-%d %H:%M),\n' \
' "google_civic_election_id": integer,\n' \
' "twitter_description": string,\n' \
' "twitter_followers_count": integer,\n' \
' "twitter_handle": integer,\n' \
'}'
template_values = {
'api_name': 'voterGuideSave',
'api_slug': 'voterGuideSave',
'api_introduction':
"Save a new voter guide.",
'try_now_link': 'apis_v1:voterGuideSaveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/documentation_source/voter_guide_save_doc.py",
"copies": "1",
"size": "3932",
"license": "mit",
"hash": -6666690860575317000,
"line_mean": 43.6818181818,
"line_max": 116,
"alpha_frac": 0.5221261445,
"autogenerated": false,
"ratio": 3.744761904761905,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.9760093995211767,
"avg_score": 0.0013588108100275188,
"num_lines": 88
} |
# apis_v1/documentation_source/voter_guides_followed_by_organization_retrieve_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_guides_followed_by_organization_retrieve_doc_template_values(url_root):
"""
Show documentation about voterGuidesFollowedByOrganizationRetrieve
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
]
optional_query_parameter_list = [
{
'name': 'filter_by_this_google_civic_election_id',
'value': 'integer', # boolean, integer, long, string
'description': 'Limit the list of voter guides that the org is following to only those for this election.',
},
{
'name': 'maximum_number_to_retrieve',
'value': 'integer', # boolean, integer, long, string
'description': 'Defaults to 20 voter guides. Enter a value to set your own limit.',
},
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. A valid voter_id was not found.',
},
# {
# 'code': '',
# 'description': '',
# },
]
try_now_link_variables_dict = {
# 'organization_we_vote_id': 'wv85org1',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "voter_guides": list\n' \
' [\n' \
' "voter_guide_display_name": string (Name of this org or person),\n' \
' "voter_guide_owner_type": ORGANIZATION, PUBLIC_FIGURE, VOTER),\n' \
' "we_vote_id": string (We Vote ID of the voter guide),\n' \
' "organization_we_vote_id": string (We Vote ID for the org that owns the voter guide),\n' \
' "public_figure_we_vote_id": string (We Vote ID for the person that owns the voter guide),\n' \
' "voter_guide_image_url_large": string ' \
'(We Vote ID for the person that owns the voter guide),\n' \
' "voter_guide_image_url_medium": string ' \
'(We Vote ID for the person that owns the voter guide),\n' \
' "voter_guide_image_url_tiny": string ' \
'(We Vote ID for the person that owns the voter guide),\n' \
' "last_updated": string (time in this format %Y-%m-%d %H:%M:%S),\n' \
' "google_civic_election_id": integer,\n' \
' "twitter_description": string,\n' \
' "twitter_followers_count": integer,\n' \
' "twitter_handle": integer,\n' \
' "owner_voter_id": integer TO BE DEPRECATED,\n' \
' ],\n' \
' "google_civic_election_id": integer,\n' \
' "maximum_number_to_retrieve": integer,\n' \
'}\n'
template_values = {
'api_name': 'voterGuidesFollowedByOrganizationRetrieve',
'api_slug': 'voterGuidesFollowedByOrganizationRetrieve',
'api_introduction':
"",
'try_now_link': 'apis_v1:voterGuidesFollowedByOrganizationRetrieveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/voter_guides_followed_by_organization_retrieve_doc.py",
"copies": "1",
"size": "4575",
"license": "mit",
"hash": 810295041109508200,
"line_mean": 45.6836734694,
"line_max": 120,
"alpha_frac": 0.5202185792,
"autogenerated": false,
"ratio": 3.806156405990017,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.4826374985190017,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/voter_guides_followed_retrieve_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_guides_followed_retrieve_doc_template_values(url_root):
"""
Show documentation about voterGuidesFollowedRetrieve
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
]
optional_query_parameter_list = [
{
'name': 'maximum_number_to_retrieve',
'value': 'integer', # boolean, integer, long, string
'description': 'Defaults to 20 voter guides. Enter a value to set your own limit.',
},
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. A valid voter_id was not found.',
},
# {
# 'code': '',
# 'description': '',
# },
]
try_now_link_variables_dict = {
# 'organization_we_vote_id': 'wv85org1',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "voter_guides": list\n' \
' [\n' \
' "voter_guide_display_name": string (Name of this org or person),\n' \
' "voter_guide_owner_type": ORGANIZATION, PUBLIC_FIGURE, VOTER),\n' \
' "we_vote_id": string (We Vote ID of the voter guide),\n' \
' "organization_we_vote_id": string (We Vote ID for the org that owns the voter guide),\n' \
' "public_figure_we_vote_id": string (We Vote ID for the person that owns the voter guide),\n' \
' "voter_guide_image_url": string (We Vote ID for the person that owns the voter guide),\n' \
' "last_updated": string (time in this format %Y-%m-%d %H:%M),\n' \
' "google_civic_election_id": integer,\n' \
' "twitter_description": string,\n' \
' "twitter_followers_count": integer,\n' \
' "twitter_handle": integer,\n' \
' "owner_voter_id": integer TO BE DEPRECATED,\n' \
' ],\n' \
' "google_civic_election_id": integer,\n' \
' "maximum_number_to_retrieve": integer,\n' \
'}\n'
template_values = {
'api_name': 'voterGuidesFollowedRetrieve',
'api_slug': 'voterGuidesFollowedRetrieve',
'api_introduction':
"",
'try_now_link': 'apis_v1:voterGuidesFollowedRetrieveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WebAppPublic",
"path": "apis_v1/documentation_source/voter_guides_followed_retrieve_doc.py",
"copies": "1",
"size": "3890",
"license": "bsd-3-clause",
"hash": 3059910980909019600,
"line_mean": 43.2045454545,
"line_max": 119,
"alpha_frac": 0.5120822622,
"autogenerated": false,
"ratio": 3.751205400192864,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.9756581474382808,
"avg_score": 0.0013412376020109564,
"num_lines": 88
} |
# apis_v1/documentation_source/voter_guides_from_friends_upcoming_retrieve_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_guides_from_friends_upcoming_retrieve_doc_template_values(url_root):
"""
Show documentation about voterGuidesFromFriendsUpcomingRetrieve
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
]
optional_query_parameter_list = [
{
'name': 'google_civic_election_id_list[]',
'value': 'integerlist', # boolean, integer, long, string
'description': 'The unique identifier for one or more elections. If not provided, '
'use all of the upcoming elections.',
},
{
'name': 'start_retrieve_at_this_number',
'value': 'integer', # boolean, integer, long, string
'description': 'In most elections we have well over the maximum_number_to_retrieve voter guides that '
'we want to retrieve with each call. Setting this number lets us retrieve voter guides '
'in "pages".',
},
{
'name': 'maximum_number_to_retrieve',
'value': 'integer', # boolean, integer, long, string
'description': 'Defaults to 75 voter guides. Enter a value to set your own limit.',
},
]
potential_status_codes_list = [
{
'code': 'VOTER_GUIDES_TO_FOLLOW_RETRIEVED',
'description': 'At least one voter guide was returned.',
},
{
'code': 'ERROR_GUIDES_TO_FOLLOW_NO_VOTER_DEVICE_ID',
'description': 'A valid voter_device_id parameter was not included. Cannot proceed.',
},
{
'code': 'NO_VOTER_GUIDES_FOUND',
'description': 'No voter guides exist in the database matching the search terms.',
},
]
try_now_link_variables_dict = {
# 'kind_of_ballot_item': 'CANDIDATE',
# 'ballot_item_we_vote_id': 'wv01cand2897',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "google_civic_election_id": integer,\n' \
' "search_string": string,\n' \
' "start_retrieve_at_this_number": integer\n' \
' "number_retrieved": integer\n' \
' "maximum_number_to_retrieve": integer,\n' \
' "voter_guides": list\n' \
' [{\n' \
' "voter_guide_display_name": string (Name of this org or person),\n' \
' "voter_guide_owner_type": ORGANIZATION, PUBLIC_FIGURE, VOTER),\n' \
' "we_vote_id": string (We Vote ID of the voter guide),\n' \
' "organization_we_vote_id": string (We Vote ID for the org that owns the voter guide),\n' \
' "public_figure_we_vote_id": string (We Vote ID for the person that owns the voter guide),\n' \
' "voter_guide_image_url_large": string ' \
'(We Vote ID for the person that owns the voter guide),\n' \
' "voter_guide_image_url_medium": string ' \
'(We Vote ID for the person that owns the voter guide),\n' \
' "voter_guide_image_url_tiny": string ' \
'(We Vote ID for the person that owns the voter guide),\n' \
' "last_updated": string (time in this format %Y-%m-%d %H:%M:%S),\n' \
' "google_civic_election_id": integer,\n' \
' "twitter_description": string,\n' \
' "twitter_followers_count": integer,\n' \
' "twitter_handle": integer,\n' \
' "owner_voter_id": integer TO BE DEPRECATED,\n' \
' "ballot_item_we_vote_ids_this_org_supports": ' \
'The list of ballot_item_we_vote_ids supported by this organization,\n' \
' "ballot_item_we_vote_ids_this_org_info_only": ' \
'The list of ballot_item_we_vote_ids this organization has information about,\n' \
' "ballot_item_we_vote_ids_this_org_opposes": ' \
'The list of ballot_item_we_vote_ids opposed by this organization,\n' \
' "issue_we_vote_ids_linked": The list of issue_we_vote_ids linked to this organization,\n' \
' "is_support": boolean (Exists if looking at voter guides for one ballot_item),\n' \
' "is_positive_rating": boolean (Exists if looking at voter guides for one ballot_item),\n' \
' "is_support_or_positive_rating": boolean (Exists if looking at one ballot_item),\n' \
' "is_oppose": boolean (Exists if looking at voter guides for one ballot_item),\n' \
' "is_negative_rating": boolean (Exists if looking at voter guides for one ballot_item),\n' \
' "is_oppose_or_negative_rating": boolean (Exists if looking at one ballot_item),\n' \
' "is_information_only": boolean (Exists if looking at voter guides for one ballot_item),\n' \
' "vote_smart_rating": integer (Exists if looking at voter guides for one ballot_item),\n' \
' "vote_smart_time_span": string (Exists if looking at voter guides for one ballot_item),\n' \
' "candidate_name": string (Exists if looking at voter guides for one ballot_item),\n' \
' "speaker_display_name": string (Exists if looking at voter guides for one ballot_item),\n' \
' "statement_text": string (Exists if looking at voter guides for one ballot_item),\n' \
' "more_info_url": string (Exists if looking at voter guides for one ballot_item),\n' \
' },],\n' \
'}\n'
template_values = {
'api_name': 'voterGuidesFromFriendsUpcomingRetrieve',
'api_slug': 'voterGuidesFromFriendsUpcomingRetrieve',
'api_introduction':
"Retrieve all voter guides from voter's friends for all upcoming elections.",
'try_now_link': 'apis_v1:voterGuidesFromFriendsUpcomingRetrieveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/voter_guides_from_friends_upcoming_retrieve_doc.py",
"copies": "1",
"size": "7291",
"license": "mit",
"hash": -5770369067959516000,
"line_mean": 57.328,
"line_max": 119,
"alpha_frac": 0.5351803593,
"autogenerated": false,
"ratio": 3.7816390041493775,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.9804693312928587,
"avg_score": 0.0024252101041579857,
"num_lines": 125
} |
# apis_v1/documentation_source/voter_guides_ignored_retrieve_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_guides_ignored_retrieve_doc_template_values(url_root):
"""
Show documentation about voterGuidesIgnoredRetrieve
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
]
optional_query_parameter_list = [
{
'name': 'maximum_number_to_retrieve',
'value': 'integer', # boolean, integer, long, string
'description': 'Defaults to 20 voter guides. Enter a value to set your own limit.',
},
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. A valid voter_id was not found.',
},
# {
# 'code': '',
# 'description': '',
# },
]
try_now_link_variables_dict = {
# 'organization_we_vote_id': 'wv85org1',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "voter_guides": list\n' \
' [\n' \
' "voter_guide_display_name": string (Name of this org or person),\n' \
' "voter_guide_owner_type": ORGANIZATION, PUBLIC_FIGURE, VOTER),\n' \
' "we_vote_id": string (We Vote ID of the voter guide),\n' \
' "organization_we_vote_id": string (We Vote ID for the org that owns the voter guide),\n' \
' "public_figure_we_vote_id": string (We Vote ID for the person that owns the voter guide),\n' \
' "voter_guide_image_url_large": string ' \
'(We Vote ID for the person that owns the voter guide),\n' \
' "voter_guide_image_url_medium": string ' \
'(We Vote ID for the person that owns the voter guide),\n' \
' "voter_guide_image_url_tiny": string ' \
'(We Vote ID for the person that owns the voter guide),\n' \
' "last_updated": string (time in this format %Y-%m-%d %H:%M:%S),\n' \
' "google_civic_election_id": integer,\n' \
' "twitter_description": string,\n' \
' "twitter_followers_count": integer,\n' \
' "twitter_handle": integer,\n' \
' "owner_voter_id": integer TO BE DEPRECATED,\n' \
' ],\n' \
' "google_civic_election_id": integer,\n' \
' "maximum_number_to_retrieve": integer,\n' \
'}\n'
template_values = {
'api_name': 'voterGuidesIgnoredRetrieve',
'api_slug': 'voterGuidesIgnoredRetrieve',
'api_introduction':
"",
'try_now_link': 'apis_v1:voterGuidesIgnoredRetrieveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/voter_guides_ignored_retrieve_doc.py",
"copies": "1",
"size": "4211",
"license": "mit",
"hash": 6163709921847893000,
"line_mean": 44.2795698925,
"line_max": 119,
"alpha_frac": 0.5067679886,
"autogenerated": false,
"ratio": 3.7665474060822897,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.9767448126547167,
"avg_score": 0.0011734536270245704,
"num_lines": 93
} |
# apis_v1/documentation_source/voter_guides_retrieve_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_guides_retrieve_doc_template_values(url_root):
"""
Show documentation about voterGuidesRetrieve
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
]
optional_query_parameter_list = [
{
'name': 'organization_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'Retrieve all voter guides for this organization.',
},
{
'name': 'voter_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'Retrieve all voter guides for this voter.',
},
{
'name': 'maximum_number_to_retrieve',
'value': 'integer', # boolean, integer, long, string
'description': 'Defaults to 20 voter guides. Enter a value to set your own limit.',
},
]
potential_status_codes_list = [
]
try_now_link_variables_dict = {
'organization_we_vote_id': 'wv02org1061',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_guides": list\n' \
' [\n' \
' "election_day_text": string (YYYY-MM-DD),\n' \
' "google_civic_election_id": integer,\n' \
' "organization_we_vote_id": string (We Vote ID for the org that owns the voter guide),\n' \
' "last_updated": string (time in this format %Y-%m-%d %H:%M:%S),\n' \
' "pledge_goal": integer,\n' \
' "pledge_count": integer,\n' \
' "state_code": string,\n' \
' "twitter_description": string,\n' \
' "twitter_followers_count": integer,\n' \
' "twitter_handle": integer,\n' \
' "voter_guide_display_name": string (Name of this org or person),\n' \
' "voter_guide_image_url_large": string, \n' \
' "voter_guide_image_url_medium": string, \n' \
' "voter_guide_image_url_tiny": string, \n' \
' "voter_guide_owner_type": ORGANIZATION, PUBLIC_FIGURE, VOTER),\n' \
' "we_vote_id": string (We Vote ID of the voter guide),\n' \
' ],\n' \
' "maximum_number_to_retrieve": integer,\n' \
'}\n'
template_values = {
'api_name': 'voterGuidesRetrieve',
'api_slug': 'voterGuidesRetrieve',
'api_introduction':
"",
'try_now_link': 'apis_v1:voterGuidesRetrieveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/voter_guides_retrieve_doc.py",
"copies": "1",
"size": "3607",
"license": "mit",
"hash": -7472889597130684000,
"line_mean": 42.4578313253,
"line_max": 115,
"alpha_frac": 0.4968117549,
"autogenerated": false,
"ratio": 3.710905349794239,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.9702832679437399,
"avg_score": 0.0009768850513681565,
"num_lines": 83
} |
# apis_v1/documentation_source/voter_guides_sync_out_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_guides_sync_out_doc_template_values(url_root):
"""
Show documentation about voterGuidesSyncOut
"""
optional_query_parameter_list = [
{
'name': 'google_civic_election_id',
'value': 'integer', # boolean, integer, long, string
'description': 'Limit the voter_guides retrieved to those for this google_civic_election_id.',
},
]
potential_status_codes_list = [
]
try_now_link_variables_dict = {
'format': 'json',
}
api_response = '[{\n' \
' "we_vote_id": string,\n' \
' "display_name": string,\n' \
' "google_civic_election_id": string,\n' \
' "image_url": string,\n' \
' "last_updated": string,\n' \
' "organization_we_vote_id": string,\n' \
' "owner_we_vote_id": string,\n' \
' "public_figure_we_vote_id": string,\n' \
' "twitter_description": string,\n' \
' "twitter_followers_count": integer,\n' \
' "twitter_handle": string,\n' \
' "vote_smart_time_span": string,\n' \
' "voter_guide_owner_type": string,\n' \
'}]'
template_values = {
'api_name': 'voterGuidesSyncOut',
'api_slug': 'voterGuidesSyncOut',
'api_introduction':
"",
'try_now_link': 'apis_v1:voterGuidesSyncOutView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/voter_guides_sync_out_doc.py",
"copies": "2",
"size": "2044",
"license": "mit",
"hash": 5241275728467262000,
"line_mean": 35.5,
"line_max": 107,
"alpha_frac": 0.5078277886,
"autogenerated": false,
"ratio": 3.530224525043178,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.5038052313643179,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/voter_guides_to_follow_retrieve_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_guides_to_follow_retrieve_doc_template_values(url_root):
"""
Show documentation about voterGuidesToFollowRetrieve
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
]
optional_query_parameter_list = [
{
'name': 'kind_of_ballot_item',
'value': 'string', # boolean, integer, long, string
'description': 'What is the type of ballot item that we are retrieving? '
'(kind_of_ballot_item is either "OFFICE", "CANDIDATE", "POLITICIAN" or "MEASURE")',
},
{
'name': 'ballot_item_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'The unique identifier for a particular ballot item. If this variable is provided, '
'we want to retrieve all of the voter guides that have something to say about this '
'particular ballot item.',
},
{
'name': 'google_civic_election_id',
'value': 'integer', # boolean, integer, long, string
'description': 'The unique identifier for a particular election. If not provided, use the most recent '
'ballot for the voter\'s address.',
},
{
'name': 'search_string',
'value': 'string', # boolean, integer, long, string
'description': 'A string of keyword(s) to search for (to find twitter handle or org name).',
},
{
'name': 'use_test_election',
'value': 'boolean', # boolean, integer, long, string
'description': 'If you need to request a test election, pass this with the value \'True\'. Note that '
'text_for_map_search (either passed into this API endpoint as a value, or previously saved '
'with voterAddressSave) is required with every election, including the test election.',
},
{
'name': 'maximum_number_to_retrieve',
'value': 'integer', # boolean, integer, long, string
'description': 'Defaults to 20 voter guides. Enter a value to set your own limit.',
},
]
potential_status_codes_list = [
{
'code': 'VOTER_GUIDES_TO_FOLLOW_RETRIEVED',
'description': 'At least one voter guide was returned.',
},
{
'code': 'ERROR_GUIDES_TO_FOLLOW_NO_VOTER_DEVICE_ID',
'description': 'A valid voter_device_id parameter was not included. Cannot proceed.',
},
{
'code': 'NO_VOTER_GUIDES_FOUND',
'description': 'No voter guides exist in the database matching the search terms.',
},
]
try_now_link_variables_dict = {
'kind_of_ballot_item': 'CANDIDATE',
'ballot_item_we_vote_id': 'wv01cand2897',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "google_civic_election_id": integer,\n' \
' "search_string": string,\n' \
' "maximum_number_to_retrieve": integer,\n' \
' "voter_guides": list\n' \
' [{\n' \
' "voter_guide_display_name": string (Name of this org or person),\n' \
' "voter_guide_owner_type": ORGANIZATION, PUBLIC_FIGURE, VOTER),\n' \
' "we_vote_id": string (We Vote ID of the voter guide),\n' \
' "organization_we_vote_id": string (We Vote ID for the org that owns the voter guide),\n' \
' "public_figure_we_vote_id": string (We Vote ID for the person that owns the voter guide),\n' \
' "voter_guide_image_url": string (We Vote ID for the person that owns the voter guide),\n' \
' "last_updated": string (time in this format %Y-%m-%d %H:%M),\n' \
' "google_civic_election_id": integer,\n' \
' "twitter_description": string,\n' \
' "twitter_followers_count": integer,\n' \
' "twitter_handle": integer,\n' \
' "owner_voter_id": integer TO BE DEPRECATED,\n' \
' "is_support": boolean (Exists if looking at voter guides for one ballot_item),\n' \
' "is_positive_rating": boolean (Exists if looking at voter guides for one ballot_item),\n' \
' "is_support_or_positive_rating": boolean (Exists if looking at one ballot_item),\n' \
' "is_oppose": boolean (Exists if looking at voter guides for one ballot_item),\n' \
' "is_negative_rating": boolean (Exists if looking at voter guides for one ballot_item),\n' \
' "is_oppose_or_negative_rating": boolean (Exists if looking at one ballot_item),\n' \
' "is_information_only": boolean (Exists if looking at voter guides for one ballot_item),\n' \
' "vote_smart_rating": integer (Exists if looking at voter guides for one ballot_item),\n' \
' "vote_smart_time_span": string (Exists if looking at voter guides for one ballot_item),\n' \
' "candidate_name": string (Exists if looking at voter guides for one ballot_item),\n' \
' "speaker_display_name": string (Exists if looking at voter guides for one ballot_item),\n' \
' "statement_text": string (Exists if looking at voter guides for one ballot_item),\n' \
' "more_info_url": string (Exists if looking at voter guides for one ballot_item),\n' \
' },],\n' \
'}\n'
template_values = {
'api_name': 'voterGuidesToFollowRetrieve',
'api_slug': 'voterGuidesToFollowRetrieve',
'api_introduction':
"Look up the election and ballot items that this person is focused on. Return the organizations, "
"public figures, and voters that have shared voter guides available to follow. Take into consideration "
"which voter guides the voter has previously ignored. "
"Do not show voter guides the voter is already following."
"If neither ballot_item_we_vote_id (paired with kind_of_ballot_item) nor google_civic_election_id are"
"passed in, and google_civic_election_id is set to '0', then simply return a list of voter guides "
"that haven't been followed yet. If google_civic_election_id is NOT set to 0, the routine tries to"
"figure out which election is being looked at in the voter_device_link or the voter_address.",
'try_now_link': 'apis_v1:voterGuidesToFollowRetrieveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WebAppPublic",
"path": "apis_v1/documentation_source/voter_guides_to_follow_retrieve_doc.py",
"copies": "1",
"size": "8198",
"license": "bsd-3-clause",
"hash": 7369054689120743000,
"line_mean": 57.1418439716,
"line_max": 120,
"alpha_frac": 0.5451329593,
"autogenerated": false,
"ratio": 3.8982406086543033,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.9929967645556583,
"avg_score": 0.0026811844795440803,
"num_lines": 141
} |
# apis_v1/documentation_source/voter_guides_upcoming_retrieve_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_guides_upcoming_retrieve_doc_template_values(url_root):
"""
Show documentation about voterGuidesUpcomingRetrieve
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
]
optional_query_parameter_list = [
{
'name': 'google_civic_election_id_list[]',
'value': 'integerlist', # boolean, integer, long, string
'description': 'The unique identifier for one or more elections. If not provided, '
'use all of the upcoming elections.',
},
{
'name': 'start_retrieve_at_this_number',
'value': 'integer', # boolean, integer, long, string
'description': 'In most elections we have well over the maximum_number_to_retrieve voter guides that '
'we want to retrieve with each call. Setting this number lets us retrieve voter guides '
'in "pages".',
},
{
'name': 'maximum_number_to_retrieve',
'value': 'integer', # boolean, integer, long, string
'description': 'Defaults to 75 voter guides. Enter a value to set your own limit.',
},
]
potential_status_codes_list = [
{
'code': 'VOTER_GUIDES_TO_FOLLOW_RETRIEVED',
'description': 'At least one voter guide was returned.',
},
{
'code': 'ERROR_GUIDES_TO_FOLLOW_NO_VOTER_DEVICE_ID',
'description': 'A valid voter_device_id parameter was not included. Cannot proceed.',
},
{
'code': 'NO_VOTER_GUIDES_FOUND',
'description': 'No voter guides exist in the database matching the search terms.',
},
]
try_now_link_variables_dict = {
# 'kind_of_ballot_item': 'CANDIDATE',
# 'ballot_item_we_vote_id': 'wv01cand2897',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "google_civic_election_id": integer,\n' \
' "search_string": string,\n' \
' "start_retrieve_at_this_number": integer\n' \
' "number_retrieved": integer\n' \
' "maximum_number_to_retrieve": integer,\n' \
' "voter_guides": list\n' \
' [{\n' \
' "voter_guide_display_name": string (Name of this org or person),\n' \
' "voter_guide_owner_type": ORGANIZATION, PUBLIC_FIGURE, VOTER),\n' \
' "we_vote_id": string (We Vote ID of the voter guide),\n' \
' "organization_we_vote_id": string (We Vote ID for the org that owns the voter guide),\n' \
' "public_figure_we_vote_id": string (We Vote ID for the person that owns the voter guide),\n' \
' "voter_guide_image_url_large": string ' \
'(We Vote ID for the person that owns the voter guide),\n' \
' "voter_guide_image_url_medium": string ' \
'(We Vote ID for the person that owns the voter guide),\n' \
' "voter_guide_image_url_tiny": string ' \
'(We Vote ID for the person that owns the voter guide),\n' \
' "last_updated": string (time in this format %Y-%m-%d %H:%M:%S),\n' \
' "google_civic_election_id": integer,\n' \
' "twitter_description": string,\n' \
' "twitter_followers_count": integer,\n' \
' "twitter_handle": integer,\n' \
' "owner_voter_id": integer TO BE DEPRECATED,\n' \
' "ballot_item_we_vote_ids_this_org_supports": ' \
'The list of ballot_item_we_vote_ids supported by this organization,\n' \
' "ballot_item_we_vote_ids_this_org_info_only": ' \
'The list of ballot_item_we_vote_ids this organization has information about,\n' \
' "ballot_item_we_vote_ids_this_org_opposes": ' \
'The list of ballot_item_we_vote_ids opposed by this organization,\n' \
' "issue_we_vote_ids_linked": The list of issue_we_vote_ids linked to this organization,\n' \
' "is_support": boolean (Exists if looking at voter guides for one ballot_item),\n' \
' "is_positive_rating": boolean (Exists if looking at voter guides for one ballot_item),\n' \
' "is_support_or_positive_rating": boolean (Exists if looking at one ballot_item),\n' \
' "is_oppose": boolean (Exists if looking at voter guides for one ballot_item),\n' \
' "is_negative_rating": boolean (Exists if looking at voter guides for one ballot_item),\n' \
' "is_oppose_or_negative_rating": boolean (Exists if looking at one ballot_item),\n' \
' "is_information_only": boolean (Exists if looking at voter guides for one ballot_item),\n' \
' "vote_smart_rating": integer (Exists if looking at voter guides for one ballot_item),\n' \
' "vote_smart_time_span": string (Exists if looking at voter guides for one ballot_item),\n' \
' "candidate_name": string (Exists if looking at voter guides for one ballot_item),\n' \
' "speaker_display_name": string (Exists if looking at voter guides for one ballot_item),\n' \
' "statement_text": string (Exists if looking at voter guides for one ballot_item),\n' \
' "more_info_url": string (Exists if looking at voter guides for one ballot_item),\n' \
' },],\n' \
'}\n'
template_values = {
'api_name': 'voterGuidesUpcomingRetrieve',
'api_slug': 'voterGuidesUpcomingRetrieve',
'api_introduction':
"Retrieve all voter guides for all upcoming elections.",
'try_now_link': 'apis_v1:voterGuidesUpcomingRetrieveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/voter_guides_upcoming_retrieve_doc.py",
"copies": "1",
"size": "7200",
"license": "mit",
"hash": 2318020902523364000,
"line_mean": 56.6,
"line_max": 119,
"alpha_frac": 0.5304166667,
"autogenerated": false,
"ratio": 3.7834997372569625,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.4813916403956962,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/voter_location_retrieve_from_ip.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_location_retrieve_from_ip_doc_template_values(url_root):
"""
Show documentation about voterLocationRetrieveFromIP
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'ip_address',
'value': 'string', # boolean, integer, long, string
'description': 'The IP Address of the browser',
},
]
optional_query_parameter_list = [
# {
# 'name': '',
# 'value': '', # boolean, integer, long, string
# 'description': '',
# },
]
potential_status_codes_list = [
# {
# 'code': 'VALID_VOTER_DEVICE_ID_MISSING',
# 'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
# },
# {
# 'code': 'VALID_VOTER_ID_MISSING',
# 'description': 'Cannot proceed. A valid voter_id was not found.',
# },
# {
# 'code': '',
# 'description': '',
# },
]
try_now_link_variables_dict = {
# 'organization_we_vote_id': 'wv85org1',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_location_found": boolean,\n' \
' "voter_location": string (88 characters long),\n' \
' "ip_address": string,\n' \
'}'
template_values = {
'api_name': 'voterLocationRetrieveFromIP',
'api_slug': 'voterLocationRetrieveFromIP',
'api_introduction':
"""
Retrieve a printable string with the location of the voter, based on the browser's IP address.
Ex: 'Oakland, CA 94602' <br>
Requisite: set up <a href=https://github.com/wevote/WeVoteServer/blob/master/README_API_INSTALL.md#set-up-geoip> GeoIP </a>
""",
'try_now_link': 'apis_v1:voterLocationRetrieveFromIPView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/documentation_source/voter_location_retrieve_from_ip_doc.py",
"copies": "3",
"size": "2895",
"license": "mit",
"hash": 7876694979367009000,
"line_mean": 36.5974025974,
"line_max": 135,
"alpha_frac": 0.5208981002,
"autogenerated": false,
"ratio": 3.754863813229572,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.5775761913429572,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/voter_merge_two_accounts_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_merge_two_accounts_doc_template_values(url_root):
"""
Show documentation about voterMergeTwoAccounts
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'email_secret_key',
'value': 'string', # boolean, integer, long, string
'description': 'We can pass in the secret key as an identifier.',
},
]
optional_query_parameter_list = [
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'MISSING_VOTER_ID_OR_ADDRESS_TYPE',
'description': 'Cannot proceed. Missing variables voter_id or address_type while trying to save.',
},
]
try_now_link_variables_dict = {
# 'organization_we_vote_id': 'wv85org1',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "email_ownership_is_verified": boolean,\n' \
' "email_secret_key_belongs_to_this_voter": boolean,\n' \
' "email_address_found": boolean,\n' \
'}'
template_values = {
'api_name': 'voterMergeTwoAccounts',
'api_slug': 'voterMergeTwoAccounts',
'api_introduction':
"Combine two accounts into one. Leave existing voter_device_id in place, but link "
"it to the remaining voter account.",
'try_now_link': 'apis_v1:voterMergeTwoAccountsView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/voter_merge_two_accounts_doc.py",
"copies": "2",
"size": "2827",
"license": "mit",
"hash": -241000894502341820,
"line_mean": 38.8169014085,
"line_max": 115,
"alpha_frac": 0.549345596,
"autogenerated": false,
"ratio": 3.8410326086956523,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.5390378204695653,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/voter_notification_settings_update_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_notification_settings_update_doc_template_values(url_root):
"""
Show documentation about voterNotificationSettingsUpdate
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
]
optional_query_parameter_list = [
{
'name': 'email_subscription_secret_key',
'value': 'string', # boolean, integer, long, string
'description': 'A long string which tells us which email we want the notification options updated for. ',
},
{
'name': 'interface_status_flags',
'value': 'integer', # boolean, integer, long, string
'description': 'An integer whose bits represent several flags for the user, such as the ',
},
{
'name': 'flag_integer_to_set',
'value': 'integer', # boolean, integer, long, string
'description': 'Sets the corresponding bit represented by this integer\'s bit, '
'in interface_status_flags bit',
},
{
'name': 'flag_integer_to_unset',
'value': 'integer', # boolean, integer, long, string
'description': 'Unsets the corresponding bit represented by this integer\'s bit, '
'in interface_status_flags bit',
},
{
'name': 'notification_settings_flags',
'value': 'integer', # boolean, integer, long, string
'description': 'An integer whose bits represent several flags for the user, such as the ',
},
{
'name': 'notification_flag_integer_to_set',
'value': 'integer', # boolean, integer, long, string
'description': 'Sets the corresponding bit represented by this integer\'s bit, '
'in notification_settings_flags bit',
},
{
'name': 'notification_flag_integer_to_unset',
'value': 'integer', # boolean, integer, long, string
'description': 'Unsets the corresponding bit represented by this integer\'s bit, '
'in notification_settings_flags bit',
},
]
potential_status_codes_list = [
{
'code': 'UPDATED_VOTER',
'description': 'Successfully saved',
},
]
try_now_link_variables_dict = {
'email_subscription_secret_key': '',
'interface_status_flags': 'False',
'flag_integer_to_set': 'False',
'flag_integer_to_unset': 'False',
'notification_settings_flags': 'False',
'notification_flag_integer_to_set': 'False',
'notification_flag_integer_to_unset': 'False',
}
api_response = '{\n' \
' "status": string (description of what happened),\n' \
' "success": boolean (True as long as no db errors),\n' \
' "voter_found": boolean (True if voter found from secret key),\n' \
' "voter_updated": boolean (True if save executed successfully),\n' \
' "email_subscription_secret_key": string (88 characters long),\n' \
' "sms_subscription_secret_key": string (88 characters long),\n' \
' "interface_status_flags": integer,\n' \
' "flag_integer_to_set": integer,\n' \
' "flag_integer_to_unset": integer,\n' \
' "notification_settings_flags": integer,\n' \
' "notification_flag_integer_to_set": integer,\n' \
' "notification_flag_integer_to_unset": integer,\n' \
'}'
template_values = {
'api_name': 'voterNotificationSettingsUpdate',
'api_slug': 'voterNotificationSettingsUpdate',
'api_introduction':
"Update profile-related information for a voter based on secret key. If the string 'False' is passed "
"(or the boolean value), do not update the field.",
'try_now_link': 'apis_v1:voterNotificationSettingsUpdateView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/voter_notification_settings_update_doc.py",
"copies": "1",
"size": "4980",
"license": "mit",
"hash": 1709395925363180300,
"line_mean": 45.1111111111,
"line_max": 118,
"alpha_frac": 0.5489959839,
"autogenerated": false,
"ratio": 4.198988195615514,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.5247984179515514,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/voter_opposing_save_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_opposing_save_doc_template_values(url_root):
"""
Show documentation about voterOpposingSave
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'kind_of_ballot_item',
'value': 'string', # boolean, integer, long, string
'description': 'The kind of ballot item the voter is opposing. '
'(kind_of_ballot_item is either "CANDIDATE", "POLITICIAN" or "MEASURE")',
},
{
'name': 'ballot_item_id',
'value': 'integer', # boolean, integer, long, string
'description': 'The unique internal identifier of the ballot item the voter is opposing. '
'(either ballot_item_id OR ballot_item_we_vote_id required -- not both. '
'If it exists, ballot_item_id is used instead of ballot_item_we_vote_id)',
},
{
'name': 'ballot_item_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'The unique identifier for this ballot_item across all networks '
'(either ballot_item_id OR ballot_item_we_vote_id required -- not both. '
'NOTE: In the future we might support other identifiers used in the industry.',
},
]
optional_query_parameter_list = [
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. Missing voter_id while trying to save.',
},
{
'code': 'UNABLE_TO_SAVE-CANDIDATE_ID_AND_MEASURE_ID_MISSING',
'description': 'Cannot proceed. Neither candidate_id nor measure_id were included.',
},
{
'code': 'OPPOSING_CANDIDATE STANCE_UPDATED',
'description': 'Success. Existing entry updated.',
},
{
'code': 'OPPOSING_CANDIDATE NEW_STANCE_SAVED',
'description': 'Success. New entry created.',
},
{
'code': 'OPPOSING_CANDIDATE STANCE_COULD_NOT_BE_UPDATED',
'description': 'Cannot proceed. Existing entry could not be updated.',
},
{
'code': 'OPPOSING_CANDIDATE NEW_STANCE_COULD_NOT_BE_SAVED',
'description': 'Cannot proceed. New entry could not be created.',
},
{
'code': 'OPPOSING_MEASURE STANCE_UPDATED',
'description': 'Success. Existing entry updated.',
},
{
'code': 'OPPOSING_MEASURE NEW_STANCE_SAVED',
'description': 'Success. New entry created.',
},
{
'code': 'OPPOSING_MEASURE STANCE_COULD_NOT_BE_UPDATED',
'description': 'Cannot proceed. Existing entry could not be updated.',
},
{
'code': 'OPPOSING_MEASURE NEW_STANCE_COULD_NOT_BE_SAVED',
'description': 'Cannot proceed. New entry could not be created.',
},
]
try_now_link_variables_dict = {
'kind_of_ballot_item': 'CANDIDATE',
'ballot_item_id': '5655',
}
api_response = '{\n' \
' "status": string (description of what happened),\n' \
' "success": boolean (did the save happen?),\n' \
' "ballot_item_id": integer,\n' \
' "ballot_item_we_vote_id": string,\n' \
' "kind_of_ballot_item": string (CANDIDATE, MEASURE),\n' \
'}'
template_values = {
'api_name': 'voterOpposingSave',
'api_slug': 'voterOpposingSave',
'api_introduction':
"Save or create oppose stance for the current voter for either a measure or candidate.",
'try_now_link': 'apis_v1:voterOpposingSaveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WebAppPublic",
"path": "apis_v1/documentation_source/voter_opposing_save_doc.py",
"copies": "3",
"size": "5235",
"license": "bsd-3-clause",
"hash": 2256085159186268400,
"line_mean": 42.2644628099,
"line_max": 115,
"alpha_frac": 0.52913085,
"autogenerated": false,
"ratio": 3.8239590942293646,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.5853089944229365,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/voter_photo_save_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_photo_save_doc_template_values(url_root):
"""
Show documentation about voterPhotoSave
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'facebook_profile_image_url_https',
'value': 'string', # boolean, integer, long, string
'description': 'The url on the facebook servers of this person\'s profile photo.',
},
{
'name': 'twitter_profile_image_url_https',
'value': 'string', # boolean, integer, long, string
'description': 'The url on the twitter servers of this person\'s profile photo.',
},
]
optional_query_parameter_list = [
# {
# 'name': '',
# 'value': '', # boolean, integer, long, string
# 'description': '',
# },
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'MISSING_VOTER_ID',
'description': 'Cannot proceed. Missing variables voter_id while trying to save.',
},
{
'code': 'VOTER_PHOTO_SAVED',
'description': 'Successfully saved',
},
]
try_now_link_variables_dict = {
# 'organization_we_vote_id': 'wv85org1',
}
api_response = '{\n' \
' "status": string (description of what happened),\n' \
' "success": boolean (True as long as no db errors),\n' \
' "voter_device_id": string (88 characters long),\n' \
' "voter_photo_saved": boolean (did the voter address save happen?),\n' \
' "facebook_profile_image_url_https": string,\n' \
' "twitter_profile_image_url_https": string,\n' \
'}'
template_values = {
'api_name': 'voterPhotoSave',
'api_slug': 'voterPhotoSave',
'api_introduction':
"Save one or more photos for the current voter.",
'try_now_link': 'apis_v1:voterPhotoSaveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WebAppPublic",
"path": "apis_v1/documentation_source/voter_photo_save_doc.py",
"copies": "3",
"size": "3325",
"license": "bsd-3-clause",
"hash": -8015087003076403000,
"line_mean": 38.5833333333,
"line_max": 115,
"alpha_frac": 0.5248120301,
"autogenerated": false,
"ratio": 3.9071680376028204,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.5931980067702821,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/voter_plan_list_retrieve_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_plan_list_retrieve_doc_template_values(url_root):
"""
Show documentation about voterPlanListRetrieve
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
]
optional_query_parameter_list = [
{
'name': 'google_civic_election_id',
'value': 'integer', # boolean, integer, long, string
'description': 'Limit results to this election',
},
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'A valid voter_device_id parameter was not included. Cannot proceed.',
},
{
'code': 'VOTER_NOT_FOUND_FROM_VOTER_DEVICE_ID',
'description': 'No voter could be found from the voter_device_id',
},
]
try_now_link_variables_dict = {
# 'voter_device_id': '',
}
api_response = '{\n' \
' "success": boolean,\n' \
' "status": string,\n' \
' "voter_plan_list": list\n' \
' [{\n' \
' "google_civic_election_id": integer,\n' \
' "state_code": string,\n' \
' "voter_display_name": string,\n' \
' "voter_display_city_state": string,\n' \
' "voter_we_vote_id": string,\n' \
' "voter_plan_data_serialized": string,\n' \
' "voter_plan_text": string,\n' \
' "show_to_public": boolean,\n' \
' "date_entered": string,\n' \
' "date_last_changed": string,\n' \
' "we_vote_hosted_profile_image_url_medium": string,\n' \
' },],\n' \
'}'
template_values = {
'api_name': 'voterPlanListRetrieve',
'api_slug': 'voterPlanListRetrieve',
'api_introduction':
"Retrieve a voter_plan_list that we can display publicly.",
'try_now_link': 'apis_v1:voterPlanListRetrieveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/voter_plan_list_retrieve_doc.py",
"copies": "1",
"size": "2973",
"license": "mit",
"hash": 4601976822049825000,
"line_mean": 38.1184210526,
"line_max": 115,
"alpha_frac": 0.5025227043,
"autogenerated": false,
"ratio": 3.71625,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.47187727043,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/voter_plan_save_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_plan_save_doc_template_values(url_root):
"""
Show documentation about voterPlanSave
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'google_civic_election_id',
'value': 'integer', # boolean, integer, long, string
'description': 'Limit results to this election',
},
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server. ',
},
{
'name': 'voter_plan_data_serialized',
'value': 'string', # boolean, integer, long, string
'description': '',
},
{
'name': 'voter_plan_text',
'value': 'string', # boolean, integer, long, string
'description': '',
},
{
'name': 'show_to_public',
'value': 'boolean', # boolean, integer, long, string
'description': '',
},
]
optional_query_parameter_list = [
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'A valid voter_device_id parameter was not included. Cannot proceed.',
},
{
'code': 'VOTER_NOT_FOUND_FROM_VOTER_DEVICE_ID',
'description': 'No voter could be found from the voter_device_id',
},
]
try_now_link_variables_dict = {
# 'voter_device_id': '',
}
api_response = '{\n' \
' "success": boolean,\n' \
' "status": string,\n' \
' "voter_plan_list": list\n' \
' [{\n' \
' "google_civic_election_id": integer,\n' \
' "state_code": string,\n' \
' "voter_display_name": string,\n' \
' "voter_display_city_state": string,\n' \
' "voter_we_vote_id": string,\n' \
' "voter_plan_data_serialized": string,\n' \
' "voter_plan_text": string,\n' \
' "show_to_public": boolean,\n' \
' "date_entered": string,\n' \
' "date_last_changed": string,\n' \
' "we_vote_hosted_profile_image_url_medium": string,\n' \
' },],\n' \
'}'
template_values = {
'api_name': 'voterPlanSave',
'api_slug': 'voterPlanSave',
'api_introduction':
"Save a voter_plan for one voter.",
'try_now_link': 'apis_v1:voterPlanSaveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/voter_plan_save_doc.py",
"copies": "1",
"size": "3672",
"license": "mit",
"hash": 8880263527842868000,
"line_mean": 37.25,
"line_max": 115,
"alpha_frac": 0.4757625272,
"autogenerated": false,
"ratio": 3.8130841121495327,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.47888466393495327,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/voter_position_comment_save_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_position_comment_save_doc_template_values(url_root):
"""
Show documentation about voterPositionCommentSave
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'kind_of_ballot_item',
'value': 'string', # boolean, integer, long, string
'description': 'The kind of ballot item the voter wants to comment on. '
'(kind_of_ballot_item is either "CANDIDATE", "POLITICIAN" or "MEASURE")',
},
{
'name': 'ballot_item_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'The unique identifier for this ballot_item across all networks.',
},
{
'name': 'statement_text',
'value': 'string', # boolean, integer, long, string
'description': 'A text description of this stance.',
},
{
'name': 'statement_html',
'value': 'string', # boolean, integer, long, string
'description': 'An HTML description of this stance.',
},
{
'name': 'google_civic_election_id',
'value': 'integer', # boolean, integer, long, string
'description': 'ID of the election this position is related to.',
},
]
optional_query_parameter_list = [
{
'name': 'position_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'We Vote unique identifier for this position.',
},
{
'name': 'set_as_public_position',
'value': 'boolean', # boolean, integer, long, string
'description': 'Should this position be saved so it can be seen by anyone in the public, '
'or only for friends',
},
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VOTER_NOT_FOUND_FROM_VOTER_DEVICE_ID',
'description': 'Cannot proceed. A valid voter_id was not found.',
},
]
try_now_link_variables_dict = {
'kind_of_ballot_item': 'CANDIDATE',
'ballot_item_we_vote_id': 'wv01cand1755',
'statement_text': 'This is what I believe...',
'google_civic_election_id': '4162',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "position_we_vote_id": string (the position identifier that moves server-to-server),\n' \
' "new_position_created": boolean,\n' \
' "google_civic_election_id": integer,\n' \
' "office_we_vote_id": string,\n' \
' "candidate_we_vote_id": string,\n' \
' "measure_we_vote_id": string,\n' \
' "statement_text": string,\n' \
' "statement_html": string,\n' \
' "is_public_position": boolean,\n' \
' "last_updated": string,\n' \
'}'
template_values = {
'api_name': 'voterPositionCommentSave',
'api_slug': 'voterPositionCommentSave',
'api_introduction':
"Save a voter's comment about an office, candidate or measure, to be shared with friends. ",
'try_now_link': 'apis_v1:voterPositionCommentSaveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/voter_position_comment_save_doc.py",
"copies": "3",
"size": "4855",
"license": "mit",
"hash": -3377770130891154400,
"line_mean": 42.3482142857,
"line_max": 115,
"alpha_frac": 0.5147270855,
"autogenerated": false,
"ratio": 3.9248181083265967,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.5939545193826596,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/voter_position_like_off_save_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_position_like_off_save_doc_template_values(url_root):
"""
Show documentation about voterPositionLikeOffSave
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'position_like_id',
'value': 'integer', # boolean, integer, long, string
'description': 'The id of the position_like entry.',
},
{
'name': 'position_entered_id',
'value': 'integer', # boolean, integer, long, string
'description': 'The position that the voter is liking.',
},
]
optional_query_parameter_list = [
# {
# 'name': '',
# 'value': '', # boolean, integer, long, string
# 'description': '',
# },
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. Missing voter_id while trying to save.',
},
{
'code': 'DELETED_BY_VOTER_ID_AND_POSITION_ENTERED_ID',
'description': '',
},
{
'code': 'DELETED_BY_POSITION_LIKE_ID',
'description': '',
},
{
'code': 'UNABLE_TO_DELETE_POSITION_LIKE-INSUFFICIENT_VARIABLES',
'description': '',
},
]
try_now_link_variables_dict = {
'position_entered_id': '5655',
}
api_response = '{\n' \
' "status": string (description of what happened),\n' \
' "success": boolean (did the save happen?),\n' \
'}'
template_values = {
'api_name': 'voterPositionLikeOffSave',
'api_slug': 'voterPositionLikeOffSave',
'api_introduction':
"Remove a Like that the voter set on a position.",
'try_now_link': 'apis_v1:voterPositionLikeOffSaveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/documentation_source/voter_position_like_off_save_doc.py",
"copies": "2",
"size": "3235",
"license": "mit",
"hash": -8797034961111192000,
"line_mean": 35.7613636364,
"line_max": 115,
"alpha_frac": 0.5165378671,
"autogenerated": false,
"ratio": 3.907004830917874,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.5423542698017874,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/voter_position_like_on_save_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_position_like_on_save_doc_template_values(url_root):
"""
Show documentation about voterPositionLikeOnSave
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'position_entered_id',
'value': 'integer', # boolean, integer, long, string
'description': 'The position that the voter is liking.',
},
]
optional_query_parameter_list = [
# {
# 'name': '',
# 'value': '', # boolean, integer, long, string
# 'description': '',
# },
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. Missing voter_id while trying to save.',
},
{
'code': 'POSITION_LIKE_CREATED',
'description': '',
},
{
'code': 'POSITION_LIKE_FOUND_WITH_VOTER_ID_AND_POSITION_ID',
'description': '',
},
{
'code': 'UNABLE_TO_SAVE_POSITION_LIKE-INSUFFICIENT_VARIABLES',
'description': '',
},
]
try_now_link_variables_dict = {
'position_entered_id': '5655',
}
api_response = '{\n' \
' "status": string (description of what happened),\n' \
' "success": boolean (did the save happen?),\n' \
' "position_like_id": integer,\n' \
' "position_entered_id": integer,\n' \
'}'
template_values = {
'api_name': 'voterPositionLikeOnSave',
'api_slug': 'voterPositionLikeOnSave',
'api_introduction':
"Mark that the voter wants to Like this position.",
'try_now_link': 'apis_v1:voterPositionLikeOnSaveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/documentation_source/voter_position_like_on_save_doc.py",
"copies": "2",
"size": "3135",
"license": "mit",
"hash": 2239583360632309200,
"line_mean": 35.8823529412,
"line_max": 115,
"alpha_frac": 0.5170653907,
"autogenerated": false,
"ratio": 3.8847583643122676,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 1,
"avg_score": 0.0008713835411272823,
"num_lines": 85
} |
# apis_v1/documentation_source/voter_position_like_status_retrieve_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_position_like_status_retrieve_doc_template_values(url_root):
"""
Show documentation about voterPositionLikeStatusRetrieve
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'position_entered_id',
'value': 'integer', # boolean, integer, long, string
'description': 'The position that the voter is liking.',
},
]
optional_query_parameter_list = [
# {
# 'name': '',
# 'value': '', # boolean, integer, long, string
# 'description': '',
# },
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. A valid voter_id was not found.',
},
{
'code': 'POSITION_LIKE_FOUND_WITH_VOTER_ID_AND_POSITION_ID',
'description': '',
},
{
'code': 'UNABLE_TO_RETRIEVE-POSITION_ENTERED_ID_MISSING',
'description': '',
},
]
try_now_link_variables_dict = {
'position_entered_id': '5655',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "is_liked": boolean,\n' \
' "position_like_id": integer,\n' \
' "position_entered_id": integer,\n' \
'}'
template_values = {
'api_name': 'voterPositionLikeStatusRetrieve',
'api_slug': 'voterPositionLikeStatusRetrieve',
'api_introduction':
"Has this voter 'Liked' this position?",
'try_now_link': 'apis_v1:voterPositionLikeStatusRetrieveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/documentation_source/voter_position_like_status_retrieve_doc.py",
"copies": "2",
"size": "3123",
"license": "mit",
"hash": -3966334781196177000,
"line_mean": 36.6265060241,
"line_max": 115,
"alpha_frac": 0.5196926033,
"autogenerated": false,
"ratio": 3.8555555555555556,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.5375248158855556,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/voter_position_retrieve_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_position_retrieve_doc_template_values(url_root):
"""
Show documentation about voterPositionRetrieve
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'kind_of_ballot_item',
'value': 'string', # boolean, integer, long, string
'description': 'What is the type of ballot item for which we need to know the voter\'s stance? '
'(kind_of_ballot_item is either "CANDIDATE", "POLITICIAN" or "MEASURE")',
},
{
'name': 'ballot_item_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'The unique we_vote identifier for this ballot_item '
'(either ballot_item_id OR ballot_item_we_vote_id required -- not both. '
'If it exists, ballot_item_id is used instead of ballot_item_we_vote_id)',
},
]
optional_query_parameter_list = [
]
potential_status_codes_list = [
]
try_now_link_variables_dict = {
'kind_of_ballot_item': 'CANDIDATE',
'ballot_item_we_vote_id': 'wv01cand1755',
}
# Don't need is_positive_rating, is_support_or_positive_rating, is_negative_rating or is_oppose_or_negative_rating
api_response = '{\n' \
' "success": boolean,\n' \
' "status": string,\n' \
' "ballot_item_display_name": string (either measure name or candidate name),\n' \
' "position_we_vote_id": string (the position identifier that moves server-to-server),\n' \
' "is_support": boolean,\n' \
' "is_oppose": boolean,\n' \
' "is_information_only": boolean,\n' \
' "google_civic_election_id": integer,\n' \
' "office_we_vote_id": string,\n' \
' "candidate_we_vote_id": string,\n' \
' "measure_we_vote_id": string,\n' \
' "kind_of_ballot_item": string (OFFICE, CANDIDATE, MEASURE),\n' \
' "ballot_item_we_vote_id": string,\n' \
' "stance": string (SUPPORT, OPPOSE, INFO_ONLY, or NO_STANCE),\n' \
' "statement_text": string,\n' \
' "statement_html": string,\n' \
' "more_info_url": string,\n' \
' "last_updated": string,\n' \
'}'
template_values = {
'api_name': 'voterPositionRetrieve',
'api_slug': 'voterPositionRetrieve',
'api_introduction':
"Retrieve the position (support/oppose) on this office, candidate or measure for the voter.",
'try_now_link': 'apis_v1:voterPositionRetrieveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/documentation_source/voter_position_retrieve_doc.py",
"copies": "2",
"size": "3916",
"license": "mit",
"hash": 8697265137490879000,
"line_mean": 45.619047619,
"line_max": 118,
"alpha_frac": 0.5314096016,
"autogenerated": false,
"ratio": 3.6943396226415093,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.5225749224241509,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/voter_position_visibility_save_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_position_visibility_save_doc_template_values(url_root):
"""
Show documentation about voterPositionVisibilitySave
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'kind_of_ballot_item',
'value': 'string', # boolean, integer, long, string
'description': 'The kind of ballot item the voter is supporting. '
'(kind_of_ballot_item is either "CANDIDATE", "POLITICIAN" or "MEASURE")',
},
{
'name': 'ballot_item_id',
'value': 'integer', # boolean, integer, long, string
'description': 'The unique internal identifier of the ballot item the voter is supporting. '
'(either ballot_item_id OR ballot_item_we_vote_id required -- not both. '
'If it exists, ballot_item_id is used instead of ballot_item_we_vote_id)',
},
{
'name': 'ballot_item_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'The unique identifier for this ballot_item across all networks '
'(either ballot_item_id OR ballot_item_we_vote_id required -- not both. '
'NOTE: In the future we might support other identifiers used in the industry.',
},
{
'name': 'visibility_setting',
'value': 'string', # boolean, integer, long, string
'description': 'Two values are currently supported: \'FRIENDS_ONLY\' or \'SHOW_PUBLIC\'.',
},
]
optional_query_parameter_list = [
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. Missing voter_id while trying to save.',
},
]
try_now_link_variables_dict = {
'kind_of_ballot_item': 'CANDIDATE',
'ballot_item_id': '5655',
'visibility_setting': 'SHOW_PUBLIC',
}
api_response = '{\n' \
' "status": string (description of what happened),\n' \
' "success": boolean (did the save happen?),\n' \
' "ballot_item_id": integer,\n' \
' "ballot_item_we_vote_id": string,\n' \
' "kind_of_ballot_item": string (CANDIDATE, MEASURE),\n' \
' "visibility_setting": string (FRIENDS_ONLY, SHOW_PUBLIC),\n' \
'}'
template_values = {
'api_name': 'voterPositionVisibilitySave',
'api_slug': 'voterPositionVisibilitySave',
'api_introduction':
"Update whether the current voter\'s position for either a measure or candidate can be seen "
"by the public, or friends only.",
'try_now_link': 'apis_v1:voterPositionVisibilitySaveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WebAppPublic",
"path": "apis_v1/documentation_source/voter_position_visibility_save_doc.py",
"copies": "3",
"size": "4217",
"license": "bsd-3-clause",
"hash": -3980265520021641700,
"line_mean": 44.3440860215,
"line_max": 115,
"alpha_frac": 0.5420915343,
"autogenerated": false,
"ratio": 3.9227906976744187,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.5964882231974419,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/voter_reaction_like_off_save_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_reaction_like_off_save_doc_template_values(url_root):
"""
Show documentation about voterReactionLikeOffSave
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'reaction_like_id',
'value': 'integer', # boolean, integer, long, string
'description': 'The id of the reaction entry.',
},
{
'name': 'liked_item_we_vote_id',
'value': 'integer', # boolean, integer, long, string
'description': 'The position that the voter is liking.',
},
]
optional_query_parameter_list = [
# {
# 'name': '',
# 'value': '', # boolean, integer, long, string
# 'description': '',
# },
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. Missing voter_id while trying to save.',
},
{
'code': 'DELETED_BY_VOTER_ID_AND_LIKED_ITEM_WE_VOTE_ID',
'description': '',
},
{
'code': 'DELETED_BY_REACTION_LIKE_ID',
'description': '',
},
{
'code': 'UNABLE_TO_DELETE_REACTION_LIKE-INSUFFICIENT_VARIABLES',
'description': '',
},
]
try_now_link_variables_dict = {
'liked_item_we_vote_id': '5655',
}
api_response = '{\n' \
' "status": string (description of what happened),\n' \
' "success": boolean (did the save happen?),\n' \
'}'
template_values = {
'api_name': 'voterReactionLikeOffSave',
'api_slug': 'voterReactionLikeOffSave',
'api_introduction':
"Remove a Like that the voter set on a position.",
'try_now_link': 'apis_v1:voterReactionLikeOffSaveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/voter_reaction_like_off_save_doc.py",
"copies": "1",
"size": "3236",
"license": "mit",
"hash": -2265887512378587600,
"line_mean": 35.7727272727,
"line_max": 115,
"alpha_frac": 0.5151421508,
"autogenerated": false,
"ratio": 3.843230403800475,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.4858372554600475,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/voter_reaction_like_on_save_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_reaction_like_on_save_doc_template_values(url_root):
"""
Show documentation about voterReactionLikeOnSave
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'liked_item_we_vote_id',
'value': 'integer', # boolean, integer, long, string
'description': 'The position that the voter is liking.',
},
]
optional_query_parameter_list = [
# {
# 'name': '',
# 'value': '', # boolean, integer, long, string
# 'description': '',
# },
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. Missing voter_id while trying to save.',
},
{
'code': 'REACTION_LIKE_CREATED',
'description': '',
},
{
'code': 'REACTION_LIKE_FOUND_WITH_VOTER_ID_AND_POSITION_ID',
'description': '',
},
{
'code': 'UNABLE_TO_SAVE_REACTION_LIKE-INSUFFICIENT_VARIABLES',
'description': '',
},
]
try_now_link_variables_dict = {
'liked_item_we_vote_id': '5655',
}
api_response = '{\n' \
' "status": string (description of what happened),\n' \
' "success": boolean (did the save happen?),\n' \
' "reaction_like_id": integer,\n' \
' "liked_item_we_vote_id": integer,\n' \
'}'
template_values = {
'api_name': 'voterReactionLikeOnSave',
'api_slug': 'voterReactionLikeOnSave',
'api_introduction':
"Mark that the voter wants to Like this position.",
'try_now_link': 'apis_v1:voterReactionLikeOnSaveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/voter_reaction_like_on_save_doc.py",
"copies": "1",
"size": "3141",
"license": "mit",
"hash": 462642906469364800,
"line_mean": 35.9529411765,
"line_max": 115,
"alpha_frac": 0.5160776823,
"autogenerated": false,
"ratio": 3.821167883211679,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.9832888647806043,
"avg_score": 0.0008713835411272823,
"num_lines": 85
} |
# apis_v1/documentation_source/voter_retrieve_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_retrieve_doc_template_values(url_root):
"""
Show documentation about voterRetrieve
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
]
optional_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server. '
'If not provided, a new voter_device_id (and voter entry) '
'will be generated, and the voter_device_id will be returned.',
},
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'A valid voter_device_id parameter was not included. Cannot proceed.',
},
{
'code': 'VOTER_NOT_FOUND_FROM_DEVICE_ID',
'description': 'There is no voter_id attached to that voter_device_id',
},
{
'code': 'VOTER_ID_COULD_NOT_BE_RETRIEVED',
'description': 'Unable to retrieve voter_id, although voter_id was found linked to voter_device_id',
},
]
try_now_link_variables_dict = {
}
api_response = '{\n' \
' "status": string (description of what happened),\n' \
' "success": boolean (True as long as no db errors),\n' \
' "voter_device_id": string (88 characters long),\n' \
' "voter_created": boolean,\n' \
' "voter_found": boolean,\n' \
' "we_vote_id": string,\n' \
' "first_name": string,\n' \
' "last_name": string,\n' \
' "email": string,\n' \
' "facebook_id": integer,\n' \
' "facebook_email": string,\n' \
' "facebook_profile_image_url_https": string,\n' \
' "voter_photo_url": string,\n' \
' "twitter_screen_name": string,\n' \
' "signed_in_personal": boolean,\n' \
' "signed_in_facebook": boolean,\n' \
' "signed_in_google": boolean,\n' \
' "signed_in_twitter": boolean,\n' \
' "linked_organization_we_vote_id": string,\n' \
'}'
template_values = {
'api_name': 'voterRetrieve',
'api_slug': 'voterRetrieve',
'api_introduction': "Export key voter data to JSON format",
'try_now_link': 'apis_v1:voterRetrieveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes': "",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WebAppPublic",
"path": "apis_v1/documentation_source/voter_retrieve_doc.py",
"copies": "1",
"size": "3475",
"license": "bsd-3-clause",
"hash": 8410351752241543000,
"line_mean": 41.9012345679,
"line_max": 115,
"alpha_frac": 0.5110791367,
"autogenerated": false,
"ratio": 3.7895310796074155,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.97956272481326,
"avg_score": 0.0009965936349631077,
"num_lines": 81
} |
# apis_v1/documentation_source/voter_send_google_contacts_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_send_google_contacts_doc_template_values(url_root):
"""
Show documentation about voterSendGoogleContacts
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server. ',
},
{
'name': 'contacts',
'value': 'string', # boolean, integer, long, string
'description': 'A json structure of Google contacts, arrives as a string',
},
]
optional_query_parameter_list = [
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'A valid voter_device_id parameter was not included. Cannot proceed.',
},
{
'code': 'VOTER_NOT_FOUND_FROM_VOTER_DEVICE_ID',
'description': 'No voter could be found from the voter_device_id',
},
]
try_now_link_variables_dict = {
# 'voter_device_id': '',
}
api_response = '{\n' \
' "success": boolean,\n' \
' "status": string,\n' \
' "we_vote_id_for_google_contacts" string, \n' \
' "contacts_stored": integer, \n' \
'}'
template_values = {
'api_name': 'voterSendGoogleContacts',
'api_slug': 'voterSendGoogleContacts',
'api_introduction':
'Receive a voter's Google contacts for saving.<br>'
'<b>Example JSON string to add one contact:</b><br>'
' [{"display_name": "George Washington","family_name": "Washington",'
'"given_name": "George","email": "george@whitehouse.com","update_time": "2014-03-20T16:36:33.176Z",'
'"type": "OTHER_CONTACT"}]<br>',
'try_now_link': 'apis_v1:voterSendGoogleContactsView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'post',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/voter_send_google_contacts_doc.py",
"copies": "1",
"size": "2885",
"license": "mit",
"hash": -4052066900789380000,
"line_mean": 38.5205479452,
"line_max": 115,
"alpha_frac": 0.5469670711,
"autogenerated": false,
"ratio": 3.7082262210796917,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.9750478889306937,
"avg_score": 0.0009428805745508821,
"num_lines": 73
} |
# apis_v1/documentation_source/voter_sign_out_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_sign_out_doc_template_values(url_root):
"""
Show documentation about voterSignOut
"""
required_query_parameter_list = [
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
]
optional_query_parameter_list = [
{
'name': 'sign_out_all_devices',
'value': 'boolean', # boolean, integer, long, string
'description': 'This is \'False\' by default. If set to \'True\', sign out all other devices signed into '
'this account by deleting all voter_device_id\'s linked to this voter account.',
},
]
potential_status_codes_list = [
{
'code': 'DELETE_VOTER_DEVICE_LINK_SUCCESSFUL',
'description': 'The voter device link was successfully removed.',
},
{
'code': 'DELETE_ALL_VOTER_DEVICE_LINKS_SUCCESSFUL',
'description': 'All voter device links for this voter were successfully removed.',
},
{
'code': 'DELETE_VOTER_DEVICE_LINK-MISSING_VARIABLES',
'description': 'voter_id could not be found from the voter_device_id passed in.',
},
{
'code': 'DELETE_ALL_VOTER_DEVICE_LINKS-MISSING_VARIABLES',
'description': 'voter_id could not be found from the voter_device_id passed in.',
},
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
]
try_now_link_variables_dict = {
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
'}'
template_values = {
'api_name': 'voterSignOut',
'api_slug': 'voterSignOut',
'api_introduction':
"Sign out from this account. (Delete this voter_device_id from the database.)",
'try_now_link': 'apis_v1:voterSignOutView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/documentation_source/voter_sign_out_doc.py",
"copies": "3",
"size": "3163",
"license": "mit",
"hash": 7714181540686394000,
"line_mean": 39.0379746835,
"line_max": 119,
"alpha_frac": 0.5447360101,
"autogenerated": false,
"ratio": 3.885749385749386,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.5930485395849385,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/voter_sms_phone_number_retrieve_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_sms_phone_number_retrieve_doc_template_values(url_root):
"""
Show documentation about voterSMSPhoneNumberRetrieve
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
]
optional_query_parameter_list = [
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'A valid voter_device_id parameter was not included. Cannot proceed.',
},
{
'code': 'VOTER_NOT_FOUND_FROM_VOTER_DEVICE_ID',
'description': 'No voter could be found from the voter_device_id',
},
]
try_now_link_variables_dict = {
# 'voter_device_id': '',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "sms_phone_number_list_found": boolean,\n' \
' "sms_phone_number_list": list\n' \
' [\n' \
' "normalized_sms_phone_number": string,\n' \
' "primary_sms_phone_number": boolean,\n' \
' "sms_permanent_bounce": boolean,\n' \
' "sms_ownership_is_verified": boolean,\n' \
' "voter_we_vote_id": string,\n' \
' "sms_we_vote_id": string,\n' \
' ],\n' \
'}'
template_values = {
'api_name': 'voterSMSPhoneNumberRetrieve',
'api_slug': 'voterSMSPhoneNumberRetrieve',
'api_introduction':
"Retrieve a list of all of the sms phone numbers for voter using voter_device_id.",
'try_now_link': 'apis_v1:voterSMSPhoneNumberRetrieveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/voter_sms_phone_number_retrieve_doc.py",
"copies": "1",
"size": "2914",
"license": "mit",
"hash": -7696786757565826000,
"line_mean": 38.9178082192,
"line_max": 115,
"alpha_frac": 0.5260809883,
"autogenerated": false,
"ratio": 3.7551546391752577,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.9777916278920304,
"avg_score": 0.000663869710990568,
"num_lines": 73
} |
# apis_v1/documentation_source/voter_sms_phone_number_save_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_sms_phone_number_save_doc_template_values(url_root):
"""
Show documentation about voterSMSPhoneNumberSave
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'sms_phone_number',
'value': 'string', # boolean, integer, long, string
'description': 'The phone number to be saved.',
},
]
optional_query_parameter_list = [
{
'name': 'delete_sms_phone_number',
'value': 'boolean', # boolean, integer, long, string
'description': 'When this variable is passed in as true, mark this sms phone number as deleted.',
},
{
'name': 'make_primary_sms_phone_number',
'value': 'boolean', # boolean, integer, long, string
'description': 'When passed in as true, change this (verified) sms phone number to be the primary.',
},
{
'name': 'resend_verification_code',
'value': 'boolean', # boolean, integer, long, string
'description': 'Send the a verification code to this sms phone number again.',
},
{
'name': 'send_sign_in_code_sms',
'value': 'boolean', # boolean, integer, long, string
'description': 'Send the verification code to this sms phone number.',
},
{
'name': 'sms_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'The unique identifier for this sms across all networks ',
},
{
'name': 'verify_sms_phone_number',
'value': 'boolean', # boolean, integer, long, string
'description': 'When this variable is passed in as true, change this sms phone number to verified.',
},
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'MISSING_VOTER_ID_OR_ADDRESS_TYPE',
'description': 'Cannot proceed. Missing variables voter_id or address_type while trying to save.',
},
]
try_now_link_variables_dict = {
# 'organization_we_vote_id': 'wv85org1',
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "sms_phone_number": string,\n' \
' "make_primary_sms_phone_number": boolean,\n' \
' "delete_sms_phone_number": boolean,\n' \
' "sms_phone_number_saved_we_vote_id": string,\n' \
' "sms_phone_number_created": boolean,\n' \
' "sms_phone_number_deleted": boolean,\n' \
' "verification_code_sent": boolean,\n' \
' "sms_phone_number_already_owned_by_other_voter": boolean,\n' \
' "sms_phone_number_found": boolean,\n' \
' "sms_phone_number_list_found": boolean,\n' \
' "sms_phone_number_list": list\n' \
' [\n' \
' "normalized_sms_phone_number": string,\n' \
' "primary_sms_phone_number": boolean,\n' \
' "sms_phone_number_permanent_bounce": boolean,\n' \
' "sms_phone_number_ownership_is_verified": boolean,\n' \
' "voter_we_vote_id": string,\n' \
' "sms_phone_number_we_vote_id": string,\n' \
' ],\n' \
'}'
template_values = {
'api_name': 'voterSMSPhoneNumberSave',
'api_slug': 'voterSMSPhoneNumberSave',
'api_introduction':
"Save or create an SMS phone number for the current voter.",
'try_now_link': 'apis_v1:voterSMSPhoneNumberSaveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/voter_sms_phone_number_save_doc.py",
"copies": "1",
"size": "5238",
"license": "mit",
"hash": 7136760593212620000,
"line_mean": 44.1551724138,
"line_max": 115,
"alpha_frac": 0.510882016,
"autogenerated": false,
"ratio": 3.917726252804787,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.49286082688047866,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/voter_split_into_two_accounts_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_split_into_two_accounts_doc_template_values(url_root):
"""
Show documentation about voterSplitIntoTwoAccounts
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'split_off_twitter',
'value': 'boolean', # boolean, integer, long, string
'description': 'Confirm that we want to split off the Twitter authorization from this account.',
},
]
optional_query_parameter_list = [
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'MISSING_VOTER_ID_OR_ADDRESS_TYPE',
'description': 'Cannot proceed. Missing variables voter_id or address_type while trying to save.',
},
]
try_now_link_variables_dict = {
'split_off_twitter': True,
}
api_response = '{\n' \
' "status": string,\n' \
' "success": boolean,\n' \
' "voter_device_id": string (88 characters long),\n' \
' "email_ownership_is_verified": boolean,\n' \
' "email_secret_key_belongs_to_this_voter": boolean,\n' \
' "email_address_found": boolean,\n' \
'}'
template_values = {
'api_name': 'voterSplitIntoTwoAccounts',
'api_slug': 'voterSplitIntoTwoAccounts',
'api_introduction':
"Split one account into two accounts. Used for un-linking a Twitter account "
"from the current voter account.",
'try_now_link': 'apis_v1:voterSplitIntoTwoAccountsView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/documentation_source/voter_split_into_two_accounts_doc.py",
"copies": "2",
"size": "2863",
"license": "mit",
"hash": -7750685499478214000,
"line_mean": 39.323943662,
"line_max": 115,
"alpha_frac": 0.5560600768,
"autogenerated": false,
"ratio": 3.889945652173913,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.5446005728973913,
"avg_score": null,
"num_lines": null
} |
# apis_v1/documentation_source/voter_star_off_save_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_star_off_save_doc_template_values(url_root):
"""
Show documentation about voterStarOffSave
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'kind_of_ballot_item',
'value': 'string', # boolean, integer, long, string
'description': 'What is the type of ballot item for which we are saving the \'off\' status? '
'(kind_of_ballot_item is either "OFFICE", "CANDIDATE", "POLITICIAN" or "MEASURE")',
},
{
'name': 'ballot_item_id',
'value': 'integer', # boolean, integer, long, string
'description': 'The unique internal identifier for this ballot_item '
'(either ballot_item_id OR ballot_item_we_vote_id required -- not both. '
'If it exists, ballot_item_id is used instead of ballot_item_we_vote_id)',
},
{
'name': 'ballot_item_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'The unique identifier for this ballot_item across all networks '
'(either ballot_item_id OR ballot_item_we_vote_id required -- not both. '
'NOTE: In the future we might support other identifiers used in the industry.',
},
]
optional_query_parameter_list = [
# {
# 'name': '',
# 'value': '', # boolean, integer, long, string
# 'description': '',
# },
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. Missing voter_id while trying to save.',
},
{
'code': 'STAR_OFF_OFFICE CREATE/UPDATE ITEM_STARRED',
'description': '',
},
{
'code': 'STAR_OFF_CANDIDATE CREATE/UPDATE ITEM_STARRED',
'description': '',
},
{
'code': 'STAR_OFF_MEASURE CREATE/UPDATE ITEM_STARRED',
'description': '',
},
]
try_now_link_variables_dict = {
'kind_of_ballot_item': 'CANDIDATE',
'ballot_item_id': '5655',
}
api_response = '{\n' \
' "status": string (description of what happened),\n' \
' "success": boolean (did the save happen?),\n' \
' "ballot_item_id": integer,\n' \
' "ballot_item_we_vote_id": string,\n' \
' "kind_of_ballot_item": string (CANDIDATE, MEASURE),\n' \
'}'
template_values = {
'api_name': 'voterStarOffSave',
'api_slug': 'voterStarOffSave',
'api_introduction':
"Save or create private 'star off' state for the current voter for a measure, an office or candidate.",
'try_now_link': 'apis_v1:voterStarOffSaveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WebAppPublic",
"path": "apis_v1/documentation_source/voter_star_off_save_doc.py",
"copies": "1",
"size": "4297",
"license": "bsd-3-clause",
"hash": -1977682416022826200,
"line_mean": 41.1274509804,
"line_max": 115,
"alpha_frac": 0.5154759134,
"autogenerated": false,
"ratio": 3.846911369740376,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.9855630855905441,
"avg_score": 0.001351285446986988,
"num_lines": 102
} |
# apis_v1/documentation_source/voter_star_on_save_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_star_on_save_doc_template_values(url_root):
"""
Show documentation about voterStarOnSave
"""
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))', # boolean, integer, long, string
'description': 'The unique key provided to any organization using the WeVoteServer APIs',
},
{
'name': 'voter_device_id',
'value': 'string', # boolean, integer, long, string
'description': 'An 88 character unique identifier linked to a voter record on the server',
},
{
'name': 'kind_of_ballot_item',
'value': 'string', # boolean, integer, long, string
'description': 'What is the type of ballot item for which we are saving the \'on\' status? '
'(kind_of_ballot_item is either "OFFICE", "CANDIDATE", "POLITICIAN" or "MEASURE")',
},
{
'name': 'ballot_item_id',
'value': 'integer', # boolean, integer, long, string
'description': 'The unique internal identifier for this ballot_item '
'(either ballot_item_id OR ballot_item_we_vote_id required -- not both. '
'If it exists, ballot_item_id is used instead of ballot_item_we_vote_id)',
},
{
'name': 'ballot_item_we_vote_id',
'value': 'string', # boolean, integer, long, string
'description': 'The unique identifier for this ballot_item across all networks '
'(either ballot_item_id OR ballot_item_we_vote_id required -- not both. '
'NOTE: In the future we might support other identifiers used in the industry.',
},
]
optional_query_parameter_list = [
]
potential_status_codes_list = [
{
'code': 'VALID_VOTER_DEVICE_ID_MISSING',
'description': 'Cannot proceed. A valid voter_device_id parameter was not included.',
},
{
'code': 'VALID_VOTER_ID_MISSING',
'description': 'Cannot proceed. Missing voter_id while trying to save.',
},
{
'code': 'STAR_ON_OFFICE CREATE/UPDATE ITEM_STARRED',
'description': '',
},
{
'code': 'STAR_ON_CANDIDATE CREATE/UPDATE ITEM_STARRED',
'description': '',
},
{
'code': 'STAR_ON_MEASURE CREATE/UPDATE ITEM_STARRED',
'description': '',
},
]
try_now_link_variables_dict = {
'kind_of_ballot_item': 'CANDIDATE',
'ballot_item_id': '5655',
}
api_response = '{\n' \
' "status": string (description of what happened),\n' \
' "success": boolean (did the save happen?),\n' \
' "ballot_item_id": integer,\n' \
' "ballot_item_we_vote_id": string,\n' \
' "kind_of_ballot_item": string (CANDIDATE, MEASURE),\n' \
'}'
template_values = {
'api_name': 'voterStarOnSave',
'api_slug': 'voterStarOnSave',
'api_introduction':
"Save or create private 'star on' state for the current voter for a measure, an office or candidate.",
'try_now_link': 'apis_v1:voterStarOnSaveView',
'try_now_link_variables_dict': try_now_link_variables_dict,
'url_root': url_root,
'get_or_post': 'GET',
'required_query_parameter_list': required_query_parameter_list,
'optional_query_parameter_list': optional_query_parameter_list,
'api_response': api_response,
'api_response_notes':
"",
'potential_status_codes_list': potential_status_codes_list,
}
return template_values
| {
"repo_name": "wevote/WebAppPublic",
"path": "apis_v1/documentation_source/voter_star_on_save_doc.py",
"copies": "1",
"size": "4125",
"license": "bsd-3-clause",
"hash": 5779155386989226000,
"line_mean": 41.5257731959,
"line_max": 115,
"alpha_frac": 0.5236363636,
"autogenerated": false,
"ratio": 3.826530612244898,
"config_test": false,
"has_no_keywords": false,
"few_assignments": false,
"quality_score": 0.4850166975844898,
"avg_score": null,
"num_lines": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.