text stringlengths 0 1.05M | meta dict |
|---|---|
# apis_v1/documentation_source/voter_star_status_retrieve_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_star_status_retrieve_doc_template_values(url_root):
"""
Show documentation about voterStarStatusRetrieve
"""
required_query_parameter_list = [
{
... | {
"repo_name": "wevote/WebAppPublic",
"path": "apis_v1/documentation_source/voter_star_status_retrieve_doc.py",
"copies": "1",
"size": "3982",
"license": "bsd-3-clause",
"hash": 5254674576067759000,
"line_mean": 43.2444444444,
"line_max": 115,
"alpha_frac": 0.5266197891,
"autogenerated": false,
"r... |
# apis_v1/documentation_source/voter_stop_opposing_save_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_stop_opposing_save_doc_template_values(url_root):
"""
Show documentation about voterStopOpposingSave
"""
required_query_parameter_list = [
{
'name'... | {
"repo_name": "wevote/WebAppPublic",
"path": "apis_v1/documentation_source/voter_stop_opposing_save_doc.py",
"copies": "3",
"size": "5400",
"license": "bsd-3-clause",
"hash": 3577176962938382300,
"line_mean": 43.262295082,
"line_max": 115,
"alpha_frac": 0.5355555556,
"autogenerated": false,
"rati... |
# apis_v1/documentation_source/voter_stop_supporting_save_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_stop_supporting_save_doc_template_values(url_root):
"""
Show documentation about voterStopSupportingSave
"""
required_query_parameter_list = [
{
... | {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/documentation_source/voter_stop_supporting_save_doc.py",
"copies": "3",
"size": "5431",
"license": "mit",
"hash": -7728557728156666000,
"line_mean": 43.5163934426,
"line_max": 116,
"alpha_frac": 0.5382065918,
"autogenerated": false,
"rat... |
# apis_v1/documentation_source/voter_supporting_save_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_supporting_save_doc_template_values(url_root):
"""
Show documentation about voterSupportingSave
"""
required_query_parameter_list = [
{
'name': ... | {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/documentation_source/voter_supporting_save_doc.py",
"copies": "3",
"size": "5268",
"license": "mit",
"hash": -609635633713504400,
"line_mean": 42.5371900826,
"line_max": 115,
"alpha_frac": 0.532080486,
"autogenerated": false,
"ratio": 3.... |
# apis_v1/documentation_source/voter_twitter_save_to_current_account_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_twitter_save_to_current_account_doc_template_values(url_root):
"""
Show documentation about voterTwitterSaveToCurrentAccount
"""
required_query_parameter_... | {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/voter_twitter_save_to_current_account_doc.py",
"copies": "2",
"size": "2551",
"license": "mit",
"hash": 899691113006147000,
"line_mean": 37.0746268657,
"line_max": 115,
"alpha_frac": 0.5558604469,
"autogenerated": false,
"... |
# apis_v1/documentation_source/voter_update_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_update_doc_template_values(url_root):
"""
Show documentation about voterUpdate
"""
required_query_parameter_list = [
{
'name': 'api_key',
'... | {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/voter_update_doc.py",
"copies": "1",
"size": "7874",
"license": "mit",
"hash": -4015227381384591000,
"line_mean": 43.9942857143,
"line_max": 115,
"alpha_frac": 0.5102870206,
"autogenerated": false,
"ratio": 4.1398527865404... |
# apis_v1/documentation_source/voter_verify_secret_code_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_verify_secret_code_doc_template_values(url_root):
"""
Show documentation about voterVerifySecretCode
"""
required_query_parameter_list = [
{
'name'... | {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/documentation_source/voter_verify_secret_code_doc.py",
"copies": "1",
"size": "3288",
"license": "mit",
"hash": -3974457857774130700,
"line_mean": 41.7012987013,
"line_max": 119,
"alpha_frac": 0.5538321168,
"autogenerated": false,
"ratio": 3.7... |
# apis_v1/tests/test_views_voter_sms_phone_number_retrieve.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from django.urls import reverse
from django.test import TestCase
from email_outbound.models import EmailAddress, EmailManager
import json
class WeVoteAPIsV1TestsVoterSMSPhoneNumberRetrieve(TestC... | {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/tests/test_views_voter_sms_phone_number_retrieve.py",
"copies": "1",
"size": "5097",
"license": "mit",
"hash": 6415936813966341000,
"line_mean": 57.5862068966,
"line_max": 117,
"alpha_frac": 0.607612321,
"autogenerated": false,
"ratio": 3.8496... |
# apis_v1/test_views_campaign_list_retrieve.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from admin_tools.controllers import import_data_for_tests
from django.urls import reverse
from django.test import TestCase
import json
from office.models import ContestOffice, ContestOfficeManager
class WeVot... | {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/tests/test_views_campaign_list_retrieve.py",
"copies": "1",
"size": "2175",
"license": "mit",
"hash": -1180101732422628600,
"line_mean": 50.7857142857,
"line_max": 111,
"alpha_frac": 0.6395402299,
"autogenerated": false,
"ratio": 3.84275618374... |
# apis_v1/test_views_candidates_retrieve.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from admin_tools.controllers import import_data_for_tests
from django.urls import reverse
from django.test import TestCase
import json
from office.models import ContestOffice, ContestOfficeManager
class WeVoteAP... | {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/tests/test_views_candidates_retrieve.py",
"copies": "1",
"size": "6827",
"license": "mit",
"hash": 221185482149253950,
"line_mean": 61.6330275229,
"line_max": 118,
"alpha_frac": 0.6004101362,
"autogenerated": false,
"ratio": 3.799109627156372,... |
# apis_v1/test_views_organization_count.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from django.core.urlresolvers import reverse
from django.test import TestCase
import json
from organization.models import Organization
class WeVoteAPIsV1TestsOrganizationCount(TestCase):
def setUp(self):
... | {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/tests/test_views_organization_count.py",
"copies": "2",
"size": "10244",
"license": "mit",
"hash": 182108065036742240,
"line_mean": 51,
"line_max": 116,
"alpha_frac": 0.6147012886,
"autogenerated": false,
"ratio": 4.390912987569653,
"c... |
# apis_v1/test_views_organization_count.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from django.urls import reverse
from django.test import TestCase
import json
from organization.models import Organization
class WeVoteAPIsV1TestsOrganizationCount(TestCase):
databases = ["default", "readonly"... | {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/tests/test_views_organization_count.py",
"copies": "1",
"size": "10271",
"license": "mit",
"hash": -7955086373884550000,
"line_mean": 50.8737373737,
"line_max": 116,
"alpha_frac": 0.6142537241,
"autogenerated": false,
"ratio": 4.38931623931624... |
# apis_v1/test_views_organization_follow.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from django.core.urlresolvers import reverse
from django.test import TestCase
import json
from organization.models import Organization
class WeVoteAPIsV1TestsOrganizationFollow(TestCase):
def setUp(self):
... | {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/tests/test_views_organization_follow.py",
"copies": "2",
"size": "22432",
"license": "mit",
"hash": 3879804061874503000,
"line_mean": 68.4489164087,
"line_max": 116,
"alpha_frac": 0.6077924394,
"autogenerated": false,
"ratio": 4.15638317... |
# apis_v1/test_views_organization_retrieve.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from django.urls import reverse
from django.test import TestCase
import json
from organization.models import Organization
class WeVoteAPIsV1TestsOrganizationRetrieve(TestCase):
databases = ["default", "rea... | {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/tests/test_views_organization_retrieve.py",
"copies": "1",
"size": "12344",
"license": "mit",
"hash": 5098208909216038000,
"line_mean": 57.5023696682,
"line_max": 116,
"alpha_frac": 0.6129293584,
"autogenerated": false,
"ratio": 4.496903460837... |
# apis_v1/test_views_voter_address_retrieve.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from django.core.urlresolvers import reverse
from django.test import TestCase
import json
class WeVoteAPIsV1TestsVoterAddressRetrieve(TestCase):
def setUp(self):
self.generate_voter_device_id_url... | {
"repo_name": "wevote/WebAppPublic",
"path": "apis_v1/tests/test_views_voter_address_retrieve.py",
"copies": "2",
"size": "7230",
"license": "bsd-3-clause",
"hash": 3518466451627186000,
"line_mean": 56.84,
"line_max": 118,
"alpha_frac": 0.6164591978,
"autogenerated": false,
"ratio": 4.00332225913... |
# apis_v1/test_views_voter_email_address_save.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from django.urls import reverse
from django.test import TestCase
from email_outbound.models import EmailAddress, EmailManager
import json
class WeVoteAPIsV1TestsVoterEmailAddressSave(TestCase):
database... | {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/tests/test_views_voter_email_address_save.py",
"copies": "1",
"size": "9236",
"license": "mit",
"hash": 4900110462402552000,
"line_mean": 63.1458333333,
"line_max": 242,
"alpha_frac": 0.6069727155,
"autogenerated": false,
"ratio": 3.9707652622... |
# apis_v1/test_views_voter_guides_to_follow_retrieve.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from django.core.urlresolvers import reverse
from django.test import TestCase
import json
from organization.models import Organization
class WeVoteAPIsV1TestsVoterGuidesToFollowRetrieve(TestCase):
... | {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/tests/test_views_voter_guides_to_follow_retrieve.py",
"copies": "2",
"size": "9241",
"license": "mit",
"hash": 2242157543452405200,
"line_mean": 58.2371794872,
"line_max": 120,
"alpha_frac": 0.6264473542,
"autogenerated": false,
"ratio":... |
# apis_v1/urls.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
"""
This is called from config/urls.py like this:
url(r'^apis/v1/', include('apis_v1.urls', namespace="apis_v1")),
"""
from django.conf import settings
from django.conf.urls import url
from django.conf.urls.static import static
from a... | {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/urls.py",
"copies": "1",
"size": "31965",
"license": "mit",
"hash": 6519527933093854000,
"line_mean": 76.9634146341,
"line_max": 120,
"alpha_frac": 0.7579852964,
"autogenerated": false,
"ratio": 3.401979565772669,
"config_test": false,... |
# apis_v1/views_docs.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from .documentation_source import ballot_item_options_retrieve_doc, ballot_item_retrieve_doc, \
ballot_items_sync_out_doc, ballot_returned_sync_out_doc, \
candidate_retrieve_doc, \
candidates_retrieve_doc, candidates_sync... | {
"repo_name": "wevote/WebAppPublic",
"path": "apis_v1/views_docs.py",
"copies": "1",
"size": "33469",
"license": "bsd-3-clause",
"hash": -3199976514379304000,
"line_mean": 40.3197530864,
"line_max": 120,
"alpha_frac": 0.7254773074,
"autogenerated": false,
"ratio": 3.1470615890926186,
"config_te... |
# apis_v1/views/views_activity.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from datetime import datetime, timedelta
from django.http import HttpResponse
import json
import threading
import time
from activity.controllers import update_or_create_activity_notice_seed_for_activity_posts
from activity.... | {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/views/views_activity.py",
"copies": "1",
"size": "35747",
"license": "mit",
"hash": 4284211825635188000,
"line_mean": 56.0127591707,
"line_max": 120,
"alpha_frac": 0.6207234173,
"autogenerated": false,
"ratio": 3.803681634390296,
"config_tes... |
# apis_v1/views/views_analytics.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from analytics.controllers import save_analytics_action_for_api
from analytics.models import ACTIONS_THAT_REQUIRE_ORGANIZATION_IDS
from config.base import get_environment_variable
from django.http import HttpResponse
impor... | {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/views/views_analytics.py",
"copies": "2",
"size": "6801",
"license": "mit",
"hash": -7309852727518212000,
"line_mean": 50.1353383459,
"line_max": 118,
"alpha_frac": 0.6174092045,
"autogenerated": false,
"ratio": 3.6782044348296377,
"config_t... |
# apis_v1/views/views_apple.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from datetime import datetime
from django.http import HttpResponse, HttpResponseRedirect
from django.views.decorators.csrf import csrf_exempt
from exception.models import print_to_log, handle_exception
import json
from apple.Ap... | {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/views/views_apple.py",
"copies": "1",
"size": "17147",
"license": "mit",
"hash": 1220516328548887300,
"line_mean": 43.1932989691,
"line_max": 125,
"alpha_frac": 0.6291479559,
"autogenerated": false,
"ratio": 3.4252896524170993,
"config_test"... |
# apis_v1/views/views_ballot.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from ballot.controllers import all_ballot_items_retrieve_for_api, ballot_item_highlights_retrieve_for_api, \
ballot_item_options_retrieve_for_api, ballot_items_search_retrieve_for_api
from candidate.controllers import cand... | {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/views/views_ballot.py",
"copies": "1",
"size": "6298",
"license": "mit",
"hash": -3376968477361722400,
"line_mean": 46.3533834586,
"line_max": 114,
"alpha_frac": 0.6590981264,
"autogenerated": false,
"ratio": 3.4452954048140043,
"config_test... |
# apis_v1/views/views_ballot.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from ballot.controllers import ballot_item_options_retrieve_for_api
from candidate.controllers import candidate_retrieve_for_api
from config.base import get_environment_variable
from django.http import HttpResponse
import json... | {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/views/views_ballot.py",
"copies": "1",
"size": "4469",
"license": "mit",
"hash": 6380296267698609000,
"line_mean": 49.2134831461,
"line_max": 112,
"alpha_frac": 0.6442157082,
"autogenerated": false,
"ratio": 3.4271472392638036,
"config... |
# apis_v1/views/views_campaign.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from campaign.controllers import campaignx_list_retrieve_for_api, campaignx_retrieve_for_api, campaignx_save_for_api, \
campaignx_supporter_retrieve_for_api, campaignx_supporter_save_for_api
from config.base import get_e... | {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/views/views_campaign.py",
"copies": "1",
"size": "8263",
"license": "mit",
"hash": -297616346298878850,
"line_mean": 52.3096774194,
"line_max": 119,
"alpha_frac": 0.7237080963,
"autogenerated": false,
"ratio": 3.3331988705123035,
"config_tes... |
# apis_v1/views/views_candidate.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from candidate.controllers import candidate_retrieve_for_api, candidates_retrieve_for_api, \
retrieve_candidate_list_for_all_upcoming_elections
from candidate.views_admin import candidate_change_names
from politician.vi... | {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/views/views_candidate.py",
"copies": "1",
"size": "3493",
"license": "mit",
"hash": 5854225030299931000,
"line_mean": 38.2471910112,
"line_max": 114,
"alpha_frac": 0.659891211,
"autogenerated": false,
"ratio": 3.7640086206896552,
"config_tes... |
# apis_v1/views/views_docs.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from apis_v1.documentation_source import ballot_item_options_retrieve_doc, ballot_item_retrieve_doc, \
ballot_items_sync_out_doc, ballot_returned_sync_out_doc, \
candidate_retrieve_doc, \
candidates_retrieve_doc, ca... | {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/views/views_docs.py",
"copies": "1",
"size": "53318",
"license": "mit",
"hash": 867474051103411000,
"line_mean": 41.0488958991,
"line_max": 127,
"alpha_frac": 0.7268652238,
"autogenerated": false,
"ratio": 3.1463472205830283,
"config_t... |
# apis_v1/views/views_docs.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from apis_v1.documentation_source import \
activity_comment_save_doc, activity_list_retrieve_doc, activity_notice_list_retrieve_doc, activity_post_save_doc,\
all_ballot_items_retrieve_doc, \
analytics_action_sync_ou... | {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/views/views_docs.py",
"copies": "1",
"size": "76395",
"license": "mit",
"hash": 2298719904206964000,
"line_mean": 41.1373414231,
"line_max": 125,
"alpha_frac": 0.7271287388,
"autogenerated": false,
"ratio": 3.1682080205698173,
"config_test":... |
# apis_v1/views/views_donation.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from config.base import get_environment_variable
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from stripe_donations.controllers import donation_lists_for_a_voter
from stripe_donat... | {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/views/views_donation.py",
"copies": "1",
"size": "17165",
"license": "mit",
"hash": -4381624226390850600,
"line_mean": 42.7882653061,
"line_max": 118,
"alpha_frac": 0.6415962715,
"autogenerated": false,
"ratio": 3.3796022839141564,
"config_t... |
# apis_v1/views/views_donaton.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from config.base import get_environment_variable
from django.http import HttpResponse
from donate.controllers import donation_with_stripe_for_api, donation_process_stripe_webhook_event, \
donation_refund_for_api, donation... | {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/views/views_donation.py",
"copies": "1",
"size": "6079",
"license": "mit",
"hash": 6366485263024015000,
"line_mean": 36.2944785276,
"line_max": 110,
"alpha_frac": 0.6451719033,
"autogenerated": false,
"ratio": 3.522016222479722,
"confi... |
# apis_v1/views/views_election.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from config.base import get_environment_variable
from django.http import HttpResponse
from election.controllers import elections_retrieve_for_api, elections_sync_out_list_for_api
import json
import wevote_functions.admin
fro... | {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/views/views_election.py",
"copies": "1",
"size": "2601",
"license": "mit",
"hash": 7318285440672759000,
"line_mean": 43.8448275862,
"line_max": 112,
"alpha_frac": 0.6574394464,
"autogenerated": false,
"ratio": 3.477272727272727,
"config_test... |
# apis_v1/views/views_extension.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
import boto3
import datetime
import json
import os
import subprocess
import urllib.request
from django.http import HttpResponse
import wevote_functions.admin
from config.base import get_environment_variable
from wevote_func... | {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/views/views_extension.py",
"copies": "1",
"size": "5125",
"license": "mit",
"hash": -5092679917792189000,
"line_mean": 37.2462686567,
"line_max": 126,
"alpha_frac": 0.6565853659,
"autogenerated": false,
"ratio": 3.260178117048346,
"config_te... |
# apis_v1/views/views_facebook.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from config.base import get_environment_variable
from django.http import HttpResponse
from import_export_facebook.controllers import facebook_disconnect_for_api, \
voter_facebook_save_to_current_account_for_api, facebook... | {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/views/views_facebook.py",
"copies": "2",
"size": "2851",
"license": "mit",
"hash": -3950832712307516000,
"line_mean": 40.3188405797,
"line_max": 115,
"alpha_frac": 0.6787092248,
"autogenerated": false,
"ratio": 3.5906801007556677,
"config_te... |
# apis_v1/views/views_friend.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from config.base import get_environment_variable
from django.http import HttpResponse
from friend.controllers import friend_invitation_by_email_send_for_api, friend_invitation_by_email_verify_for_api, \
friend_invitation_b... | {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/views/views_friend.py",
"copies": "1",
"size": "9697",
"license": "mit",
"hash": -959730269688284000,
"line_mean": 50.579787234,
"line_max": 119,
"alpha_frac": 0.6143137053,
"autogenerated": false,
"ratio": 3.5197822141560797,
"config_... |
# apis_v1/views/views_measure.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from config.base import get_environment_variable
from django.http import HttpResponse
import json
from measure.controllers import add_measure_name_alternatives_to_measure_list_light, measure_retrieve_for_api, \
retrieve_m... | {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/views/views_measure.py",
"copies": "1",
"size": "2317",
"license": "mit",
"hash": -2015509019839633,
"line_mean": 41.1272727273,
"line_max": 112,
"alpha_frac": 0.6685369012,
"autogenerated": false,
"ratio": 3.6146645865834635,
"config_test":... |
# apis_v1/views/views_misc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from config.base import get_environment_variable
from django.http import HttpResponse
import json
from measure.controllers import measure_retrieve_for_api
from office.controllers import office_retrieve_for_api
from quick_info.co... | {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/views/views_misc.py",
"copies": "1",
"size": "4233",
"license": "mit",
"hash": -5662861473171419000,
"line_mean": 38.1944444444,
"line_max": 109,
"alpha_frac": 0.655090952,
"autogenerated": false,
"ratio": 3.4810855263157894,
"config_t... |
# apis_v1/views/views_misc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from config.base import get_environment_variable
from django.http import HttpResponse
import json
import sys
from office.controllers import office_retrieve_for_api
from quick_info.controllers import quick_info_retrieve_for_api
f... | {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/views/views_misc.py",
"copies": "1",
"size": "6705",
"license": "mit",
"hash": -6481073472814796000,
"line_mean": 41.9807692308,
"line_max": 119,
"alpha_frac": 0.6521998509,
"autogenerated": false,
"ratio": 3.4940072954663886,
"config_test":... |
# apis_v1/views/views_organization.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from follow.models import UPDATE_SUGGESTIONS_FROM_TWITTER_IDS_I_FOLLOW, UPDATE_SUGGESTIONS_FROM_WHAT_FRIENDS_FOLLOW, \
UPDATE_SUGGESTIONS_FROM_WHAT_FRIENDS_FOLLOW_ON_TWITTER, UPDATE_SUGGESTIONS_FROM_WHAT_FRIEND_FOLLO... | {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/views/views_organization.py",
"copies": "1",
"size": "15026",
"license": "mit",
"hash": 6730277787073531000,
"line_mean": 56.7923076923,
"line_max": 118,
"alpha_frac": 0.671169972,
"autogenerated": false,
"ratio": 3.853808668889459,
"c... |
# apis_v1/views/views_organization.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from issue.models import *
from config.base import get_environment_variable
from django.http import HttpResponse
import json
from issue.controllers import retrieve_issues_not_linked_to_organization_for_api, \
retriev... | {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/views/views_issues.py",
"copies": "2",
"size": "4758",
"license": "mit",
"hash": -6043446872625550000,
"line_mean": 42.6513761468,
"line_max": 111,
"alpha_frac": 0.6862126944,
"autogenerated": false,
"ratio": 3.4378612716763004,
"config_test... |
# apis_v1/views/views_pledge_to_vote.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from config.base import get_environment_variable
from django.http import HttpResponse
import json
from pledge_to_vote.controllers import pledge_to_vote_with_voter_guide_for_api
import wevote_functions.admin
from wevot... | {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/views/views_pledge_to_vote.py",
"copies": "2",
"size": "2766",
"license": "mit",
"hash": 311591141984737540,
"line_mean": 42.9047619048,
"line_max": 116,
"alpha_frac": 0.6160520607,
"autogenerated": false,
"ratio": 3.3405797101449277,
... |
# apis_v1/views/views_position.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from config.base import get_environment_variable
from django.http import HttpResponse
import json
from ballot.controllers import figure_out_google_civic_election_id_voter_is_watching
from ballot.models import OFFICE, CANDIDA... | {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/views/views_position.py",
"copies": "1",
"size": "20860",
"license": "mit",
"hash": 7985455592691340000,
"line_mean": 44.6455142232,
"line_max": 119,
"alpha_frac": 0.6555129434,
"autogenerated": false,
"ratio": 3.193508879363135,
"config_tes... |
# apis_v1/views/views_share.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from share.controllers import shared_item_retrieve_for_api, shared_item_save_for_api
from config.base import get_environment_variable
from django.http import HttpResponse
from django_user_agents.utils import get_user_agent
impo... | {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/views/views_share.py",
"copies": "1",
"size": "3228",
"license": "mit",
"hash": -182025012795226000,
"line_mean": 51.064516129,
"line_max": 103,
"alpha_frac": 0.720260223,
"autogenerated": false,
"ratio": 3.2377131394182546,
"config_test": f... |
# apis_v1/views/views_task.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from datetime import datetime, timedelta
import dateutil.parser
import json
import pytz
import requests as python_requests
import subprocess
from django.http import HttpResponse
from background_task import background
from conf... | {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/views/views_task.py",
"copies": "1",
"size": "6003",
"license": "mit",
"hash": -4059705618453515300,
"line_mean": 33.5,
"line_max": 118,
"alpha_frac": 0.6430118274,
"autogenerated": false,
"ratio": 3.55207100591716,
"config_test": false,
"... |
# apis_v1/views/views_twitter.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from config.base import get_environment_variable
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from import_export_twitter.controllers import twitter_identity_retrieve_for_api, ... | {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/views/views_twitter.py",
"copies": "1",
"size": "14214",
"license": "mit",
"hash": 8815026310988910000,
"line_mean": 48.5261324042,
"line_max": 118,
"alpha_frac": 0.6167862671,
"autogenerated": false,
"ratio": 3.659629248197734,
"config_test... |
# apis_v1/views/views_voter_guide.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from ballot.controllers import choose_election_from_existing_data
from config.base import get_environment_variable
from django.http import HttpResponse
import json
from voter.models import VoterAddress, VoterAddressManag... | {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/views/views_voter_guide.py",
"copies": "1",
"size": "10569",
"license": "mit",
"hash": 2425666245986255000,
"line_mean": 57.0714285714,
"line_max": 117,
"alpha_frac": 0.6836976062,
"autogenerated": false,
"ratio": 3.3755988502076013,
"... |
# apis_v1/views/views_voter_guide.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from ballot.controllers import choose_election_from_existing_data
from django.http import HttpResponse
import json
from api_internal_cache.models import ApiInternalCacheManager
from position.models import FRIENDS_AND_PUB... | {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/views/views_voter_guide.py",
"copies": "1",
"size": "20752",
"license": "mit",
"hash": -4363824848264682500,
"line_mean": 54.1914893617,
"line_max": 117,
"alpha_frac": 0.6957883577,
"autogenerated": false,
"ratio": 3.4081129906388568,
"confi... |
# apis_v1/views/views_voter.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from apis_v1.controllers import voter_count
from ballot.controllers import choose_election_and_prepare_ballot_data,voter_ballot_items_retrieve_for_api, \
voter_ballot_list_retrieve_for_api
from ballot.models import BallotI... | {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/views/views_voter.py",
"copies": "1",
"size": "152099",
"license": "mit",
"hash": 1745390494599923000,
"line_mean": 51.5203729282,
"line_max": 120,
"alpha_frac": 0.6126667499,
"autogenerated": false,
"ratio": 3.7147148613994383,
"config_test... |
# apis_v1/views/views_voter.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from apis_v1.controllers import voter_count
from ballot.controllers import voter_ballot_items_retrieve_for_api
from ballot.models import copy_existing_ballot_items_from_stored_ballot
from config.base import get_environment_var... | {
"repo_name": "jainanisha90/WeVoteServer",
"path": "apis_v1/views/views_voter.py",
"copies": "1",
"size": "93668",
"license": "mit",
"hash": 2277234212951619000,
"line_mean": 48.6912466844,
"line_max": 120,
"alpha_frac": 0.6177349789,
"autogenerated": false,
"ratio": 3.615408368071638,
"config_... |
# apis_v1/views/views_voter.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from config.base import get_environment_variable
from reaction.controllers import reaction_like_count_for_api, voter_reaction_like_off_save_for_api, \
voter_reaction_like_on_save_for_api, reaction_like_status_retrieve_for_... | {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/views/views_reaction.py",
"copies": "1",
"size": "3253",
"license": "mit",
"hash": 5483287004495386000,
"line_mean": 46.1449275362,
"line_max": 116,
"alpha_frac": 0.7098063326,
"autogenerated": false,
"ratio": 3.0573308270676693,
"config_tes... |
# apis_v1/views/views_voter_utils.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from config.base import get_environment_variable
from voter.models import VoterDeviceLinkManager, VoterManager
from voter_guide.controllers import voter_follow_all_organizations_followed_by_organization_for_api
import w... | {
"repo_name": "wevote/WeVoteServer",
"path": "apis_v1/views/views_voter_utils.py",
"copies": "1",
"size": "1638",
"license": "mit",
"hash": 1355742992215018000,
"line_mean": 39.95,
"line_max": 103,
"alpha_frac": 0.6984126984,
"autogenerated": false,
"ratio": 3.269461077844311,
"config_test": fa... |
"""API testing."""
try:
from mock import Mock
except:
# python3
from unittest.mock import Mock
from flask import Flask, abort, make_response, request, url_for
from flask import __version__ as flask_version
from flask.json import loads
from flask_resteasy import Api, ApiResponse, Resource, JSONResponse, unpa... | {
"repo_name": "jidn/flask-resteasy",
"path": "tests/test_api.py",
"copies": "1",
"size": "14587",
"license": "apache-2.0",
"hash": 5744709129054726000,
"line_mean": 32.0770975057,
"line_max": 80,
"alpha_frac": 0.5414410091,
"autogenerated": false,
"ratio": 4.028445180889257,
"config_test": true... |
# api/tests/base_case.py
import os.path
import unittest
import json
from api import create_app, db
from api.models import User
bucketlists_data = [
'Swimming',
'Reading',
'Travelling',
'Philanthropy',
'Reading',
'Spiritual Enlightment',
'Open Source Contribution',
'Charity',
'Get M... | {
"repo_name": "Mbarak-Mbigo/cp2_bucketlist",
"path": "api/tests/base_case.py",
"copies": "1",
"size": "2986",
"license": "mit",
"hash": 4292362255340314600,
"line_mean": 27.7115384615,
"line_max": 71,
"alpha_frac": 0.5833891494,
"autogenerated": false,
"ratio": 3.7001239157372985,
"config_test"... |
"""API tests"""
from email.utils import formataddr
import pytest
from mail.api import (
context_for_user,
safe_format_recipients,
render_email_templates,
send_messages,
messages_for_recipients,
)
from open_discussions.factories import UserFactory
from open_discussions.test_utils import any_instance... | {
"repo_name": "mitodl/open-discussions",
"path": "mail/api_test.py",
"copies": "1",
"size": "4679",
"license": "bsd-3-clause",
"hash": -6304059307296625000,
"line_mean": 29.1870967742,
"line_max": 88,
"alpha_frac": 0.5883735841,
"autogenerated": false,
"ratio": 3.9485232067510547,
"config_test"... |
"""API tests"""
from email.utils import formataddr
import pytest
from mail.v2.api import (
context_for_user,
safe_format_recipients,
render_email_templates,
send_messages,
messages_for_recipients,
build_messages,
build_user_specific_messages,
build_message,
UserMessageProps,
Ema... | {
"repo_name": "mitodl/bootcamp-ecommerce",
"path": "mail/v2/api_test.py",
"copies": "1",
"size": "9775",
"license": "bsd-3-clause",
"hash": -2535375619078276000,
"line_mean": 33.5406360424,
"line_max": 102,
"alpha_frac": 0.6212787724,
"autogenerated": false,
"ratio": 3.796116504854369,
"config_... |
"""API tests.
"""
import io
import os
from pathlib import Path
import pytest
import rarfile
#
# test start
#
def test_not_rar():
with pytest.raises(rarfile.NotRarFile):
rarfile.RarFile("rarfile.py", "r")
with pytest.raises(rarfile.NotRarFile):
with open("rarfile.py", "rb") as f:
... | {
"repo_name": "markokr/rarfile",
"path": "test/test_api.py",
"copies": "1",
"size": "10216",
"license": "isc",
"hash": 226486897763476580,
"line_mean": 28.7842565598,
"line_max": 104,
"alpha_frac": 0.6072826938,
"autogenerated": false,
"ratio": 2.8891402714932126,
"config_test": true,
"has_no... |
# api/tests/test_resource_bucketlist.py
import json
from api.tests.base_case import BucketBaseCase, bucketlists_data
new_bucketlist = {
'name': 'Bucketlist_1'
}
update_bucket_list = {
'name': 'My_Bucketlist_1 '
}
new_bucket_item = {
'name' : "Visit a children's home"
}
invalid_token = {
'auth_toke... | {
"repo_name": "Mbarak-Mbigo/cp2_bucketlist",
"path": "api/tests/test_resource_bucketlist.py",
"copies": "1",
"size": "10835",
"license": "mit",
"hash": -7075993557204231000,
"line_mean": 37.2862190813,
"line_max": 107,
"alpha_frac": 0.5971389017,
"autogenerated": false,
"ratio": 3.934277414669571... |
"""API to access and modify traffic data records.
"""
import base64
import datetime
try:
from urllib.parse import urljoin, urlencode, parse_qs
except ImportError:
from urlparse import urljoin, parse_qs
from urllib import urlencode
import uuid
from flask import *
import six
from sqlalchemy import func
from... | {
"repo_name": "rjw57/trafficdb",
"path": "trafficdb/blueprint/api.py",
"copies": "1",
"size": "15044",
"license": "mit",
"hash": 545257173108239940,
"line_mean": 32.806741573,
"line_max": 102,
"alpha_frac": 0.640720553,
"autogenerated": false,
"ratio": 3.7136509503826214,
"config_test": false,
... |
"""API to persist and read upload data metrics"""
import os
import sqlite3
DATABASE_FILENAME = os.path.expanduser('~/pypic.db')
def create_upload_table():
"""Create the necessary database objects for upload monitoring and
persistent data regarding all things video uploads
"""
db_connection = sqlite... | {
"repo_name": "tstringer/pypic",
"path": "data/upload.py",
"copies": "1",
"size": "1228",
"license": "mit",
"hash": 8118761760214176000,
"line_mean": 27.5581395349,
"line_max": 73,
"alpha_frac": 0.5960912052,
"autogenerated": false,
"ratio": 4.401433691756273,
"config_test": false,
"has_no_ke... |
# api to remote mysql web server
import logging
from .utils.SpiderUrlApi import SpiderUrlApi
from . import defaults
from .logger import sm_log
def get_mysql_from_settings(settings):
"""Returns a mysql client instance from given Scrapy settings object.
This function uses ``get_client`` to instantiate the clie... | {
"repo_name": "mavarick/scrapy-mysql",
"path": "scrapy_mysql/connection.py",
"copies": "1",
"size": "2486",
"license": "mit",
"hash": 7263601706212468000,
"line_mean": 25.7311827957,
"line_max": 100,
"alpha_frac": 0.6166532582,
"autogenerated": false,
"ratio": 4.1433333333333335,
"config_test":... |
"""API to the genotype store"""
import logging
from datetime import datetime
from typing import Optional
from alchy import Manager
from sqlalchemy import func, or_
from genotype.store.models import SNP, Analysis, Genotype, Model, Plate, Sample
log = logging.getLogger(__name__)
def connect(uri: str) -> Manager:
... | {
"repo_name": "Clinical-Genomics/taboo",
"path": "genotype/store/api.py",
"copies": "1",
"size": "7126",
"license": "mit",
"hash": 4028818856359431700,
"line_mean": 29.0675105485,
"line_max": 99,
"alpha_frac": 0.6595565535,
"autogenerated": false,
"ratio": 3.827067669172932,
"config_test": fals... |
# API upgrade business logic.
import copy
import re
from tools.api_proto_plugin import traverse
from tools.api_proto_plugin import visitor
from tools.protoxform import options
from tools.protoxform import utils
from envoy.annotations import resource_pb2
from udpa.annotations import migrate_pb2
from google.api import... | {
"repo_name": "jrajahalme/envoy",
"path": "tools/protoxform/migrate.py",
"copies": "3",
"size": "10627",
"license": "apache-2.0",
"hash": 6613400925035987000,
"line_mean": 41.3386454183,
"line_max": 112,
"alpha_frac": 0.6876823186,
"autogenerated": false,
"ratio": 3.6121685927940175,
"config_te... |
"""api URL Configuration
from rest_framework.urlpatterns import format_suffix_patterns
from snippets import views
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import v... | {
"repo_name": "dominicneeraj/Technex_api",
"path": "api/urls.py",
"copies": "1",
"size": "1321",
"license": "mit",
"hash": -4594076713696050000,
"line_mean": 37.8823529412,
"line_max": 77,
"alpha_frac": 0.6858440575,
"autogenerated": false,
"ratio": 3.5510752688172045,
"config_test": false,
"... |
"""api URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based ... | {
"repo_name": "jaconsta/soat_cnpx",
"path": "api/api/urls.py",
"copies": "1",
"size": "1154",
"license": "mit",
"hash": 7905527873555374000,
"line_mean": 31.9714285714,
"line_max": 79,
"alpha_frac": 0.7183708839,
"autogenerated": false,
"ratio": 3.4142011834319526,
"config_test": false,
"has_... |
"""api URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based ... | {
"repo_name": "micnigh/django-react-todo-app",
"path": "api/project/urls.py",
"copies": "1",
"size": "1119",
"license": "mit",
"hash": 307737744846847500,
"line_mean": 32.9090909091,
"line_max": 79,
"alpha_frac": 0.7068811439,
"autogenerated": false,
"ratio": 3.4220183486238533,
"config_test": ... |
"""api URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based v... | {
"repo_name": "HPI-DeepLearning/CaptchaService",
"path": "server/api/urls.py",
"copies": "1",
"size": "1350",
"license": "mit",
"hash": 8601334276148616000,
"line_mean": 44,
"line_max": 113,
"alpha_frac": 0.7,
"autogenerated": false,
"ratio": 3.5340314136125652,
"config_test": false,
"has_no_... |
"""api URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based v... | {
"repo_name": "apiaas/drawer-api",
"path": "api/urls.py",
"copies": "1",
"size": "1453",
"license": "apache-2.0",
"hash": 7720042213109682000,
"line_mean": 35.35,
"line_max": 83,
"alpha_frac": 0.7068134893,
"autogenerated": false,
"ratio": 3.678481012658228,
"config_test": false,
"has_no_keyw... |
API_URL = "http://q.daskeyboard.com"
headers = {'Content-Type': 'application/json'}
data = {
"clientId": "",
"clientSecret": "",
"grantType": "client_credentials"
}
# result = requests.post(API_URL + "/oauth/1.3/token", json=data, headers=headers)
# access_token = result.json()["access_token"]
from pprin... | {
"repo_name": "bertrandvidal/stuff",
"path": "5q/py5q.py",
"copies": "1",
"size": "1214",
"license": "unlicense",
"hash": -2259019662857294000,
"line_mean": 26.5909090909,
"line_max": 98,
"alpha_frac": 0.6326194399,
"autogenerated": false,
"ratio": 3.145077720207254,
"config_test": false,
"ha... |
api_url = "https://api.robinhood.com"
def login():
return api_url + "/oauth2/token/"
def logout():
return api_url + "/oauth2/revoke_token/"
def investment_profile():
return api_url + "/user/investment_profile/"
def accounts():
return api_url + "/accounts/"
def ach(option):
'''
Combination o... | {
"repo_name": "MeheLLC/Robinhood",
"path": "Robinhood/endpoints.py",
"copies": "1",
"size": "2709",
"license": "mit",
"hash": 4033072038718945300,
"line_mean": 26.6428571429,
"line_max": 195,
"alpha_frac": 0.661498708,
"autogenerated": false,
"ratio": 3.3444444444444446,
"config_test": false,
... |
API_URL = 'https://www.tsd-aff.com/cgi-bin/xml_core.exe'
EXT_START_SESSION_URL = 'https://www.tsd-aff.com/cgi-bin/xml_start_session.exe'
DATE_SLUG_MAP = (
{
'slug': 'today',
'auto_date': 'today_only',
},
{
'slug': 'this-week',
'auto_date': 'next_week',
}
)
AUTO_DATE_RAN... | {
"repo_name": "graingert/pyticketswitch",
"path": "pyticketswitch/settings.py",
"copies": "2",
"size": "1146",
"license": "mit",
"hash": -8533405353884759000,
"line_mean": 23.3829787234,
"line_max": 79,
"alpha_frac": 0.6579406632,
"autogenerated": false,
"ratio": 2.5076586433260393,
"config_tes... |
"""API urls for password recovery
"""
from pulsar.api import MethodNotAllowed
from lux.core import AuthenticationError
from lux.models import Schema, fields, ValidationError
from lux.ext.rest import RestRouter, route
from .registrations import (
RegistrationModel, PasswordSchema, RegistrationSchema
)
from . impor... | {
"repo_name": "quantmind/lux",
"path": "lux/ext/auth/rest/passwords.py",
"copies": "1",
"size": "3131",
"license": "bsd-3-clause",
"hash": 1145919485363786000,
"line_mean": 30.31,
"line_max": 79,
"alpha_frac": 0.6416480358,
"autogenerated": false,
"ratio": 4.584187408491947,
"config_test": fals... |
#API Usage Example
#==========
#To use: Modify the fqdn, username, and password
import isilon
import time
import logging
def main():
fqdn = '192.168.167.101' #change to your cluster
username = 'root'
password = 'a'
#httplib.HTTPConnection.debuglevel = 1
logging.basicConfig()
logging.getLog... | {
"repo_name": "sile16/python-isilon-api",
"path": "api_example.py",
"copies": "2",
"size": "2181",
"license": "mit",
"hash": 2339419487736192000,
"line_mean": 27.904109589,
"line_max": 103,
"alpha_frac": 0.6795048143,
"autogenerated": false,
"ratio": 3.4024960998439937,
"config_test": true,
"... |
"""API utility functions.
Version Added:
3.0
"""
from __future__ import unicode_literals
from rbtools.api.client import RBClient
from reviewbot import get_version_string
from reviewbot.config import config
def get_api_root(url, username=None, api_token=None, session=None):
"""Return the root of the Review... | {
"repo_name": "reviewboard/ReviewBot",
"path": "bot/reviewbot/utils/api.py",
"copies": "1",
"size": "1300",
"license": "mit",
"hash": 6148282321621236000,
"line_mean": 25.5306122449,
"line_max": 69,
"alpha_frac": 0.6053846154,
"autogenerated": false,
"ratio": 4.436860068259386,
"config_test": f... |
"""ApiUtil.py - Utilities for RESTful APIs"""
from flask import current_app
# Base messages, allowing for future localization of API error messages
API_REQUIRES_JSON = 'All PUT/POST API requests require JSON, and this request did not'
API_REQUIRES_FIELDS = 'Must provide {} for this API'
API_CREATE_EXISTS = '{} with {}... | {
"repo_name": "Wittle-South-LLC/base",
"path": "server/src/APIs/ApiUtil.py",
"copies": "1",
"size": "2275",
"license": "mit",
"hash": 1907345172425065200,
"line_mean": 40.3636363636,
"line_max": 90,
"alpha_frac": 0.6338461538,
"autogenerated": false,
"ratio": 3.888888888888889,
"config_test": f... |
""" API v0 URLs. """
from django.conf.urls import url
from django.urls import path
from .views import (
EchoDataView,
ResponseViewSet,
ErrorViewSet,
GenReportView,
CourseReportViewSet,
HealthCheck,
OnboardingStatus,
OnboardingBpAnalysis,
BestPracticeCreate,
BestPracticeUpload,
... | {
"repo_name": "cjlee112/socraticqs2",
"path": "mysite/api/v0/urls.py",
"copies": "1",
"size": "1505",
"license": "apache-2.0",
"hash": -3960347761718940000,
"line_mean": 25.4035087719,
"line_max": 112,
"alpha_frac": 0.5900332226,
"autogenerated": false,
"ratio": 3.351893095768374,
"config_test"... |
# /api/v1/dataresource/
# auth
# url(r'^new/', views.create_dataset),
# url(r'^(?P<slug>[a-z0-9\-/]+)/schema/', views.schema),
# url(r'^(?P<slug>[a-z0-9\-/]+)/query/(?P<x1>[0-9\-.]+),(?P<y1>[0-9\-.]+),(?P<x2>[0-9\-.]+),(?P<y2>[0-9\-.]+)/',
# views.query),
# url(r'^(?P<slug>[a-z0-9\-/]+)/query/', views.query),
# url... | {
"repo_name": "hydroshare/hydroshare_temp",
"path": "ga_resources/tests/http_tests.py",
"copies": "2",
"size": "20491",
"license": "bsd-3-clause",
"hash": -5066294926264110000,
"line_mean": 37.0892193309,
"line_max": 112,
"alpha_frac": 0.4114489288,
"autogenerated": false,
"ratio": 4.480865952328... |
# API v1
import logging
from django.conf import settings
from django.contrib import auth, messages
from django.contrib.auth.decorators import login_required
from django.shortcuts import get_object_or_404
from django.urls import reverse, reverse_lazy
from django.utils.decorators import method_decorator
from django.view... | {
"repo_name": "dotKom/onlineweb4",
"path": "apps/shop/views.py",
"copies": "1",
"size": "7097",
"license": "mit",
"hash": 2935421780059293000,
"line_mean": 36.935828877,
"line_max": 112,
"alpha_frac": 0.6857908091,
"autogenerated": false,
"ratio": 4.0011280315848845,
"config_test": false,
"ha... |
"""API v1 routes for builds."""
from __future__ import annotations
from typing import TYPE_CHECKING, Dict, Tuple
from flask import jsonify, request
from flask_accept import accept_fallback
from keeper.api import api
from keeper.auth import permission_required, token_auth
from keeper.logutils import log_route
from k... | {
"repo_name": "lsst-sqre/ltd-keeper",
"path": "keeper/api/builds.py",
"copies": "1",
"size": "8057",
"license": "mit",
"hash": -3218584869562538500,
"line_mean": 28.5128205128,
"line_max": 79,
"alpha_frac": 0.6368375326,
"autogenerated": false,
"ratio": 3.694176983035305,
"config_test": false,
... |
"""API v1 routes for Editions."""
from __future__ import annotations
from typing import TYPE_CHECKING, Dict, Tuple
from flask import jsonify, request
from flask_accept import accept_fallback
from keeper.api import api
from keeper.auth import permission_required, token_auth
from keeper.logutils import log_route
from... | {
"repo_name": "lsst-sqre/ltd-keeper",
"path": "keeper/api/editions.py",
"copies": "1",
"size": "14022",
"license": "mit",
"hash": 4452582215047378400,
"line_mean": 32.1489361702,
"line_max": 79,
"alpha_frac": 0.6430609043,
"autogenerated": false,
"ratio": 3.6803149606299215,
"config_test": fals... |
"""API v1 routes for products."""
from __future__ import annotations
from typing import Dict, Tuple
from flask import jsonify, request
from flask_accept import accept_fallback
from keeper.api import api
from keeper.auth import permission_required, token_auth
from keeper.logutils import log_route
from keeper.models ... | {
"repo_name": "lsst-sqre/ltd-keeper",
"path": "keeper/api/products.py",
"copies": "1",
"size": "11177",
"license": "mit",
"hash": 3300125539110220000,
"line_mean": 30.5734463277,
"line_max": 79,
"alpha_frac": 0.6440010736,
"autogenerated": false,
"ratio": 3.6742274819197895,
"config_test": fals... |
"""API v2 tests."""
from django.urls import reverse
from modoboa.admin import factories as admin_factories
from modoboa.admin import models as admin_models
from modoboa.dnstools import factories
from modoboa.lib.tests import ModoAPITestCase
class DNSViewSetTestCase(ModoAPITestCase):
@classmethod
def setUpT... | {
"repo_name": "modoboa/modoboa",
"path": "modoboa/dnstools/api/v2/tests.py",
"copies": "1",
"size": "1474",
"license": "isc",
"hash": -8027733014501985000,
"line_mean": 34.0952380952,
"line_max": 70,
"alpha_frac": 0.6153324288,
"autogenerated": false,
"ratio": 3.639506172839506,
"config_test": ... |
"""API v2 tests."""
from django.urls import reverse
from rest_framework.authtoken.models import Token
from modoboa.admin import factories, models
from modoboa.core import models as core_models
from modoboa.lib.tests import ModoAPITestCase
class DomainViewSetTestCase(ModoAPITestCase):
@classmethod
def setU... | {
"repo_name": "modoboa/modoboa",
"path": "modoboa/admin/api/v2/tests.py",
"copies": "1",
"size": "7006",
"license": "isc",
"hash": -9328286895874996,
"line_mean": 33.5123152709,
"line_max": 77,
"alpha_frac": 0.5977733371,
"autogenerated": false,
"ratio": 3.7585836909871246,
"config_test": true,... |
"""API version 1.0 models.
api/models.py
"""
import datetime
import jwt
from flask_marshmallow import Marshmallow
from werkzeug.security import generate_password_hash, check_password_hash
from flask import current_app
from api import db
ma = Marshmallow()
class AddUpdateDelete():
def add(self, resource):
... | {
"repo_name": "Mbarak-Mbigo/cp2_bucketlist",
"path": "api/models.py",
"copies": "1",
"size": "3808",
"license": "mit",
"hash": 1702551584011660000,
"line_mean": 32.4035087719,
"line_max": 97,
"alpha_frac": 0.6294642857,
"autogenerated": false,
"ratio": 3.8936605316973414,
"config_test": false,
... |
API_VERSIONSTRING = "V3.7.1.16"
HS_OT_CallOptions = 'C'
HS_OT_PutOptions = 'P'
HS_EI_SSE = "1"
HS_EI_SZSE = "2"
HS_EI_CZCE = "F1"
HS_EI_DCE = "F2"
HS_EI_SHFE = "F3"
HS_EI_CFFEX = "F4"
HS_EI_INE = "F5"
HS_ET_Abandon = '0'
HS_ET_Exec = '1'
HS_CSI_CNSJC = "CNSJC"
HS_CSI_PXSJC = "PXSJC"
HS_CSI_PNSJC = "PNSJC"
HS_CSI_CXSJC ... | {
"repo_name": "vnpy/vnpy",
"path": "vnpy/api/uft/uft_constant.py",
"copies": "6",
"size": "3509",
"license": "mit",
"hash": 2599308808955940000,
"line_mean": 21.3503184713,
"line_max": 36,
"alpha_frac": 0.6414933029,
"autogenerated": false,
"ratio": 1.8342916884474647,
"config_test": false,
"... |
"""API Views and ViewSets"""
from django.conf import settings
from django.contrib.auth import get_user_model
from django.db.models.loading import get_models
from django.http import Http404
from django.utils import timezone
from django.utils.dateparse import parse_datetime
from djes.apps import indexable_registry
impo... | {
"repo_name": "pombredanne/django-bulbs",
"path": "bulbs/api/views.py",
"copies": "1",
"size": "19696",
"license": "mit",
"hash": 6770155719583608000,
"line_mean": 37.0967117988,
"line_max": 117,
"alpha_frac": 0.6468826158,
"autogenerated": false,
"ratio": 4.179966044142614,
"config_test": fals... |
"""API Views and ViewSets"""
import datetime
from django.http import StreamingHttpResponse
from django.utils import dateparse, timezone
from elasticsearch_dsl import filter as es_filter
from rest_framework import viewsets, routers, mixins
from rest_framework.settings import api_settings
from rest_framework_nested im... | {
"repo_name": "theonion/django-bulbs",
"path": "bulbs/contributions/views.py",
"copies": "1",
"size": "11927",
"license": "mit",
"hash": -8269935978208210000,
"line_mean": 35.9256965944,
"line_max": 99,
"alpha_frac": 0.6576674772,
"autogenerated": false,
"ratio": 3.9983238350653703,
"config_tes... |
"""API Views and ViewSets"""
import datetime
from django.utils import dateparse, timezone
from rest_framework import viewsets, routers, mixins
from rest_framework.settings import api_settings
from rest_framework_csv.renderers import CSVRenderer
from .models import ContributorRole, Contribution
from .serializers im... | {
"repo_name": "pombredanne/django-bulbs",
"path": "bulbs/contributions/views.py",
"copies": "1",
"size": "2901",
"license": "mit",
"hash": -5324259239207334000,
"line_mean": 34.3780487805,
"line_max": 160,
"alpha_frac": 0.6938986556,
"autogenerated": false,
"ratio": 3.9903713892709765,
"config_... |
"""API Views and ViewSets"""
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse
from django.conf import settings
from django.contrib.auth import get_user_model
from django.core.urlresolvers import resolve, Resolver404
from django.core.mail import EmailMessage
from django.... | {
"repo_name": "theonion/django-bulbs",
"path": "bulbs/api/views.py",
"copies": "1",
"size": "25841",
"license": "mit",
"hash": -7718534135161639000,
"line_mean": 37.6841317365,
"line_max": 100,
"alpha_frac": 0.6315545064,
"autogenerated": false,
"ratio": 4.220316838151233,
"config_test": false,... |
"""API viewsets."""
from rest_framework import filters, mixins, permissions, viewsets
from . import models
from . import serializers
class EmailProviderViewSet(viewsets.ModelViewSet):
"""ViewSet class for EmailProvider."""
filter_backends = (filters.SearchFilter, )
permission_classes = (
permis... | {
"repo_name": "modoboa/modoboa-imap-migration",
"path": "modoboa_imap_migration/viewsets.py",
"copies": "1",
"size": "1225",
"license": "isc",
"hash": -2822384685650824700,
"line_mean": 31.2368421053,
"line_max": 77,
"alpha_frac": 0.6751020408,
"autogenerated": false,
"ratio": 4.748062015503876,
... |
"""API viewsets test cases."""
from unittest import mock
from django.urls import reverse
from modoboa.admin import factories as admin_factories
from modoboa.lib.tests import ModoAPITestCase
from .. import models
class AccountViewSetTestCase(ModoAPITestCase):
"""Account viewset tests."""
@classmethod
... | {
"repo_name": "modoboa/modoboa",
"path": "modoboa/core/tests/test_viewsets.py",
"copies": "1",
"size": "2686",
"license": "isc",
"hash": -2888151352362224600,
"line_mean": 35.2972972973,
"line_max": 77,
"alpha_frac": 0.6567386448,
"autogenerated": false,
"ratio": 3.8591954022988504,
"config_tes... |
"""API Views for certificate generation"""
import io
import logging
import rest_framework
import zipfile
from django.conf import settings
from django.http import HttpResponse, HttpResponseNotFound
from django.views.generic import View
from rest_framework import generics, permissions
from rest_framework.pagination imp... | {
"repo_name": "repleo/bounca",
"path": "api/views.py",
"copies": "1",
"size": "9201",
"license": "apache-2.0",
"hash": -8457099899022678000,
"line_mean": 35.9518072289,
"line_max": 104,
"alpha_frac": 0.619932616,
"autogenerated": false,
"ratio": 4.263670064874884,
"config_test": true,
"has_no... |
"""API views for social_network."""
from rest_framework import viewsets
from rest_framework.decorators import api_view, detail_route
from rest_framework.response import Response
from rest_framework.reverse import reverse
from .models import Profile, Post, Vote
from .serializers import ProfileSerializer, PostSerialize... | {
"repo_name": "ctcusc/django-react-boilerplate",
"path": "server/social_network/views.py",
"copies": "1",
"size": "2245",
"license": "apache-2.0",
"hash": 574262935045386560,
"line_mean": 33.5384615385,
"line_max": 90,
"alpha_frac": 0.6690423163,
"autogenerated": false,
"ratio": 4.157407407407407... |
# api/views/mark.py
from flask import g
from flask.ext.restful import fields, marshal_with, reqparse, abort, marshal
from ..core.setup import Resource, auth, db
from ..core.customfields import TagList
from ..core.validators import validate_url
from ..models import Mark
mark_fields = {
'id': fields.Integer,
'... | {
"repo_name": "plastboks/Flaskmarks-API",
"path": "api/views/mark.py",
"copies": "1",
"size": "3156",
"license": "mit",
"hash": 7584735383102451000,
"line_mean": 31.875,
"line_max": 76,
"alpha_frac": 0.5719264892,
"autogenerated": false,
"ratio": 3.7437722419928825,
"config_test": false,
"has... |
"""API views."""
from django.conf import settings
from rest_framework import decorators, mixins, response, status, viewsets
from rest_framework.views import APIView
from .models import ModoboaInstance, ModoboaExtension
from .forms import ClientVersionForm
from . import constants
from . import models
from . import se... | {
"repo_name": "tonioo/modoboa-public-api",
"path": "modoboa_public_api/views.py",
"copies": "1",
"size": "4085",
"license": "mit",
"hash": -5763816079134920000,
"line_mean": 36.8240740741,
"line_max": 84,
"alpha_frac": 0.6249694002,
"autogenerated": false,
"ratio": 4.097291875626881,
"config_te... |
# API views
import os
import json
from query import parse_query
from interfaces.flickr import parse_interface_flickr
from django.http import HttpResponse
INTERFACE_DIR = os.path.abspath(os.path.dirname(__file__)) + '/interfaces/json/'
INTERFACES = ["university", "flickr", "weather"];
FLICKR_KEY = ["Yahoo", "pictures",... | {
"repo_name": "bezi/globalizr",
"path": "globalizr/api/views.py",
"copies": "1",
"size": "1088",
"license": "mit",
"hash": -7600003124083859000,
"line_mean": 40.8461538462,
"line_max": 109,
"alpha_frac": 0.6691176471,
"autogenerated": false,
"ratio": 3.296969696969697,
"config_test": false,
"... |
# api/views/profile.py
from flask import g
from flask.ext.restful import fields, marshal_with, reqparse, abort
from ..core.setup import Resource, auth, config
from ..models import User
from ..core.validators import validate_email
user_fields = {
'id': fields.Integer,
'username': fields.String,
'per_page':... | {
"repo_name": "plastboks/Flaskmarks-API",
"path": "api/views/profile.py",
"copies": "1",
"size": "2059",
"license": "mit",
"hash": 6053696413204733000,
"line_mean": 28.4142857143,
"line_max": 70,
"alpha_frac": 0.5633802817,
"autogenerated": false,
"ratio": 4.151209677419355,
"config_test": fals... |
# api/views/setting.py
from flask import g
from flask.ext.restful import fields, marshal_with, reqparse, abort
from ..core.setup import Resource, auth
import json
setting_fields = {
'name': fields.String,
'client': fields.String,
'json': fields.String,
'created': fields.DateTime,
'updated': field... | {
"repo_name": "plastboks/Flaskmarks-API",
"path": "api/views/setting.py",
"copies": "1",
"size": "2188",
"license": "mit",
"hash": 8721360821436905000,
"line_mean": 31.6567164179,
"line_max": 75,
"alpha_frac": 0.6192870201,
"autogenerated": false,
"ratio": 3.893238434163701,
"config_test": fals... |
# API with users and posts
import hashlib, uuid
import flask_gasket.control
# uses userID as additional salt
# uuid.uuid4().hex
salt = 'df67a20945b34119a39f7bbe37a3697f'
# len(uuid.uuid4().hex)
SIZE_ID = 32
def authorize(args):
serverDef = args['_all_models']['user']['_server']
recv = args['_recv']
conn = arg... | {
"repo_name": "dbunker/Flask-Gasket",
"path": "example/view.py",
"copies": "1",
"size": "4502",
"license": "bsd-3-clause",
"hash": -1515083914184472800,
"line_mean": 19.9441860465,
"line_max": 64,
"alpha_frac": 0.6674811195,
"autogenerated": false,
"ratio": 2.987392169873922,
"config_test": fal... |
# api wrapper for three.js
__pragma__ ('noanno')
def _ctor(obj):
def _c_(*args):
return __new__(obj (*args))
return _c_
api = __pragma__ ('js',
'{}',
'THREE'
)
WebGLRenderTargetCube = _ctor(api.WebGLRenderTargetCube)
WebGLRenderTarget = _ctor(api.WebGLRenderTarget)
WebGLRendere... | {
"repo_name": "QQuick/Transcrypt",
"path": "transcrypt/demos/pysteroids_demo/org/threejs/__init__.py",
"copies": "1",
"size": "17190",
"license": "apache-2.0",
"hash": 3954658747400767000,
"line_mean": 41.8520408163,
"line_max": 78,
"alpha_frac": 0.792495637,
"autogenerated": false,
"ratio": 2.84... |
"""APL 2.0 code from github.com/pkmital/tensorflow_tutorials w/ permission
from Parag K. Mital.
"""
import math
import tensorflow as tf
from tensorflow.python import control_flow_ops
def batch_norm(x, phase_train, scope='bn', affine=True):
"""
Batch normalization on convolutional maps.
from: https://stack... | {
"repo_name": "hpssjellis/forth-tensorflow",
"path": "tensorflow-tutorials/libs/connections.py",
"copies": "2",
"size": "3521",
"license": "mit",
"hash": -7156250542624844000,
"line_mean": 30.7207207207,
"line_max": 77,
"alpha_frac": 0.5609201931,
"autogenerated": false,
"ratio": 3.81887201735357... |
"""APL 2.0 code from github.com/pkmital/tensorflow_tutorials w/ permission
from Parag K. Mital.
"""
import math
import tensorflow as tf
def batch_norm(x, phase_train, scope='bn', affine=True):
"""
Batch normalization on convolutional maps.
from: https://stackoverflow.com/questions/33949786/how-could-i-
... | {
"repo_name": "apoorva-sharma/deep-frame-interpolation",
"path": "tensorflow_tutorials-master/python/libs/connections.py",
"copies": "3",
"size": "5006",
"license": "mit",
"hash": -5773513209197408000,
"line_mean": 29.5243902439,
"line_max": 79,
"alpha_frac": 0.5511386336,
"autogenerated": false,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.