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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
18183508730 | from azureml.core import Experiment, ScriptRunConfig, Environment
from azureml.core.conda_dependencies import CondaDependencies
from azureml.core import Workspace
from azureml.core.compute import AmlCompute, ComputeTarget
from azureml.core.compute_target import ComputeTargetException
def azureml_setup():
# Load t... | webclinic017/autonomous-portfolio-management | app/models/DEC/azureml_setup.py | azureml_setup.py | py | 1,567 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "azureml.core.Workspace.from_config",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "azureml.core.Workspace",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "azureml.core.Environment",
"line_number": 13,
"usage_type": "call"
},
{
... |
37493568910 | from django.shortcuts import render_to_response, redirect
from django.http import HttpResponse, HttpResponseRedirect
from django.views.decorators.csrf import csrf_protect
from django.template import RequestContext, loader, Context
from forms import FeedbackForm
from mymissedopportunities.util import spam
from recaptch... | ramin32/mymissedopportunities | feedback/views.py | views.py | py | 1,181 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "django.shortcuts.render_to_response",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "forms.FeedbackForm",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.template.RequestContext",
"line_number": 16,
"usage_type": "call"
},
{
... |
18965389504 | # -*- coding: utf-8 -*-
"""
Created on Sun Oct 2 10:02:04 2022
@author: Naveen Kumar
"""
#import necessary libraries
import pandas as pd
import matplotlib.pylab as plt
import seaborn as sns
from sklearn.cluster import KMeans
#Read excel using pandas
airlines1 = pd.read_excel(r"C:\Users\Naveen Kumar\Desktop\Data Sci... | Naveen-learner/Data_science | Data Science/Assignments/Day13-K-Means Clustering/airlines.py | airlines.py | py | 1,695 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "pandas.read_excel",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sklearn.cluster.KMeans",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "matplotlib.pylab.plot",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "matplo... |
37622858282 | import openai
import streamlit as st
from streamlit_chat import message
from api_key import openai_secret_key
# openai.api_key=st.secrets["api_secret"]
openai.api_key=openai_secret_key
#For this project, I used this article as my main reference https://medium.com/@avra42/build-your-own-chatbot-with-openai-gpt-3-and-str... | Thigiang/Chatbot | chatbotdemo.py | chatbotdemo.py | py | 2,140 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "openai.api_key",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "api_key.openai_secret_key",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "openai.Completion.create",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "... |
35651873859 | #!/usr/bin/env python
# coding: utf-8
# In[63]:
# sudo apt install tesseract-ocr -y
import cv2
#get_ipython().system('pip install pytesseract')
import pytesseract
from pytesseract import Output
import os
import regex
# In[64]:
# img = cv2.imread('output107.jpg')
# height, width, channels = img.shape
# In[65]:... | code93/pdfstruc | pdfocr.py | pdfocr.py | py | 2,101 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "os.listdir",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 98,
"usage_type": "call"
},
{
"api_name": "pytesseract.image_to_data",
"line_number": 100,
"usage_type": "call"
},
{
"api_name": "pytesseract.Output.D... |
11506627628 | """"""
from sqlalchemy import Column, Integer, String, DateTime
from sqlalchemy import ForeignKey
from sqlalchemy.sql import func
from sqlalchemy.orm import relationship
import typing
from ._defs import Base
from .city_part import CityPart
from .street import Street
class Address(Base):
""""""
# data
add... | martinbenes1996/cpost | src/db/orm/address.py | address.py | py | 1,694 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "_defs.Base",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integer",
"line_number": 16,
"usage_type": "argument"
},
{
"api_name": "sqlalchemy.Column... |
30080310893 | """Test EC2 Instance CDK construct module."""
from aws_cdk import aws_ec2 as ec2
from aws_cdk import aws_iam as iam
from aws_cdk.aws_ec2 import IMachineImage
from constructs import Construct
class EC2Construct(Construct):
"""Test EC2 Instance CDK construct class."""
def __init__(
self,
... | avishayil/secure-rds-connection | cdk/secure_db_connection_service/cdk_constructs/ec2.py | ec2.py | py | 1,751 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "constructs.Construct",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "constructs.Construct",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "aws_cdk.aws_ec2.IVpc",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "aw... |
16006984070 |
from django.test import TestCase
from rest_framework.test import APIClient
from rest_framework import status
from .models import Invoice
from .serializers import InvoiceSerializer
class InvoiceViewSetTestCase(TestCase):
def setUp(self):
self.client = APIClient()
def test_create_invoice(sel... | mahbubu1640/Invoice-Management-Project-DRF | invoice_app/tests.py | tests.py | py | 1,241 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "django.test.TestCase",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "rest_framework.test.APIClient",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "rest_framework.status.HTTP_201_CREATED",
"line_number": 34,
"usage_type": "attribute"
... |
34537923334 | import socket
import sys
import threading
import numpy as np
import pygame
import sounddevice as sd
from pygame.locals import *
if len(sys.argv) < 2 or 3 < len(sys.argv):
sys.stderr.write("Usage: " + sys.argv[0] + " PORT HOST(optional)\n")
sys.exit(0)
is_server = len(sys.argv) == 2
HOST = "" if is_server el... | rire-ihn/walkie_talkie_on_PC | main.py | main.py | py | 9,131 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "sys.argv",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "sys.stderr.write",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.stderr",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_n... |
39620048875 | import argparse
import os
import platform
import shutil
import time
from pathlib import Path
import cv2
import torch
import torch.backends.cudnn as cudnn
from numpy import random
import requests
from conf_thresh import confidence_threshold
from bounding_box import check_bounding_box
from models.experimental import at... | MDP-15/Image-Recognition | detect_file_and_save.py | detect_file_and_save.py | py | 7,675 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "utils.general.set_logging",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "utils.torch_utils.select_device",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 64,
"usage_type": "call"
},
{
"api_name... |
28781336880 | import asyncio
import logging
from dataclasses import dataclass
from http import HTTPStatus
from typing import Awaitable, Callable, Iterable, List
from .collector import ServiceCollector, Severity
@dataclass
class Component:
"""Атрибуты внешнего компонента по стандарту ДП."""
name: str
type: str
sev... | VVVibia/PostmanPractice | src/app/system/mdw_prometheus_metrics/service/external.py | external.py | py | 3,816 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "collector.Severity",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "typing.Callable",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.Awaitable",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "dataclasses.datac... |
71118507430 | import ast
import datetime
import json
import logging
import os
import threading
import shutil
import requests as rq
from flask import Blueprint, make_response, jsonify, request
from flask_restplus import Api, Resource, fields
from flask_api import status
from common import init_config
from common.config import confi... | lnminh0710/xt-XoonitDoc | PythonService/routers/ocr_manually_route.py | ocr_manually_route.py | py | 28,367 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "flask.Blueprint",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "flask_restplus.Api",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "common.init_config",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "flask_restplus.... |
10315764591 | import glob
import os
import time
import traceback
import win32api
import win32gui
from datetime import datetime
from threading import Thread
from ScreenTools import findAndClick, findPic, try_find_and_click, click_when_second_image_not_exist, any_pic_exist, \
sleep, log, click_when_second_image_exist
is_logout =... | SpiderFZL/wechatGameTool | main.py | main.py | py | 16,130 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "ScreenTools.findAndClick",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "ScreenTools.sleep",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "ScreenTools.try_find_and_click",
"line_number": 25,
"usage_type": "call"
},
{
"api_nam... |
23026382976 | from multiprocessing import Process, Queue
from time import sleep
def f(q):
print("start to sleep")
sleep(10)
print("stop to sleep")
q.put([42, None, 'hello'])
if __name__ == '__main__':
q = Queue()
p = Process(target=f, args=(q,))
p.start()
print(q.get()) # print... | liranzxc/SmartCross | Models/Queue.py | Queue.py | py | 361 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "time.sleep",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Queue",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Process",
"line_number": 11,
"usage_type": "call"
}
] |
7490984692 | import sys
sys.path.append("..")
from preprocess import PreprocessedData, Data
from model import Model
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import RandomForestClassifier
from sklearn.linear_model import LogisticRegression
import numpy as np
from sklearn.metrics import accuracy_score, f1... | Never-github/CCKS_Cup | models/sklearn_model.py | sklearn_model.py | py | 2,317 | python | en | code | 2 | github-code | 71 | [
{
"api_name": "sys.path.append",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "model.Model",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "sklearn.tree.DecisionTreeClas... |
71076193831 | from flask import Flask, request, Response, send_file
import ml_core.question_answering.drqa.reader.predictor as predictor
# import ml_core.drqa.test_module.test as testing
import ml_core.object_detection.yoloModel as yoloModel
import jsonpickle
import numpy as np
import cv2
import base64
import json
import ast
from ge... | iamvon/viBlind | Backend/AI/server/api.py | api.py | py | 5,934 | python | en | code | 33 | github-code | 71 | [
{
"api_name": "flask.Flask",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "ml_core.object_detection.yoloModel.load_label",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "ml_core.object_detection.yoloModel",
"line_number": 25,
"usage_type": "name"
... |
26454352197 | from flask import Flask, render_template, request
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
def index():
bmi = None
if request.method == 'POST':
weight = float(request.form['weight'])
height = float(request.form['height'])
weight_unit = request.form['weig... | joshuamoses926/ChatGPT-BMI-Webapp | app.py | app.py | py | 734 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "flask.Flask",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "flask.request.form",... |
14164869309 | from behave import given, then, when
from helper_functions import *
import json as jsonObj
@given("A valid project instance with id")
def step_valid_project_with_id(context):
context.data = TEST_DATA_PROJECT
context.URL = "projects"
context.response = sendRequest("POST", context.URL, data=context.data, ret... | shyamdesai03/ESCE429-Project-BDD | steps/projects_delete.py | projects_delete.py | py | 3,542 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "behave.given",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "behave.given",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "behave.given",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "behave.when",
"line_number"... |
10536061994 | from flask import request
def get_zipkin_headers():
try:
request.headers
except RuntimeError:
return {}
headers_of_interest = (
'x-b3-flags',
'x-b3-parentspanid',
'x-b3-sampled',
'x-b3-spanid',
'x-b3-traceid',
'x-ot-span-context',
'x... | ueni-ltd/python-b3-propagation | flask/b3_propagation/__init__.py | __init__.py | py | 589 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "flask.request.headers",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "flask.request.headers.get",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "flas... |
32936703433 | # Name: value_at_risk.py
# Purpose: Calculate value at risk for a portfolio of US equities using the variance-covariance method
# Author: Aric Rosenbaum
import datetime
import numpy as np
import pandas as pd
import pandas_datareader as web
from scipy.stats import norm
class ValueAtRisk:
# Constructor
... | mbogoevici/devconf.us-2022 | var-calc-service/value_at_risk.py | value_at_risk.py | py | 2,260 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "pandas.DataFrame",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "scipy.stats.norm.ppf",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "scipy.stats.norm",
"line_number": 52,
"usage_type": "name"
},
{
"api_name": "scipy.stats.no... |
22764541249 | import pygame
class Dinosaur:
def __init__(self, x_pos, y_pos, pic):
self.x_pos = x_pos
self.y_pos = y_pos
self.pic = pygame.image.load(pic)
self.y_vel = 0
def check_on_ground(self):
if self.y_pos == 230:
return True
else:
return False
... | Hiennhanomoris/Dinosaur-Python | class_dinosaur.py | class_dinosaur.py | py | 742 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "pygame.image.load",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pygame.key.get_pressed",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pygame.key",... |
35172585887 | #!/usr/bin/env python3
from lxml import html
import requests
import DateTime
import time
from pathlib import Path
class Scraper:
datalocations = {}
datalocations['cases'] = './/td[2]/text()'
datalocations['newcases'] = './/td[3]/text()'
datalocations['deaths'] = './/td[4]/text()'
datalocations['ne... | Caffeno/cv19scraper | cv19scraper.py | cv19scraper.py | py | 7,634 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "requests.get",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "lxml.html.fromstring",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "lxml.html",
"line_number": 41,
"usage_type": "name"
},
{
"api_name": "DateTime.DateTime",
"... |
36109908136 | from random import uniform
import time as Time
import argparse
from utils import *
from panda_primitives import *
import ikfast
import os
import csv
def packed_force_aware_transfer_HIRO(show_sols=True, arm='right', num=1, dist=0.5, high_angle=math.pi/4, low_angle = -math.pi/4, mass=MASS, initial_conf=TOP_HOLDING_LEFT_... | HIRO-group/torque_constrained_motion_planning | src/collect_data.py | collect_data.py | py | 6,511 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "random.uniform",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"lin... |
26204932710 | import json
import base64
from threading import Thread
from multiprocessing import Process
import time
from wxpy import *
from databases import models
from . import plugs_manager
import re
import requests
from multiprocessing import Pipe
import os
import threading
from helper.channels_manager import cm
from .plugs_m... | qiyuebuku/WxRobot | helper/bot_manager.py | bot_manager.py | py | 25,571 | python | en | code | 8 | github-code | 71 | [
{
"api_name": "threading.Thread",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "threading.Thread",
"line_number": 103,
"usage_type": "name"
},
{
"api_name": "base64.b64encode",
"line_number": 159,
"usage_type": "call"
},
{
"api_name": "databases.models... |
13529165814 | import os
from config import dbuser, dbpassword
import pandas as pd
import numpy as np
from flask import Flask, jsonify, render_template, request, redirect
from flask_pymongo import PyMongo
import pymongo
import keras
from keras.preprocessing import image
from keras import backend as K
# from keras.genetic_utils imp... | karawenz01/dogpedia | app.py | app.py | py | 6,219 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "flask.Flask",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "config.dbuser",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "config.dbpassword",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "pymongo.MongoClient",
... |
13023133962 | from __future__ import absolute_import, division, print_function, unicode_literals
import argparse
from scipy import inner, outer
import tensorflow as tf
import numpy as np
import pandas as pd
import matplotlib
matplotlib.use('Agg')
from sklearn.utils import shuffle
from sklearn import datasets, metrics
from sklearn.mo... | nomoresomethingwentwrong/PSN_Fusion | src/train.py | train.py | py | 26,496 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "matplotlib.use",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.ConfigProto",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "tensorflow.__ver... |
73863266789 | from datetime import datetime, date
from os.path import join, exists
from os import makedirs, listdir
import gc
import subprocess
import sys
import torch
import numpy as np
import csv
def worker_init_fn(wid):
np.random.seed(np.mod(torch.utils.data.get_worker_info().seed, 2**32-1))
def create_results_dir(results_... | acasamitjana/sreg | src/utils/io_utils.py | io_utils.py | py | 7,775 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "numpy.random.seed",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "numpy.mod",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.utils.data.get_wo... |
23150521190 | # Execute Javascript using selenium
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as ec
from selenium.webdriver.support.wait import WebDriverWait
from webdriver_manager.chrome import ChromeDriverManager
driver = webdri... | vthebbar/SeleniumWithPython2 | Programs/JavaScript.py | JavaScript.py | py | 1,699 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "webdriver_manager.chrome.ChromeDriverManager",
"line_number": 10,
"usage_type": "call"
},
... |
70445125991 | #!/usr/bin/env python
import sys
import os
sys.path.append("../tools")
import mergejs
import optparse
def build(config_file = None, output_file = None, options = None):
have_compressor = []
try:
import jsmin
have_compressor.append("jsmin")
except ImportError as E:
print("No jsmin (... | openlayers/ol2 | build/build.py | build.py | py | 6,864 | python | en | code | 1,472 | github-code | 71 | [
{
"api_name": "sys.path.append",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "uglify_js.check_available",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "mergejs.getName... |
15732394178 | import sqlite3
import tkinter as tk
from tkinter import ttk
from tkinter import messagebox
conn = sqlite3.connect('store.db')
c = conn.cursor()
c.execute('''
CREATE TABLE IF NOT EXISTS items (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT,
quantity INTEGER,
cost REAL
)
''')
... | YashM8/SalesManager | manage_inventory.py | manage_inventory.py | py | 4,437 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "sqlite3.connect",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "tkinter.END",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "tkinter.END",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "tkinter.END",
"l... |
39920126352 | # Copyright (C) 2020 OrangeShell Developers
#
# 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 3 of the License, or
# (at your option) any later version.
#
# ... | SejDevStuff/OrangeShell | src/UpdateManager/updater_main.py | updater_main.py | py | 6,243 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "sys.argv",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 42,... |
41662700377 | from stanza.server import CoreNLPClient
import pandas as pd
import neuralcoref
from pipeline_ie.config import Config
import time
class Coref:
def __init__(self, nlp, coref_mode, data, coref_output=False):
self.nlp = nlp
self.coref_mode = coref_mode
self.data = data
self.coref_outpu... | vj1494/PipelineIE | pipeline_ie/coref.py | coref.py | py | 5,462 | python | en | code | 10 | github-code | 71 | [
{
"api_name": "pipeline_ie.config.Config",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "stanza.server.CoreNLPClient",
"line_number": 69,
"usage_type": "call"
},
{
"api_name":... |
10486434186 | import os
import unittest
from spotinst_sdk2 import SpotinstSession
from spotinst_sdk2.models.elastigroup.aws import *
class AwsElastigroupTestCase(unittest.TestCase):
def setUp(self):
self.session = SpotinstSession(
auth_token='dummy-token',
account_id='dummy-account')
s... | spotinst/spotinst-sdk-python | spotinst_sdk2/test/elastigroup/aws/test_aws_eg_model.py | test_aws_eg_model.py | py | 22,111 | python | en | code | 17 | github-code | 71 | [
{
"api_name": "unittest.TestCase",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "spotinst_sdk2.SpotinstSession",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.p... |
3997586783 | import hashlib
from .api import DispatcherAPI, UserError
from . import plot_tools
from datetime import datetime
from astropy import units as u
from astropy.coordinates import Angle, SkyCoord
import numpy as np
import logging
import typing
import requests
import os
import tempfile
import shutil
import json
import ins... | oda-hub/oda_api | oda_api/gallery_api.py | gallery_api.py | py | 42,811 | python | en | code | 2 | github-code | 71 | [
{
"api_name": "logging.getLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "api.DispatcherAPI",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "typing.Optio... |
39420959379 | import time
import cv2
import imutils
import platform
import numpy as np
from threading import Thread
from queue import Queue
from Detection import Detection
from Record import Record
class Camera:
def __init__(self, video_id):
if cv2.ocl.haveOpenCL() :
cv2.ocl.setUseOpenCL(True)
s... | Capston2023-Interveiw/Cheer-UP | analysis/Camera.py | Camera.py | py | 5,647 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "cv2.ocl.haveOpenCL",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.ocl",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "cv2.ocl.setUseOpenCL",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.ocl",
"l... |
23192778400 | import torch
def qort(q, v):
"""
Rotate vector(s) v about the rotation described by quaternion(s) q.
Expects a tensor of shape (*, 4) for q and a tensor of shape (*, 3) for v,
where * denotes any number of dimensions.
Returns a tensor of shape (*, 3).
"""
assert q.shape[-1] == 4
assert... | fabro66/GAST-Net-3DPoseEstimation | common/quaternion.py | quaternion.py | py | 1,234 | python | en | code | 290 | github-code | 71 | [
{
"api_name": "torch.cross",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.cross",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.cat",
"line_number": 35,
"usage_type": "call"
}
] |
247484585 | #!/usr/bin/python2
"""
Select 5000 random Spanish words from the Spanish corpa, then selects nine at random to use as anchor points. The anchor point words are printed to a
file so that human can generate their translations
"""
import logging
import random
if __name__ == '__main__':
logging.basicConfig(level=lo... | DethRaid/voynich-translation | src/spanish/select_for_translation.py | select_for_translation.py | py | 949 | python | en | code | 7 | github-code | 71 | [
{
"api_name": "logging.basicConfig",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "random.shuff... |
30754648067 | import bs4
from bs4 import BeautifulSoup
import requests
import csv
baseURL = 'http://www.innatthecrossroads.com/home/game-thrones-recipes/recipes-by-meal/'
pages = [
'main-courses',
'sides',
'breakfast',
'soupsstews',
'pies',
'bread',
'vegetarian',
'desserts',
'bever... | SlothBorg/Parsers | RPGs/Misc World Building/fictionalFoods.py | fictionalFoods.py | py | 620 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "requests.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 21,
"usage_type": "call"
}
] |
17599283856 | import os
import time
from random import randint
import discord
import discord.utils
from discord.ext import commands
from discord.ext.commands import Bot
from discord.utils import get
import requests
from PIL import Image, ImageFont, ImageDraw
import io
import youtube_dl
prefix = '!'
zeli_bot = Bot(command_prefi... | mee1git/Zelibot | main.py | main.py | py | 16,002 | python | ru | code | 0 | github-code | 71 | [
{
"api_name": "discord.ext.commands.Bot",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands.Bot.remove_command",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands.Bot",
"line_number": 22,
"usage_type": "name"
},
... |
21346943440 | """
Split Beverage table into Beverage and BeverageScrape. Separates the scraping (temporal) from the actual beverage.
Beverage table will be renamed to BeverageScrape. Beverage table created with similar columns. Move all unique
BeverageScrapes to Beverages table. Then drop unnecessary columns from BeverageScrape.
"""... | dmertl/DrinkDifferent | scripts/link_distinct_beer.py | link_distinct_beer.py | py | 1,275 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "web.models.DistinctBeer.query.all",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": ... |
10834428730 | import torch.nn as nn
import torch.nn.functional as F
class BasicBlock(nn.Module):
def __init__(self, in_channels, out_channels, stride=1):
super().__init__()
self.conv1 = nn.Conv2d(in_channels, out_channels, kernel_size=3, stride=stride, padding=1, bias=False)
self.bn1 = nn.BatchNorm2d(out... | huutuongtu/OCR_Vietnamese | resnet18.py | resnet18.py | py | 2,603 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "torch.nn.Module",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numbe... |
71213379429 | from PIL import Image
import numpy as np
from collections import Counter
# Ordena a quantidade de ocorrencia da intensidade
def contar_numeros(image):
pixels = image.flatten()
counts = Counter(pixels).items()
return sorted(counts, key=lambda x: x[::-1])
# Constroe árvore de cima para baixo
def construir_... | GabrielDosReisUFC/Projeto-Processamento-de-Imagens | huffman.py | huffman.py | py | 7,388 | python | pt | code | 0 | github-code | 71 | [
{
"api_name": "collections.Counter",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.uint16",
"line_number": 193,
"usage_type": "call"
},
{
"api_name": "numpy.uint16",
"line_number": 203,
"usage_type": "call"
},
{
"api_name": "numpy.empty",
"lin... |
18400780116 | import os
from typing import List
from domain.contracts.abstract_dataset_preparartion_service import AbstractDatasetPreparationService
from domain.models.evaluation_job_parameters import EvaluationJobParameters
from domain.models.inference_object import InferenceObject
from shared.helpers.dataset_helpers import get_da... | BMW-InnovationLab/SORDI-AI-Evaluation-GUI | src/application/dataset_preparation/services/image_classification_dataset_preparation_service.py | image_classification_dataset_preparation_service.py | py | 1,896 | python | en | code | 69 | github-code | 71 | [
{
"api_name": "domain.contracts.abstract_dataset_preparartion_service.AbstractDatasetPreparationService",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "shared.services.image_classification_formatting_service.ImageClassificationFormattingService",
"line_number": 14,
"usage_typ... |
14120858309 | import requests
import json
def post_message_to_discord(message_content):
"""
Posts a message to a Discord channel using a webhook.
Args:
message_content (str): The content of the message to be posted.
Returns:
bool: True if the message was successfully sent, False otherwise.
"""
... | Swaggy1224/portfolio-site | webhook.py | webhook.py | py | 1,074 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "requests.post",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 25,
"usage_type": "call"
}
] |
86284979508 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
import pytest
from sofia_redux.toolkit.fitting.polynomial \
import Polyfit, linear_polyfit, gaussj_polyfit, nonlinear_polyfit
@pytest.fixture
def data():
y, x = np.mgrid[:5, :5]
z = 1.0 + x + (x * y) + (y ** 2)
c = np... | SOFIA-USRA/sofia_redux | sofia_redux/toolkit/fitting/tests/test_polynomial/test_polyfit_class.py | test_polyfit_class.py | py | 5,189 | python | en | code | 9 | github-code | 71 | [
{
"api_name": "numpy.mgrid",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "sofia_redux.toolkit.... |
69903036391 | from collections import defaultdict
from typing import List
class Solution:
def longestEqualSubarray(self, nums: List[int], k: int) -> int:
window_start = 0
frequency_dict = {}
frequency_dict = defaultdict(lambda: 0, frequency_dict)
max_arr = 0
max_frequency = 0
fo... | naveen17797/leetcode-py | length-of-longest-sub-array/solution.py | solution.py | py | 802 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "typing.List",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "collections.defaultdict",
"line_number": 9,
"usage_type": "call"
}
] |
28734388221 | #plot de todos os autovalores em função de v(vertices)
#um para cada rede.
import matplotlib.pyplot as plt
import numpy as np
import networkx as nx
def diretorio(matriz,caso, nome):
matriz1 = '/home/pc/Desktop/IC/caos/arestas'
matriz2 = '/home/pc/Desktop/IC/caos/m_complex/espectral'
casos = ['/LM_p1','LM_int','LM_... | Eudilucas/LM_VisibilityGraph | m_complex/autovalores.py | autovalores.py | py | 2,448 | python | pt | code | 0 | github-code | 71 | [
{
"api_name": "networkx.Graph",
"line_number": 81,
"usage_type": "call"
},
{
"api_name": "networkx.adjacency_spectrum",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "numpy.real",
"line_number": 87,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
... |
71042939749 | from django.urls import path
from . import views
app_name = 'lol'
urlpatterns = [
path('', views.IndexView, name='index'),
path('summoner', views.SummonerView, name='summoner'),
path('lastgame', views.LastGameView, name='lastgame'),
path('laststat', views.LastGameStats, name='laststat'),
] | veikoon/RiotAPI101 | lol/urls.py | urls.py | py | 310 | python | en | code | 0 | github-code | 71 | [
{
"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",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
25007578830 | import math
import os
import numpy as np
import pandas as pd
from ipfn import ipfn
from scipy.spatial import distance_matrix
##### Definition of input Data #####
subfolder = "FSKx"
no_of_cells = 100 # should be a number that gives a square (10x10)
## Shops Data ##
# only one chain with 5 stores distributed randomly... | Sandi-hub/Diffusion_Model_FSKx | Diffusion_Model_FSKx_OLD/Gravity_Model_FSKx.py | Gravity_Model_FSKx.py | py | 11,267 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "math.isqrt",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "numpy.repeat",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 4... |
41309161745 | from django.urls import path
from django.views.decorators.csrf import csrf_exempt
from poll.views import ActivationView, ActiveQuestionDetailView, VoteView, StatView, NomineesView, RestartPollView
urlpatterns = [
path('<int:question_id>/activate/', csrf_exempt(ActivationView.as_view())),
path('active/', Acti... | Melevir/going_python | poll/urls.py | urls.py | py | 625 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.views.decorators.csrf.csrf_exempt",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "poll.views.ActivationView.as_view",
"line_number": 8,
"usage_type": "call"
},
... |
2740904772 | # -*- coding: utf-8 -*-
import gzip
import urllib.request
from urllib import parse
import json
import matplotlib.pyplot as plt
from matplotlib.font_manager import FontProperties
class Weather:
def __init__(self, city):
city_name = parse.quote_plus(city)
only_now = parse.quote_plus("")
... | JackyXiao98/Pyqt_weather | weather_info.py | weather_info.py | py | 3,852 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "urllib.parse.quote_plus",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "urllib.parse",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "urllib.parse.quote_plus",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "urllib.p... |
15795006799 | import json
from datetime import datetime
from inspect import getframeinfo, stack
class i_messages:
def __init__(self, log_level='None', path='./log/log_config/message.json'):
self.messages = {}
self.path = path
self.read_messages()
self.log_level=log_level
def read_me... | ersingulbahar/el_tool | log/_log.py | _log.py | py | 1,646 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "json.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "inspect.getframeinfo",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "inspect.stack",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.today"... |
72593598309 | from fastapi import FastAPI, HTTPException
from pydantic import BaseModel
from typing import List
import datetime
import json
class LogItem(BaseModel):
""" LogItem class to manage the log data
"""
id: int = None # id is auto-incremented
item_name: str
quantity: int
time: datetime.datetime
... | LuminolT/GTNH-monitor-backend | main.py | main.py | py | 3,194 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "pydantic.BaseModel",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "datetime.datetime",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "json.dump",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "json.load",
"l... |
15760633982 | #!/usr/bin/env python3
"""Example of redis cache"""
from functools import wraps
from typing import Union, Callable, Optional
import redis
import uuid
def count_calls(method: Callable) -> Callable:
"""decorator function to define a wrapper function
that counts times Cache class methods are called"""
name =... | fk2019/alx-backend-storage | 0x02-redis_basic/exercise.py | exercise.py | py | 2,445 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "typing.Callable",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "functools.wraps",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "typing.Callable",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "functools.wraps",
... |
7170944806 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
import torch
def index_to_mask(index, size):
mask = torch.zeros(size, dtype=torch.bool, device=index.device)
mask[index] = 1
return mask
# def random_planetoid_splits(data, num_classes, percls_trn=20, val_lb=500, Flag=1):
# # Set new r... | DaDaCheng/SMGCN | Realdata/FSGNN/utils_g.py | utils_g.py | py | 4,796 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "torch.zeros",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.bool",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.randperm",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "torch.cat",
"line_number... |
12421224759 | #
# _.._ ,------------.
# ,' `. ( We want you! )
# / __) __` \ `-,----------'
# ( (`-`(-') ) _.-'
# /) \ = / (
# /' |--' . \
# ( ,---| `-.)__`
# )( `-.,--' _`-.
# '/,' ( Uu",
# (_ , `/,-' )
# `.__, ... | OYQ-GFH/ChinaChess | chinese_chess.py | chinese_chess.py | py | 29,983 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "pygame.init",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "pygame.mixer.init",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "pygame.mixer",
"line_number": 67,
"usage_type": "attribute"
},
{
"api_name": "pygame.mixer.Sound",
... |
37622605431 | import pandas as pd
from tqdm import tqdm
from multiprocessing.pool import Pool
import numpy as np
import os
import subprocess
import shutil
import zipfile
def convert_mp4_to_zip_ffmpeg(mp4_path: str,
zip_path: str,
fps: int = None,
... | FeipengMa6/VSC22-Submission | VSC22-Descriptor-Track-1st/preprocess/vid2jpg_zip.py | vid2jpg_zip.py | py | 3,170 | python | en | code | 29 | github-code | 71 | [
{
"api_name": "os.path.isfile",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "os.remove",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_num... |
17359236240 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @File : nova_aggregate_host_relation_table.py
# @Author: gaofzhan
# @Email: gaofeng.a.zhang@ericssoin.com
# @Date : 2020/12/3 13:45
# @Desc : nova aggregate-show <ha-id>
from backend.myBluePrint.ericic_v2.model.ericic_base_model import BASE
from sqlalchemy import Co... | yanliangchen/ware_house | gzbj/optimus_2.1/optimus/backend/myBluePrint/ericic_v2/model/nova_aggregate_host_relation_table.py | nova_aggregate_host_relation_table.py | py | 1,203 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "backend.myBluePrint.ericic_v2.model.ericic_base_model.BASE",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.String",
"line_number": 18,
"usage_type": "call"
... |
25989065682 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue May 5 11:50:19 2020
@author: nsai
"""
import xlrd
import re
import nltk
from nltk.corpus import stopwords
from sklearn.feature_extraction.text import TfidfVectorizer
from unicodedata import normalize
from sklearn.neighbors import NearestNeighbors
from ... | nsai11/NLP-WebScrap | task3_2.py | task3_2.py | py | 5,199 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "xlrd.open_workbook",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "unicodedata.normalize",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords... |
38649502347 | import os
import json
import glob
import numpy as np
import seaborn as sns
import torch
import torch.nn as nn
import torch.optim as optim
from tqdm import tqdm
from idgl_utils.generic_utils import to_cuda
from idgl_utils.constants import VERY_SMALL_NUMBER
import torch.nn.functional as F
import shutil
... | xzwbsz/DGFormer | model_handler.py | model_handler.py | py | 15,479 | python | en | code | 2 | github-code | 71 | [
{
"api_name": "os.path.dirname",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"l... |
6122067991 | # -------------------------------------------------------------------------- #
# ---------------------------- Imported Modules ---------------------------- #
# General
import os
# PyTorch
import torch
import torch.nn as nn
# Plotting
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.animation as man... | Samwich1998/Stress-Analysis-Head | Helper Files/Machine Learning/Model Control/Models/pyTorch Models/Model Architectures/_emotionModel/_modelComponents/transformerEncoder.py | transformerEncoder.py | py | 9,076 | python | en | code | 3 | github-code | 71 | [
{
"api_name": "torch.nn.Module",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "torch.nn.MultiheadAttention",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "torch.nn",
... |
11602343027 | ## flask related
from flask import Flask, jsonify, request
app = Flask('PrivaDroid', static_url_path = '/static')
## change directory for dev purpose
import os
os.chdir('ActivityBuddyBundle/privadroid')
## util
include_test_users = False
from util import filter_out_test_user_data, fill_in_users_that_dont_have_events... | wayneiny/PrivaDroid | flask/flask_rest_api_server.py | flask_rest_api_server.py | py | 9,247 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "flask.Flask",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "user_join_event_provider.get_all_real_users_join_events",
"line_number": 20,
"usage_type": "call"
},
{
"api_na... |
17052449896 | import string
import re
import pandas as pd
from sklearn.feature_extraction.text import CountVectorizer
from sklearn import linear_model
from nltk.corpus import stopwords
from local_functions import *
import spacy
# -------------------------------
# Parameters
# -------------------------------
# Corpus tsv path
cor... | gguex/char2char_vectors | old_scripts/2.1_Tests_lesMiserables.py | 2.1_Tests_lesMiserables.py | py | 9,184 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "pandas.read_csv",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "string.punctuation",
"line_number": 66,
"usage_type": "attribute"
},
{
"api_name": "re.sub",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "spacy.load",
"line... |
6161672766 | from django.conf.urls import url
from django.views.generic import TemplateView
from django.views.generic.base import RedirectView
from rest_framework.urlpatterns import format_suffix_patterns
from rest_framework.authtoken.views import obtain_auth_token
from .views import DogView, UserDogView, UserPreferenceView, User... | EliForester/pug-or-ugh-api | backend/pugorugh/urls.py | urls.py | py | 1,191 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "rest_framework.urlpatterns.format_suffix_patterns",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "rest_framework.authtoken.views.obtain_auth_token",
"line_number": 12,
... |
24647850418 | import sys
import time
import matplotlib.pyplot as plt
import array
import numpy as np
import pandas as pd
import math
import conf
import datalogger
start_time = time.time()
with open("./data/raw.dat", "rb") as f:
f.read(4096)
b = f.read()
f.close()
def RemoveFirstByte(val):
return val & 0xFFF
def... | Chatphongp/tgfr-qar | src/testnp.py | testnp.py | py | 2,212 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "time.time",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.vectorize",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.vectorize",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "numpy.frombuffer",
"lin... |
72811448549 | from django.test import TestCase, Client
from django.urls import reverse
from meetupfinder.models import Event, Categories
from meetupfinder.forms import AddEventForm, EventFilterForm
import json, requests
from django.contrib.auth.models import User
from urllib.parse import urlencode
from django.utils import timezone
... | glc6qrx/Meet-up-Finder | meetupfinder/tests/test_views.py | test_views.py | py | 8,279 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "django.test.TestCase",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.test.Client",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.urls.reverse",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django.ur... |
9740338573 | import json
import boto3
import logging
from notification import send_notification
from transform_data import transform_data
from extract_data import extract_data
from load_data import load_data
REGION = "us-east-1"
def lambda_handler(event, context):
logger = get_logger(__name__)
try:
logger.info("... | scottstark/aws-covid-etl-challenge | etl/etl.py | etl.py | py | 2,518 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "extract_data.extract_data",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "extract_data.extract_data",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "transform_data.transform_data",
"line_number": 25,
"usage_type": "call"
},
{
... |
18111583688 | #!/usr/bin/env python
import os
import sys
import io
import subprocess
import numpy
from setuptools import setup, find_packages
from Cython.Distutils import Extension, build_ext
with io.open('README.md', encoding='utf-8') as f:
long_description = f.read()
# BEFORE importing distutils, remove MANIFEST. distutils... | goballooning/nlsam | setup.py | setup.py | py | 4,256 | python | en | code | null | github-code | 71 | [
{
"api_name": "io.open",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.remove",
"line_number": 18... |
30807904774 | import cv2
import numpy as np
import matplotlib.pyplot as plt
from skimage import img_as_ubyte
from skimage import transform as tf
def pad(img, crd, resize_val): # pad image with constant border and calculates new bounding box coordinates
pad_y, pad_x = int(img.shape[0]/resize_val), int(img.shape[1]/resiz... | keshavoct98/Indian-Number-Plate-Recognition | data/augmentation_methods.py | augmentation_methods.py | py | 1,542 | python | en | code | 15 | github-code | 71 | [
{
"api_name": "cv2.copyMakeBorder",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.BORDER_CONSTANT",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "cv2.resize",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.array",
... |
14473208050 | import requests
import uuid
import shutil
import re
HOST = 'https://rtex.probablyaweb.site'
def load_template():
with open('template.tex', encoding = 'utf-8') as f:
raw = f.read()
# Remove any comments from the template
cleaned = re.sub(r'%.*\n', '', raw)
return cleaned
def render_latex(late... | devksingh4/fogelbot | latex.py | latex.py | py | 1,599 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "re.sub",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "uuid.uuid4",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 28,... |
4454574649 | import mock
import unittest
import numpy as np
from wavealign.loudness_processing.i_audio_level_calculator import IAudioLevelCalculator
from wavealign.loudness_processing.windowed_level_calculator import WindowedLevelCalculator
class TestWindowedLevelCalculator(unittest.TestCase):
@mock.patch('wavealign.loudness... | y-brehm/waveAlign | tests/unit/loudness_processing/test_windowed_level_calculator.py | test_windowed_level_calculator.py | py | 1,403 | python | en | code | 2 | github-code | 71 | [
{
"api_name": "unittest.TestCase",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.rand",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "mock.MagicM... |
3843070494 | import constants
import os
from helpers import get_all_categories
from proxy_chrome import proxy_chrome
from proxy_handler import ProxyHandler
from time import sleep
from contextlib import nullcontext
import requests
# Get all categories
categories = get_all_categories(1)
proxy_handler = ProxyHandler()
XPATH_T... | teocns/Trustpilot-Scraper | scrape-hierarchy-2.py | scrape-hierarchy-2.py | py | 2,246 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "helpers.get_all_categories",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "proxy_handler.ProxyHandler",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "proxy_handler.getProxy",
"line_number": 26,
"usage_type": "call"
},
{
"api_... |
18825116770 | import gc
import torch
import models
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from models import register
from utils import make_coord
@register('NIS')
class NeuralImageStitching(nn.Module):
def __init__(self, encoder_spec, blender_spec, hidden_dim=256, imnet_spec=None, detailor_sp... | minshu-kim/Neural-Image-Stitching | models/NIS.py | NIS.py | py | 4,101 | python | en | code | 12 | github-code | 71 | [
{
"api_name": "torch.nn.Module",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "models.make",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "models.make",
"line_num... |
32909389361 | """Main script which monitors git status."""
import os
from typing import List
import telegram
from dotenv import load_dotenv
from git import Repo
load_dotenv(".env")
def get_changed_files(repo: Repo) -> List[str]:
"""Returns list of changed files."""
return [item.a_path for item in repo.index.diff(None)]
... | rkhass/monitor-git-changes | main.py | main.py | py | 2,435 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "git.Repo",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "git.Repo",
"line_number": ... |
71101010470 | from flask import Flask, redirect, url_for, render_template, send_from_directory
from flask import request
import time
app = Flask(__name__)
database = list()
@app.route("/index")
def index():
get_current_time()
timedata = dict(time = get_current_time())
return render_template("base.html", datas = databas... | DRyan1995/web_learning | flask_demo/mainplatform.py | mainplatform.py | py | 2,081 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask.redirect",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "flask.url_for",
"... |
71397858150 | import torch
import torch.nn as nn
from ..builder import (ALGORITHMS, build_backbone, build_head, build_memory,
build_neck)
from .base import BaseModel
@ALGORITHMS.register_module()
class NPID(BaseModel):
"""NPID.
Implementation of `Unsupervised Feature Learning via Non-parametric
... | cliangyu/CSVAL | selection/mmselfsup/models/algorithms/npid.py | npid.py | py | 3,898 | python | en | code | 30 | github-code | 71 | [
{
"api_name": "base.BaseModel",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "builder.build_backbone",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "builder.build_neck",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "builder.buil... |
17470058856 | # -*- coding: utf-8 -*-
"""
Created on Tue Jul 6 13:36:50 2021
@author: MJH
"""
from tokenization import *
import pandas as pd
import numpy as np
import tensorflow as tf
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Input, Bidirectional, LSTM, GlobalAveragePooling1D, GlobalMaxPool... | rpycgo/Practice | NLP/Semantic Similarity/tensorflow_bert_semantic_similarity.py | tensorflow_bert_semantic_similarity.py | py | 8,703 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "numpy.array",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "numpy.argmax",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "tensorflow.distribute.MirroredStrategy",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "tenso... |
39509492567 | import pygame
import os
import time
import random
import Assets
import Player
import Enemy
import Ship
import Laser
pygame.font.init()
# Main Function
def main():
run = True
fps = 60
level = 0
lives = 3
lost = False
lostCount = 0
mainFont = pygame.font.SysFont("calibri", 50)
lostFont ... | saulgeorge13/SpaceFighters | main.py | main.py | py | 4,285 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "pygame.font.init",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pygame.font",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pygame.font.SysFont",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pygame.font",
... |
10801188401 | import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from statsmodels.tsa.stattools import adfuller
from statsmodels.tsa.seasonal import seasonal_decompose
from statsmodels.tsa.arima_model import ARIMA
from pandas.plotting import register_matplotlib_converters
register_matplotlib_converters()
de... | VanAnhNgo97/Recruitment | forecast/detect_amount.py | detect_amount.py | py | 2,144 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "pandas.plotting.register_matplotlib_converters",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 17,
"usage_type": "name"
},
{... |
2196827967 | from .sample import Sample
from .meta import fit_field
from .diffeomorphisms import Image
from patsy import dmatrix
import numpy as np
from scipy.stats.distributions import t
import pandas as pd
import pickle
class PopulationModel:
"""
The FMRI population model
Parameters
----------
sample ... | fmristats/fmristats | fmristats/pmodel.py | pmodel.py | py | 5,503 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "sample.Sample",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "sample.covariates",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "sample.statistics",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "patsy.dma... |
36877475613 | import argparse
import numpy as np
from mpi4py import MPI
from datetime import datetime
def sort_by_pivot(a, pivot):
l = 0
r = len(a) - 1
while l < r:
if a[l] < pivot:
l += 1
continue
if a[r] >= pivot:
r -= 1
continue
a[l], a[r] = a[r... | maiksaray/mp-labs | lab3/lab3_np.py | lab3_np.py | py | 3,731 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "mpi4py.MPI.COMM_WORLD",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "mpi4py.MPI",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "numpy.l... |
7526070542 | import json
import numpy as np
import os
import tensorflow as tf
import time
from typing import Any, Tuple, Callable
from queue import Queue, Empty
from threading import Thread, RLock
from absl import logging, flags
from datetime import datetime
from tensorflow.python.profiler.internal import _pywrap_traceme
from tens... | bytedance/monolith | monolith/native_training/metric/metric_hook.py | metric_hook.py | py | 18,705 | python | en | code | 702 | github-code | 71 | [
{
"api_name": "absl.flags.FLAGS",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "absl.flags",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "tensorflow.estimator",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "monolith.n... |
29526899882 | from django.db.models import Sum
from .models import Order, OrderDetail
from apps_base.influencer.models import Influencer
from apps_base.shipping.models import ShippingCost
from apps_base.promotion.models import CouponGenerate, Coupon
from apps_base.order.constants import PROCESO
from decimal import Decimal as D, getc... | danielhuamani/fanntop | src/apps_base/order/order.py | order.py | py | 9,203 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "apps_base.influencer.models.Influencer.objects.filter",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "apps_base.influencer.models.Influencer.objects",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "apps_base.influencer.models.Influencer"... |
25466535962 | # -*- coding: utf-8 -*-
"""
Created on Tue Jul 26 19:04:23 2022
This code pulls static info from MIMIC IV for validation. Looks at the ADMISSIONS,
PATIENTS, CHARTEVENTS ,TRANSFERS, and services tables.
Covers:
Age
Gender
AdmitWeight
Ethnicity
HospitalAdmitTime24
UnitAdmitTime24
NumBeds
TeachingStatus
... | ryanlu41/delirium | Dynamic/Ext Validation 2/Static/pull_dynamic_MIMICIV_adm_info.py | pull_dynamic_MIMICIV_adm_info.py | py | 8,787 | python | en | code | 10 | github-code | 71 | [
{
"api_name": "time.time",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_nu... |
75007542949 | import os
import sys
import yaml
import json
from copy import deepcopy
from importlib import import_module
from inspect import ismethod, isfunction
from .utils import singleton
__all__ = ('Context', 'BaseConfig', )
def _url2dict(arg):
if arg.endswith('.yaml') or arg.endswith('.yml'):
with open(arg) as f... | kubeedge/sedna | lib/sedna/common/config.py | config.py | py | 9,474 | python | en | code | 466 | github-code | 71 | [
{
"api_name": "yaml.load",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "yaml.FullLoader",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.basename",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_n... |
9782692709 | import sys
import zlib
import random
import base64
from io import BytesIO
from PIL import Image
__version__ = '0.1.0'
class TermImage(object):
def __init__(self, data: str):
"""Creates a new TermImage object using base64 encoded image data"""
# The raw base64 encoded data
self._r... | watzon/tgp | tgp/__init__.py | __init__.py | py | 3,190 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "PIL.Image.open",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "io.BytesIO",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "base64.b64decode",
"line_numb... |
74568521189 | from flask import Flask, request
import json
app = Flask(__name__)
import serial
import smtplib
import logging
import platform
import subprocess
import sys
import threading
from google.assistant.library.event import EventType
from aiy.assistant import auth_helpers
from aiy.assistant.library import Assistant
from aiy.bo... | ethanr33/r-home | google_home_control.py | google_home_control.py | py | 8,359 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "flask.Flask",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "smtplib.SMTP",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "serial.Serial",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number":... |
31280739524 | # coding=utf-8
# coding=utf-8
import requests
from bs4 import BeautifulSoup
import re
import pandas as pd
from lxml import etree
#生成页面url
def get_url1(pages):
urls={} #存贮链接的字典,key为页数,value为链接
for page in range(1,int(pages)+1):
page_url="https://sh.lianjia.com/chengjiao/pg{}/".format(page)
... | zhyali/data_visualization | data_craw.py | data_craw.py | py | 3,608 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "requests.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": ... |
74874213029 | #coding: 'utf-8'
"""
LDP_Net
demo.py
created by Kazunari on 2018/08/29
"""
import argparse
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import chainer
import sys
import os.path as osp
sys.path.append(osp.curdir)
from model.ldp_net import LDP_Net
from dataset.Local_Depth_Dataset import Loca... | kazutvoice05/LDP_Net | demo.py | demo.py | py | 1,959 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "sys.path.append",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "os.path.curdir",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"line... |
7056477054 | from itertools import combinations
from collections import Counter
def solution(orders, course):
answer = []
for c in course:
lst = []
for order in orders:
for l in list(combinations(sorted(order), c)):
lst.append(''.join(l))
result = Counter(lst).most_common... | hyungkyu1234/algorithm | 프로그래머스/level2/메뉴리뉴얼.py | 메뉴리뉴얼.py | py | 538 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "itertools.combinations",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 11,
"usage_type": "call"
}
] |
23922040093 | #!/usr/bin/python
###############################################################################
# #
# This file is part of IfcOpenShell. #
# ... | IfcOpenShell/IfcOpenShell | nix/build-all.py | build-all.py | py | 39,318 | python | en | code | 1,412 | github-code | 71 | [
{
"api_name": "ssl._create_default_https_context",
"line_number": 64,
"usage_type": "attribute"
},
{
"api_name": "ssl._create_unverified_context",
"line_number": 64,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 69,
"usage_type": "call"
... |
26205166922 | # _*_ coding:utf-8 _*_
# @File : short_message.py
# @Time : 2020-09-15 13:40
# @Author: zizle
""" 短信通业务逻辑 """
import json
from datetime import datetime
from PyQt5.QtWidgets import qApp, QWidget, QVBoxLayout, QLabel
from PyQt5.QtCore import QTimer, Qt, QMargins, QUrl
from PyQt5.QtNetwork import QNetworkRequest
from s... | zizle/AnalysisDecisionClient | frames/product/short_message.py | short_message.py | py | 4,712 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCore.QTimer",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QVBoxLayout",
"line_number": 23,
"usage_type": "call"
},
{
"api_name"... |
24315818516 | from __future__ import annotations
from typing import Tuple, List
from random import randint
from card import Card
from abc import ABC, abstractmethod
class DefaultDeck(ABC):
@abstractmethod
def __init__(self) -> None:
self.deck = []
return None
def get_cards(self, number_of_cards: int) ... | Authier/card-games | decks.py | decks.py | py | 3,616 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "abc.ABC",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "card.Card",
"line_number": 1... |
39717408138 | import matplotlib.pylab as pl
import matplotlib.pyplot as plt
import numpy as np
index = list(range(1, 13))
values = list(range(3, 15))
plt.bar(index, values)
plt.plot(index, values, 'rD')
plt.plot(index, values, '+')
plt.title('Title')
plt.xlabel('xlabel')
plt.ylabel('ylabel')
plt.show()
t = np.arange(0., 4., 0.1)
p... | jixing-beihang/pytrain | dataAnalysis/test_matplotlib.py | test_matplotlib.py | py | 440 | python | uk | code | 0 | github-code | 71 | [
{
"api_name": "matplotlib.pyplot.bar",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotli... |
2709006843 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'Owen_Study/owen_study@126.com'
# Create date: 17-7-18 下午10:43
import shelve
import const, publicparameters, ordermanage, common
import priceupdate, ormmysql
import time
'''对查找到的COIN进行交易,买入或者卖出'''
'''交易结构'''
class OrderItem(object):
def __init__(self, m... | owenstudy/octopusforcastbtc | cointrans.py | cointrans.py | py | 22,953 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "const.ORDER_STATUS_OPEN",
"line_number": 103,
"usage_type": "attribute"
},
{
"api_name": "const.ORDER_STATUS_CLOSED",
"line_number": 104,
"usage_type": "attribute"
},
{
"api_name": "const.ORDER_STATUS_CANCEL",
"line_number": 105,
"usage_type": "attribute"
... |
43111120122 | import functools
import json
import jsonschema
import tornado.web
from .. import basehandler
class ApiBaseHandler(basehandler.BaseHandler):
def check_xsrf_cookie(self):
pass
def prepare(self):
"""prepare function: it is called after initialize function"""
if self.request.headers.get... | kocsob/tornado-template | handlers/api/apibasehandler.py | apibasehandler.py | py | 1,576 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "json.loads",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "tornado.web.web.HTTPError",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "tornado.web.web",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "tornado.web... |
10773755868 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 6 14:42:48 2018
@author: davidstupski
"""
from __future__ import division
import numpy as np
from scipy.integrate import odeint
import matplotlib.pyplot as plt
#from matplotlib import cm
#from mpl_toolkits.mplot3d import Axes3D
import pandas as pd... | dstups/Heat_transfer_code | water_loss_adjusted.py | water_loss_adjusted.py | py | 6,206 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "matplotlib.pyplot.style.use",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 17,
"usage_type": "name"
},
{
"api_na... |
10719947857 | # -*- coding: utf-8 -*-
import json
import time
from datetime import datetime, timedelta
from django.conf import settings
from django.core import mail
import mock
from olympia import amo
from olympia.abuse.models import AbuseReport
from olympia.access.models import Group, GroupUser
from olympia.activity.models impo... | binoc-third-party-archive/tb-addons-server | src/olympia/reviewers/tests/test_models.py | test_models.py | py | 65,706 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "olympia.addons.models.Addon.objects.get_or_create",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "olympia.addons.models.Addon.objects",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "olympia.addons.models.Addon",
"line_number": 33,
... |
40119501266 | import matplotlib.pyplot as plt
def plot_metrics(history, show=False):
plt.subplot(2, 1, 1)
plt.title('Loss')
plt.plot(history['loss'], '-o', label='train')
plt.plot(history['val_loss'], '-o', label='val')
plt.xlabel('epoch')
plt.legend(loc='upper right')
plt.subplot(2,1,2)
plt.title('A... | mia2mia/audioeventdetector | utils.py | utils.py | py | 620 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "matplotlib.pyplot.subplot",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.title",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "matp... |
34750253112 | """ Middleware classes for the main app"""
from django.conf import settings
from django.utils.deprecation import MiddlewareMixin
class CachelessAPIMiddleware(MiddlewareMixin):
"""Add Cache-Control header to API responses"""
def process_response(self, request, response):
"""Add a Cache-Control header ... | mitodl/bootcamp-ecommerce | main/middleware.py | middleware.py | py | 620 | python | en | code | 5 | github-code | 71 | [
{
"api_name": "django.utils.deprecation.MiddlewareMixin",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.conf.settings.CACHEABLE_ENDPOINTS",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 11,
"usage_ty... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.