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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1655512886 | import random
from turtle import Screen
from display import DisplaySet
from paddle import Paddle
from ball import Ball
from score import Score
import time
screen = Screen()
screen.title('PONG')
screen.bgcolor('black')
screen.setup(height=600, width=800)
screen.tracer(0)
set_game_field = DisplaySet()
game_on = True
bal... | wojtekgajda/pong_game | main.py | main.py | py | 1,600 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "turtle.Screen",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "display.DisplaySet",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "ball.Ball",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "score.Score",
"line_num... |
34023408707 | import cv2
import os
from ultralytics import YOLO
from datetime import datetime, timedelta
# Load the YOLOv8 model
modelo_pt = r'Modelos\Deploys_Ultralytics_Hub\detector_de_placas_yolov8_nano.pt'
model = YOLO(f'{modelo_pt}')
# Open the video file
video_path = r"Video\Video_teste.mp4"
cap = cv2.VideoCapture(video_path... | DevJoaoPedroGiancoli/BrazilTrafficSignsDetector | Detector/detector_com_ids.py | detector_com_ids.py | py | 3,255 | python | pt | code | 0 | github-code | 36 | [
{
"api_name": "ultralytics.YOLO",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_n... |
43205799120 |
import pandas as pd
import numpy as np
import sqlite3
from datetime import timedelta
import matplotlib.pyplot as plt
import pandas as pd
from copy import deepcopy
from ipywidgets import IntProgress
import warnings
warnings.filterwarnings(action='ignore', category=FutureWarning) # setting ignore as a parameter and furt... | MaksimSavinov/demand_forecasting_pipeline | Pipeline/preABT.py | preABT.py | py | 7,729 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.percentile",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.PeriodIndex",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pandas.pe... |
19293482431 | """Parameter Store Loader
Use (setting_name, cast function) or setting_name as lookup value.
If no cast function is passed, the parameter will be stored as retrieved
from Parameter Store, typically string or stringList.
Usage:
from awstanding.parameter_store import load_parameters
LOOKUP_DICT = {
'/my/parameter/p... | jiss2891/awstanding | src/awstanding/parameter_store.py | parameter_store.py | py | 4,272 | python | en | code | 13 | github-code | 36 | [
{
"api_name": "boto3.client",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "exceptions.ParameterNotFoundException",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 61,
"usage_type": "attribute"
},
{
"api_name": "os... |
2123056410 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Oct 7 20:18:11 2018
@author: tanthanhnhanphan
MECH2700: Assignment 2
"""
import matplotlib.pyplot as plt
from numpy import *
from math import *
D = 100*10**3 #Dynamic Pressure
Ly = 1 #m
Lx = 5 #m
a = 20*pi/180
E = 70*10**9 #Young's Modulus
S = 96.5#... | oncernhan/MECH2700 | assignment2.py | assignment2.py | py | 8,879 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 263,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 263,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.xlabel",
"line_number": 264,
"usage_type": "call"
},
{
"api_name": "... |
75312916265 | """
Usage:
trajectory.py <path> <start_time> <resolution> <x0> <y0> <z0> <t0> [<output_path>]
trajectory.py (-h | --help)
Arguments:
<path>
<start_time>
<resolution>
Options:
-h --help
Show this screen.
"""
import datetime
import warnings
import numpy as np
from twinotter.util.scrip... | leosaffin/moisture_tracers | moisture_tracers/trajectory.py | trajectory.py | py | 2,859 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "moisture_tracers.grey_zone_forecast",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "pylagranto.datasets.MetUMStaggeredGrid",
"line_number": 66,
"usage_type": "call"
},
{... |
1412530570 | from flask import Flask,render_template,flash,redirect,session,url_for,logging,request,Blueprint,json,session
from flask_json import FlaskJSON, JsonError, json_response, as_json
from smartiot.bin.config.db_config import mysql
from smartiot.routes.route_Permissions.userPermissions import getPermissions
import RPi.GPIO a... | Singh-Kiran-P/smart-iot-python-api | smartiot/routes/iot/ultraSonic.py | ultraSonic.py | py | 3,894 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Blueprint",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.request.get_json",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "flask.request",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "flask_json.json_r... |
75263426665 | """
@Time : 30/03/2023
@Author : qinghua
@Software: PyCharm
@File : process_data.py
"""
import os.path
import pickle
import lgsvl
import pandas as pd
import json
from config import Config
from tqdm import tqdm
"""Processing deep scenario data"""
def get_ds_data(runner):
"""pair paths of ... | qhml/ppt | process_data.py | process_data.py | py | 10,320 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.walk",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "config.Config.scenario_dir",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "config.Config",
... |
523657887 | #REGINALD HUEY TAN IAN JAY (S10239913) - IT01 (P01)
#============================== IMPORTING RESOURCES ===============================
import random, math, time
import os, asyncio
os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = "hide" #hide pygame initialisation message
from pygame import mixer
from S10239913E_Assignment_... | klystrn/Tower-Defence-Game | towerDefence.py | towerDefence.py | py | 42,879 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.environ",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "S10239913E_Assignment_gameData.game_vars",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "S10239913E_Assignment_gameData.game_vars",
"line_number": 13,
"usage_type": "name... |
73712141864 | from typing import Dict, Any
from argus.processors.post_processors.utils import post_process as pp
from h2o_docai_scorer.post_processors.post_processor_supply_chain import PostProcessor as PostProcessorSupplyChain
class PostProcessor(PostProcessorSupplyChain):
"""Represents a last step in pipeline process that re... | h2oai/docai-recipes | post_processor/v0.6/post_processor_4.py | post_processor_4.py | py | 1,636 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "h2o_docai_scorer.post_processors.post_processor_supply_chain.PostProcessor",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 11,
"usage_type": "name... |
28888308996 | '''
https://www.codewars.com/kata/52efefcbcdf57161d4000091/
The main idea is to count all the occurring characters in a string. If you have a string like aba, then the result should be {'a': 2, 'b': 1}.
What if the string is empty? Then the result should be empty object literal, {}.
'''
# my solution
def count(str):... | MSKose/Codewars | 6 kyu/Count characters in your string.py | Count characters in your string.py | py | 694 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "collections.Counter",
"line_number": 25,
"usage_type": "call"
}
] |
23111168251 | from mixer.auto import mixer
from rest_framework.test import APITestCase, APIClient
from stock_setup_info.factory import IndustryFactory
from stock_setup_info.models import Industry
# Create your tests here.
class BaseViewTest(APITestCase):
client = APIClient()
@staticmethod
def create_industry(name="... | Maxcutex/stockman_project | stock_setup_info/tests/test_models/test_industry_model.py | test_industry_model.py | py | 1,184 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "rest_framework.test.APITestCase",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "rest_framework.test.APIClient",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "stock_setup_info.models.Industry.objects.create",
"line_number": 17,
"usage... |
1947313325 | import unittest
import pathlib
import typing
import kclvm.compiler.parser.parser as parser
import kclvm.tools.docs.doc_parser as doc_parser
import kclvm.kcl.types.checker as type_checker
import kclvm.api.object as obj_pkg
import kclvm.tools.docs.model_pb2 as model
_DIR_PATH = pathlib.Path(__file__).parent.joinpath("... | kcl-lang/kcl-py | test/test_units/test_kclvm/test_tools/test_doc/test_checker.py | test_checker.py | py | 2,149 | python | en | code | 8 | github-code | 36 | [
{
"api_name": "pathlib.Path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "kclvm.compiler.parser.parser.LoadProgram",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "kclvm.compiler.parser.parser",
"line_number": 16,
"usage_type": "name"
},
{
... |
26755841181 | from Crypto.Cipher import AES
from base64 import b64decode
import os
def main():
key = 'YELLOW SUBMARINE'
cipher = AES.new(key, AES.MODE_ECB)
file_path = os.path.expanduser('~/Downloads/7.txt')
with open(file_path, 'r') as f:
data = f.read()
data = b64decode(data)
msg = cipher.decrypt... | dominicle8/cryptopals | 1_7.py | 1_7.py | py | 398 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "Crypto.Cipher.AES.new",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "Crypto.Cipher.AES",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "Crypto.Cipher.AES.MODE_ECB",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "... |
22968912977 | from fastapi import APIRouter, Depends, Request
from sqlalchemy.orm import Session
from components.auth.logics import AuthLogic
from config.settings import get_db
from framework.api_response import ApiResponse
from framework.decorators import default_api_response, classview
from components.auth.schemas import (
L... | minhhh-0927/cookiecutter-fastapi-sun-asterisk | {{cookiecutter.project_slug}}/components/auth/routers.py | routers.py | py | 857 | python | en | code | 13 | github-code | 36 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.Session",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "fastapi.Depends",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "config.setti... |
7662718828 | import sqlite3
import urllib
from bs4 import BeautifulSoup
from datetime import datetime
conn = sqlite3.connect('pftcrawlerdb.sqlite')
cur = conn.cursor()
# Setup database
cur.executescript('''
DROP TABLE IF EXISTS Podcasts;
DROP TABLE IF EXISTS Appearances;
CREATE TABLE Podcasts (
id INTEGER NOT NULL PRIMAR... | astewa13/PFTCrawler | ScrapeEarwolf.py | ScrapeEarwolf.py | py | 2,589 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sqlite3.connect",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "urllib.urlopen",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
... |
15936612595 | import os
import atexit
import asyncio
import aiohttp
import requests
from scraper import scrape
from models import db, Movie
from flask import Flask, jsonify, request, abort
from apscheduler.schedulers.background import BackgroundScheduler
app = Flask(__name__)
# SQLAlchemy configurations
app.config['SQLALCHEMY_DAT... | Joseph-Villegas/JS-New-DVD-Releases | backend/app.py | app.py | py | 6,279 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "models.db.init_app",
"... |
2530109965 | from typing import Tuple
from pricer.pricer import Offer, Basket, Catalogue
def multibuy(item: str, buy: int, get: int) -> Offer:
def offer(basket: Basket, catalogue: Catalogue) -> Tuple[float, Basket]:
basket = basket.copy()
if item not in basket or item not in catalogue:
return 0... | zamkot/basket_pricer | pricer/offers.py | offers.py | py | 950 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pricer.pricer.Basket",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "pricer.pricer.Catalogue",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "pricer.pricer.... |
41068976001 | from matplotlib import pyplot as plt
from matplotlib import font_manager
# 设置中文
# !本字体路径为本机一款字体路径,运行时可任意替换为系统中的一款中文字体路径,必须为中文字体,系统不限:Windows/macOS/Linux
my_font = font_manager.FontProperties(
fname='C:\Windows\Fonts\STFANGSO.TTF')
# 设置图片大小
plt.figure(figsize=(20, 8), dpi=80)
# 数据
x_3 = range(1, 32)
x_10 = range(... | XiongZhouR/python-of-learning | matplotlib/scatter.py | scatter.py | py | 1,563 | python | zh | code | 1 | github-code | 36 | [
{
"api_name": "matplotlib.font_manager.FontProperties",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "matplotlib.font_manager",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 8,
"usage_type": "call"
},
{
... |
34400546796 | from pages.courses.register_course_page import RegisterCoursePage
from utilities.test_status import TestStatus
from pages.home.login_page import LoginPage
import unittest
import pytest
from ddt import ddt, data, unpack
import time
from pages.home.navigation_page import NavigationPage
@pytest.mark.usefixtures("oneTime... | dragosavac/Testing_Framework | tests/courses/course_test.py | course_test.py | py | 1,440 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "unittest.TestCase",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "pages.courses.register_course_page.RegisterCoursePage",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "utilities.test_status.TestStatus",
"line_number": 19,
"usage... |
37351904509 | # This file is part of avahi.
#
# avahi is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# avahi is distributed in the hope tha... | RMerl/asuswrt-merlin | release/src/router/avahi-0.6.31/avahi-python/avahi/__init__.py | __init__.py | py | 3,082 | python | en | code | 6,715 | github-code | 36 | [
{
"api_name": "dbus.Byte",
"line_number": 94,
"usage_type": "call"
}
] |
41730576127 | # Create the grid
import numpy as np
import pygame
grid_size = 20
# The abstract representation of the grid.
# A nxn grid
grid = np.zeros((grid_size, grid_size))
pygame.init()
screen_width, screen_height = 600, 600
screen = pygame.display.set_mode((screen_width, screen_height))
clock = pygame.time.Clock()
class ... | crimsondevi/PathThroughDestruction | grid.py | grid.py | py | 2,736 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.zeros",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pygame.init",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pygame.display",
... |
20591380597 | from django.contrib.auth.models import AbstractUser
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
from api_yamdb.settings import ADMIN, MODERATOR, ROLE_CHOICES, USER
from .validators import validate_year
class User(AbstractUser):
"""Модель пользователя, доба... | QBC1/api_yamdb | api_yamdb/reviews/models.py | models.py | py | 4,957 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "django.contrib.auth.models.AbstractUser",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.db.models.TextField",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.db.models",
"line_number": 13,
"usage_type": "name"
},
{
... |
12484573322 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from pathlib import Path
from urllib.parse import urlparse
from urllib.request import urlretrieve
from sklearn.metrics import roc_auc_score
def download(url):
"""Downloads a file if it doesn't already exist.
Args:
url: string or... | drivendataorg/tutorial-flu-shot-learning | utils.py | utils.py | py | 3,053 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "urllib.parse.urlparse",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "urllib.request.urlret... |
36953625709 | __all__ = [
'MatchesException',
'Raises',
'raises',
]
import sys
from testtools.compat import (
classtypes,
_error_repr,
isbaseexception,
istext,
)
from ._basic import MatchesRegex
from ._higherorder import AfterPreproccessing
from ._impl import (
Matcher,
Mismatch,
)
... | mongodb/mongo | src/third_party/wiredtiger/test/3rdparty/testtools-0.9.34/testtools/matchers/_exception.py | _exception.py | py | 4,567 | python | en | code | 24,670 | github-code | 36 | [
{
"api_name": "_impl.Matcher",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "_impl.Matcher.__init__",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "_impl.Matcher",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "testtools.compat.i... |
16253007713 | #!/usr/bin/env python3
"""
Database Aggregator from a Kafka Consumer.
Author: Santhosh Balasa
Email: santhosh.kbr@gmail.com
Date: 18/May/2021
"""
import sys
import logging
import psycopg2
from kafka import KafkaConsumer
logging.basicConfig(
format=f"%(asctime)s %(name)s %(levelname)-8s %(message)s",
level=l... | sbalasa/WebMonitor | db_aggregator.py | db_aggregator.py | py | 2,697 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "logging.basicConfig",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "kafka.KafkaCo... |
36777613557 | from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
driver = webdriver.Chrome()
driver.get('https://www.dummyticket.com/dummy-ticket-for-visa-application/')
driver.maximize_window()
d... | blessycheriyan/Selenium_From_Scratch | part-13/bootstrap.py | bootstrap.py | py | 651 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.common.by.By.XPATH",
"line_number": 10,
"usage_type": "attribute"
},
{
... |
12507519121 | # BFS
# 이모티콘
from collections import deque
s = int(input())
q = deque([(1, 0, 0)]) # 만들어진 이모티콘, 시간
visited = [[False] * 1001 for _ in range(1001)]
visited[1][0] = True
while q:
now, copy, sec = q.popleft()
if now == s:
print(sec)
break
for i in ((now, now), (now+copy, copy), (now-1... | Hong-Jinseo/Algorithm | baekjoon/14226.py | 14226.py | py | 565 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "collections.deque",
"line_number": 7,
"usage_type": "call"
}
] |
71760950503 | """module for containing the code that produces charts"""
import os
from bokeh.charts import Bar, output_file, show, Line
from bokeh.models import HoverTool
# bar chart showing total response by HH group split by digital/paper
def bar_response(results_list, output_path):
output_dir = os.path.join(output_path, "c... | ONSdigital/FOCUS | create_graphs.py | create_graphs.py | py | 1,086 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.join",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.isdir",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": ... |
3855782251 | # %%
from sklearn.datasets import load_sample_image
import matplotlib.pyplot as plt
import seaborn as sns
with sns.axes_style('dark'):
img = load_sample_image('china.jpg')
plt.imshow(img)
# %%
print (img.shape)
# Rescacle the color so that they lie btw 0 and 1, then reshape the array to be
# a typical scikit-le... | haininhhoang94/wqu | MScFE650/Kmean_image.py | Kmean_image.py | py | 962 | python | en | code | 21 | github-code | 36 | [
{
"api_name": "seaborn.axes_style",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets.load_sample_image",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.imshow",
"line_number": 7,
"usage_type": "call"
},
{
"api_n... |
74901731943 | import time
import numpy as np
from librosa import load, stft, istft, resample
from librosa.output import write_wav
from sklearn.cluster import MiniBatchKMeans, FeatureAgglomeration
from sklearn import datasets
import warnings
# import matplotlib.pyplot as plt
import mir_eval
import corpus
from scipy.io import loa... | TeunKrikke/SourceSeparationNMF | CovNTF/beta_ntf_np.py | beta_ntf_np.py | py | 13,598 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "numpy.ones",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": ... |
71607160424 | import numpy as np
import matplotlib.pyplot as plt
from scipy import interpolate
import pyximport
pyximport.install()
import heat_solver
def coeff_dis(x):
alpha2 = np.zeros(len(x))
for i in range(len(x)):
if x[i] > 0.5:
alpha2[i]= 10
elif x[i]< 0.3:
alpha2[i]= 5
else:
alpha2[i] = 1
return alpha2... | jedman/numerics | src1/heat_nl_dis.py | heat_nl_dis.py | py | 2,702 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pyximport.install",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_nu... |
4109177627 | import dash
import dash_core_components as dcc
import dash_html_components as html
import plotly.express as px
import pandas as pd
import pickle
import json
import dash_table
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
"""... | arsalhuda24/credit_card_fraud_detection | fraud_detection/dash-app/app.py | app.py | py | 1,654 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "dash.Dash",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame.from_dict",
"lin... |
35862373343 | import logging
import time
from aiogram import F, Router
from aiogram.fsm.context import FSMContext
from aiogram.types import CallbackQuery, InlineKeyboardMarkup, Message
from sqlalchemy.orm import Session
from keyboards.keyboards import (
back_keyboard,
pagination_keyboard,
yes_no_keyboard,
)
from keyboa... | Studio-Yandex-Practicum/EdGame_bot | handlers/methodist_categories_handlers.py | methodist_categories_handlers.py | py | 19,739 | python | ru | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "aiogram.Router",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "aiogram.types.Message",
"line_number": 48,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.orm... |
40294597567 | import requests
import json
from urllib.parse import urlencode, quote_plus
def getBusInterval() :
api_key = 'g2B7EooEAgEwa++yErKYAhIk93i7tdYXP/3i5nOrRMN0Fmt78AnTzkaJUGqdsIUcqd7ITge5nUX0dAK/luCmFg=='
serviceKey = requests.utils.unquote(api_key)
api_url = 'http://ws.bus.go.kr/api/rest/busRouteInfo/getRoute... | CSID-DGU/2023-2-OSSP1-Idle-3 | data/graphDataProcessing/bus_data_processing/intervalTime/getBusInterval.py | getBusInterval.py | py | 771 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.utils.unquote",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "requests.utils",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "json.load",
... |
31757113296 | from django.db import models, transaction
from django.contrib.auth.models import AbstractUser
from django.core.exceptions import ValidationError
from django.db.models import JSONField
from django.db.models.signals import post_save
from django.dispatch import receiver
USER_TYPE_CHOICES = (
("customer", "Customer"),... | A7med3365/Project4-Backend | shop/models.py | models.py | py | 6,379 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.contrib.auth.models.AbstractUser",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "django.db.models",
"line_number": 17,
"usage_type": "name"
},
{
... |
35864159569 | # Import dependencies
import numpy as np
from keras.models import Sequential
from keras.layers import Activation, Dropout, UpSampling2D, Conv2D, Conv2DTranspose, MaxPooling2D
from keras.layers.normalization import BatchNormalization
from sklearn.utils import shuffle
from sklearn.model_selection import train_test_split
... | codeXing8/LaneRecognition | keras-cnn/train.py | train.py | py | 3,943 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "os.environ",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_numbe... |
42095536498 | from subprocess import call
import win32api
import win32gui
import win32con
import win32com.client
from enum import Enum
import sounddevice as sd
from scipy.io.wavfile import read
import requests
import json
import numpy as np
from settings import Settings
from logging import debug, warning, error
class MixerCommand... | schms27/raspi.pico.collection | pico.hid.service/sound_mixer.py | sound_mixer.py | py | 6,492 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "enum.Enum",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "settings.Settings",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "logging.debug",
"line_numbe... |
11998084066 | import htcondor
import classad
import time
def get_existing_resources(self, group):
"""
Get list of worker nodes
"""
try:
coll = htcondor.Collector()
results = coll.query(htcondor.AdTypes.Startd,
'PartitionableSlot=?=True',
["To... | prominence-eosc/prominence | prominence/backend/resources.py | resources.py | py | 1,061 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "htcondor.Collector",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "htcondor.AdTypes",
"line_number": 12,
"usage_type": "attribute"
}
] |
9824574989 | """
Classes related to OpenAPI-defined operations and their arguments and parameters.
"""
from __future__ import print_function
import argparse
import json
def parse_boolean(value):
"""
A helper to allow accepting booleans in from argparse. This is intended to
be passed to the `type=` kwarg for Argument... | rovaughn/linode-cli | linodecli/operation.py | operation.py | py | 4,061 | python | en | code | null | github-code | 36 | [
{
"api_name": "argparse.ArgumentTypeError",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentTypeError",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "argp... |
40513708895 | import sys
from textblob import TextBlob
import redis
import json
from multiprocessing import Pool
import signal
import logging
import cPickle
import sys
sys.path.insert(0, '../NLP/Wrapper/')
sys.path.insert(0, '../NLP/')
sys.path.insert(0, '../NLP/NaiveBayes')
sys.path.insert(0, '../NLP/MaximumEntropy')
sys.path.inser... | archanl/thetweetrises | backend/tweet_categorize.py | tweet_categorize.py | py | 5,629 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "sys.path.insert",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "sys.path.insert",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_nu... |
2465805518 | import glob
import os
import statistics
from .pid_data_evaluator import PidDataEvaluator
class OcrEvaluator:
def __init__(self, options):
# set properties
self.correct_line_ocr_log = options.correct_line_ocr_log
self.eval_main_text_only = options.eval_main_text_only
self.eval_annot... | ndl-lab/ndlocr_cli | submodules/ocr_line_eval_script/ocr_evaluator/ocr_evaluator.py | ocr_evaluator.py | py | 7,152 | python | en | code | 325 | github-code | 36 | [
{
"api_name": "os.path.splitext",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "os.path.basename",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pid_data_evaluator.Pid... |
9689098423 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import TestCase, RequestFactory, Client
from app.tests.mixins import AuthRouteTestingWithKwargs
from app.tests.mixins import Pep8ViewsTests
import app.views as views
performance = views.user_performance_views
class PasswordResetPep8Test... | Contrast-Security-OSS/DjanGoat | app/tests/views/test_users_performance.py | test_users_performance.py | py | 1,247 | python | en | code | 69 | github-code | 36 | [
{
"api_name": "app.views.user_performance_views",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "app.views",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.test.TestCase",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "ap... |
30280424346 | import requests
def get_random_wiki_article_link():
WIKI_RANDOM_LINK_API_URL = "https://en.wikipedia.org/w/api.php?action=query&list=random&rnnamespace=0&rnlimit=1&format=json"
response = requests.get(WIKI_RANDOM_LINK_API_URL)
if response.status_code == 200:
random_article_data = response.json()... | hafeezulkareem/python_scripts | get_random_wiki_article_link.py | get_random_wiki_article_link.py | py | 905 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 7,
"usage_type": "call"
}
] |
25464205303 | from django import forms
from .models import Event
from django.core.exceptions import ValidationError
from django.utils import timezone
tz = timezone.get_default_timezone()
class EventForm(forms.ModelForm):
date_date = forms.CharField(max_length=40, required=True, widget=forms.TextInput(attrs={'class': 'form-contr... | voc/voctoimport | event/forms.py | forms.py | py | 1,135 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.utils.timezone.get_default_timezone",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.utils.timezone",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.forms.ModelForm",
"line_number": 7,
"usage_type": "attribute"
},
... |
42578251551 | from tkinter import StringVar, Tk
from tkinter.ttk import Frame
import pytest
from pyDEA.core.gui_modules.data_frame_gui import DataFrame
from tests.test_gui_data_tab_frame import ParamsFrameMock
class ParentMock(Frame):
def __init__(self, parent):
super().__init__(parent)
self.progress_bar = {... | araith/pyDEA | tests/test_gui_data_frame.py | test_gui_data_frame.py | py | 998 | python | en | code | 38 | github-code | 36 | [
{
"api_name": "tkinter.ttk.Frame",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "tkinter.Tk",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pyDEA.core.gui_modules.data_frame_gui.DataFrame",
"line_number": 21,
"usage_type": "call"
},
{
"api_... |
4714548611 | """
Write simple languoid stats to build/languoids.json.
This is to allow comparison between two branches of the repos.
Intended usage:
```
git checkout master
glottolog-admin writelanguoidstats
git checkout <OTHER_BRANCH>
glottolog-admin check --old-languoids
```
"""
try:
from git import Repo
except ImportError:... | glottolog/pyglottolog | src/pyglottolog/admin_commands/writelanguoidstats.py | writelanguoidstats.py | py | 772 | python | en | code | 20 | github-code | 36 | [
{
"api_name": "git.Repo",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "git.Repo",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "git.Repo",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "clldutils.jsonlib.dump",
"line_number"... |
16764769514 | import dns.resolver
import sys
'''
Returns the dns records specified in rtypes, if you want to change this script feel free to do it. :)
To run this script just type --> python3 dnsenum.py <domain name> e.g domain name <example.com>
For the first import install dnspython using pip3 install dnspython
'''
def m... | Gl4uc0m4/InformationGatheringTools | dnsenum.py | dnsenum.py | py | 1,299 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.argv",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "dns.resolver.resolver.resolve",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "dns.resolver.resolver",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name":... |
2114660989 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
class MyUser(models.Model):
id = models.IntegerField(primary_key=True, verbose_name='ID')
username = models.CharField(max_length=255)
@classmethod
def get_sharding_table(cls, id=None):
piece = id % 2... | the5fire/django-sharding-demo | sharding_demo/app/models.py | models.py | py | 1,189 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.db.models.Model",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.models.IntegerField",
"line_number": 8,
"usage_type": "call"
},
{
"api_name"... |
11909593894 | from pprint import pprint
import boto3
import openpyxl
import time
import csv
def put_object(fileHash, request='', today = int(time.time()), dynamodb=None):
if not dynamodb:
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table('image-reuse-image-hash-dev')
response = table.put_item(
... | shakazi/aws_essential_scripts | upload_to_db.py | upload_to_db.py | py | 1,821 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "time.time",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "boto3.resource",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 44,
... |
35802251836 | import os
import config
from dotenv import load_dotenv
import neuronet
import markups as nav
import actions
import constants
import paths
import user_settings as settings
from utils import set_default_commands
import markovify
import logging
from gtts import gTTS
import asyncio
from aiogram import Bot, types, Dispat... | Lucifer13Freeman/Sunny-Telegram-Bot | bot.py | bot.py | py | 7,710 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.join",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_... |
5834016480 | import pygame, time
from math import pi, cos, sin
from random import randrange, random
WIDTH = 900
HEIGHT = 900
pygame.init()
screen = pygame.display.set_mode((WIDTH, HEIGHT))
class Branch:
tree = []
random_seed = []
def __init__(self, startPoint, angle, size, width):
self.width = width
... | YohannPardes/Fractal-tree | Versions/Tree_generator.py | Tree_generator.py | py | 2,195 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pygame.init",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "math.cos",
... |
751441711 | import torch
from torch import nn
import torch.nn.functional as F
#Useful for nn.Sequential
class Flatten(nn.Module):
def forward(self, input):
return input.view(input.size(0), -1)
#Picked from Udacity's PyTorch course
class CIFARNet(nn.Module):
def __init__(self, z_dim):
super(CIFARNet, self)... | guptv93/saycam-metric-learning | model/cifar_model.py | cifar_model.py | py | 1,929 | python | en | code | 8 | github-code | 36 | [
{
"api_name": "torch.nn.Module",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.nn.Module",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line... |
2735470039 | # 3rdpartyimports
import math
from sklearn.model_selection import (
cross_val_score, KFold, train_test_split, GridSearchCV, RepeatedKFold)
import matplotlib.pyplot as plt
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import (OneHotEncoder, StandardScaler,
Polyn... | chadk94/FreeThrowProjections | model.py | model.py | py | 5,208 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.get_dummies",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "math.isnan",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model.Lass... |
10841211976 | import logging
import pathlib
from flask import Blueprint, g, request, make_response
from flask_restplus import Resource, Namespace, fields, abort
from photos.model import SourceFolder
from photos.scanner import scan_source_folder
log = logging.getLogger(__name__)
sources_blueprint = Blueprint("sources", __name__)
... | sebbegg/photos | photos/web/resources/scanner.py | scanner.py | py | 1,419 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.Blueprint",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask_restplus.Namespace",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask_rest... |
72242760743 | from django.shortcuts import render
from django.http.request import QueryDict
from django.urls import reverse
from django.http import HttpResponseRedirect
from django.views.generic.base import TemplateView
from six.moves.urllib.parse import urlparse
from rest_framework.renderers import JSONRenderer
from rest_framework... | bfolks2/django-aviation | prepair/views.py | views.py | py | 4,566 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "api.flightplan_client.FlightPlanAPIClient",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "django.http.HttpResponseRedirect",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "django.urls.reverse",
"line_number": 31,
"usage_type": "call"
... |
3640835274 | import torch
import torch.nn as nn
import torch.optim as optim
from torchtext.legacy.datasets import Multi30k
from torchtext.legacy.data import Field, BucketIterator
import spacy
import numpy as np
import random
import math
import time
from model import Seq2Seq, Encoder, Decoder
def train(model, iterator, optimize... | HallerPatrick/two_hot_encoding | multihot/seq2seq/train.py | train.py | py | 4,787 | python | en | code | 6 | github-code | 36 | [
{
"api_name": "model.train",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.nn.utils.clip_grad_norm_",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 47,
"usage_type": "attribute"
},
{
"api_name": "model.parame... |
41629760399 | from django.shortcuts import render, redirect
import smtplib
from django.contrib.auth import get_user_model
from django.contrib.auth.decorators import login_required
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserChangeForm
from django.views import... | nrking0/votesite | votesite/views.py | views.py | py | 2,346 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.shortcuts.render",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "smtplib.SMTP",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "django.c... |
21119814957 | from typing import List
class Solution:
def vowelStrings(self, words: List[str], left: int, right: int) -> int:
s = set()
s.add('a'); s.add('e'); s.add('i'); s.add('o'); s.add('u')
ans = 0
i = 0
for word in words:
if left<=i<=right:
if word[0] in... | plattanus/leetcodeDAY | python/6315. 统计范围内的元音字符串数.py | 6315. 统计范围内的元音字符串数.py | py | 648 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
}
] |
17211879792 | from datetime import date
atual = date.today().year
totmaior = 0
totmenor = 0
for c in range(1, 8):
nasc = int(input(f'Em que ano a {c}° pessoa nasceu? '))
idade = atual - nasc
if idade >= 18:
totmaior += 1
else:
totmenor += 1
print(f'No total contamos {totmaior} maior de idade e {totmen... | GRSFFE/PythonExercicios | ex054.py | ex054.py | py | 344 | python | pt | code | 0 | github-code | 36 | [
{
"api_name": "datetime.date.today",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 2,
"usage_type": "name"
}
] |
74157473702 | from django.urls import path
from . import views
app_name = "core"
urlpatterns = [
path('author/', views.AuthorList.as_view(), name='list-author'),
path('author/<int:pk>/', views.AuthorDetail.as_view(), name='detail-author'),
path('book/', views.BookList.as_view(), name='list-book'),
path('book/<int:p... | PauloGuillen/library | libraryapi/core/urls.py | urls.py | py | 377 | python | en | code | 0 | github-code | 36 | [
{
"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",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
42149656698 | from PIL import Image
import numpy as np
import cv2
img = Image.open('back_img.jpg')
size = img.size
x_length = size[0]
print('x_length:', x_length)
y_length = size[1]
print('y_length:', y_length)
im_num = np.array(img)
img_blur = cv2.GaussianBlur(im_num, (5, 5), 0)
img_gray = cv2.cvtColor(img_blur, cv2.COLOR_BG... | magicnian/neteasy | myTest.py | myTest.py | py | 463 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "PIL.Image.open",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.GaussianBlur",
"line_numbe... |
216104646 |
from ast import Add
from flask import render_template, session, request, url_for, flash, redirect
from loja.produtos.models import Addproduto, Marca, Categoria
from loja import app, db, bcrypt
from .formulario import LoginFormulario, RegistrationForm
from .models import User
import os
@app.route('/admin')
def admi... | ReinierSoares/SiteFlask | loja/admin/rotas.py | rotas.py | py | 2,351 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.session",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "flask.flash",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask.redirect",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "flask.url_for",
"line_nu... |
8247731797 | import cvxopt
import cvxopt.solvers
from cvxopt.solvers import lp
from numpy import array
cvxopt.solvers.options['show_progress'] = False # disable cvxopt output
try:
import cvxopt.glpk
GLPK_IF_AVAILABLE = 'glpk'
# GLPK is the fastest LP solver I could find so far:
# <https://scaron.info/blog/linea... | furiiibond/Tinder | venv/Lib/site-packages/lpsolvers/cvxopt_.py | cvxopt_.py | py | 2,213 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "cvxopt.solvers",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "cvxopt.solvers",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "cvxopt.solvers",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "cvxopt.sol... |
23413088374 | # -*- coding: utf-8 -*-
"""
A disk cache layer to store url and its html.
"""
from __future__ import print_function
import os
import zlib
import diskcache
class CompressedDisk(diskcache.Disk): # pragma: no cover
"""
Serialization Layer. Value has to be bytes or string type, and will be
compressed usi... | MacHu-GWU/crawlib-project | crawlib/cache.py | cache.py | py | 3,738 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "diskcache.Disk",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "zlib.decompress",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "zlib.decompress",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "zlib.compress",
... |
30024110320 | from itertools import combinations
from scipy.optimize import fsolve
from copy import copy
from pdb import set_trace
INFT = float(10**10)
class Bound(object):
def __init__(self,x,y,r):
self.x , self.y , self.r = x , y , r
def fit(self,another_bound):
if another_bound.x == INFT :
retu... | ElderTrump/ball_in_box | ball_in_box/key_function.py | key_function.py | py | 2,583 | python | en | code | null | github-code | 36 | [
{
"api_name": "copy.copy",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "itertools.combinations",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "scipy.optimize.fsolve",
"line_number": 64,
"usage_type": "call"
}
] |
1437749316 | from django.urls import path, include
from . import views
from django.contrib.auth.views import auth_login
urlpatterns = [
path('', views.index, name='main_home'),
path('login', views.index, name='main_login'),
path('account/', views.account, name='main_account'),
path('feed/', views.feed, name='main_f... | chavkin94/YouDeo | main/urls.py | urls.py | py | 570 | python | en | code | 0 | github-code | 36 | [
{
"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",
... |
27452373548 | import json
import os
import re
import sys
class Request(object):
def __init__(self, getenv=os.getenv):
self.getenv_ = getenv
self.populate_options_()
self.populate_args_()
if sys.stdin.isatty() == False:
self.input = json.load(sys.stdin)
else:
self.i... | operable/pycog3 | cog/request.py | request.py | py | 1,830 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "os.getenv",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "sys.stdin.isatty",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_n... |
23741088080 | #! /Users/tianranmao/Projects/so1.0/venv/bin/python
import requests
from bs4 import BeautifulSoup
import datetime
import pytz
import time
import re
import os
# --------------------------------------------------------------------
# Main Function
# -----------------------------------------------... | timmao78/so1.0 | get_txt.py | get_txt.py | py | 7,564 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "datetime.datetim... |
13145223871 | #!/usr/bin/env python3
import argparse
import configparser
import json
import os
import tempfile
import shutil
import subprocess
import stat
import time
import dateutil
import dateutil.parser
import urllib.parse
from submitty_utils import dateutils, glob
import grade_items_logging
import write_grade_history
import in... | alirizwi/Submitty | bin/grade_item.py | grade_item.py | py | 29,887 | python | en | code | null | github-code | 36 | [
{
"api_name": "os.path.join",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 2... |
32191704409 | import time
from threading import Timer
import xmlrpc.client
from .edit import Edit
from .utils import firmwareWarning
import json
import os
import base64
class Session(object):
"""
Session object
"""
def __init__(self, sessionURL, mainAPI, autoHeartbeat=True, autoHeartbeatInterval=10):
self.... | ifm/o2x5xx-python | source/rpc/session.py | session.py | py | 12,153 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "xmlrpc.client.client.ServerProxy",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "xmlrpc.client.client",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "xmlrpc.client",
"line_number": 20,
"usage_type": "name"
},
{
"api_name... |
18694457154 | # -*- coding: utf-8 -*-
"""
Created on Tue Mar 21 11:14:59 2023
@author: giamp
"""
import scipy
import logging
import numpy as np
import hcd
import matplotlib.pyplot as plt
from hppdWC import utils
from hppdWC import plots
def cutInTime(x, y, interval):
'''
Given x (time array), y (values), and interval, eras... | mmtlab/wheelchair_contact_detection | hcd/xcorrelation.py | xcorrelation.py | py | 17,731 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.warning",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "hppdWC.utils.toFloatNumpyArray",
"line_number": 156,
"usage_type": "call"
},
{
"api_name": "hppdWC.utils",
"line_number": 156,
"usage_type": "name"
},
{
"api_name": "hppdWC.... |
1488340313 | # Code you have previously used to load data
import pandas as pd
from sklearn.metrics import mean_absolute_error
from sklearn.model_selection import train_test_split
from sklearn.tree import DecisionTreeRegressor
from sklearn.ensemble import RandomForestRegressor
# Path of the file to read
file_path = './home-data-fo... | tyrl76/Kaggle | House Prices/main.py | main.py | py | 1,604 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sklearn.ensemble.RandomForestRegressor",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.mean_absolute_error",
"line_number": 29,
"usage_type": "call"
},... |
37597891395 | # -*- coding: utf-8 -*-
"""
Created on Thu May 23 20:49:32 2019
@author: 18443
"""
import os
import time
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data as Data
from torch import optim
from torch.utils.data import DataLoader
import numpy as np
i... | yudmoe/neural-combination-of-HCTR | threeinput_training.py | threeinput_training.py | py | 14,833 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "torch.device",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "argparse.Argumen... |
74577237222 | import subprocess
from pathlib import Path
from typing import List
RESOURCE_PATH = Path("tests/resources")
def call_main(args: List[str]) -> List[str]:
root_path = Path("./")
filename = root_path / "rmsd/calculate_rmsd.py"
cmd = ["python", f"{filename}", *args]
proc = subprocess.Popen(cmd, stdout=... | charnley/rmsd | tests/context.py | context.py | py | 510 | python | en | code | 431 | github-code | 36 | [
{
"api_name": "pathlib.Path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "subprocess.Popen",
"line_numb... |
2894349509 | from typing import Dict
from src.property.PropertyFactory import PropertyFactory
from src.storage.common.entity.Entity import Entity
from src.template.entity.EntityTemplate import EntityTemplate
class EntityFactory:
def __init__(self, entity_template: EntityTemplate):
self.entity_template = entity_templ... | andreyzaytsev21/MasterDAPv2 | src/storage/common/entity/EntityFactory.py | EntityFactory.py | py | 714 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "src.template.entity.EntityTemplate.EntityTemplate",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "src.storage.common.entity.Entity.Entity",
"line_number": 14,
"usage_type": ... |
17076521686 | from fastapi import FastAPI, HTTPException, status
import uvicorn
import requests
app = FastAPI(debug=True)
BTCUSD=[]
@app.get('/')
def index():
return {'msg': 'VSETKO JE OK'}
@app.get('/usd2btc')
def USD_current_price():
re = requests.get('https://api.coindesk.com/v1/bpi/currentprice.json')
if re.statu... | fortisauris/PyDevJR_Course | FA02_FASTAPI_BTC/main.py | main.py | py | 1,498 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "fastapi.HTTPException",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "fastapi.status.HTTP... |
27283966186 | import copy
import math
from pypaq.lipytools.printout import stamp, progress_
from pypaq.lipytools.pylogger import get_pylogger, get_child
from pypaq.mpython.mptools import Que, QMessage
from torchness.tbwr import TBwr
import random
import statistics
import time
from tqdm import tqdm
from typing import Dict, List, Tupl... | piteren/pypoks | podecide/games_manager.py | games_manager.py | py | 25,904 | python | en | code | 19 | github-code | 36 | [
{
"api_name": "statistics.stdev",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "typing.Optional",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
... |
10058551191 | import numpy as np
from scipy.integrate import solve_ivp
class VanDerPolOscillator:
def __init__(self, epsilon):
self.epsilon = epsilon
def coupledEquation(self, t, x):
x1 = x[0]
x2 = x[1]
fx1 = x2
fx2 = -x1 - (self.epsilon * ((x1 ** 2) - 1) * x2)
return np.arr... | MFournierQC/PhysiqueNumerique | TP3/VanDerPolOscillator.py | VanDerPolOscillator.py | py | 685 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.array",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "scipy.integrate.solve_ivp",
"line_number": 18,
"usage_type": "call"
}
] |
75226770345 | from django.core.exceptions import ValidationError
from django.db import models
from django.urls import reverse
from django.utils.text import slugify
from django_resized import ResizedImageField
from .base import BaseModel
from .images import Images
def file_size(value):
limit = 6 * 1024 * 1024
if value.size ... | KennyDaktyl/miktel_shop | web/models/articles.py | articles.py | py | 2,215 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.core.exceptions.ValidationError",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "base.BaseModel",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "django.db.models.AutoField",
"line_number": 17,
"usage_type": "call"
},
{
"... |
35658678468 | """The filtersets tests module."""
import pytest
from django.db.models.query import QuerySet
from django.http.request import HttpRequest
from communication.filtersets import (_get_interlocutors, _get_recipients,
_get_reviews, _get_senders)
pytestmark = pytest.mark.django_db
def... | webmalc/d8base-backend | communication/tests/filtersets_tests.py | filtersets_tests.py | py | 1,658 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pytest.mark",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "django.db.models.query.QuerySet",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "communication.filtersets._get_reviews",
"line_number": 14,
"usage_type": "call"
},
{
... |
15197021379 | import argparse
import socket
import sys
import json
import urllib.request
import redis
import base64
import re
import boto3
import os
import subprocess
from faker import Faker
import logging
logging.basicConfig(level=logging.DEBUG)
fake = Faker('en_US')
Faker.seed(1337)
kms_client = boto3.client('kms')
kms_key_id =... | SMonaghan/nitro-enclave-with-redis | files/server.py | server.py | py | 5,032 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.basicConfig",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "faker.Faker",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "faker.Faker.seed",... |
41260980135 | from geometry_msgs.msg import Twist
import pyzbar.pyzbar as pyzbar
from datetime import datetime
import pyrealsense2 as rs
import numpy as np
import schedule
import rospy
import time
import cv2
frame_crop_x1 = 0
frame_crop_y1 = 120
frame_crop_x2 = 639
frame_crop_y2 = 479
minLineLength = 30
maxLineGap = 15
speed = 0
... | LEEJUNHO95/ROS_project | line_detect.py | line_detect.py | py | 8,101 | python | en | code | 5 | github-code | 36 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "cv2.CAP_PROP_FRAME_HEIGHT",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "cv2.... |
3647124333 | import commands
import sys
sys.path.append('../../')
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings")
import django
django.setup()
path = os.getcwd()
pangu_info = "/".join([path,"mysite/config/ecs_pangu.txt"])
def parse_srv_status():
oss_srv_stat = {}
ret = []
pangu_srv_... | luvensin/privateCloudMonitor | mysite/mysite/config/parse_data_ecs_pangu.py | parse_data_ecs_pangu.py | py | 689 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.path.append",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.environ.setdefault",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.environ",
"li... |
1065889096 | import numpy as np
import matplotlib.pyplot as plt
import sys
def h(X, theta):
return 1 / (1 + np.e ** -(X.dot(theta.T)))
def J(X, y, theta):
m = X.shape[0]
y_hat = h(X, theta)
erro = (-y * np.log(y_hat) - (1-y) * np.log(1-y_hat)).sum(0)
return erro / m
def GD(X, y, theta, alpha, niters):
m = X.shape[0]
cos... | brunoprograma/machine_learning | aula_03/LRegression.py | LRegression.py | py | 1,934 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.e",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "numpy.log",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.min",
"line_number": 30,
... |
1900770945 | # -*- coding: utf-8 -*-
"""
Created on Tue Dec 5 21:43:03 2017
@author: ly
"""
import numpy as np
import pandas as pd
import os
import seaborn as sns # data visualization library
import matplotlib.pyplot as plt
import xgboost as xgb
import math
from sklearn import metrics
from sklearn.model_selection import KFold
f... | LiuyangJLU/Dementia | 1205test.py | 1205test.py | py | 7,023 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.KFold",
"line_number": 88,
"usage_type": "call"
},
{
"api_name": "pandas.DataFr... |
74574329062 | # -*- coding: utf-8 -*-
#
# Author: Ingelrest François (Francois.Ingelrest@gmail.com)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any... | gabrielmcf/biel-audio-player | src/modules/StatusIcon.py | StatusIcon.py | py | 8,708 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "gettext.gettext",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "modules.Module",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "modules.Module.__init__",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "modules.M... |
12198741928 | import pandas as pd
import streamlit as st
import fitz
from PIL import Image
from dataExtractor import DataExtractor
from image2 import Canvas
from firebase import FirebaseDB
import json
from st_keyup import st_keyup
json_data = {'Tear Down': ['cable', 'bomba', 'intake'],
'Production': ['simula... | gapastorv/st_rca_project | v2-incomplete/pages/Parsing.py | Parsing.py | py | 12,399 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "streamlit.write",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "streamlit.session_state",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "fitz.open",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "fitz.Matrix",
... |
5798683173 | import pygame
from SupportFuncs import load_image
class URadioButtons(pygame.sprite.Sprite):
def __init__(self, screen, coords, group):
super(URadioButtons, self).__init__(group)
self.coords = coords
self.buttons = []
self.checked_button = 0
self.font = pygame.font.Font('fo... | musaewullubiy/BigTaskMapAPI | UTINGAME.py | UTINGAME.py | py | 6,461 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pygame.sprite",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "pygame.font.Font",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pygame.font",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pygame.Surface",
... |
28224798976 | """
Given a list of numbers, calculate another list in which
i_th element is the product of all numbers in the list except
the original i_th element.
"""
from functools import reduce
from typing import List
def solution_1(input_nums: List[int]) -> List[int]:
"""Calculate the result list via the first solution.""... | HomayoonAlimohammadi/Training | DailyProblem/19_6_2022.py | 19_6_2022.py | py | 1,176 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "typing.List",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "functools.reduce",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_numb... |
788517980 | import os, gtts, PIL, praw, PIL.Image, PIL.ImageDraw, PIL.ImageFont, moviepy.editor, shutil
class program: #the main class
class output: #the class for controlled stdout within the program
outputEnabled = True #controls whether or not to print controlled output lines
def print(string) -> None:... | renamedquery/automatic-askreddit-video-maker | video-maker.py | video-maker.py | py | 10,898 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "os.listdir",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.mkdir",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "gtts.gTTS",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "praw.Reddit",
"line_number": 25,
... |
14918571499 | from pyspark import SparkConf, SparkContext
from pyspark.streaming import StreamingContext
from pyspark.streaming.kafka import KafkaUtils
from cassandra.cluster import Cluster
import signal
# if (contents.length > 0 && !contents[0].equalsIgnoreCase("year") && !contents[18].equalsIgnoreCase("1")) {
# String origin ... | karthikBG/AviationAnalytics | SparkStreaming/2.1.TopAirlinesByAirport.py | 2.1.TopAirlinesByAirport.py | py | 3,139 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "cassandra.cluster.Cluster",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pyspark.streaming.kafka.KafkaUtils.createDirectStream",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "pyspark.streaming.kafka.KafkaUtils",
"line_number": 77,
"... |
75006697064 | from .models import TodoModel
from django import forms
class TodoForm(forms.ModelForm):
class Meta:
model = TodoModel
fields = '__all__'
labels ={
'subject':'',
'details':'',
}
widgets = {
'subject': forms.TextInput(attrs={... | SalmanMirSharin/Django-ToDo-App | todo/forms.py | forms.py | py | 611 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "models.TodoModel",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.forms.T... |
31012134032 | from django.db import connection
def ingredient_name_and_amount_query(receipt_id):
with connection.cursor() as cursor:
cursor.execute(f"SELECT ingredient_calories.ingredient_name, receipt_ingredient.amount, receipt_ingredient.amount_type \
FROM receipt_ingredient \
... | ravityeho/recipes | recipes_and_more_app/custom_queries.py | custom_queries.py | py | 2,179 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.db.connection.cursor",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.db.connection",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.db.connection.cursor",
"line_number": 21,
"usage_type": "call"
},
{
"api_na... |
43418734139 | import findspark
findspark.init()
from operator import add
from pyspark import SparkContext
from pyspark.sql import SparkSession
from pyspark.sql.types import IntegerType
from pyspark.sql import *
if __name__ == "__main__":
spark = SparkSession \
.builder \
.appName("q4") \
.g... | saitejapeddi/pyspark | q4.py | q4.py | py | 1,671 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "findspark.init",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder.appName",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder",
"line_number": 11,
"usage_type": "attribute"
... |
70786900903 | import copy, re
from django.core import validators
from django.core.exceptions import ImproperlyConfigured, ValidationError
from django.utils.deconstruct import deconstructible
from django.utils.translation import gettext_lazy as _
__all__ = ['EmptyValidator', 'KeysValidator', 'MD5ChecksumValidator']
class EmptyVal... | davidfischer-ch/pytoolbox | pytoolbox/django/core/validators.py | validators.py | py | 2,541 | python | en | code | 38 | github-code | 36 | [
{
"api_name": "django.core.validators.RegexValidator",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "django.core.validators",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.utils.translation.gettext_lazy",
"line_number": 13,
"usage_type"... |
27884844846 | import sys, os, string, random, psycopg2, sqlite3
from sqlalchemy import Column, ForeignKey, Integer, String, DateTime, Float, Boolean, Text
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship, sessionmaker, backref, scoped_session
from sqlalchemy import create_engine
from s... | ryanwaite28/cmsc-495-project-backend | models.py | models.py | py | 10,173 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sqlalchemy.ext.declarative.declarative_base",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integer",
"line_number": 17,
"usage_type": "argument"
},
{
... |
73037033705 | import pathlib
import sys
import typing
import flash
import flash.image
import pytorch_lightning
import torch
import torchmetrics
import torchvision
import enpheeph
import enpheeph.injections.plugins.indexing.indexingplugin
CURRENT_DIR = pathlib.Path(__file__).absolute().parent
RESULTS_DIRECTORY = CURRENT_DIR / "re... | Alexei95/enpheeph | papers/iros2022/comparisons/tensorfi2/alexnet-cifar10.py | alexnet-cifar10.py | py | 13,471 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "pathlib.Path",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pytorch_lightning.LightningModule",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "torc... |
9322300717 | # fit a second degree polynomial to the economic data
from numpy import arange,sin,log,tan
from pandas import read_csv
from scipy.optimize import curve_fit
from matplotlib import pyplot
# define the true objective function
def objective(x):
return 0.01006304431397636*sin(0.009997006528342673*x+0.010000006129223197)+0... | atul1503/curve-fitting | Custom_Function_Graph_Plotter_without_curve_fit.py | Custom_Function_Graph_Plotter_without_curve_fit.py | py | 907 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.sin",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot"... |
16159941777 | import asyncio
import atexit
import logging
import os
import signal
import subprocess
import time
import supriya.exceptions
logger = logging.getLogger("supriya.server")
class ProcessProtocol:
def __init__(self):
self.is_running = False
atexit.register(self.quit)
def boot(self, options, scsy... | MusicAsCode/supriya | supriya/realtime/protocols.py | protocols.py | py | 4,257 | python | en | code | null | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "atexit.register",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "subprocess.Popen",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "subprocess.STDOUT"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.