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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
24681181962 | import streamlit as st
from transformers import T5Tokenizer, T5ForConditionalGeneration
from transformers import pipeline
import torch
#model and tokenizer loading
checkpoint = "LaMini-Flan-T5-248M"
tokenizer = T5Tokenizer.from_pretrained(checkpoint)
base_model = T5ForConditionalGeneration.from_pretrained(checkpoint,... | Shoaib-Alauudin/Text-Summarization-Using-LLM | app.py | app.py | py | 1,650 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "transformers.T5Tokenizer.from_pretrained",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "transformers.T5Tokenizer",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "transformers.T5ForConditionalGeneration.from_pretrained",
"line_number": 9,
... |
25352417620 | # coding: utf-8
__author__ = "humkyung <humkyung@atools.co.kr>"
# Imports
import os, sys
import vtk
from enum import IntEnum
class NetworksJsonImporter:
KEY = vtk.vtkInformationStringVectorKey.MakeKey('Attribute', 'vtkActor')
def __init__(self):
self._file_path = None
self._nodes = {}
... | humkyung/AViewer | NetworkxJson/NetworkxJsonImporter.py | NetworkxJsonImporter.py | py | 2,564 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "vtk.vtkInformationStringVectorKey.MakeKey",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "vtk.vtkInformationStringVectorKey",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path.isfile",
"line_number": 27,
"usage_type": "call"... |
35063056732 | from json import JSONDecoder, dumps
from rest_framework.generics import get_object_or_404
from rest_framework.response import Response
from rest_framework.views import APIView
from django.db.models import ObjectDoesNotExist
from api.models import Record, KeysToken, ChildRecord, User, UnregisteredRecord
from api.seri... | cann1neof/mrecord | backend/api/views/view_edit.py | view_edit.py | py | 6,173 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "rest_framework.views.APIView",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "serv.MRDApi.Cryptographer",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "rest_framework.generics.get_object_or_404",
"line_number": 18,
"usage_type": "call... |
6486476570 | #!/usr/local/bin/python
# -*- coding: utf-8 -*-
from django.shortcuts import render_to_response
from django.template import RequestContext
from lavidaorganic.apps.talleres.models import Taller
from paypal.standard.forms import PayPalPaymentsForm
from django.shortcuts import get_object_or_404
import datetime
def taller... | Reston/lavidaorganic | lavidaorganic/lavidaorganic/apps/talleres/views.py | views.py | py | 1,372 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "lavidaorganic.apps.talleres.models.Taller.objects.filter",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "lavidaorganic.apps.talleres.models.Taller.objects",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "lavidaorganic.apps.talleres.model... |
21402553475 | from pyTasks.tasks import Task, Parameter
from pyTasks.utils import containerHash
from .graph_tasks import GraphPruningTask
from .mongo_tasks import MongoResourceTarget
from sklearn.model_selection import KFold
import numpy as np
from bson.code import Code
def non_filter(label):
return False
def identity(obj):
... | cedricrupb/pySVRanker | frequent_pattern_tasks.py | frequent_pattern_tasks.py | py | 2,344 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "pyTasks.tasks.Task",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "pyTasks.tasks.Parameter",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "graph_tasks.GraphPruningTask",
"line_number": 26,
"usage_type": "call"
},
{
"api_name"... |
38775154404 | import random
import os
import cv2
import numpy as np
import pickle
from matplotlib import style
from AI_KNearestAlogrithm import Classifier
np.set_printoptions(threshold=np.inf, suppress=True)
style.use('fivethirtyeight')
class FacialClassifier:
def __init__(self):
self.frame_array = []
... | olusegvn/Defence-and-Privacy-mechanisms | AI_FacialRecognition.py | AI_FacialRecognition.py | py | 6,190 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.set_printoptions",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.inf",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.style.use",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.st... |
37528229182 | import bs4 as bs
from urllib import request
def get_urls(file):
f = open(file,"r")
urls = []
for line in f.readlines():
urls.append(line)
return urls
def enter_urls(file,urls):
f = open(file,'w')
for url in urls:
f.write(url+'\n')
f.close()
def make_unique(... | stefanivus/Web-scraping | Web Cralwer.py | Web Cralwer.py | py | 1,017 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "urllib.request",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 31,
"usage_type": "call"
}
] |
20606152072 | import psutil
from influxdb import InfluxDBClient
import time
client = InfluxDBClient(host='localhost', port=8086)
client.create_database('system')
measurement_name = 'system_data'
data_end_time = int(time.time() * 1000)
data = []
cpu_p, mem_p, disk_read, disk_write, net_sent_now, net_recv_now, temp, \
boot_time,... | rishabh-22/influxdb-scripts | system_data_insert.py | system_data_insert.py | py | 2,150 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "influxdb.InfluxDBClient",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "psutil.net_io_counters",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "time.time",
... |
38454000752 | from collections import defaultdict
def factorize(n):
if n == 1:
return 0
factor = defaultdict(int)
while True:
isPrime = True
for i in range(2, int(n**0.5)+1):
if n % i == 0:
factor[i] += 1
n = n // i
isPrime = False
... | LightPotato99/baekjoon | math/prime/primeland.py | primeland.py | py | 766 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.defaultdict",
"line_number": 7,
"usage_type": "call"
}
] |
36164982911 | from PyQt6 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(1500,200)
MainWindow.setStyleSheet("background-color: #282828")
self.centralwidget = QtWidgets.QWidget(MainWindow)... | Framon64/CryptoProgram | programWindow.py | programWindow.py | py | 11,677 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "PyQt6.QtWidgets.QWidget",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "PyQt6.QtWidgets",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "PyQt6.QtWidgets.QGridLayout",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "P... |
6399955298 | # welcome to tweet-yeet – lets yeet those tweets!
from datetime import datetime, timedelta
import tweepy
if __name__ == "__main__":
# options
delete_tweets = True
deletes_favs = False
censor= True
days_to_keep = 7
censor_word = "word"
# api info
consumer_key = 'XXXXXXXX'
consumer_s... | Malcolmms/tweet_yeet | main.py | main.py | py | 1,769 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tweepy.OAuthHandler",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "tweepy.API",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.utcnow",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "datetime.date... |
33917530992 | from dateutil.parser import parse as parse_date
from flask import current_app
from inspire_dojson import record2marcxml
from inspire_utils.record import get_value
from lxml import etree
def dumps_etree(pid, record, **kwargs):
"""Dump MARC21 compatible record.
:param pid: The :class:`invenio_pidstore.models.Pe... | SCOAP3/scoap3-next | scoap3/modules/records/oai_serializer.py | oai_serializer.py | py | 1,264 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "dateutil.parser.parse",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "inspire_utils.record.get_value",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "flask.current_app.config.get",
"line_number": 31,
"usage_type": "call"
},
{
... |
1848378529 | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.action_chains import ActionChains
import pyperclip
import time
def copy_input(driver, xpath, input) :
pyperclip.copy(input)
driver.find_element_b... | SLT-DJH/selenium-test | test.py | test.py | py | 1,484 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pyperclip.copy",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.common.action_chains.ActionChains",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.common.keys.Keys.CONTROL",
"line_number": 11,
"usag... |
12050806024 | """Setup the tilemap and the camera"""
import pygame as pg
from settings import TILESIZE, MAPSIZE, VIEWSIZE
from tile import Tile
class Camera():
"""A camera like"""
def __init__(self, width, height):
self.camera = pg.Rect(0, 0, width, height)
self.width = width
self.height = height
... | Barbapapazes/dungeons-dragons | map_editor/tilemap.py | tilemap.py | py | 1,448 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "pygame.Rect",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pygame.key.get_pressed",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pygame.key",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "pygame.K_i",
"... |
20362021082 | from rest_framework.decorators import api_view
from rest_framework.response import Response
from account.models import User
from store.models import Product
from django.contrib.auth.decorators import login_required
from account.authentication import create_access_token, create_refresh_token, decode_access_token, decode... | MTrungNghia/Gundam_web | BackEnd/GundamMTN/Orders/views.py | views.py | py | 4,330 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rest_framework.views.APIView",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "rest_framework.response.Response",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "rest_framework.status.HTTP_400_BAD_REQUEST",
"line_number": 22,
"usage_type... |
9766345042 | # Run this app with `python app.py` and
# visit http://127.0.0.1:8050/ in your web browser.
"""
Dashboard that shows user groups with percentages
and recommended books
"""
from dash import dcc, html
import plotly.express as px
import pandas as pd
from dash.exceptions import PreventUpdate
from dash.dependencies import I... | Johan-Ortegon-1/uaque | Dashboard/apps/dashboard_pertenencia.py | dashboard_pertenencia.py | py | 5,360 | python | es | code | 0 | github-code | 6 | [
{
"api_name": "dash.html.Div",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "dash.html",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "dash.html.H1",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "dash.html",
"line_number": 3... |
12978124343 | import sys
from pymongo import MongoClient,DESCENDING,ASCENDING
def get_rank(user_id):
client =MongoClient()
db = client.shiyanlou
contests = db.contests
#计算用户 user_id 的排名,总分数以及花费的总时间
#排名的计算方法:
# 1.找到user_id所对应的信息总和,即得分总数,用时总数
# 2.根据得到的得分与用时,对应排名规则,筛选出排名在该用户前的所有用户
# 3.对筛选结果进行计数,... | JockerMa/syl_challenge3 | getrank.py | getrank.py | py | 2,282 | python | zh | code | 0 | github-code | 6 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 67,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number... |
36849894613 | import tensorflow.compat.v1 as tf
print(tf.__version__)
import matplotlib.pyplot as plt
import numpy as np
from datetime import datetime
from graphnnSiamese import graphnn
from utils import *
import os
import argparse
import json
parser = argparse.ArgumentParser()
parser.add_argument('--device', type=str, default='0,1... | DeepSoftwareAnalytics/LibDB | main/torch/get_threshold.py | get_threshold.py | py | 5,724 | python | en | code | 31 | github-code | 6 | [
{
"api_name": "tensorflow.compat.v1.__version__",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.compat.v1",
"line_number": 2,
"usage_type": "name"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"... |
74222296187 | #!/usr/bin/env python
# coding: utf-8
import pandas as pd
import matplotlib.pyplot as plt
import geopandas as gpd
import requests
# For storing png files in memory
import io
# For generating GIF
import imageio
###########################################################
########## Globals....
######################... | mulroony/SDCovidGIFMap | CovidMapFullMinimal.py | CovidMapFullMinimal.py | py | 6,244 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "geopandas.GeoDataFrame.fro... |
26625562386 | """A Mailman newsletter subscription interface.
To use this plugin, enable the newsletter module and set the newsletter module and name settings
in the admin settings page.
"""
from django.utils.translation import ugettext as _
from Mailman import MailList, Errors
from models import Subscription
from livesettings imp... | dokterbob/satchmo | satchmo/apps/satchmo_ext/newsletter/mailman.py | mailman.py | py | 5,119 | python | en | code | 30 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "models.Subscription.email_is_subscribed",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "models.Subscription",
"line_number": 19,
"usage_type": "name"
},
{
"api... |
724197866 |
from time import time
from flask import render_template, redirect, url_for, flash, make_response, current_app, request, abort
from flask.json import jsonify
from flask.ext.login import login_required, current_user
from etherpad_lite import EtherpadLiteClient
from . import main
from .forms import UserDefaultRoom
from... | compeit-open-source/dashboard | app/main/views.py | views.py | py | 4,544 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "flask.redirect",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "flask.url_for",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "flask.ext.login.current_user.is_authenticated",
"line_number": 23,
"usage_type": "call"
},
{
"api_na... |
7092756844 | #!/usr/bin/env python3
import ast
import astor
expr_l = """
for e in g.Edges():
e.dst["sum1"] += e.data123
for e in g.Edges():
e["data1"] = e.data2 / e.dst.sum1
"""
expr_l_ast = ast.parse(expr_l)
print(ast.dump(expr_l_ast))
def is_call_edges(call):
if isinstance(call, ast.Call):
f_func = call.fun... | K-Wu/python_and_bash_playground | pyctor/astor_edge_loop_to_node_loop.py | astor_edge_loop_to_node_loop.py | py | 4,511 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "ast.parse",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "ast.dump",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "ast.Call",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "ast.Attribute",
"line_number": 1... |
41767569580 | import numpy as np
from scipy.stats import norm
import matplotlib.pyplot as plt
class LinearDynamicSystem:
def __init__(self, gamma, sigma):
self.gamma = gamma
self.sigma = sigma
self.log_p_x_history = []
self.pred_mu_history = []
self.mu_history = []
self.pred_mu_... | faabl/class_seq | seq4-2.py | seq4-2.py | py | 3,796 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "matpl... |
15619190553 | import numpy as np
import os
from PIL import Image
from PIL import ImageFont, ImageDraw
import time
import core.utils as utils
import core.v_detection as detect
import cv2
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-i', type=str, default="./1.mp4", help="input video")
parser.add_argument('... | byq-luo/vehicle_detection-1 | video_clients.py | video_clients.py | py | 1,122 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cv2.VideoWriter_fourcc",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "cv2.V... |
17944469658 | import tensorflow as tf
from keras.layers.convolutional import Conv2D, MaxPooling2D
from keras.layers.core import Dense, Activation, Flatten
# import tensorflow as tf
# tf.python.control_flow_ops = tf # some hack to get tf running with Dropout
# 224x224
def alex_net_keras(x, num_classes=2, keep_prob=0.5):
x = C... | CharlesLoo/stockPrediction_CNN | alexnet_keras.py | alexnet_keras.py | py | 1,831 | python | en | code | 13 | github-code | 6 | [
{
"api_name": "keras.layers.convolutional.Conv2D",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "keras.layers.core.Activation",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "keras.layers.convolutional.MaxPooling2D",
"line_number": 15,
"usage_type":... |
26310660224 | from alarmageddon.publishing.hipchat import HipChatPublisher
from alarmageddon.result import Failure
from alarmageddon.result import Success
from alarmageddon.publishing.exceptions import PublishFailure
from alarmageddon.validations.validation import Validation, Priority
import pytest
#Successes aren't sent, so monke... | PearsonEducation/Alarmageddon | tests/publishing/test_hipchat.py | test_hipchat.py | py | 2,640 | python | en | code | 15 | github-code | 6 | [
{
"api_name": "pytest.fixture",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "alarmageddon.publishing.hipchat.HipChatPublisher",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pytest.raises",
"line_number": 25,
"usage_type": "call"
},
{
... |
27089945038 | #=============================================================================================================#
# HOW TO RUN? #
# python3 chop_segments.py ... | STEELISI/Youtube-PG | chop_segments.py | chop_segments.py | py | 3,488 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "csv.DictWriter",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "nltk.word_tokenize",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "nltk.word_tokenize",
"line_number": 62,
"usage_type": "call"
}
] |
34660089311 | import requests
from bs4 import BeautifulSoup
import csv
import os
URL = 'https://citaty.info/book/quotes'
HEADERS = {'user-agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0',
'accept': '*/*'}
FILE_CSV = 'quotations_csv.csv'
def get_html(url, params=None... | isorokina012/course_work | course_paper.py | course_paper.py | py | 1,737 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.startfile",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_nu... |
32584237829 | # #
import dash
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
app = dash.Dash(__name__, external_stylesheets=[dbc.themes.BOOTSTRAP])
card = dbc.Card(
[dbc.CardHeader("Header"), dbc.CardBody("Body", style={"height": 250})],
className="h-100",
)
... | thigbee/dashBootstrapThemeExplorer | gallery/layout_template_1.py | layout_template_1.py | py | 890 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "dash.Dash",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "dash_bootstrap_components.themes",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "dash_bootstrap_components.Card",
"line_number": 9,
"usage_type": "call"
},
{
"api_n... |
11036108434 | import wx
import PropToolPanel
import CollisionToolPanel
import POIToolPanel
class ToolBrowser(wx.Panel):
def __init__(self, parent, id):
wx.Panel.__init__(self, parent, id)
self.notebook = wx.Notebook(self, -1)
self.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGED, self.onPageChanged, self.notebook)
... | sdetwiler/pammo | editor/source/ToolBrowser.py | ToolBrowser.py | py | 1,872 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "wx.Panel",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "wx.Panel.__init__",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "wx.Panel",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "wx.Notebook",
"line_nu... |
4403084906 | import unittest
from pyunitreport import HTMLTestRunner
import parse_api_test_cases
import os
import time
from api_test_case import ApiTestCase
from parse_api_test_cases import TestCaseParser
import argparse
import logging
if __name__ == '__main__':
# Argument Parse
parser = argparse.ArgumentParser(
de... | PengDongCd/ApiTestAssitant | api_test_assistant_main.py | api_test_assistant_main.py | py | 2,481 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
... |
43248987614 | import os
import itertools
import scipy.io
import scipy.stats as stt
import numpy as np
import matplotlib.pyplot as plt
from mou_model import MOU
_RES_DIR = 'model_parameter/'
_I_REST_RUN = 0
_I_NBACK_RUN = 1
_I_NO_TIMESHIFT = 0
_I_ONE_TIMESHIFT = 1
_SUBJECT_AXIS = 0
plt.close('all')
## Create a local folder to stor... | bjoernkoehn21/Reproduce-results-from-Senden-paper | mou_ec_estimation.py | mou_ec_estimation.py | py | 12,115 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.close",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "os.path.exists",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
19541081496 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.ensemble import RandomForestRegressor
df = pd.read_csv('Franchise_Dataset.csv')
df.head()
X =df.iloc[:, 1:2].values
y =df.iloc[:, 2].values
model = RandomForestRegressor(n_estimators = 10, random_state = 0)
model.fit(X, y)
y_pred =m... | flawlesscode254/Linear-Regression-Assignment | three.py | three.py | py | 657 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sklearn.ensemble.RandomForestRegressor",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "ma... |
36689632480 | from __future__ import division
import re
import sys
import threading
import pyautogui
import pyperclip
import os
import speech_recognition as sr
from pywinauto import Application
import time
import openai
import win32com.client as wincl
#발급 받은 API 키 설정
OPENAI_API_KEY = "..."
# openai API 키 인증
op... | quswjdgns399/air_command | voicecommand_final.py | voicecommand_final.py | py | 13,739 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "openai.api_key",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "six.moves.queue.Queue",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "six.moves.q... |
45017283256 | try:
import sys
import os.path
sys.path.append(os.path.join(os.path.dirname(__file__), '../lib'))
import os, errno
import logging # http://www.onlamp.com/pub/a/python/2005/06/02/logging.html
from logging import handlers
import argparse
#sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'pysunspec'))
f... | phgachoud/sty-pub-raspi-modbus-drivers | lib/sit_json_conf.py | sit_json_conf.py | py | 5,275 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.path.path.join",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line... |
810754112 | from scipy import sparse
import time
import gradient
import vector_fields
def enforce_boundaries(phi, img_shape, dim):
# make sure we are inside the image
phi[:, 1] = phi[:, 1].clip(0, img_shape[1])
phi[:, 0] = phi[:, 0].clip(0, img_shape[0])
# 3d case
if dim == 3:
phi[:, 2] = phi[:, 2].cl... | polaschwoebel/NonLinearDataAugmentation | forward_euler.py | forward_euler.py | py | 2,149 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "time.time",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "vector_fields.evaluation_matrix_blowup",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "vector_fields.evaluation_matrix",
"line_number": 21,
"usage_type": "call"
},
{
"... |
2015306414 | import re
from pyspark import SparkConf, SparkContext
def normalizeWords(text):
return re.compile(r'\W+', re.UNICODE).split(text.lower())
conf = SparkConf().setMaster("local").setAppName("WordCount")
sc = SparkContext(conf = conf)
input = sc.textFile("file:///sparkcourse/book.txt")
words = input.flatMa... | gdhruv80/Spark | word-count-better.py | word-count-better.py | py | 654 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "re.compile",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "re.UNICODE",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "pyspark.SparkConf",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pyspark.SparkContext",
... |
22185534420 | import numpy as np
import pandas as pd
from collections import defaultdict
import matplotlib.pyplot as plt
from datetime import datetime
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import Dataset, DataLoader
import torch.optim as optim
import os, sys
class SDAE(nn.Module)... | yeonjun-in/GNN_Recsys_paper | rec/CDL/model.py | model.py | py | 6,259 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
71994778748 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import Bernoulli
from torch.autograd import Variable
import torch.optim as optim
import numpy as np
import random
import math
import sys
import os
torch.manual_seed(0)
class armax_model(nn.Module):
def __init__(self, no_of... | kaustubhsridhar/Constrained_Models | AP/armax_model_on_reformatted_data.py | armax_model_on_reformatted_data.py | py | 6,454 | python | en | code | 15 | github-code | 6 | [
{
"api_name": "torch.manual_seed",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "torch.nn.Parameter",
... |
16326125244 | from typing import Dict
import json as _json
import datetime as _dt
def get_all_events() -> Dict:
with open("events.json", encoding='utf-8') as events_file:
data = _json.load(events_file)
return data
def get_all_month_events(month: str) -> Dict:
events = get_all_events()
month = month... | mysterious-shailendr/Web-Scraping-and-Fast-API | services.py | services.py | py | 948 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "typing.Dict",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 20,
... |
3706334563 | from cgitb import reset
from flask import Flask, jsonify, request, render_template
import Crypto
import Crypto.Random
from Crypto.PublicKey import RSA
import binascii
from collections import OrderedDict
from Crypto.Signature import PKCS1_v1_5
from Crypto.Hash import SHA
import webbrowser
class Transaction:
def _... | LoneCannibal/Netherite2 | blockchain_client/client.py | client.py | py | 3,109 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.OrderedDict",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "Crypto.PublicKey.RSA.importKey",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "Crypto.PublicKey.RSA",
"line_number": 32,
"usage_type": "name"
},
{
"api_n... |
74031521788 | from matplotlib import pyplot as plt
import numpy as np
import random
import utils
features = np.array([1,2,3,5,6,7])
labels = np.array([155, 197, 244, 356,407,448])
print(features)
print(labels)
utils.plot_points(features, labels)
# Feature cross / synthetic feature
def feature_cross(num_rooms, population):
ro... | sithu/cmpe255-spring21 | lecture/regression/home-price.py | home-price.py | py | 3,939 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "utils.plot_points",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "random.random",
"line_num... |
5832109821 | """
Implementation based on:
https://www.kaggle.com/c/quora-question-pairs/discussion/33371
"""
import networkx as nx
import pandas as pd
def magic_feature_3_with_load():
train = pd.read_csv('../data/train.csv', encoding='utf-8')
test = pd.read_csv('../data/test.csv', encoding='utf-8')
return magic_featur... | ahara/kaggle_quora_question_pairs | magic_feature_3.py | magic_feature_3.py | py | 4,136 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"... |
14696724987 | import math
import sys
from typing import Iterable, Optional
import torch
from timm.data import Mixup
from timm.utils import accuracy
import util.misc as misc
import util.lr_sched as lr_sched
import numpy as np
from scipy.stats import spearmanr, pearsonr
def train_koniq_epoch(model: torch.nn.Module, criterion: tor... | wang3702/retina_mae | koniq/train_koniq_epoch.py | train_koniq_epoch.py | py | 5,602 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "torch.nn",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "typing.Iterable",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "torch.optim",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "torch.device",
"li... |
43943174399 | # M0_C9 - Sudoku Validator
import sys
import os
from typing import List
def validate(grid: List[List[int]]) -> bool:
"""Validates a given 2D list representing a completed Sudoku puzzle"""
# Write your code here
pass
##########################################
### DO NOT MODIFY CODE BELOW THIS LINE ###
####... | Static-Void-Academy/M0_C9 | sudoku_validator.py | sudoku_validator.py | py | 1,112 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "sys.exit",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 30,
"u... |
25225726686 | from read_the_maxfilename_for_sort import max_number
import requests
i = 1
temp_number = max_number()
def download(url):
global i
global temp_number
print('Processing {0} url:{1}'.format(i,url))
img = open('{}.jpg'.format(temp_number),'wb')
respone = requests.get(url, stream=True).content
img.... | HawkingLaugh/FC-Photo-Download | image_batch_download.py | image_batch_download.py | py | 382 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "read_the_maxfilename_for_sort.max_number",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
}
] |
43364784094 | from pathlib import Path
from argparse import ArgumentParser
# The path the project resides in
BASE_PATH = Path(__file__).parent.parent
# Alarm net dimensions
ALARM_HUGE = (5000, 2000, 500, 200)
ALARM_BIG = (1000, 500, 200, 75)
ALARM_SMALL = (100, 50, 25, 10)
# Standard arguments
def add_standard_arguments(parser: ... | Fraunhofer-AISEC/DA3D | libs/constants.py | constants.py | py | 2,063 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "pathlib.Path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 52,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"... |
30536133746 | import importlib.util
import shutil
from pathlib import Path
from typing import List
import pandas as pd
import plotly.express as px
from bot_game import Bot
EXAMPLES_FOLDER = Path("examples")
DOWNLOAD_FOLDER = Path("downloads")
DOWNLOAD_FOLDER.mkdir(exist_ok=True)
def save_code_to_file(code: str, filename: str):
... | gabrielecalvo/bot_game | util.py | util.py | py | 2,208 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pathlib.Path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "importlib.util.util.spec_from_... |
73017760828 | from rb_api.dto.two_mode_graph.article_keyword_dto import ArticleKeywordDTO
from rb_api.json_serialize import JsonSerialize
import json
class TopicEvolutionDTO(JsonSerialize):
def __init__(self):
self.wordList = []
self.yearList = []
def add_year(self, year: int) -> None:
self.yearL... | rwth-acis/readerbenchpyapi | rb_api/dto/two_mode_graph/topic_evolution_dto.py | topic_evolution_dto.py | py | 1,146 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "rb_api.json_serialize.JsonSerialize",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "rb_api.dto.two_mode_graph.article_keyword_dto.ArticleKeywordDTO",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 38,
"usage... |
13575734742 | import os
import numpy as np
import matplotlib
matplotlib.use('agg')
import xrt.runner as xrtrun
import xrt.plotter as xrtplot
import xrt.backends.raycing as raycing
from SKIF_NSTU_SCW import SKIFNSTU
from utilits.xrt_tools import crystal_focus
resol='mat'
E0 = 30000
subdir=rf"C:\Users\synchrotron\PycharmProjects\SKI... | Kutkin-Oleg/SKIF | SKIF_NSTU_SCW/scans.py | scans.py | py | 3,966 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.use",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_nu... |
2416697564 | import pygame
import sys
from random import randint
display = True
class snakeGame:
snake = [(16, 16),(16,15)]
apple = (18, 18)
is_dead = False
is_left = False
is_right = False
def move_left(self):
self.is_left = True
self.move_forward()
self.is_left = False
... | dogancanalgul/Pong | scratch.py | scratch.py | py | 3,004 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "random.randint",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "pygame.init",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
... |
34511399562 | from django import forms
from .models import Producto
from django.forms import ModelForm
class ProductosForm(forms.ModelForm):
class Meta:
model = Producto
fields = ('nombre','material','cantidad','categoria')
labels = {
'nombre':'Nombre',
'cantidad':'n. can... | SteveManfred/eco_facil_mio | test/electivo_2023/productos/forms.py | forms.py | py | 543 | python | es | code | 0 | github-code | 6 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "models.Producto",
"line_number": 11,
"usage_type": "name"
}
] |
23553579650 | import numpy as np
import pandas as pd
from scipy.io import loadmat
def glf(
mz: np.ndarray,
intens: np.ndarray,
delta_cts: float = 0.1,
delta_mz: float = 2000.0,
k: float = 7.0
) -> np.ndarray:
y1 = np.max(intens) * 0.02
y2 = (np.max(intens) - y1) * delta_cts
res = y1 + y2 / (1 + ... | Wimplex/AIJourney_AI4Bio_4th | source/utils/pkf.py | pkf.py | py | 1,351 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.ndarray",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "numpy.ndarray",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "numpy.max",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.max",
"line_n... |
29585592655 | from fastapi import FastAPI, Depends
from sqlalchemy import create_engine
from sqlalchemy.dialects.sqlite import *
from sqlalchemy.orm import sessionmaker, Session
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String
from typing import List
from pydantic import BaseMode... | vdtheone/crud_fastapi | main.py | main.py | py | 2,199 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.create_engine",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.sessionmaker",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "... |
27679932090 | """This module allows to interact with the user via the command line and processes
the input information.
"""
import os
import re
from inspect import getsourcefile
import numpy as np
import yaml
class CommandLineParser():
"""See documentation of the init method.
"""
def __init__(self) -> None:
"... | COMCIFS/instrument-geometry-info | Tools/imgCIF_Creator/imgCIF_Creator/command_line_interfaces/parser.py | parser.py | py | 19,777 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.abspath",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "inspect.getsourcefile",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "yaml.safe_load",
... |
39674044871 | from kucoin.client import Trade
from kucoin.client import Market
import pandas as pd
from time import sleep
api_key = '60491b8da682810006e2f600'
api_secret = 'a79226df-55ce-43d0-b771-20746e338b67'
api_passphrase = 'algotrading101'
m_client = Market(url='https://api.kucoin.com')
client = Trade(api_key, api_secret, api... | briansegs/Kucoin-api-example- | example-2.py | example-2.py | py | 1,725 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "kucoin.client.Market",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "kucoin.client.Trade",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.Timestamp.now",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.... |
22702565799 | import logging
import random
import asyncio
import websockets
import pandas as pd
import numpy as np
import plotly.express as px
import traits
from alleles import *
pd.options.plotting.backend = "plotly"
#Fix population crash issue
#Work on save function, produce population/world snapshots
#Improve data visualizati... | Adrian-Grey/EvoProject | evoBackend.py | evoBackend.py | py | 15,553 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "pandas.options",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "logging.basicConfig",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "logging.de... |
650674857 | #! /g/kreshuk/pape/Work/software/conda/miniconda3/envs/cluster_env37/bin/python
import os
import json
import luigi
from cluster_tools import MulticutSegmentationWorkflow
def initial_mc(max_jobs, max_threads, tmp_folder, target='slurm'):
n_scales = 1
input_path = '/g/kreshuk/data/FIB25/cutout.n5'
exp_pa... | constantinpape/cluster_tools | publications/leveraging_domain_knowledge/5_lifted_solver/initial_multicut.py | initial_multicut.py | py | 4,330 | python | en | code | 32 | github-code | 6 | [
{
"api_name": "cluster_tools.MulticutSegmentationWorkflow.get_config",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "cluster_tools.MulticutSegmentationWorkflow",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "os.path.exists",
"line_number": 24,
"usa... |
71452823867 | import os
import pandas as pd
import numpy as np
from keras.models import load_model
sample_submission = pd.read_csv('submissions/sample_submission.csv')
print(sample_submission['Class'])
band = ''
def preproc(X_all):
X_all[X_all == -np.inf] = -10
X_all[X_all > 1000] = 1000
X_all = np.swapaxes(X_all, 1, ... | Anmol6/kaggle-seizure-competition | make_sub.py | make_sub.py | py | 1,618 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.inf",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "numpy.swapaxes",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "keras.models.load_model"... |
74907691708 | # 2-D plot function for SODA TEMPERATURE
# YUE WANG
# Nov. 12st 2013
import numpy as np
import netCDF4
from mpl_toolkits.basemap import Basemap,cm
import matplotlib.pyplot as plt
def soda_plot(url,variable,llat, ulat, llon, rlon):
nc = netCDF4.Dataset(url)
var = nc.variables[variable][0,0,:,:]
lon ... | yueewang/Python_Digitizer | soda_plot_function_2.py | soda_plot_function_2.py | py | 1,539 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "netCDF4.Dataset",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.meshgrid",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "matplotlib.py... |
8939054368 | from django.conf.urls.defaults import *
from django.views.generic.simple import direct_to_template
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Map-related
url(r'^/?$', direct_to_template, {'template': 'p... | epkugelmass/USG-srv-dev | tigerapps/pom/urls.py | urls.py | py | 1,045 | python | en | code | null | github-code | 6 | [
{
"api_name": "django.contrib.admin.autodiscover",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.views.generic.simple.direct_to_template",
"line_number": 10,
"usage_type": "a... |
16116517818 | import tools as t
import json
import requests
def get_wikipedia(title):
base_url = "https://de.wikipedia.org/w/api.php"
params = {
"action": "query",
"format": "json",
"prop": "extracts",
"exintro": True,
"titles": title
}
response = requests.get(base_url, para... | Paul-Tru/PyAssistant2 | api.py | api.py | py | 1,369 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "tools.his",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "tools.clean_html",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "tools.config_var",
"line_... |
4691442147 | from attrdict import AttrDict
from flask import Flask, request, jsonify, make_response
from semantic_selector.model.one_to_one import NNFullyConnectedModel
from semantic_selector.adapter.one_to_one import JSONInferenceAdapter
app = Flask(__name__)
model = None
@app.before_first_request
def startup():
global mod... | cuhavp/semantic_selector | projects/bin/api.py | api.py | py | 1,079 | python | en | code | null | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "semantic_selector.model.one_to_one.NNFullyConnectedModel",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.request.headers",
"line_number": 22,
"usage_type": "attribute"
... |
32019692905 | from subprocess import run
from pathlib import Path
import os
from rich.console import Console
from rich.markup import escape
from builtins import print as builtin_print
import shutil
if __name__ == "__main__":
console = Console(emoji=False)
def print(msg):
console.print(msg)
here = Path(__file__... | Analog-Devices-MSDK/refdes | .github/workflows/scripts/build.py | build.py | py | 1,733 | python | en | code | 14 | github-code | 6 | [
{
"api_name": "rich.console.Console",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "subprocess.run",
"... |
19203182463 | import os
from dotenv import load_dotenv
from minio import Minio
from io import BytesIO
from data_pipeline.classes.data_loader.DataLoader import DataLoader
class MinIOLoader(DataLoader):
def __init__(self, endpoint, bucket_name):
super().__init__(endpoint)
self._bucket_name = bucket_... | robbailiff/data_pipeline | src/data_pipeline/classes/data_loader/MinIOLoader.py | MinIOLoader.py | py | 1,836 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "data_pipeline.classes.data_loader.DataLoader.DataLoader",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "dotenv.load_dotenv",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 18,
"usage_type": "call"
},
{
... |
71754427069 | import paramiko
import paramiko.client
client = paramiko.client.SSHClient()
client.load_system_host_keys()
client.set_missing_host_key_policy(
paramiko.AutoAddPolicy()
)
client.connect(
"localhost",
username="developer",
password="4linux"
)
(stdin, stdout, stderr) = client.exec_command("ls")
status ... | elderlima/4linux | ssh/main.py | main.py | py | 500 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "paramiko.client.SSHClient",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "paramiko.client",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "paramiko.AutoAddPolicy",
"line_number": 7,
"usage_type": "call"
}
] |
20678034139 | from omegaconf import DictConfig
import hydra
from VisualClassificationRunner import VisualClassificationRunner
class CueConflictRunner(VisualClassificationRunner):
def test(self) -> dict:
"""Test the model on the standard dataset and the randomized datasets.
:return: Dictionary wi... | nathansomavarapu/core-ml | src/CueConflictRunner.py | CueConflictRunner.py | py | 1,053 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "VisualClassificationRunner.VisualClassificationRunner",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "omegaconf.DictConfig",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "hydra.main",
"line_number": 30,
"usage_type": "call"
}
] |
38589291607 | import os
from django.conf import settings
from django.core.mail import EmailMessage
from .models import STATUS_TYPES
from smtplib import SMTPException
from django.core.mail import BadHeaderError
from python_http_client import exceptions
import logging
logger = logging.getLogger("django")
# admin emails (add more her... | NimbusInformatics/bdcat-data-tracker | api/tracker/mail.py | mail.py | py | 4,796 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.SENDGRID_NO_REPLY_EMAIL",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 13,
"usage_type": "name"
},
... |
29626198089 | import pygame
import pathlib
import random
img_path = pathlib.Path(__file__).parent / 'img'
class Locators(object):
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
GREEN = (0, 255, 0)
RED = (255, 0, 0)
screen_width = 800
screen_height = 600
random_speed = [1, -1]
rect_width = 40
rect_... | aksaule-bagytzhanova/game | Objects.py | Objects.py | py | 2,501 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pathlib.Path",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pygame.sprite.Group",
"line... |
72515571067 | from langchain.embeddings.openai import OpenAIEmbeddings
from langchain.text_splitter import CharacterTextSplitter
from langchain.chains import RetrievalQAWithSourcesChain, RetrievalQA
from langchain import OpenAI
from langchain.vectorstores import Chroma
import gradio as gr
from langchain.chains.question_answering i... | uni-3/gradio-apps | qa_retrieval/app.py | app.py | py | 2,753 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "langchain.chains.question_answering.load_qa_chain",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "langchain.OpenAI",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 22,
"usage_type": "call"
},
{
"api_... |
74977717307 | import csv
import os
from datetime import datetime
import logging
import re
from dipper.sources.PostgreSQLSource import PostgreSQLSource
from dipper.models.assoc.Association import Assoc
from dipper.models.assoc.G2PAssoc import G2PAssoc
from dipper.models.Genotype import Genotype
from dipper.models.Reference import Ref... | monarch-initiative/dipper | dipper/sources/MGI.py | MGI.py | py | 99,120 | python | en | code | 53 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "dipper.sources.PostgreSQLSource.PostgreSQLSource",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "dipper.config.get_config",
"line_number": 348,
"usage_type": "call"
... |
20516636897 | from AWSIoTPythonSDK.MQTTLib import AWSIoTMQTTShadowClient
import sys
import time
import json
import getopt
# Import SPI library (for hardware SPI) and MCP3008 library.
import Adafruit_GPIO.SPI as SPI
import Adafruit_MCP3008
# Hardware SPI configuration:
SPI_PORT = 0
SPI_DEVICE = 0
mcp = Adafruit_MCP3008.MCP3008(sp... | chls84/TCC | Código Python/medidor-aws-iot.py | medidor-aws-iot.py | py | 6,262 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "Adafruit_MCP3008.MCP3008",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "Adafruit_GPIO.SPI.SpiDev",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "Adafruit_GPIO.SPI",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "t... |
19933423422 | import requests, zipfile, os, json, sqlite3
def get_manifest():
manifest_url = 'http://www.bungie.net/Platform/Destiny2/Manifest/'
print("Downloading Manifest from http://www.bungie.net/Platform/Destiny2/Manifest/...")
r = requests.get(manifest_url)
manifest = r.json()
mani_url = 'http://www.bungi... | RyanGrant/RyanGrant.github.io | Python/Manifest.py | Manifest.py | py | 5,969 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "zipfile.ZipFile",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.rename",
"line_number... |
24556414335 | import json
from flask import Flask, jsonify, request
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import func
from flask_bcrypt import Bcrypt
from flask_redis import FlaskRedis
app = Flask(__name__)
app.config['SECRET_KEY'] = 'ghjrhhrohirorthrtohi'
app.config['SQLALCHEMY_DATABASE_URI'] = "mysql://root:root... | Ankita2802/Quiz_backend | routes.py | routes.py | py | 9,890 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask_redis.FlaskRedis",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask_b... |
4520925854 | from django.urls import path
from rest_framework_simplejwt.views import (
TokenObtainPairView,
TokenRefreshView, TokenVerifyView,
TokenObtainSlidingView, TokenRefreshSlidingView
)
from .views import SingUpView, BlacklistRefreshView
urlpatterns = [
path('signup/', SingUpView.as_view(), name='sign_up'),
... | rustamovjavohir/EcommerceSHOP | auth_user/urls.py | urls.py | py | 638 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "views.SingUpView.as_view",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "views.SingUpView",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.url... |
10167784496 | # (c) Nelen & Schuurmans. MIT licensed, see LICENSE.rst.
from __future__ import unicode_literals
from django.http.multipartparser import parse_header
from rest_framework.renderers import BaseRenderer
COLNAME_FORMAT = '%Y-%m-%d %H:%M:%S.%f'
class CSVRenderer(BaseRenderer):
"""
Renderer which serializes to c... | ddsc/dikedata-api | dikedata_api/renderers.py | renderers.py | py | 957 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rest_framework.renderers.BaseRenderer",
"line_number": 10,
"usage_type": "name"
}
] |
6846678287 | from tkinter import Frame, Label, Menu, ttk
from tkinter.messagebox import showinfo
import tkinter as tk
import requests
class AttackInfo(Frame):
def __init__(self, master=None):
super(AttackInfo, self).__init__(master)
master = master
self.type_label = Label(self, text=" ", font=('Helve... | iamcrysun/eqw | desktop/views/attackinfo.py | attackinfo.py | py | 2,001 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tkinter.Frame",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "tkinter.Label",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tkinter.Label",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_num... |
20701388833 | import sqlite3
samira = sqlite3.connect('shallownowschool.db')
cursor = samira.cursor()
cursor.execute("""
INSERT INTO td_estudante(nome, endereco, nascimento, matricula)
VALUES ('Maria da Conceição', 'Rua da Paz', '1902-12-12', 20161382596);
""")
samira.commit()
print("Inserido com sucesso.")
samira.close(... | kemelynfigueiredo/TopicosEspeciais | MeuPrimeiroSQLite/temp.py | temp.py | py | 324 | python | pt | code | 0 | github-code | 6 | [
{
"api_name": "sqlite3.connect",
"line_number": 3,
"usage_type": "call"
}
] |
6105704383 | import requests
import sys
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
proxies = {'http': 'http://127.0.0.1:8080', 'https': 'http://127.0.0.1:8080'}
def promote_to_admin(s, url):
# login as the wiener user
login_url = url + "/login"
data_login = {"username": "wiene... | rkhal101/Web-Security-Academy-Series | broken-access-control/lab-06/access-control-lab-06.py | access-control-lab-06.py | py | 1,364 | python | en | code | 396 | github-code | 6 | [
{
"api_name": "urllib3.disable_warnings",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "urllib3.exceptions",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "sys.exit",
... |
4083668934 | from urllib.parse import urlencode
import httpx
from common.kan_params import crd_params
from common.voe_ipc import KanAgent
#host = 'localhost'
#host = 'kan-agent'
#port = '8088'
class KanAgentClient:
#def __init__(self, host=host, port=port, scope='default', version='v1', ref='v1alpha2.ReferenceK8sCRD'):
... | Azure/KAN | src/edge/EdgeSolution/modules/common/common/kan_agent_client.py | kan_agent_client.py | py | 3,527 | python | en | code | 61 | github-code | 6 | [
{
"api_name": "common.voe_ipc.KanAgent.Url",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "common.voe_ipc.KanAgent",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "common.kan_params.crd_params",
"line_number": 35,
"usage_type": "name"
},
{
... |
17625798812 | import sys
import os
import pandas as pd
from util import load_column_transformers, preprocess_data
from alphagan_class import AlphaGAN
from keras.losses import MeanAbsoluteError
from bigan import BIGAN
import keras.backend as K
import tensorflow as tf
import numpy as np
if __name__ == '__main__':
session = K.ge... | royalsalute/fraud-creditcard-detection | eval.py | eval.py | py | 1,784 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "keras.backend.get_session",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "keras.backend",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "tensorflow.global_variables_initializer",
"line_number": 16,
"usage_type": "call"
},
{
"a... |
26774631311 | import pygame
from sys import exit
import numpy as np
import copy as cp
import math
import random as rd
import time
class GameState:
def __init__(self, board):
self.board = board
self.end=-1
self.children = []
self.parent = None
self.parentPlay = None # (play, ... | ToniCardosooo/EIACD-Artificial-Intelligence-Project | ataxx.py | ataxx.py | py | 26,079 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "copy.deepcopy",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "numpy.count_nonzero",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "numpy.count_nonzero",
... |
13659068319 | from django.http import HttpResponse
from django.shortcuts import redirect, render
from .forms import ContactForm
from django.core.mail import send_mail, BadHeaderError
from config.settings import RECIPIENTS_EMAIL, DEFAULT_FROM_EMAIL
# Create your views here.
def contact_view(request):
if request.method == "GET... | Dauka03/food_project_back | sendemail/views.py | views.py | py | 1,235 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "forms.ContactForm",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "forms.ContactForm",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.core.mail.send_mail",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "config... |
14959290509 | import json
from json import JSONEncoder
from yoti_python_sdk.crypto import Crypto
from yoti_python_sdk.http import SignedRequestBuilder
import yoti_python_sandbox
from .anchor import SandboxAnchor
from .attribute import SandboxAttribute
from .endpoint import SandboxEndpoint
from .sandbox_exception import SandboxExce... | getyoti/yoti-python-sdk-sandbox | yoti_python_sandbox/client.py | client.py | py | 4,176 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.JSONEncoder",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "token.YotiTokenRequest",
"line_number": 18,
"usage_type": "argument"
},
{
"api_name": "attribute.SandboxAttribute",
"line_number": 20,
"usage_type": "argument"
},
{
"api_na... |
1414123757 | import pytest
import os
import shutil
import tngsdk.project.workspace as workspace
from tngsdk.project.workspace import Workspace
from tngsdk.project.project import Project
class TestProjectUnit:
# create and return a temporary workspace 'test-ws'
@pytest.fixture(scope='module')
def workspace(self):
... | sonata-nfv/tng-sdk-project | tests/test_project_unit.py | test_project_unit.py | py | 1,124 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "os.path.isdir",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "shutil.rmtree",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "tngsdk.project.workspace.par... |
24519278933 | import argparse
import os
import cv2
from wand.image import Image
import numpy as np
#ArgumentParser객체:명령행을 파이썬 데이터형으로 파싱하는데 필요한 모든 정보가 들어있음
#ArgumentParser객체 생성
ap=argparse.ArgumentParser()
ap.add_argument("-i","--images",required=True, help="absolute path to the input image")
ap.add_argument("-c","--cascade",default... | Zzang-yeah/catholic | cat_detection/feic_to_jpg.py | feic_to_jpg.py | py | 1,733 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "wand.image.Image",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.remove",
"l... |
11711962924 | import os
import numpy as np
import bpy
import mathutils
import math
from satvis.utils.blender_utils import make_sat, make_sun, \
make_camera, make_torch, setup_depth, rotate_sat, \
rotate_earth, save_render, get_data, CAMERA_VIEW_DIRECTION, \
... | Ben-Guthrie/satvis | utils/vis_utils.py | vis_utils.py | py | 9,405 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "bpy.context",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "bpy.context",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "bpy.context",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "bpy.context",
... |
27516283256 | import random
from discord.ext import commands
class Hive(commands.Cog):
def __init__(self, bot):
self.bot = bot
self._last_member = None
@commands.command(name='roll_dice',
help='<min> <max>')
async def roll_dice(self, ctx, min: int, max: int):
await ctx.se... | tintin10q/hive-discord-bot | commands/roll_dice.py | roll_dice.py | py | 394 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "random.randint",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "disco... |
5095318867 | import random
import torchvision
from torchvision import datasets, transforms
from data.RPSLS.types import *
transformations = transforms.Compose([
transforms.ToTensor(),
])
dataset = datasets.ImageFolder(
root='../../../data/RPSLS/rock-paper-scissors-lizard-spock',
transform = transformations
)
def gener... | AytugAltin/ProblogRPSLS | examples/RPSLS/Rock-Paper-Scissors/generate_data.py | generate_data.py | py | 698 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "torchvision.transforms.Compose",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.ToTensor",
"line_number": 7,
"usage_type": "call"
},
{
... |
30789951381 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import plotly.graph_objects as go
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import LogisticRegression
from sklear... | nimishakhaitan/Evil-Geniuses-assessment | Assessment_Data_Science.py | Assessment_Data_Science.py | py | 11,117 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.bar",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 75,
"usage_type": "name"
},
{
"api_name": "matplotlib.py... |
30896806208 | import cv2
# loading the images
img1 = cv2.imread("png//yy.jpg")
img2 = cv2.imread("png//ra.jpg")
# resizing the both images in same resolution
scale_percent = 60 # percent of original size
width = int(img1.shape[1] * scale_percent / 90)
height = int(img2.shape[0] * scale_percent / 90)
dim = (width, height)... | singhsaurabh1998/OpenCv | SimilarImg.py | SimilarImg.py | py | 2,656 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.imread",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.INTER_AREA",
"line_number": 13... |
38979909130 | from datetime import datetime, timedelta, timezone
import pytz
tokyo_tz = pytz.timezone('Asia/Tokyo')
# def delete_feed_with_too_many_entries(reader, db, url):
# entries = list(reader.get_entries())
# if len(entries) > 300:
# print("deleting feeds: ", url)
# reader.delete_feed(url)
# ... | kei49/rss-to-slack | src/feed.py | feed.py | py | 637 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pytz.timezone",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "datetime.timedel... |
37693718022 | from enum import Enum, auto
from typing import Any, Tuple
from mesa import Model
from mesa.datacollection import DataCollector
from mesa.space import ContinuousSpace
from mesa.time import SimultaneousActivation
from autonomous_intersection.agents.direction import Direction
from autonomous_intersection.agents.visualce... | GrzegorzNieuzyla/Autonomous-Intersection | autonomous_intersection/model.py | model.py | py | 3,906 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "enum.Enum",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "enum.auto",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "enum.auto",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "enum.auto",
"line_number": 22,
... |
39363863586 | import networkx as nx
from node import Node
class Graph(nx.Graph):
def __init__(self):
super().__init__()
self.arcs=[]
self.nao_servido = 0
def increment_nao_servido(self):
self.nao_servido += 1
def decrement_nao_serveido(self):
self.nao_servido-=1
def create... | marcoscezar1/Simulador | Simulação I/graph.py | graph.py | py | 1,642 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "networkx.Graph",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "node.Node",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "node.Node",
"line_number": 17,
"usage_type": "name"
}
] |
21033229877 | """
All together
Demonstrate how you can build a quick and dirty framework with a bottle like
API.
Chick is the main application frame.
CapitalizeResponse is a middleware which you can use to wrap your application.
It stores session information, and it capitalizes all responses.
"""
def request_factory(env):
""... | oz123/advanced-python | examples/all_together/chick_w_request_response.py | chick_w_request_response.py | py | 3,678 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "wsgiref.simple_server.make_server",
"line_number": 147,
"usage_type": "call"
}
] |
34607069404 | import os
import json
import pandas as pd
import numpy as np
import networkx as nx
#所有节点和边构成网络图
def form_graph(parent_path):
every_pro_path = os.path.join(parent_path, r'dataset\secondExperiments\COVID_Node2Vec.csv')
simGO_path = os.path.join(parent_path, r'dataset\secondExperiments\train_COVID_AllHuman_GoSim.... | LittleBird120/DiseaseGenePredicition | DiseaseGenePredicition/20210315covering-clustering-algorithm - COVID/algorithm/formComplex.py | formComplex.py | py | 6,315 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,... |
41283122101 | # -*- coding: utf-8 -*-
import math
import numpy as np
from scipy.interpolate import interp1d
class SpatialParameters:
def __init__(self, signal, fs, window_size, running_step):
self.time_steps, self.iacc, self.tiacc, self.wiacc = self.__get_xcorr_descriptors(
signal, fs, window_... | kgordillo-hub/SoundMonitor-MetricsCalculator | SpatialParameters.py | SpatialParameters.py | py | 4,821 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": ... |
24416364915 | import grp
import json
import logging
import os
import pkgutil
import tempfile
from cloudify.decorators import operation
from cloudify.exceptions import NonRecoverableError
from managed_nagios_plugin._compat import text_type
from managed_nagios_plugin.constants import (
BASE_OBJECTS_DIR,
OBJECT_DIR_PERMISSION... | cloudify-cosmo/cloudify-managed-nagios-plugin | managed_nagios_plugin/nagios/tasks.py | tasks.py | py | 26,382 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cloudify.exceptions.NonRecoverableError",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "managed_nagios_plugin.utils.yum_install",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "managed_nagios_plugin._compat.text_type",
"line_number": 62,
... |
37740591228 | from fastapi import Depends, FastAPI, Header, HTTPException
from fastapi.middleware.cors import CORSMiddleware
from app.auth import main as auths
from app.users import main as users
from app.blogs import main as blogs, sub as blogs_sub
app = FastAPI()
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
... | tokusumi/fastapi-nuxt-blog | backend/app/app/main.py | main.py | py | 524 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "app.auth",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "fastapi.FastAPI",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "app.auth.add_middleware",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "fastapi.middleware.cors... |
28051281167 | """
Tests for the petl.fluent module.
"""
from __future__ import absolute_import, print_function, division
from tempfile import NamedTemporaryFile
import csv
from nose.tools import eq_
import petl
import petl.interactive as etl
from petl.testutils import ieq
def test_basics():
t1 = (('foo', 'bar'),
... | podpearson/petl | src/petl/test/test_interactive.py | test_interactive.py | py | 2,716 | python | en | code | null | github-code | 6 | [
{
"api_name": "petl.interactive.wrap",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "petl.interactive",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "nose.tools.eq_",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "nose.tools.eq_"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.