seq_id string | text string | repo_name string | sub_path string | file_name string | file_ext string | file_size_in_byte int64 | program_lang string | lang string | doc_type string | stars int64 | dataset string | pt string | api list |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
21368105721 | from pages.search import SearchPage
from pages.results import ResultsPage
import pytest
@pytest.mark.parametrize('n', range(50))
def test_cat_search(driver, n):
search_page = SearchPage(driver)
search_page.open_page()
search_page.enter_search_phrase('cat')
results_page = ResultsPage(driver)
assert... | eugene-okulik/google-test | tests/test_search_cat.py | test_search_cat.py | py | 363 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "pages.search.SearchPage",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pages.results.ResultsPage",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 6,
"usage_type": "call"
},
{
"api_name"... |
10643532871 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 7 09:34:42 2017
@author: jacobfisher
"""
from nltk.tokenize import RegexpTokenizer
from stop_words import get_stop_words
from nltk.stem.porter import PorterStemmer
from gensim import corpora, models
en_stop = get_stop_words('en')
p_stemmer = Port... | devincornell/newsmedia-analysis | old_stuff/NYTLDA.py | NYTLDA.py | py | 1,274 | python | en | code | 1 | github-code | 70 | [
{
"api_name": "stop_words.get_stop_words",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "nltk.stem.porter.PorterStemmer",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "nltk.tokenize.RegexpTokenizer",
"line_number": 17,
"usage_type": "call"
},
{... |
28659323745 | import time
import usb.core
import libusbx1
from const_vars import *
from usb_misc import *
from usb_dl import *
from usb_generic import get_usb_dev_eps
from usb_probe import verify_im_ldr_usb
import configs
class ldr_update_worker(object):
def __init__(self, dlr_opts, dev_opts):
self.dlr_opts = dlr_opts
... | z7z8th/usb-img-dl | ldr_update_worker.py | ldr_update_worker.py | py | 2,310 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "configs.ram_loader_path",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "time.sleep",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "usb.core.core.find... |
12696102395 | import ply.lex as lex
# List of token names. This is always required
tokens = (
'NUMBER',
'PLUS',
'MINUS',
'TIMES',
'DIVIDE',
'LPAREN',
'RPAREN',
)
# Regular expression rules for simple tokens
t_PLUS = r'\+'
t_MINUS = r'-'
t_TIMES = r'\*'
t_DIVIDE = r'/'
t_LPAREN = r'\('
t_RPAREN = r'... | saeedark/yaccwp | test.py | test.py | py | 2,105 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "ply.lex.lex",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "ply.lex",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "ply.yacc.yacc",
"line_number": 101,
"usage_type": "call"
},
{
"api_name": "ply.yacc",
"line_number": 101,... |
17503310042 | from django.shortcuts import render, get_object_or_404
from django.core import serializers
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from django.urls import reverse
from . import models
from . import forms
def home(request):
context = {
'recipes': models.Recipe.... | vorg-san/apicbase_recipe_manager | recipe_manager/views.py | views.py | py | 5,780 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "django.shortcuts.render",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.get_object_or_404",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "django.http.HttpResponseRedirect",
"line_number": 47,
"usage_type": "call"
}... |
11907623133 | import aiofiles
import aiofiles.os
import aioshutil
import asyncio
import logging
import os
from pathlib import Path
import shutil
import time
import unittest
from unittest import mock
import yaml
from asyncinotify import Mask
from cputils.fsWatcher import FSWatcher, get_directories_recursive, mask2text
from tests.tes... | computePods/pythonUtils | tests/fsWatcher_tests.py | fsWatcher_tests.py | py | 4,958 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "logging.getLogger",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "unittest.TestCase",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "os.makedi... |
33329042615 | import json
from django.http import HttpResponse
from django.shortcuts import get_object_or_404, redirect, render
from django.contrib.auth import login, authenticate, logout
from django.contrib import messages
from django.contrib.auth.models import User
from .models import Profile
from .forms import registerForm
fro... | isayaeli/pastpral_social_media | userauth/views.py | views.py | py | 3,569 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "django.contrib.auth.authenticate",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.login",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "django.contrib.messages.success",
"line_number": 19,
"usage_type": "call"
},... |
72835201188 | from django.urls import path
from . import views
urlpatterns = [
path('', views.home, name='home'),
path('basic', views.basic, name='basic'),
path('datatypes', views.datatypes, name='datatypes'),
path('operators', views.operators, name='operators'),
path('conditionalstatements', views.con... | santhosh404/Python-app-quiz | QuizApp/urls.py | urls.py | py | 519 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
32505025760 | # --*-- coding: utf-8 --*--
# author: ZhangLe
# text processing and information extract task
# 2021.Sep.30
import pandas as pd
import emoji
from transformers import pipeline
import nltk
from nltk import word_tokenize, pos_tag
nltk.download('punkt')
nltk.download('averaged_perceptron_tagger')
nltk.download('universal... | ZhangLe59151/language-processing | main.py | main.py | py | 2,425 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "nltk.download",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "nltk.download",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "nltk.download",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "nltk.download",
"line_n... |
3957443872 | #! /usr/bin/env python3
#
# this is a deprecated version of the prose encoding script - use prose_encoding.py instead
# 1.2 has an annotation that literally says "Lemma annotation"
# 1.3 <ab> in the csv does not match anything in the text, because we remove the <> in the text.
# for now, I have removed them in the csv... | DigitalLatin/automation | python/full_encoding.py | full_encoding.py | py | 22,156 | python | en | code | 2 | github-code | 70 | [
{
"api_name": "codecs.open",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 44,... |
21149900994 | #!/usr/bin/env python3
from setuptools import setup, find_packages
with open('requirements.txt', 'r') as req_handle:
requirements = req_handle.read().splitlines()
with open('README.md', 'r') as readme_handle:
long_description = readme_handle.read()
setup(
name='pysotope',
version='0.2.2',
descri... | tarting/pysotope | setup.py | setup.py | py | 1,291 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "setuptools.setup",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 22,
"usage_type": "call"
}
] |
21580252501 | from re import L
import requests
import json
import random
import time
import base64
import logging
from datetime import datetime
class RestPost():
def __init__(self, url, user, password, logger = None):
"""initialize class"""
self.logger = logger or logging.getLogger(__name__)
self.url = ... | marto-karanja/Wordpress-GUI-Poster-program- | engine/rest_post.py | rest_post.py | py | 5,542 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "base64.b64encode",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "random.randint",
... |
20965307737 | # -*- coding: utf-8 -*-
import unittest
from time import sleep
import ddt
from framework.browser_engine import BrowserEngine
from pageobjects.catalog_page import DirectoryList
from pageobjects.shift_type_page import ShiftTypeList, Add, Alter, Del
from unit.excel import ExcelUtils
from unit.login import login
from uni... | peterQA/wfm_flow | testsuits/test_shift_type.py | test_shift_type.py | py | 5,732 | python | en | code | 1 | github-code | 70 | [
{
"api_name": "unit.excel.ExcelUtils",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "unit.excel.ExcelUtils",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "unit.excel.ExcelUtils",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "uni... |
988872782 | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
from bs4 import BeautifulSoup
import requests
import csv
from general import *
start_url_list = ["https://sacramento.craigslist.org/search/cpg?query=web%20developer&sort=date&is_paid=yes&searchNearby=2",
"https://sacramento.craigslist.org/search/cpg?que... | donavinhannon/web-scrape | main.py | main.py | py | 3,619 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "requests.get",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "requests.exceptions",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "requests.get"... |
18979380347 | import botocore
import boto3
import pandas
from collections import defaultdict
from argparse import ArgumentParser
aws_profiles = ["prod"]
aws_accounts = {
"staging" : ['098097435277'],
"prod" : ['098097435277'],
"china" : ["224803950515"]
}
aws_regions = {
"staging" : ['us-east-2'],
"prod" : ['ap... | ymaniukevich/AWS-tools | python.py | python.py | py | 5,115 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "botocore.exceptions",
"line_number": 62,
"usage_type": "attribute"
},
{
"api_name": "pandas.ExcelWriter",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "b... |
43929837654 | import os
import random
import numpy as np
import json
import time
import transformers as tfs
import torch
from torch import nn
from tqdm import tqdm
from model import create_model
import argparse
from sklearn.feature_extraction.text import CountVectorizer
from utils.split_data import load_data
softmax = nn.Softmax(di... | YashengFu/hw_text_classification | code/build_pu_data.py | build_pu_data.py | py | 6,718 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "torch.nn.Softmax",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "json.loads",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": ... |
38488949661 | from django.urls import path,include
from . import views
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
urlpatterns = [
path('', views.StatusListPageView.as_view(), name='status_list'),
path('<int:pk>/delete/', views.StatusDeletePageView.as_view(), name='status_delete'),
path('search/', v... | pol905/Airport-Ground-Management-System | airport/status/urls.py | urls.py | py | 752 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
31298490896 | # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
# controlamos las librerias que importamos
try:
# Uvicorn es un servidor web ASGI (interfaz de puerta de enlace de servidor asíncrono)
import uvicorn
# utilizamos la clase FastApi
... | alejpnovillog/FastApi-Curso-Completo | Respuesta_Header/useResponseParameter.py | useResponseParameter.py | py | 1,055 | python | uk | code | 0 | github-code | 70 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "fastapi.Response",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "uvicorn.run",
"line_number": 30,
"usage_type": "call"
}
] |
17226896456 | import numpy as np
import matplotlib.pyplot as plt
from seaborn import heatmap
import queue
import time
mazeOri = open("maze.txt", "r") #a file of 2601 row with each row having a single boolean value
matrix = [] #data structure is a list
for i in range(51):
row = [] #making each row in the maze a list by itself
... | Kenneth0528/MS1008_MazeFinding | A* Search Maze Project .py | A* Search Maze Project .py | py | 7,280 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "numpy.array",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "seaborn.heatma... |
27727513203 | import pytest
import numpy as np
import nnabla as nn
import nnabla.functions as F
import scipy.signal as sig
@pytest.mark.parametrize("window_size, stride, fft_size, window_type, center", [
(256, 128, 512, 'hamming', True),
(256, 128, 256, 'hanning', False),
])
def test_istft(window_size, stride, fft_size, wi... | cl886699/nnabla | python/test/function/test_stft.py | test_stft.py | py | 2,454 | python | en | code | null | github-code | 70 | [
{
"api_name": "nnabla.clear_parameters",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.random.randn",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "nnabla.V... |
35620306610 | import json
class Config:
def __init__(self, path):
self.confPath = path
self.loadConf()
self.writeConf()
def loadConf(self):
with open(self.confPath) as json_file:
data = json.load(json_file)
self.type = data['type']
self.cryptoAmount ... | Hakaczu/CryptoTrader | Config.py | Config.py | py | 879 | python | en | code | 1 | github-code | 70 | [
{
"api_name": "json.load",
"line_number": 13,
"usage_type": "call"
}
] |
10527626146 | import urllib
import urllib2
import json
def post_message_to_slack(message_text='a message from Satellite', channel='#content_satellite', username='Dr. Satellite', icon_emoji=':sol_2:'):
"""
message_text: the markup for the message body
channel: which channel should receive the message
refs:
https://slack.zendes... | ellenbowman/Satellite | content_satellite/satellite/slack_utils.py | slack_utils.py | py | 824 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "urllib.urlencode",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "urllib2.urlopen",
"line_number": 29,
"usage_type": "call"
}
] |
4737376936 | import tensorflow as tf
from datetime import datetime
import pytz
from src import utils
import numpy as np
import matplotlib.pyplot as plt
import io
class Time2Vec(tf.keras.layers.Layer):
def __init__(self, output_dims, name="time2vec"):
super(Time2Vec, self).__init__(name=name)
self.output_dims = ... | sdrft1251/PersonalStudy | jomjam/Python/AnomalyDetection/ECG/src/ae_rnn_attention.py | ae_rnn_attention.py | py | 14,203 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "tensorflow.keras",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.random_normal_initializer",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "tensorflow.zeros_initializer",
"line_number": 16,
"usage_type": "call"
},
{... |
6371250741 | from django.db import models
from django.contrib.auth.models import User
GENDER_MALE= 'Male'
GENDER_FEMALE= 'Female'
GENDER_OTHERS= 'Others'
GENDER_CHOICE=(
(GENDER_MALE,'Male'),
(GENDER_FEMALE, 'Female'),
(GENDER_OTHERS, 'Others'),
)
STATUS_PENDING = 'Pending'
STATUS_REJECTED = 'Rejected'
STATUS_ACC... | sanooptp/jobportal | candidates/models.py | models.py | py | 1,093 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "django.db.models.Model",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 24,
"usage_type": "call"
},
{
"api_name"... |
70998137828 | import torch.nn as nn
import torch
import torch.nn.functional as F
class SiMSE(nn.Module):
def __init__(self):
super().__init__()
def forward(self, shared, private):
n = torch.numel(shared)
loss = torch.cdist(shared, private, p=2).mean()
loss = loss / n
return loss
class diffLoss(nn.Module):
def __i... | choupingru/VAE-GAN-DANN-DSN-ADDA | utils/loss.py | loss.py | py | 2,391 | python | en | code | 1 | github-code | 70 | [
{
"api_name": "torch.nn.Module",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "torch.numel",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.cdist",
"line_numbe... |
43337203754 | import argparse
import re
from collections import defaultdict
import itertools as it
import math
from hashlib import md5
from advent_of_code import lib
from copy import deepcopy
import pdb
parser = argparse.ArgumentParser()
parser.add_argument("input")
parser.add_argument("part", type=int)
args = parser.p... | srdjankrstic/advent_of_code | 2016/14/sol.py | sol.py | py | 1,419 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "itertools.count",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "adven... |
5140392896 | #!/usr/bin/env python3
import subprocess
import time
import signal
import sys
import json
import requests
from colorama import Fore, Style
from tqdm import tqdm
def start_ngrok(port):
global ngrok_process
print(f"{Fore.GREEN}Démarrage du tunnel ngrok sur le port {port}...{Style.RESET_ALL}")
ngrok_process =... | Mickael-Salmon/QuickShare | quickShare.py | quickShare.py | py | 2,459 | python | fr | code | 0 | github-code | 70 | [
{
"api_name": "colorama.Fore.GREEN",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "colorama.Fore",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "colorama.Style.RESET_ALL",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "... |
43523432613 | # Welcome to
# __________ __ __ .__ __
# \______ \_____ _/ |__/ |_| | ____ ______ ____ _____ | | __ ____
# | | _/\__ \\ __\ __\ | _/ __ \ / ___// \\__ \ | |/ // __ \
# | | \ / __ \| | | | | |_\ ___/ \___ \| | \/ __ \| <\ ___/
# |__... | YongpengFu/BattleSnake | main_enhanced.py | main_enhanced.py | py | 14,190 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "typing.Dict",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "typing.Dict",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "typing.Dict",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "typing.Dict",
... |
12076108505 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: eman-saeed
"""
import numpy as np
import matplotlib.pyplot as plt
#python image library.
"""
PIL is a library that used for transformation of image
into an array that numpy can understand.
"""
from PIL import Image
"""
-> support the path of the image... | EmanSaeed331/ComputerVision | NumpywithImage/ImagesWithNumpy.py | ImagesWithNumpy.py | py | 1,083 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "PIL.Image.open",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "numpy.asarray",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.imshow",
... |
70167041507 | import logging
from .models import LogApiRequestsModel
logger = logging.getLogger(__name__)
class LogApiRequestsMiddleware:
"""
Writes API request history to DB
"""
def __init__(self, get_response):
self.get_response = get_response
def __call__(self, request):
response = self.ge... | zedko/AG | project/api/middleware.py | middleware.py | py | 589 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "logging.getLogger",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "models.LogApiRequestsModel.objects.create",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "models.LogApiRequestsModel.objects",
"line_number": 18,
"usage_type": "attribu... |
38410796940 | # 例題3-3
import numpy as np
import scipy.stats as st
import matplotlib.pyplot as plt
# データ
S2 = 4.0
n = 7
m = 4
alpha = 0.01
# グラフ
gxmin,gxmax = (0.01, 25)
gymin,gymax = (0.0, 0.7)
# 確率密度関数
t = np.arange(gxmin,gxmax,0.01)
rv = st.f(dfn=m-1,dfd=n-1)
f = rv.pdf(t)
# 確率変数値
t1 = rv.isf(alpha)
print('t1=',t1)
# 分散
T = ((m... | sangjiexun/Sinngou-ToukeiPP | 信号・統計PP/信号・統計PP/toukei_kadai3.py | toukei_kadai3.py | py | 626 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "numpy.arange",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "scipy.stats.f",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "scipy.stats",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.figure",
... |
29330516341 | from django.shortcuts import render, HttpResponseRedirect, redirect
from .models import Todo, Date
from django.urls import reverse
from .forms import TodoForm
from django.utils import timezone
from django.contrib.auth.decorators import login_required
# Create your views here.
@login_required
def index(request):
au... | csb0710/openSourceHomework | TodoList/todo_app/views.py | views.py | py | 3,256 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "models.Date.objects.filter",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "models.Date.objects",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "models.Date",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "djang... |
26707298351 | from collections.abc import Callable
def mutate(par: list, p: int, d: float) -> list:
newpar = par.copy()
newpar[p - 1] += d
return newpar
def hj(f: Callable[[list[float]], float], parv: list[float], maxiter: int, startstep: float, endstep: float) -> list[float]:
p = len(parv)
currentstep = star... | jbytecode/mccga.py | hookejeeves.py | hookejeeves.py | py | 1,007 | python | en | code | 1 | github-code | 70 | [
{
"api_name": "collections.abc.Callable",
"line_number": 10,
"usage_type": "name"
}
] |
11471003847 | import pandas as pd
from sklearn.model_selection import train_test_split, GridSearchCV
from sklearn.preprocessing import LabelEncoder
from xgboost import XGBClassifier
from sklearn.metrics import classification_report, accuracy_score
import pickle
# Load the data
data = pd.read_csv("crop_data.csv")
# Encode crop name... | shamisodzino/crop-predictor | train_xgboost_hyper.py | train_xgboost_hyper.py | py | 1,808 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "pandas.read_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.LabelEncoder",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 20,
"usage_type": "call"
},... |
71016753188 | import tempfile
import os
import numpy
import mathutil
import shelve
import argparse
import glob
import subprocess
import exifread
from enum import Enum
import datetime
import os.path
import inspect
import sys
import itertools
import nptime
from nptime import nptime
try:
import cv2
#from cv2 import waitKey
exce... | brettbeeson/tlmm | tlmm-cv.py | tlmm-cv.py | py | 24,684 | python | en | code | 2 | github-code | 70 | [
{
"api_name": "sys.modules",
"line_number": 47,
"usage_type": "attribute"
},
{
"api_name": "inspect.stack",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "enum.Enum",
"line_number": 66,
"usage_type": "name"
},
{
"api_name": "datetime.time",
"line_nu... |
41286899364 | # N개의 수가 주어지고 : 1 <= N <= 1,000,000
# N개의 수 각 항을 자기보다 작은 수의 개수로 변환
from collections import defaultdict as dd
import sys
input = sys.stdin.readline
t = int(input())
d = dd(int)
li = list(map(int,input().split()))
order = -1
acc = 0
_li = li.copy()
_li.sort(key=lambda x : x)
for i in range(t):
if i > 0 and _li[i] =... | HwangBaco/Algorithms | legacy/baekjoon_18870.py | baekjoon_18870.py | py | 506 | python | ko | code | 0 | github-code | 70 | [
{
"api_name": "sys.stdin",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "collections.defaultdict",
"line_number": 9,
"usage_type": "call"
}
] |
32695233080 | import json
import boto3
import os
dynamodb=boto3.client('dynamodb')
def handler(event, context):
connectionId=event['requestContext']['connectionId']
dynamodb.delete_item(
TableName=os.environ.get('TABLE_NAME'),
Key={'socketId':{'S':connectionId}}
)
return {}
| JosueReyes-1/ChatConnect-Backend | Disconnect/handler.py | handler.py | py | 296 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "boto3.client",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
}
] |
3914385041 | import json
import uuid
import sqlite3
import sys
from typing import List, Optional
from goet.lib.converter.converter import converter
from goet.lib.frame.frame import Frame
from goet.tracer.base import BaseTracer
CURR_FRAME_ID: int = 0
PREV_FRAME_IDS: List[Optional[int]] = [None]
class SqlTracer(BaseTracer):
"... | vivster7/goet | goet/tracer/sql.py | sql.py | py | 1,801 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "typing.List",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "goet.tracer.base.BaseTracer",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "sqlite3.Conne... |
33304025613 | from django.db import models
from voyage.models import Voyage
# Create your models here.
class Excursion(models.Model):
nom=models.CharField(max_length=100,null=True)
photoexcursion = models.ImageField(upload_to='pics',default=False)
optionnelle=models.BooleanField(default=False)
voyage = models.ManyToM... | Babatta/examen_python_2021 | excursion/models.py | models.py | py | 452 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "django.db.models.Model",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "... |
70588406629 | from tensorflow.python.keras.saving import save
import h5py
import json
import inspect
from deepposekit.models.layers.util import ImageNormalization
from deepposekit.models.layers.convolutional import (
UpSampling2D,
SubPixelDownscaling,
SubPixelUpscaling,
)
from deepposekit.models.layers.deeplabcut impor... | jgraving/DeepPoseKit | deepposekit/models/loading.py | loading.py | py | 3,891 | python | en | code | 370 | github-code | 71 | [
{
"api_name": "deepposekit.models.LEAP.LEAP",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "deepposekit.models.StackedDenseNet.StackedDenseNet",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "deepposekit.models.StackedHourglass.StackedHourglass",
"line_... |
40574086870 | from PyQt5 import QtCore as qtc
from PyQt5 import QtGui as qtg
from PyQt5 import QtWidgets as qtw
# ################################
# SEE COMMENTS AT END OF THIS FILE
# ################################
from io import StringIO
from gui.qualityTabGui import Ui_Form
#
from psSettings import PSSettings
from picamera i... | cambridgeBlueMan/piSnap | qualityTab.py | qualityTab.py | py | 8,259 | python | en | code | 2 | github-code | 70 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "json.load",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "gui.qualityTab... |
28956506991 | __author__ = 'alipirani'
import os
from config_settings import ConfigSectionMap
from sys import platform as _platform
from modules.log_modules import keep_logging
from modules.logging_subprocess import *
def vcftools_vcf2fasta_filter2(only_snp_filter2_vcf, out_path, analysis, reference, logger, Config):
bgzip_cmd ... | alipirani88/snpkit | modules/vcftools.py | vcftools.py | py | 5,198 | python | en | code | 4 | github-code | 71 | [
{
"api_name": "modules.log_modules.keep_logging",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "modules.log_modules.keep_logging",
"line_number": 23,
"usage_type": "call"
},
{
"api_na... |
14577267971 | from __future__ import annotations
from decimal import Decimal
from functools import lru_cache
from math import floor
from typing import List, Optional, TypeVar, Union
from kraken.base_api import KrakenBaseSpotAPI, defined, ensure_string
from kraken.spot.market import Market
Self = TypeVar("Self")
class Trade(Krak... | btschwertfeger/python-kraken-sdk | kraken/spot/trade.py | trade.py | py | 28,919 | python | en | code | 19 | github-code | 70 | [
{
"api_name": "typing.TypeVar",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "kraken.base_api.KrakenBaseSpotAPI",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "kraken.spot.market.Market",
"line_number": 52,
"usage_type": "name"
},
{
"api_na... |
15775870051 | # 导入opencv工具包
import cv2
# 导入numpy
import numpy as np
# 导入姿势识别器
from PoseDetector import PoseDetector
detector = PoseDetector()
# 方向与个数
squatdir = 0 # 0为站立,1为蹲下
squatcount = 0
def squat(decimg):
global squatcount,squatdir
# 读取摄像头,img为每帧图片
img = decimg
h, w, c = img.shape
# 识别姿势
img = detec... | SunFzzf/Robot | PC/Sports/Squat.py | Squat.py | py | 1,393 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "PoseDetector.PoseDetector",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.interp",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "cv2.rectangle",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "cv2.FILLED",
... |
70939194791 | import sys
import os
import os.path
import shutil
from cx_Freeze import setup, Executable
# Remove the existing folders folder
shutil.rmtree("build", ignore_errors=True)
shutil.rmtree("dist", ignore_errors=True)
sys.path.append(os.path.dirname(__file__))
############################################################... | IIXIXII/inkscape-extract | src/python/iextract_setup.py | iextract_setup.py | py | 9,918 | python | en | code | 2 | github-code | 71 | [
{
"api_name": "shutil.rmtree",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "shutil.rmtree",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_numb... |
25549280180 | import requests
import json
import os
def get_pic_url(num):
pic_url= []
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36'}
for i in range(num):
page_url = 'https://image.baidu.com/search/a... | LQX-lqx/- | shin_taobao.py | shin_taobao.py | py | 1,518 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 2... |
74700410788 | import nltk
import re
def main():
nltk.download('words')
all_words = nltk.corpus.words.words()
word = word_entry(1)
check = check_word(word)
guesses = compile_guesses(all_words, word, check)
print_guesses(guesses)
def word_entry(n):
while True:
word = input(f"Enter word {n}: "... | hunterkepley/guessle | main.py | main.py | py | 1,579 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "nltk.download",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.words.words",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "nltk.corpus",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "re.compile",
... |
36693858712 | import socket
import time
import json
import random
# import subprocess
# _ = subprocess.call("route add 10.255.255.255 dev client1-eth0", shell=True)
# _ = subprocess.call("route add 10.255.255.255 dev client1-eth1", shell=True)
# _ = subprocess.call("ifconfig client1-eth1 10.0.0.10 netmask 255.0.0.0 broadcast 10.25... | stevelorenz/comnetsemu | app/realizing_mobile_edge_clouds/client.py | client.py | py | 2,257 | python | en | code | 19 | github-code | 71 | [
{
"api_name": "socket.socket",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_DGRAM",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "socket.socke... |
44315296023 | '''
训练神经网络,并画出其损失曲线
'''
import os
import pickle
import matplotlib.pyplot as plt
from py_model.NN_model import *
from py_model.MNIST_data import *
INPUT_MODE=784
OUTPUT_MODE=10
LAYER_MODE=500
L1=0
L2=0.1
LEARNING_STEPS=1500
LEARNING_RATE=0.001
LEARNING_RATE_DECAY=0.00001
N_BATCHES=60
ALPHA=0.001
class NoModelError... | PyJun/Handwriting_Recognition | src/numpy_deomo/mnist_train.py | mnist_train.py | py | 1,426 | python | en | code | 17 | github-code | 71 | [
{
"api_name": "os.path.join",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
70607949349 | import ipaddress
file_mhl = open('./mhl.txt')
try:
mhl = file_mhl.read()
finally:
file_mhl.close()
with open('./check_result/temp_file.txt') as file_object:
for line in file_object:
line = line[:-1]
for temp in ipaddress.ip_network(line).hosts():
if str(temp) in mhl:
... | ZhongdaoChen/Palo_alto_ACL_IP_check | compare_subnet_withMHL.py | compare_subnet_withMHL.py | py | 402 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "ipaddress.ip_network",
"line_number": 11,
"usage_type": "call"
}
] |
74141925988 | from matplotlib.pyplot import cla
from Data_Process import *
import torch
import sys
sys.path.append('D:\OneDrive - mail.nwpu.edu.cn\Optimal\Public\Python\Pre_Process')
from Data_Process import *
import torch as th
import math
from torch.nn.parameter import Parameter
from torch.nn.modules.module import Module
import r... | CheukNgai/FedGME | Models.py | Models.py | py | 5,637 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "sys.path.append",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.modules.module.Module",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "torch.nn.p... |
17558239841 | # -*- coding: utf-8 -*-
def application(environ, start_response):
if environ["PATH_INFO"] == "/":
respuesta = "<p>Página inicial</p>"
elif environ["PATH_INFO"] == "/hola":
respuesta = "<p>Bienvenidos a mi página web</p>"
else:
respuesta = "<p><trong>Página incorrecta</strong></p>"
... | josedom24/curso_flask | ejemplos/u4/wsgi2.py | wsgi2.py | py | 575 | python | es | code | 34 | github-code | 71 | [
{
"api_name": "wsgiref.simple_server.make_server",
"line_number": 14,
"usage_type": "call"
}
] |
3738725350 | #!/usr/bin/env python3
import os
import socket
import sys
import time
from PyQt5 import QtCore
from PyQt5.QtCore import QSize, pyqtSignal, Qt
from PyQt5.QtCore import QThread, QTimer
from PyQt5.QtGui import QIcon, QPixmap, QTransform
from PyQt5.QtWidgets import QWidget, QApplication, QPushButton, QLabel, QMainWindow, ... | duckietown/dt-gui-tools | packages/virtual_joystick/src/virtual_joystick_gui.py | virtual_joystick_gui.py | py | 15,040 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "PyQt5.QtCore.QThread",
"line_number": 51,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCore.QThread.__init__",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtCore.QThread",
"line_number": 54,
"usage_type": "name"
},
{
"api_name"... |
22575377758 | """API-Routes to fetch static Data.
eg.: spells, classes, specs
"""
# IMPORT THIRD PARTY LIBRARIES
import fastapi
# IMPORT LOCAL LIBRARIES
from lorgs.models.raid_boss import RaidBoss
from lorgs.models.raid_zone import RaidZone
from lorgs.models.wow_class import WowClass
from lorgs.models.wow_role import ... | gitarrg/lorgs | lorrgs_api/routes/api_world_data.py | api_world_data.py | py | 5,072 | python | en | code | 7 | github-code | 71 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "lorgs.models.wow_role.WowRole.list",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "lorgs.models.wow_role.WowRole",
"line_number": 31,
"usage_type": "name"
},
{
... |
15534743824 |
from math import sqrt
import numpy as np
import warnings
import matplotlib.pyplot as plt
from matplotlib import style
from collections import Counter
style.use('fivethirtyeight')
# plot1 = (1,3)
# plot2 = (2,5)
# euclidian_distance = sqrt((plot1[0]-plot2[0])**2+(plot1[1]-plot2[1])**2)
# print(euclidian_distance)
... | depzai/ML | Knearestneighbor/euclidiandist.py | euclidiandist.py | py | 1,441 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "matplotlib.style.use",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.style",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "matplot... |
15895222659 | from django import http
from django.utils.six.moves.urllib.parse import urlparse
from wagtail.wagtailredirects import models
# Originally pinched from: https://github.com/django/django/blob/master/django/contrib/redirects/middleware.py
class RedirectMiddleware(object):
def process_response(self, request, respons... | huanghc/cFinder | data/history_issues/history_app/wagtail/wagtailredirects_redirect.py | wagtailredirects_redirect.py | py | 1,390 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "wagtail.wagtailredirects.models.Redirect.normalise_path",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "wagtail.wagtailredirects.models.Redirect",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "wagtail.wagtailredirects.models",
"line... |
13544095461 | # -*- coding: utf-8 -*-
from selenium import webdriver
import unittest
# need to install Castro and PyGame
class PopupWindowTest(unittest.TestCase):
"""PopupWindowTest
Working with popup child windows. Can work with any child window
as long as it belongs to the current WebDriver context.
"""
... | CheoR/STTWP | ch9/popup_window_test.py | popup_window_test.py | py | 1,455 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "unittest.TestCase",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.Firefox",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "u... |
26550336926 | from math import factorial, sqrt#不用引入pow
import numpy as np
# 注意公式迭代的初始值
def Euler(l):
PiList=np.zeros(l)
s=0
for n in range(1,l+1):
an = 1/n**2
s = s+an
PiList[n-1]=sqrt(s*6)
return PiList
def Leibniz(l):
PiList=np.zeros(l)
s=0
for n in range(1,l+1)... | PencilFan/Experi-PhysiCompute-Homework | Python_Pi_Pro/Pi_Func.py | Pi_Func.py | py | 1,490 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "numpy.zeros",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 21,... |
18008545843 | # attention.py
import torch
from torch import nn
import math
import torch.nn.functional as F
from train_utils import clones
def attention(query, key, value, mask=None, dropout=None):
"Implementation of Scaled dot product attention"
d_k = query.size(-1)
scores = torch.matmul(query, key.transpose(-2, -1)) /... | AnubhavGupta3377/Text-Classification-Models-Pytorch | Model_Transformer/attention.py | attention.py | py | 1,915 | python | en | code | 482 | github-code | 71 | [
{
"api_name": "torch.matmul",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.nn.functional.softmax",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.nn.functiona... |
3060032919 | import rpm
import os, subprocess, urllib, getpass
from argparse import ArgumentParser
SOURCES = '{0}/rpmbuild/SOURCES'.format(os.getenv('HOME'))
parser = ArgumentParser()
parser.add_argument('-u', '--user', help='SCP User', required=True)
parser.add_argument('--host', help='SCP Host', default='10.0.254.23')
parser.a... | masom/Buildy | buildy.py | buildy.py | py | 2,271 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "os.getenv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_nu... |
72851816549 | # Геопандас / Cвердловская обл.
import geopandas as gpd
import pandas as pd
from matplotlib import pyplot as plt
pd.set_option('display.max_columns', None)
#Свердловская обл общая граница
gpd_svd_L1 = gpd.read_file('~/PycharmProjects/maps/GeoData/svd/boundary-polygon-lvl4.shp', encoding='utf-8')
# районы и округа 73 ш... | rldba/maps | 6.2 geopandas.py | 6.2 geopandas.py | py | 1,211 | python | ru | code | 0 | github-code | 71 | [
{
"api_name": "pandas.set_option",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "geopandas.read_file",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "geopandas.read_file",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "geopandas.rea... |
19200573511 | #!/usr/bin/env python
#_*_ coding: utf8 _*_
import socket
import sys
import argparse
from colorama import Fore
import platform
import os
import time
from os import path
parse = argparse.ArgumentParser()
parse.add_argument('-t','--target',help='target')
parse.add_argument('-s','--seconds',help='seconds sleep',default=... | ReldSec/silent | silent.py | silent.py | py | 5,538 | python | en | code | 1 | github-code | 70 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.stdout.write",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "sys.stdout.f... |
1247836320 | import unittest
from unittest.mock import MagicMock, patch
from requests import Session
from src.kong_gateway_client.api import KongAPIClient
import json
class MockResponse:
def __init__(self, json_data):
self.json_data = json_data
self.content = json.dumps(json_data).encode("utf-8") if json_data... | KongHQ-CX/kong-gateway-client | tests/resources/test_routes.py | test_routes.py | py | 3,738 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "json.dumps",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "unittest.TestCase",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "unittest.mock.MagicMock",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "unittest.mo... |
19286290455 | import os
import re
import shutil
import zipfile
from functools import partial
from os import path as op
import pooch
import pytest
from mne import datasets, read_labels_from_annot, write_labels_to_annot
from mne.datasets import fetch_dataset, fetch_infant_template, fetch_phantom, testing
from mne.datasets._fsaverage... | mne-tools/mne-python | mne/datasets/tests/test_datasets.py | test_datasets.py | py | 12,474 | python | en | code | 2,405 | github-code | 71 | [
{
"api_name": "mne.datasets.testing.data_path",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "mne.datasets.testing",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "mne.datasets.brainstorm",
"line_number": 52,
"usage_type": "attribute"
},
{
"... |
33953886585 | import json
from odoo.http import request, route
from odoo.addons.website_sale.controllers.main import WebsiteSale
class WebsiteSaleProductComparison(WebsiteSale):
@route('/shop/compare', type='http', auth='public', website=True, sitemap=False)
def product_compare(self, **post):
values = {}
... | odoo/odoo | addons/website_sale_comparison/controllers/main.py | main.py | py | 1,738 | python | en | code | 31,745 | github-code | 71 | [
{
"api_name": "odoo.addons.website_sale.controllers.main.WebsiteSale",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "odoo.http.request.redirect",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "odoo.http.request",
"line_number": 14,
"usage_type": "nam... |
4805740604 | import logging
from pathlib import Path
from farm.data_handler.processor import TextClassificationProcessor
from farm.modeling.tokenization import Tokenizer
from farm.utils import set_all_seeds
import torch
def test_processor_saving_loading(caplog):
if caplog is not None:
caplog.set_level(logging.CRITICAL... | deepset-ai/FARM | test/test_processor_saving_loading.py | test_processor_saving_loading.py | py | 1,897 | python | en | code | 1,699 | github-code | 71 | [
{
"api_name": "logging.CRITICAL",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "farm.utils.set_all_seeds",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "farm.modeling.tokenization.Tokenizer.load",
"line_number": 16,
"usage_type": "call"
},
... |
19125638278 | from typing import Any, Callable
import wrapt
import numba as nb
import numpy as np
import pandas as pd
from numba import prange
from pandas.api.types import infer_dtype
from anndata import AnnData
from cellrank import logging as logg
jit_kwargs = {"nogil": True, "cache": True, "fastmath": True}
@nb.njit(paralle... | theislab/cellrank | src/cellrank/kernels/_utils.py | _utils.py | py | 5,441 | python | en | code | 272 | github-code | 71 | [
{
"api_name": "numpy.ndarray",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "numpy.empty",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "numpy.empty",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "numba.njit",
"line_num... |
7636632140 | """Add img_url column to Project table
Revision ID: 1dcb912d6836
Revises: c50fa84f7100
Create Date: 2021-11-22 15:15:27.054109
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '1dcb912d6836'
down_revision = 'c50fa84f7100'
branch_labels = None
depends_on = None
... | deepmatters/impactflow | migrations/versions/1dcb912d6836_add_img_url_column_to_project_table.py | 1dcb912d6836_add_img_url_column_to_project_table.py | py | 689 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "alembic.op.add_column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.String"... |
28339636192 | import json
python_dict = {
"이름":"홍길동",
"나이": 25,
"거주지": "서울",
"신체 정보": {
"키" : 175.4,
"몸무게" : 71.2
},
"취미": [
"등산",
"자전거 타기",
"독서"
]
}
print(type(python_dict), python_dict)
json_data = json.dumps(python_dict) # json 형태로변환
print(type(json_data), jso... | JasonJIJS/git_python_study | python_study/ch15/json_study01.py | json_study01.py | py | 1,837 | python | ko | code | 0 | github-code | 71 | [
{
"api_name": "json.dumps",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 45,
... |
17503823826 | import io
import pytest
import random
import string
from unittest import mock
import snarl.exc
import snarl.main
@pytest.fixture(scope='function')
def snarlobj():
return snarl.main.Snarl()
def test_include_recursive(snarlobj):
def doc():
data = '\n'.join(('This is a test',
... | larsks/snarl | tests/test_snarl.py | test_snarl.py | py | 4,946 | python | en | code | 5 | github-code | 71 | [
{
"api_name": "snarl.exc.main.Snarl",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "snarl.exc.main",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "snarl.exc",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "pytest.fixture",
... |
5411152099 | import os
import pandas as pd
from PIL import Image
import numpy as np
import warnings
warnings.filterwarnings("ignore", "(Possibly )?corrupt EXIF data", UserWarning)
Image.MAX_IMAGE_PIXELS = None
def export_csv(root_imgs_path, csv_name):
dic_categories = {'scenery' : [], 'furniture' : [], 'animal' : [], ... | RioLei/Basic-Image-Retrieval | utils/preprocessingData.py | preprocessingData.py | py | 3,306 | python | vi | code | 2 | github-code | 71 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "PIL.Image.MAX_IMAGE_PIXELS",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "os.lis... |
71526318948 | import os
import yaml
ATTRIBUTES = [('nesbi_username', ''),
('nesbi_password', ''),
('nesbi_dry_run', False),
('nesbi_network_driver', ''),
('nsot_url', ''),
('nsot_email', ''),
('nsot_secret_key', ''),
('nsot_auth_heade... | dm-drogeriemarkt/nesbi | nesbi/core/configuration.py | configuration.py | py | 1,448 | python | en | code | 3 | github-code | 70 | [
{
"api_name": "yaml.safe_load",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_... |
27949871224 | """
Checks to see if Makefile follows standards
"""
import os
import re
import pytest
from pytest_repo_health import health_metadata
from repo_health import get_file_content
module_dict_key = "makefile"
output_keys = {
"upgrade": "target that upgrades our dependencies to newer released versions",
"test": "ta... | openedx/edx-repo-health | repo_health/check_makefile.py | check_makefile.py | py | 2,541 | python | en | code | 5 | github-code | 70 | [
{
"api_name": "os.path.join",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "repo_health.get_file_content",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pytest.fixture... |
35475380168 | import numpy as np
import h5py
from collections import defaultdict
from typing import List
from june.epidemiology.infection import (
TransmissionGamma,
Transmission,
TransmissionConstant,
TransmissionXNExp,
)
from june.hdf5_savers.utils import read_dataset, write_dataset
str_to_class = {
"Transmis... | IDAS-Durham/JUNE | june/hdf5_savers/infection_savers/transmission_saver.py | transmission_saver.py | py | 4,524 | python | en | code | 35 | github-code | 70 | [
{
"api_name": "june.epidemiology.infection.TransmissionXNExp",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "june.epidemiology.infection.TransmissionGamma",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "june.epidemiology.infection.TransmissionConstant",
... |
21298324286 | import requests
import db_connector
import sys
user_id = sys.argv[1]
# Creating the user with a POST
post = requests.post(f'http://127.0.0.1:5000/data/{user_id}', json={"user_name": "oriel"})
if post.ok:
print('User Created:', post.json())
else:
print('response code 500:', post.json())
# Checking the u... | orielgoel/Project | backend_testing.py | backend_testing.py | py | 665 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "sys.argv",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "requests.post",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 17,
"usage_type": "call"
}
] |
71724580706 | import websockets
import asyncio
import base64
PORT = 5050
print(f"Server listening in Port {PORT}")
connected = set()
async def echo(webs, path):
print('A client is connected')
connected.add(webs)
try:
async for message in webs:
for conn in connected:
if conn != webs:... | alexmudrak/exp-websocket-stream | ws-server.py | ws-server.py | py | 736 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "websockets.exceptions",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "websockets.serve",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "asyncio.get_event_loop",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "as... |
24793995420 | #
# Copyright (c) 2023 Thibaut Zeissloff.
#
# This file is part of Thumb2ISS
# (see https://github.com/TZe-0xff/thumb2ISS).
#
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
#
import logging, struct
from _testing import Core, test
logging.basicConfig(level=logging.DEBUG)
c = Core(pr... | TZe-0xff/thumb2ISS | thumb2ISS/test/tbb.py | tbb.py | py | 997 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "logging.basicConfig",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "_testing.Core",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "struct.pack",
... |
15836542976 | from flask import Flask,render_template,request
app = Flask(__name__)
def calc_tax(v,rate):
try:
rs = str(int(float(v)*(1 + rate)))
except:
print('calc error')
rs = "計算できませんでした。"
return rs
@app.route("/")
def index():
return render_template("index.html")
@app.route("/health-c... | Katsutoshi-Inuga/docker-study-001 | api_img/api/app.py | app.py | py | 735 | python | en | code | 1 | github-code | 70 | [
{
"api_name": "flask.Flask",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.request.get_data",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "flask.request... |
71075124070 | from math import ceil, cos, radians, sin
from PIL import Image, ImageDraw, ImageFont
vu_navy = ( 0, 31, 91)
vu_yellow = (255, 220, 79)
vu_orange = (248, 151, 40)
vu_green = (193, 205, 35)
vu_blue = ( 80, 145, 205)
vu_teal = ( 0, 146, 143)
vu_gray= (148, 156, 166)
colors = [vu_navy, vu_blue, vu_orange... | FalveyLibraryTechnology/deselection-toolkit | graphs.py | graphs.py | py | 10,948 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "PIL.Image.new",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "PIL.ImageDraw.Draw",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "PIL.ImageDraw",
"line_... |
21426185435 | import cv2
import numpy
import PIL
import datetime
def count_Faces(frame):
face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_frontalface_default.xml') # Load the Haar Cascade Classifier for face detection
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) # Convert the frame
faces = f... | dsc-gtbit/HacktoberFest-23-AIML | Advance/FaceDetection/Detection-Main.py | Detection-Main.py | py | 2,246 | python | en | code | 1 | github-code | 70 | [
{
"api_name": "cv2.CascadeClassifier",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.data",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "cv2.cvtColor",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
... |
8717858794 | import cv2
import numpy as np
import face_recognition
import os, csv
from datetime import datetime
from pathlib import Path
path = 'ImageDatabase' # path of the folder where all sample images are present
images = [] # an empyt array
classNames = []
myList = os.listdir(path) # it will fetch the name... | SatyamBhargav/Security-and-surveillance-system | engine/Biometric_scanner/Biometric_Scanner.py | Biometric_Scanner.py | py | 5,198 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "os.listdir",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path.splitext",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 2... |
15690322654 | if False:
from data.word_api.wordnik import _word_api
from spec.mamba import *
with _description('_word_api'):
with description('synonyms'):
with it('executes without error'):
expect(calling(_word_api.synonyms, 'string')).not_to(raise_error)
with it('returns synonyms'):
results = _word_api.s... | PhilHarnish/forge | spec/data/word_api/wordnik/_word_api_spec.py | _word_api_spec.py | py | 678 | python | en | code | 3 | github-code | 70 | [
{
"api_name": "data.word_api.wordnik._word_api.synonyms",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "data.word_api.wordnik._word_api",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "data.word_api.wordnik._word_api.synonyms",
"line_number": 11,
... |
35960223159 | import matplotlib.pyplot as plt
COLORS = 'bgmck'
def read_file(fn):
with open(f'data/{fn}', 'r') as f:
return list(map(lambda x: int(float(x)), f.read().split()))
def write_data(fn, data):
with open(f'data/{fn}', 'w') as f:
f.write('\n'.join([str(x) for x in data]))
def draw(fn, setpoint... | MaGaroo/throttune | functions.py | functions.py | py | 918 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "matpl... |
24324345817 | """Takes fs-essentia-extractor_legacy embeddings, and to implements
the Gaia feature preprocessing with Python. Namely, select a subset
of the features, normalizes each of them independently and applies
dimensionality reduction with PCA."""
import os
import time
import glob
import yaml
import json
from pathlib impor... | raraz15/freesound-sound_similarity | code/fs-essentia-extractor_legacy-create_clip_level_embedding.py | fs-essentia-extractor_legacy-create_clip_level_embedding.py | py | 7,548 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "yaml.safe_load",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "argparse.Argument... |
18855672479 | import importlib
import pickle
from os import listdir
from os.path import join, exists
from typing import List
import numpy as np
from PIL import Image
from natsort import natsorted
from pyrep.objects import VisionSensor
from rlbench.backend.const import *
from rlbench.backend.utils import image_to_float_array, rgb_h... | stepjam/RLBench | rlbench/utils.py | utils.py | py | 16,245 | python | en | code | 839 | github-code | 71 | [
{
"api_name": "importlib.import_module",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "importlib.reload",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "rlbench.observation_config.ObservationConfig",
"line_number": 43,
"usage_type": "name"
},
{
... |
11661673739 | # -*- encoding: utf-8 -*-
import json
import random
import requests
import sched
import time
from django.shortcuts import render
from django.http import HttpResponse
from datetime import datetime
from .load_data import load_data, load_access_token
from .getCalenderInformation import get_schedule
REPLY_ENDPOINT = 'h... | task4233/schedule_bot | bot/views.py | views.py | py | 2,580 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "load_data.load_access_token",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "django.http.HttpResponse",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "djang... |
243325829 | # -*- encoding: utf-8 -*-
'''
Created on 15/01/2011
@author: ErunamoJAZZ
@license: GPLv3
@summary: Muffin Translator, ayudante para la traducción de anime.
@web: http://code.google.com/p/muffin/
'''
#import wx.stc as stc
import wx, os
import threading, time
import codecs
class MuffinText(wx.TextCtrl):
'''
M... | Averroes/muffin | src/MuffinText.py | MuffinText.py | py | 5,260 | python | es | code | 0 | github-code | 70 | [
{
"api_name": "wx.TextCtrl",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "wx.TextCtrl.__init__",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "wx.TextCtrl",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "wx.TE_MULTILIN... |
13598067625 | import pygame
import random
import time
red_color = (255, 0, 0)
class Character(object):
def __init__(self, name, health, max_health, power, defense, special_desc, coins, x_y, min_walk_x, max_walk_x, min_walk_y, max_walk_y, items={}, bounty=[]):
self.name = name
self.health = health
self.... | Adrian-Jablonski/python-exercises | Hero_RPG_V3_Pygame/characters/base_characters.py | base_characters.py | py | 9,034 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "random.randint",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "random.randint",
"li... |
26661213345 | import json
def write_stats (newData):
obj= read_stats()
for key,value in newData.items():
obj[key] = value
with open("media/datasets/stats.json", "w") as outfile:
json_object = json.dumps(obj, indent=4)
outfile.write(json_object)
def read_stats():
with open('media/datasets/s... | Manikanta-kalyan/Photo-Editor | backend/photo_editing_api/photo_editing_app/contollers/get_statistics.py | get_statistics.py | py | 414 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "json.dumps",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 15,
"usage_type": "call"
}
] |
6141505831 | # 0_Executing Program ============================================================================
import sys
import getopt
import re
args = sys.argv[1:]
opts, args = getopt.getopt(args, "i:b:h")
i_opt = './sample/sample_1.wav'
b_opt = "black"
for opt, arg in opts:
if opt == "-i":
i_opt = arg
x =... | MYEONGJOONIL/sound-visualization | main_SV.py | main_SV.py | py | 8,213 | python | en | code | 4 | github-code | 70 | [
{
"api_name": "sys.argv",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "getopt.getopt",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "librosa.load",
"line_number"... |
41355693456 | from fastapi import FastAPI
from app.routers import router
app = FastAPI(
title="FastAPI",
description="API prueba",
version="0.0.1",
terms_of_service="http://example.com/terms/",
contact={
"name": "Deadpoolio the Amazing",
"url": "http://x-force.example.com/contact/",
"emai... | Christust/fastapi | app/__init__.py | __init__.py | py | 511 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "app.routers",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "fastapi.FastAPI",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "app.routers.include_router",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "app.routers.rout... |
464091360 | # -*- coding: utf-8 -*-
import tensorflow as tf
from tensorflow.python.ops import rnn, rnn_cell
import numpy as np
import preprocess
from sklearn.metrics import confusion_matrix
from sklearn.metrics import precision_recall_fscore_support
max_seq_len = 75
k = 800
mapping = [-1,0,1]
class LSTMs():
"""
LSTM for... | teerapat-ch/sentiment_seg | lstm.py | lstm.py | py | 7,364 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "tensorflow.placeholder",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tensorflow.float32",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.placeholder",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": ... |
74262425187 | import json
import re
from flask import Flask, render_template, request
app = Flask(__name__)
def sort_items(db):
return dict(sorted(db.items(), key=lambda x: x[0].lower()))
with open("terms.json", encoding="UTF8") as file:
db = json.load(file)
db = sort_items(db)
@app.route("/")
def home():
return... | cvmota/plneb-2223 | TPC9/aula6.py | aula6.py | py | 2,812 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "flask.request.form.get",
... |
31547783951 | import eel
import os
import desktop
from googletrans import Translator
app_name = os.path.dirname(__file__)+'/html'
end_point = 'index.html'
size = (1200, 800)
translator = Translator()
@ eel.expose
def translate_to_japanese(text):
eel.view_log_js(translator.translate(text, dest='ja').text)
@... | yutoriSE/menta_basic | 課題7/translator.py | translator.py | py | 477 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "os.path.dirname",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "googletrans.Translator",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "eel.view_log_js",
... |
35986313384 | #!/usr/bin/env python
# coding: utf-8
from __future__ import print_function
import os
def get_name(cont):
names = cont["Names"]
return names[0][1:]
def get_ipaddr(cont, client):
info = client.inspect_container(cont)
return info["NetworkSettings"]['IPAddress']
def update_ssh_config():
import docke... | muravjov/disvolvu | src/update_ssh_config.py | update_ssh_config.py | py | 2,291 | python | ru | code | 0 | github-code | 70 | [
{
"api_name": "docker.Client",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "disvolvu.make_struct",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path.expanduser",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.path",
"... |
14517894218 | import os
import logging
from logging.config import dictConfig
class Config:
SECRET_KEY = 'hard to guess string'
SSL_DISABLE = False
SQLALCHEMY_COMMIT_ON_TEARDOWN = True
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_RECORD_QUERIES = True
# MySQL config
MYSQL_DATABASE = 'flask_test'
... | sinrro/flask_sample | config.py | config.py | py | 2,498 | python | en | code | 3 | github-code | 70 | [
{
"api_name": "logging.config.dictConfig",
"line_number": 22,
"usage_type": "call"
}
] |
35026655966 | import json
import pandas as pd
import pandas.io.json
from pandas.io.json import json_normalize
def readJson():
# Opening JSON file
f = open('./config/materias_ids_v2.json', encoding="utf8")
# returns JSON object as
# a dictionary
data = json.load(f)
f.close()
df2 = pandas.json_normali... | 193228/critical_path_upchiapas | src/JSON.py | JSON.py | py | 494 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "json.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pandas.json_normalize",
"line_number": 18,
"usage_type": "call"
}
] |
70120154468 | from functools import lru_cache
from collections import Counter
@lru_cache(maxsize=4*(10**5))
def _f(n):
string=bin(n)
popcount=string.count('1')
return n%popcount
@lru_cache(maxsize=4*(10**5))
def f(n):
if n==0:
return 0
else:
return 1+f(_f(n))
cache=[f(i) for i in range(2*(10**... | FullteaR/CompetitiveProgramming | AtCoder/エイシング プログラミング コンテスト 2020/D.py | D.py | py | 760 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "functools.lru_cache",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "functools.lru_cache",
"line_number": 11,
"usage_type": "call"
}
] |
43193382902 | from dataclasses import dataclass, field
from typing import Optional
from xsdata.models.datatype import XmlDuration, XmlTime
from .alternative_texts_rel_structure import DataManagedObjectStructure
from .block_parts_rel_structure import BlockPartsRelStructure
from .compound_train_ref import CompoundTrainRef
from .course... | tefra/xsdata-samples | netex/models/block_version_structure.py | block_version_structure.py | py | 5,864 | python | en | code | 7 | github-code | 70 | [
{
"api_name": "alternative_texts_rel_structure.DataManagedObjectStructure",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "multilingual_string.MultilingualString",
"line_number": 26,
"u... |
74929214945 | #3.7 version of tweepy, time module, and dog API
import tweepy
import time
import dog
#Put your keys here
CONSUMER_KEY = ''
CONSUMER_SECRET = ''
ACCESS_KEY = ''
ACCESS_SECRET = ''
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_token(ACCESS_KEY, ACCESS_SECRET)
api = tweepy.API(auth, wait_on_... | PoloIslam/twitterBot | replyBot.py | replyBot.py | py | 1,757 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "tweepy.OAuthHandler",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "tweepy.API",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "dog.getDog",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_numb... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.