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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
18915553573 | import pytest
from src.same_tree import Solution
from src.utils.binary_tree import list_to_tree
@pytest.mark.parametrize(
"list_p,list_q,equal",
[
([1, 2, 3], [1, 2, 3], True),
([1, 2], [1, None, 2], False),
([], [], True),
([1, 2, 1], [1, 1, 2], False),
],
)
def test_solu... | lancelote/leetcode | tests/test_same_tree.py | test_same_tree.py | py | 456 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "src.utils.binary_tree.list_to_tree",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "src.utils.binary_tree.list_to_tree",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "src.same_tree.Solution",
"line_number": 20,
"usage_type": "call"
... |
38830842298 | from rest_framework import status
def jwt_response_payload_handler(token, user=None, request=None):
return {
'code': status.HTTP_200_OK,
'message': '',
'result': {
'token': token,
'user_id': user.id,
'username': user.username
}
}
| helloming86/DjangoJWTDemo | users/utils.py | utils.py | py | 308 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "rest_framework.status.HTTP_200_OK",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.status",
"line_number": 6,
"usage_type": "name"
}
] |
16283819127 | from django.conf.urls import url
from .views import(
AddQuestionCreateAPIView,
QuestionListAPIView,
QuestionRUDAPIView,
QuestionImageRUDAPIView,
UserQuestionListAPIView,
TopicCreateAPIView,
TopicRUDAPIView,
SubTopicCreateAPIView,
SubTopicRUDAPIView,
... | ashukesri/100Percentile | questions/urls.py | urls.py | py | 2,307 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.conf.urls.url",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "views.QuestionListAPIView.as_view",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "views.QuestionListAPIView",
"line_number": 28,
"usage_type": "name"
},
{
"... |
71056879784 | from wordcloud import WordCloud
import matplotlib.pyplot as plt
from collections import Counter
from konlpy.tag import Okt
from PIL import Image
import numpy as np
import sys
#์ฌ์ฉ์ ์ ์ ๊ฐ๋ฅํ ์ ๋ณด ์
๋ ฅ
least_num = int(input("์๋ ํด๋ผ์ฐ๋ ๋จ์ด ์ต์ ๋น๋๋ฅผ ์ ์๋ก ์
๋ ฅํ์์ค.:"))
directory = input("๋ฐ์ดํฐ์ ์ฃผ์๋ฅผ ์
๋ ฅํด ์ฃผ์ธ์.(ํ์ผ๋จ์์
๋๋ค.):")
temp_save... | LimJinOuk/Word-Cloud | WordCloud.py | WordCloud.py | py | 2,206 | python | ko | code | 0 | github-code | 36 | [
{
"api_name": "matplotlib.pyplot.ion",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "konlpy.tag.Okt",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "collections.Co... |
74202841385 | import pyaudio
import numpy as np
FORMAT = pyaudio.paInt16
CHANNELS = 1
RATE = 16000
CHUNK_SIZE = 1000
MAX_INT16 = np.iinfo(np.int16).max
p = pyaudio.PyAudio()
stream = p.open(format=FORMAT,
channels=CHANNELS,
rate=RATE,
output=True)
for i in range(0, 18):
print(i)... | gmamaladze/tf-voice-pi | tfvoicepi/tools/play.py | play.py | py | 663 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "pyaudio.paInt16",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "numpy.iinfo",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.int16",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pyaudio.PyAudio",
... |
35555355731 | from datetime import date
from fastapi import APIRouter, Depends, Query
from sqlalchemy.ext.asyncio import AsyncSession
from api.deps import get_db
from crud.analytics import get_analytics_by_range_of_dates, get_analytics_by_student_id
from schemas.analytics import AnalyticsByRangeOfDates
router = APIRouter()
@rou... | starminalush/mfdp-2023-mvp | backend/api/endpoints/analytics.py | analytics.py | py | 1,680 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.ext.asyncio.AsyncSession",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "f... |
35941174358 | import requests
import json
from PIL import Image, ImageTk
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
import time
import os
from bs4 import BeautifulSoup
import tkinter as tk
im... | akaTiger/Mapiot | old.py | old.py | py | 18,576 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "tkinter.Frame",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "tkinter.Frame",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "PIL.ImageTk.PhotoImage",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "PIL.ImageTk",
... |
29642501697 | import argparse
import numpy as np
import scipy.stats
from statsmodels.stats.proportion import *
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
from matplotlib.patches import Patch
import matplotlib.patches as mpatches
matplotlib.rcParams['font.family'] = 'Arial'
def get_conf_in... | pqian11/fragment-completion | analysis/exp1_analysis.py | exp1_analysis.py | py | 20,639 | python | en | code | 5 | github-code | 36 | [
{
"api_name": "matplotlib.rcParams",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": ... |
33660433557 | import os
from flask import Flask, Response, request, current_app, url_for, send_from_directory
from fishapiv2.database.models import *
from flask_restful import Resource
from werkzeug.utils import secure_filename
from fishapiv2.resources.helper import *
from fishapiv2.resources.controller.authentication import *
impor... | MauL08/AquaBreedingAPI-V2 | fishapiv2/resources/controller/pond.py | pond.py | py | 12,401 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask_restful.Resource",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "flask.url_for",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "flask_jwt_extended.get_jwt_identity",
"line_number": 21,
"usage_type": "call"
},
{
"api_name... |
71257318823 | import math
from typing import List
import numpy as np
import torch
import torch.jit as jit
import torch.nn as nn
import torch.nn.functional as F
from torch import Tensor
from torch.nn import Parameter
from language_models.language_base_model import LanguageBaselightning
class RNNCell(jit.ScriptModule):
def __... | shuishen112/TensorLanguageModel | language_models/lightRNN.py | lightRNN.py | py | 7,044 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.jit.ScriptModule",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "torch.jit",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "torch.nn.Parameter",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "torch.randn"... |
35257408476 | import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk,GdkPixbuf
from ui import login
import socket
import select
import json
import os
import redis
from ui import event
HOST = "127.0.0.1"
PORT = 5000
class ChatWindow(Gtk.Window):
def __init__(self):
super().__init__(title="Mega Chat | ... | Kiril0l/gtk_new | ui/chat.py | chat.py | py | 7,521 | python | ru | code | 0 | github-code | 36 | [
{
"api_name": "gi.require_version",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "gi.repository.Gtk.Window",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "gi.repository.Gtk",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "ui.... |
12803276455 | import os, sys, io, math
class SequenceReader:
def __init__(self, file_path):
self.file_path = file_path
def set_file_path(self, file_path):
self.file_path = file_path
def get_file_path(self):
return self.file_path
def read_sequence(self):
with open(self.file_path... | ender-s/HMM-Based-Secondary-Structure-Prediction | hmm_based_predictor.py | hmm_based_predictor.py | py | 12,161 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.stdout.flush",
"line_number": 191,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 191,
"usage_type": "attribute"
},
{
"api_name": "io.StringIO",
"line_number": 194,
"usage_type": "call"
},
{
"api_name": "io.StringIO",
"li... |
13989585282 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from PyQt5.QtWidgets import QWidget, QApplication
from PyQt5.QtGui import QPainter, QColor
class MainWindow(QWidget):
def __init__(self):
super().__init__()
self.initUI()
def initUI(self):
self.setGeometry(300, 300, 350, 100)
... | shellever/Python3Learning | thirdparty/pyqt5/painting/drawrectangles.py | drawrectangles.py | py | 1,308 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtGui.QPainter",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtGui.QColor",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "PyQt5.... |
42244011138 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, tools, _
from odoo import SUPERUSER_ID
import io
import csv
import base64
import ftplib
from odoo.tools import pycompat
import logging
_logger = logging.getLogger(__name__... | eqilibruim-solutions/Theme-1 | clarico_ext/models/product_template.py | product_template.py | py | 7,913 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "odoo.http.request.session",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "odoo.http.request",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "od... |
30420538376 | from pyspark.sql import Window
import pyspark.sql.functions as f
from app import columns
class QueryManager:
def __init__(self, spark, trip_fare_df, trip_data_df):
self.spark = spark
self.trip_fare_df = trip_fare_df
self.trip_data_df = trip_data_df
def trips_count(self, date_column):
... | andriisydor/big_data_2023 | app/QueryManager.py | QueryManager.py | py | 20,166 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pyspark.sql.functions.date_format",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.functions",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "pyspark.sql.functions.col",
"line_number": 24,
"usage_type": "call"
},
{
... |
2894217699 | from typing import Dict, Callable
from src.dialog.common.manage_entity.ManageEntityDialogMode import ManageEntityDialogMode
from src.property.Property import Property
from src.session.common.Session import Session
from src.storage.common.entity.Entity import Entity
from src.storage.common.entity.EntityStorage import E... | andreyzaytsev21/MasterDAPv2 | src/dialog/common/manage_entity/ManageEntityContainerSaver.py | ManageEntityContainerSaver.py | py | 2,456 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "src.session.common.Session.Session",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "src.storage.common.entity.EntityStorage.EntityStorage",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.Callable",
"line_number": 16,
"usage_type... |
5491253992 | import torch
import torch.nn.functional as F
import constants
import numpy as np
def gauss1D(window_size, sigma):
center = window_size // 2
gauss = torch.Tensor([np.exp(-(x - center)**2 / (2*(sigma**2))) for x in range(window_size)])
gauss = gauss/gauss.sum()
return gauss
def create_window(win... | daoduyhungkaistgit/SRGAN | src/metrics.py | metrics.py | py | 4,011 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "torch.Tensor",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.mm",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.Tensor",
"line_number": 18,
... |
27359625037 | #!/usr/bin/python3
import os
import requests
my_ip_file = os.path.join("/tmp", "myIp.txt")
def myIp():
return requests.get("https://gianlu.dev/ip").text.strip()
def writToFile(filename, content):
fp = open(filename, "wt", encoding="utf8")
fp.write(content)
fp.close()
def readFile(filename):
... | GianluDeveloper/OpenRemotePort | CronKeeper.py | CronKeeper.py | py | 681 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.join",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_numbe... |
3746051837 | # Standard Library
import json
import logging
import urllib.parse
# Third Party
from fastapi import APIRouter, Depends, HTTPException, Query, status
from fastapi_cache.decorator import cache
# First Party
from resc_backend.constants import (
CACHE_NAMESPACE_FINDING,
DEFAULT_RECORDS_PER_PAGE_LIMIT,
ERROR_M... | abnamro/repository-scanner | components/resc-backend/src/resc_backend/resc_web_service/endpoints/detailed_findings.py | detailed_findings.py | py | 6,741 | python | en | code | 137 | github-code | 36 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "resc_backend.constants.RWS_ROUTE_DETAILED_FINDINGS",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "resc_backend.constants.FINDINGS_TAG",
"line_number": 28,
"usage_type... |
74998248105 | from __future__ import print_function
import numpy as np
import cv2
import subprocess
import itertools
from multiprocessing import Pool
import sys
import os
import time
import numpy as np
import theano
import theano.tensor as T
import lasagne
f = subprocess.check_output(["ls"]).split()
files = []
#make list of... | arvigj/cv_hw3 | new_eval.py | new_eval.py | py | 15,057 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "subprocess.check_output",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.ogrid",
"line_number": 60,
"usage_type": "attribute"
},
{
"api_name": "numpy.power",
... |
41977316312 | import json
class Destinations:
def __init__(self):
self.destination = ""
self.file_name = "destinations.json"
def write_to_json_file(self):
dictionary = {
"destination": self.destination
}
json_object = json.dumps(dictionary, indent=1, ensure_ascii=False)
... | DistributedTravels/Scraper | scraper/destinations.py | destinations.py | py | 416 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "json.dumps",
"line_number": 12,
"usage_type": "call"
}
] |
73571310823 | from datetime import datetime
from typing import List, Union
from sqlalchemy import select
from sqlalchemy.ext.asyncio import AsyncSession
from app.models import CharityProject, Donation
async def get_not_closed_investing_objects(
model: Union[CharityProject, Donation],
session: AsyncSession
) -> Li... | ThatCoderMan/QRkot_spreadsheets | app/services/investing.py | investing.py | py | 2,014 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "typing.Union",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "app.models.CharityProject",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "app.models.Donation",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "sqlalchemy... |
25338326690 | import torch
import seaborn as sn
from matplotlib import pyplot as plt
from model import ConvNet
from MnistDataset import Mydataset
from torch.utils.data import DataLoader
import numpy as np
import pandas as pd
torch.manual_seed(13)
def get_score(confusion_mat):
smooth = 0.0001 #้ฒๆญขๅบ็ฐ้คๆฐไธบ0่ๅ ไธไธไธชๅพๅฐ็ๆฐ
tp = np.di... | Huyf9/mnist_pytorch | test.py | test.py | py | 1,732 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "torch.manual_seed",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.diagonal",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_numb... |
35906634663 | from flask import Flask, render_template, flash, redirect, request, url_for, jsonify
from multiprocessing import Process, Queue
from xBee_recieve import reciever
app = Flask(__name__)
processes = []
collectedData = []
def getNewXbeeData(q):
PORT = "COM2"
BAUD = 9600
MAC = "13A20041C7BFFC"
r = reci... | explosion33/PIPayload | ground/api.py | api.py | py | 2,488 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "xBee_recieve.reciever",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"lin... |
11014211257 |
from django.shortcuts import render, redirect, get_object_or_404
from .forms import LibroForm
from django.shortcuts import render
from .models import Libro
from django.urls import reverse_lazy
from django.contrib.auth.mixins import LoginRequiredMixin
from django.views.generic.edit import CreateView
from django.views.g... | ezecodo/Entrega1-Angeloni | libros/views.py | views.py | py | 2,052 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.contrib.auth.mixins.LoginRequiredMixin",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "django.views.generic.edit.CreateView",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "models.Libro",
"line_number": 18,
"usage_type": "name"... |
38164787541 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('foi_requests', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='foirequest',
name=... | foilaundering/foilaundering | foilaundering/apps/foi_requests/migrations/0002_auto_20151122_1253.py | 0002_auto_20151122_1253.py | py | 587 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AddField",
"line_number": 14,
"usage_type": "call"
},
{
... |
35396952388 | from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
from collections import defaultdict
from contextlib import contextmanager
import inspect
import logging
import os
import re
import sys
import traceback
from twitter.c... | fakeNetflix/square-repo-pants | src/python/pants/commands/goal_runner.py | goal_runner.py | py | 10,794 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "twitter.common.lang.Compatibility.StringIO",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "twitter.common.lang.Compatibility",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "pants.commands.command.Command",
"line_number": 41,
"us... |
23469121006 | import yaml,os
class Common_funcs():
def get_datas(self,path:str)-> list:
# ๆๅผๆไปถ
current_path = os.getcwd().split("lagou05")[0]
#print(current_path)
with open(current_path+"\\lagou05"+path) as f:
datas = yaml.safe_load(f)
#print(datas)
# ่ทๅๆไปถไธญkeyไธบd... | testroute/lagou05 | Common/Read_yaml.py | Read_yaml.py | py | 1,286 | python | zh | code | null | github-code | 36 | [
{
"api_name": "os.getcwd",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "yaml.safe_load",
"line_number": 8,
"usage_type": "call"
}
] |
74218356582 | from PySide6.QtCore import QObject, Property, Slot, Signal, QTimer
from typing import Optional
from .qml_file_wrapper import QmlFileWrapper
class MainController(QObject):
main_content_qml_changed = Signal()
def __init__(self, parent=None):
super().__init__(parent)
self._app = pare... | maldata/qml-error-test | errortest/main_controller.py | main_controller.py | py | 1,733 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "PySide6.QtCore.QObject",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "PySide6.QtCore.Signal",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "qml_file_wrapper.QmlFileWrapper",
"line_number": 14,
"usage_type": "call"
},
{
"api_na... |
39885168812 | import pytz
import base64
from typing import List
from flask import Blueprint, request, redirect, abort
from flask_login.utils import login_required
from datetime import datetime, timedelta, timezone
from flask.templating import render_template
from flask_login import current_user
from mib.rao.user_manager import UserM... | squad03mib/api-gateway | mib/views/messages.py | messages.py | py | 5,044 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Blueprint",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "flask.request... |
27616329139 | #coding=utf8
import numpy as np
np.random.seed(1337) # for reproducibility
import re
import h5py
import os
from nltk import tokenize
from keras.preprocessing.text import Tokenizer, text_to_word_sequence
from attention import Attention_input1, Attention_input2
from keras.preprocessing.text import Tokenizer
from keras.p... | xunan0812/MultiSentiNet | src/att_sc_ob_txt.py | att_sc_ob_txt.py | py | 6,726 | python | en | code | 16 | github-code | 36 | [
{
"api_name": "numpy.random.seed",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "h5py.File",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_nu... |
7813396326 | import re
from math import ceil
import dateparser
from aspen.database.models import TreeType
from aspen.workflows.nextstrain_run.build_plugins.base_plugin import BaseConfigPlugin
class TreeTypePlugin(BaseConfigPlugin):
crowding_penalty: float = 0
tree_type: TreeType
subsampling_scheme: str = "NONE"
... | chanzuckerberg/czgenepi | src/backend/aspen/workflows/nextstrain_run/build_plugins/type_plugins.py | type_plugins.py | py | 14,798 | python | en | code | 11 | github-code | 36 | [
{
"api_name": "aspen.workflows.nextstrain_run.build_plugins.base_plugin.BaseConfigPlugin",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "aspen.database.models.TreeType",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "dateparser.parse",
"line_number": 55... |
35851037675 | #Django Libs
from django.http.response import FileResponse, HttpResponse
from django.shortcuts import render
from django.urls import reverse
from django.views.generic import View, CreateView, DeleteView, UpdateView, DetailView, ListView, TemplateView
from django.db.models import Sum
from django.core.serializers import ... | RobertoMarroquin/garrobo | iva/views.py | views.py | py | 8,321 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.views.generic.CreateView",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "forms.ConsumidorFinalForm",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "django.db.models.Sum",
"line_number": 29,
"usage_type": "call"
},
{
"ap... |
43753620311 | from rest_framework_simplejwt.authentication import JWTAuthentication
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework.decorators import (
api_view,
permission_classes,
authentication_classes
)
from django.contrib.auth.models import Use... | lazarmarkovic/uks2020 | backend/repository/views/repo_views.py | repo_views.py | py | 8,275 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.shortcuts.get_object_or_404",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "repository.models.Repository",
"line_number": 38,
"usage_type": "argument"
},
{
"api_name": "repository.serializers.repo_serializers.RepositorySerializer",
"line_numb... |
41635503393 | from google.cloud import firestore, storage, exceptions
import os
db = firestore.Client()
content = db.collection('fl_content')
storage_client = storage.client.Client()
bucket = storage_client.get_bucket('psyclonic-studios-website.appspot.com')
def new_transaction():
return db.transaction()
@firestore.transacti... | Psyclonic-Studios/psyclonic-studios-website | server/crud.py | crud.py | py | 13,541 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "google.cloud.firestore.Client",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "google.cloud.firestore",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "google.cloud.storage.client.Client",
"line_number": 7,
"usage_type": "call"
},
{
... |
32527125731 | #!/usr/bin/env python
# coding: utf-8
# In[2]:
# input_data
import numpy as np
import pandas as pd
import pickle as pkl
def load_dc_data(dataset):
dc_adj1 = pd.read_csv('C:/YimingXu/Micromobility_DL/data/adjacency_selected.csv')
adj1 = np.mat(dc_adj1)
dc_adj2 = pd.read_csv('C:/YimingXu/Micromobility_D... | xuyimingxym/MicroMobility-DL | Multi-GCN_GRU.py | Multi-GCN_GRU.py | py | 13,757 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.mat",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.mat",
"line_numbe... |
1206611132 | """Utils functions."""
import datetime
def MillisecondsSinceEpoch(hours):
"""Returns time in milliseconds since epoch for given time in hours.
Args:
hours: Int, the hours of the future timestamp.
Returns:
Int, the future timestamp in milliseconds.
"""
hours = datetime.datetime.no... | DomRosenberger/google_bigquery | google_bigquery/common/utils.py | utils.py | py | 479 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "datetime.datetime.now",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "datetime.timedelta",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datet... |
20763051017 | import os
import json
import time
from datetime import datetime
# Importing shared dependencies
from task_management import task_list
from ai_agent_management import ai_agents
sync_status = {}
def autoSync():
while True:
time.sleep(60) # Sync every minute
sync_status['last_sync'] = datetime.now(... | shadowaxe99/c | TaskMaster/src/auto_sync.py | auto_sync.py | py | 668 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "time.sleep",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "json.dump",
"l... |
34086502752 | from batch import create_udb
from projectMetrics import projectMetric
from subprocess import call
import git
import sys
import datetime
import os
import shutil
import time
def main():
git_repo = sys.argv[1] # git repo is the relative path from the folder
all_sha1 = []
sha_dtime = []
repo = git.Rep... | akhilsinghal1234/mdd-intern-work | Extraction/main.py | main.py | py | 1,009 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "git.Repo",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.fromtimestamp",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "datetime.datet... |
30338835101 | import marqo
import pprint
import requests
import random
import math
# Test bug in pagination feature of OpenSearch
# Create marqo index
mq = marqo.Client(url='http://localhost:8882')
try:
mq.index("my-first-index").delete()
except:
pass
# Index set number of documents
# 100 random words
mq.... | vicilliar/public-code | pagination/os_from_tester.py | os_from_tester.py | py | 2,920 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "marqo.Client",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "random.seed",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "random.choices",
"line_numbe... |
21056220601 | #!/usr/bin/python3
import requests, argparse
parser = argparse.ArgumentParser()
parser.add_argument("--rhost", "-rh", type=str, help="remote host (if not specified, 127.0.0.1 will be used)", default="127.0.0.1")
parser.add_argument("--rport", "-rp", type=str, help="remote port (if not specified, 8500 will be used)", d... | GatoGamer1155/Scripts | Ambassador/privesc.py | privesc.py | py | 1,409 | python | en | code | 33 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "requests.put",
"line_number": 22,
"usage_type": "call"
}
] |
5468407661 | import os
import numpy as np
import torch
import torchvision
import torch.nn as nn
import torchvision.transforms as transforms
import torch.optim as optim
import matplotlib.pyplot as plt
import torch.nn.functional as F
from torchvision import datasets
from torch.utils.data import DataLoader
from torchvision.utils impo... | MAyaCohenCS/Experimental_CNN_3 | image_posterior.py | image_posterior.py | py | 3,724 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.exp",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "torch.norm",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "torch.norm",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "torch.log",
"line_number": 28,
... |
29197653617 | import re
import json
import torch
import logging
from tokenizers import ByteLevelBPETokenizer
from os.path import exists, join, abspath
from . import Target, Entity
from models.pre_abstract.model import LSTMTagger
class PreAbstractParser(Target):
def __init__(self, model_dir, device="cpu"):
super().__ini... | kherud/native-language-identification | pipeline/pipes/pre_abstract.py | pre_abstract.py | py | 5,835 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "os.path.abspath",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"lin... |
35104869337 | # -*- coding: utf-8 -*-
import os
import codecs
import collections
from six.moves import cPickle
import numpy as np
import re
import itertools
import pandas as pd
from ts_FeatureCoding import Feature_Coding
DATA_DIR = "data/events"
class DataLoader():
def __init__(self, args):
self.data_dir = args.data_di... | traderscience/market_transformer | tsutils/data_loader.py | data_loader.py | py | 9,544 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "ts_FeatureCoding.Feature_Coding",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "os.path.joi... |
29314289325 | from django.shortcuts import render, redirect
from django.contrib import messages
from .models import *
import bcrypt
# Create your views here.
def main(request):
if 'logged_in' in request.session:
# messages.success(request,"Welcome to Tom's Library!"),
return render(request, 'main/index.html',{... | tomnguyen103/Coding_Dojo | python_stack/django/Project1/apps/main/views.py | views.py | py | 8,660 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.shortcuts.render",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "django.contrib.messages.success",
"line_number": 23,
"usage_type": "call"
},
{
"a... |
74004428583 | from flask import Flask, jsonify
from apscheduler.schedulers.background import BackgroundScheduler
app = Flask(__name__)
#Sample data not acurate
cancer_stats = {
'Total_infected': 1000,
'Active_cases': 500,
'Recovered': 400,
'Deaths': 200,
'Critical': 50,
'Mortality_rate': 20,
'deceased':... | Ceced20/SimpleCancerAPI | API.py | API.py | py | 955 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "apscheduler.schedulers.background.BackgroundScheduler",
"line_number": 32,
"usage_type": "call"
}
] |
6774316642 | import pickle
import streamlit as st
classifier_in=open("classifier.pkl","rb")
clf=pickle.load(classifier_in)
def predict_banknote(variance,skewness,kurtosis,entropy):
pred=clf.predict([[variance,skewness,kurtosis,entropy]])
if(pred[0]>0.5):
pred="Its a fake note"
else:
pred="It's a real b... | adamdavis99/Bank-Note-Authentication | streamlit_app.py | streamlit_app.py | py | 645 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pickle.load",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "streamlit.number_input",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "streamlit.number_input",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "streamlit.nu... |
455748841 | from astropy.io import fits
import numpy as np
hdulist=fits.open('/Users/dhk/work/cat/NGC_IC/VII_118.fits')
tb=hdulist[1].data
for x in range(0,len(tb)/1000+1):
f=open("sha_quarry_batch_%d.txt" % (x),"w")
f.write("COORD_SYSTEM: Equatorial\n")
f.write("EQUINOX: J2000\n")
f.write("NAME-RESOLVER: NED\n")
for y in r... | DuhoKim/py_code_US | ngc_ic_cat.py | ngc_ic_cat.py | py | 533 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "astropy.io.fits.open",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "astropy.io.fits",
"line_number": 4,
"usage_type": "name"
}
] |
30143632560 | from itertools import product
# from PyMiniSolvers import minisolvers
import os
def req1(n: int, N: int, disjunctions_list):
i_range = range(n, N + n)
for i in i_range:
clauses = [(f"t_{i}_0_0_" ), (f"t_{i}_0_1_" ),
(f"t_{i}_1_0_" ), (f"-t_{i}_1_1_" )]
disjunctions_list.exten... | PeterLarochkin/discrete_structures | HM2/final.py | final.py | py | 8,046 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "itertools.product",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "itertools.product",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "itertools.product",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "itertools.produ... |
852394623 | # -*- coding: utf-8 -*-
import requests
import json
import csv
import time
import re
from CrawlClient import Crawler
from lxml import etree
class ZOJCrawler(Crawler.Crawler):
def __init__(self, max_try_cnt, url = 'http://acm.zju.edu.cn/onlinejudge'):
self.try_cnt = 0
self.max_try_cnt = max_try_cnt
... | deepwzh/OJ-Crawers | CrawlClient/ZOJCrawler.py | ZOJCrawler.py | py | 3,051 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "CrawlClient.Crawler.Crawler",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "CrawlClient.Crawler",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "time.time",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "requests... |
70878385064 | from secrets import choice
from asyncio import sleep
import discord
from discord.ext import tasks, commands
from extras import constants
from utils.audio import YoutubeHelper, YTDLSource
from utils.docker import DockerLogger
from utils import decorators
class TiozaoZap(commands.Cog):
'''
TiozaoZap Cogs
... | LombardiDaniel/Sebotiao | src/cogs/tiozao.py | tiozao.py | py | 3,850 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "utils.docker.DockerLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_... |
39353557558 | import math
def area(r):
"""Area of a circle with radius 'r'"""
return math.pi * (r**2)
radii = [2, 5, 7.1, 0.3, 10]
# Method 1: Direct method
areas = []
for r in radii:
a = area(r)
areas.append(a)
print(areas)
# Method 2: Use 'map' functions
print(list(map(area, radii)))
print("===========")
... | Vaijyant/PythonPlayground | 23_map_filter_redunce.py | 23_map_filter_redunce.py | py | 1,113 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "math.pi",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "statistics.mean",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "functools.reduce",
"line_number": 60,
"usage_type": "call"
}
] |
6672970825 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""``stsynphot`` configurable items.
The default configuration heavily depends on STScI TRDS structure
but it can be easily re-configured as the user wishes via
`astropy.config`.
``PYSYN_CDBS`` must be a defined system environment variable for
directorie... | spacetelescope/stsynphot_refactor | stsynphot/config.py | config.py | py | 4,330 | python | en | code | 11 | github-code | 36 | [
{
"api_name": "astropy.config.ConfigNamespace",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "synphot.utils.generate_wavelengths",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "astropy.config.ConfigItem",
"line_number": 37,
"usage_type": "call"
}... |
11939197341 | from flask import (
Blueprint,
flash,
redirect,
url_for,
render_template,
request,
send_from_directory,
)
from filenavi import model
from .wrap import require_authentication
from .error import MalformedRequest, Unauthorized, NotAuthenticated, NotAccessible
INLINE_EXTENSIONS = ["txt", "pdf"... | lukaswrz/filenavi | filenavi/routing/storage.py | storage.py | py | 7,605 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Blueprint",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "filenavi.model.User.current",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "filenavi.model.User",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "... |
27970752684 | import shutil
import tarfile
from collections.abc import Sequence
from pathlib import Path
from typing import Callable, Generic, TypedDict, TypeVar
import lightning.pytorch as pl
import torch
import torchaudio
from einops import rearrange
from torch import Tensor
from torch.hub import download_url_to_file
from torch.u... | int0thewind/s4-dynamic-range-compressor | s4drc/src/dataset.py | dataset.py | py | 5,685 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "typing.TypeVar",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.utils.data.Dataset",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "typing.Generic",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "collections.ab... |
6217952013 | """
Runs that functionality of the program, the flask app and the server that communicates with Walabot.
"""
from threading import Thread
from meeting_room import app
from FreeRoomsServer import FreeRoomsServer
from config import HOST, PORT
def main():
"""
Start the server that communicates with Walabot and... | Walabot-Projects/Walabot-MeetingRoom | server/main.py | main.py | py | 817 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "FreeRoomsServer.FreeRoomsServer",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "config.HOST",
"line_number": 17,
"usage_type": "argument"
},
{
"api_name": "config.PORT",
"line_number": 17,
"usage_type": "argument"
},
{
"api_name": "threa... |
20145975874 | import torch.nn as nn
# define small classifier
class MlpClassifier(nn.Module):
""" Simple classifier """
def __init__(self, args, n_classes, pretrain_stage_config):
super(MlpClassifier, self).__init__()
self.input_size = int(args['pretrain_output_size'] * args['seq_length'])
self.hid... | antonior92/physionet-12ecg-classification | models/mlp.py | mlp.py | py | 1,046 | python | en | code | 6 | github-code | 36 | [
{
"api_name": "torch.nn.Module",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numb... |
6971950883 | '''creating a form using flask to get username and password using html
and displaying success on submitting'''
from flask import Flask, redirect, render_template, request
app = Flask(__name__)
@app.route('/')
def home():
return render_template("index.html")
@app.route("/success", methods = ['POST... | R19R/Login_App_Using_Flask | may8th_ex1.py | may8th_ex1.py | py | 590 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "flask.requ... |
70862843305 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Apr 15 14:41:09 2022
@author: bas
"""
#https://instaloader.github.io/as-module.html
import instaloader
from datetime import datetime
from login import getMyUsername
import random
import pandas
def login(L, username, filename='login_session'):
if n... | Basdorsman/instagram-analysis | collect_data.py | collect_data.py | py | 1,976 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "instaloader.Profile.from_username",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "instaloader.Profile",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "instaloader.Instaloader",
"line_number": 31,
"usage_type": "call"
},
{
... |
18553686764 | import random
from itertools import chain
import numpy as np
import pandas as pd
from cytoolz import itemmap, sliding_window, valmap
from skfusion import fusion
class DataFusionModel(object):
def __init__(
self, nodes, relations, init_type="random", random_state=666, n_jobs=1
):
self.nodes = ... | zorzalerrante/aves | src/aves/models/datafusion/base.py | base.py | py | 4,339 | python | en | code | 57 | github-code | 36 | [
{
"api_name": "pandas.DataFrame",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "cytoolz.sliding_window",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "numpy.dot",
... |
24331960093 | from argparse import ArgumentParser
from ast import parse
import os
def handle_file(filename: str, blank: list[str]):
with open(filename) as f:
content = f.readlines()
data = ['[']
data.extend([f'"{x}",' for x in blank])
data.extend(['\n'])
skip = True
for line in content:
# lin... | zeusops/mission-templates | limited-arsenal-factions/update.py | update.py | py | 1,430 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 39,
"usage_type": "call"
}
] |
3325760856 | from django.contrib import admin
from .models import Review
# Register your models here.
class ReviewAdmin(admin.ModelAdmin):
list_display = (
'product',
'user',
'rating',
'title',
'description',
'review_date',
)
ordering = ('product',)
admin.site.registe... | mosull20/crushed-grapes-ms4 | reviews/admin.py | admin.py | py | 343 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.site.register",
"line_number": 19,
"usage_type": "call"
},... |
40917483210 | import requests
import json
import sys
import os
class PR():
def __init__(self, token, user, repo) -> None:
self.token = token
self.user = user
self.repo = repo
def raise_pr(self, title, head, base):
url = "https://api.github.com/repos/"+ self.user +"/"+ self.repo+"/p... | ajayk007/UI_release | raise_pr.py | raise_pr.py | py | 2,156 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "json.dumps",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "requests.request",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number... |
13565958708 | # Author: Joshua Jackson
# Date: 06/20/2020
# This file will contain the class which create Word2Vec file using gensim
from gensim.models import Word2Vec
from gensim.models.phrases import Phrases, Phraser
from datetime import datetime
# script to create word embeddings for Neural Network weight
class word2vec:
... | jjacks95/sentiment-analysis-financial-news | financialTextProcessing/financialTextProcessing/createWord2Vec.py | createWord2Vec.py | py | 1,730 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "gensim.models.phrases.Phrases",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "gensim.models.phrases.Phraser",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "gensim.models.Word2Vec",
"line_number": 31,
"usage_type": "call"
},
{
... |
74051194023 | #from apiclient.discovery import build
from googleapiclient.discovery import build
from oauth2client.service_account import ServiceAccountCredentials
import httplib2
#from oauth2client import client, file, tools
import datetime
import pytz
import re
import configparser
# """
# timezone/DST correction:
# """
# def get... | LabNeuroCogDevel/LNCDcal.py | LNCDcal/LNCDcal.py | LNCDcal.py | py | 6,453 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pytz.timezone",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "oauth2client.service_account.ServiceAccountCredentials.from_p12_keyfile",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "oauth2client.service_account.ServiceAccountCredentials",
... |
34998272866 | # Import packages
import cv2
import numpy as np
from PIL import Image
from pytesseract import pytesseract
from pytesseract import Output
if __name__ == "__main__":
img = cv2.imread('shelf_for_rectangles.jpg')
print(img.shape) # Print image shape
cv2.imshow("original", img)
# Cropping an ... | klarahi/Fuzzy_project | cropped_image.py | cropped_image.py | py | 2,544 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "cv2.imread",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pytesseract.pytesseract.image_to_string",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "pytesse... |
18879607170 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""
Support for django-reversion on models with translatable fields and django-cms
placeholder fields.
"""
from functools import partial
from django.db.models.signals import post_save
from cms.models.pluginmodel import CMSPlugin
from reversion.revision... | aldryn/aldryn-reversion | aldryn_reversion/core.py | core.py | py | 4,835 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "reversion.revisions.default_revision_manager",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "reversion.revisions.default_revision_manager._revision_context_manager",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "reversion.revisions.defa... |
19950192198 | import xdg.BaseDirectory
import xdg.MenuEditor
import gtk
import gio
import uxm.adapters as adapters
from uxm.adapters import xdg_adapter
def lookup_menu_files(filename):
return [f for f in xdg.BaseDirectory.load_config_paths('menus/' + filename)]
class MenuTreeModel(gtk.TreeStore):
(
COLUMN_HIDE,
... | ju1ius/uxdgmenu | usr/lib/uxdgmenu/uxm/dialogs/editor/treemodel.py | treemodel.py | py | 6,603 | python | en | code | 17 | github-code | 36 | [
{
"api_name": "xdg.BaseDirectory.BaseDirectory.load_config_paths",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "xdg.BaseDirectory.BaseDirectory",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "xdg.BaseDirectory",
"line_number": 10,
"usage_type... |
11936779128 | #import ipdb
import logging
from typing import Optional, cast
from rest_framework import serializers
from rest_framework.exceptions import APIException, ErrorDetail, ValidationError
from rest_flex_fields.serializers import FlexFieldsSerializerMixin
from ..exception.unprocessable_entity import UnprocessableEntity
f... | CloudReactor/task_manager | server/processes/serializers/workflow_serializer.py | workflow_serializer.py | py | 10,948 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "group_setting_serializer_mixin.GroupSettingSerializerMixin",
"line_number": 53,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.HyperlinkedModelSerializer",
"line_nu... |
9710241755 | import subprocess
from datetime import datetime
import tkinter as tk
from tkinter import ttk
from tkinter import messagebox
from local import my_printer, printer_list
# Ce programme imprime de petites รฉtiquettes pour des tubes de type Eppendorf 1.5 ml
# L'utilisateur dispose de 4 champs.
# L'utilisateur peut dรฉcider d... | bermau/py_liq_dilutions | tk_label.py | tk_label.py | py | 5,100 | python | fr | code | 0 | github-code | 36 | [
{
"api_name": "datetime.datetime.now",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "subprocess.check_output",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "tkint... |
37662015618 | from PyQt5.QtWidgets import QDialog, QComboBox, QPushButton, QRadioButton
from pulse.utils import error
from os.path import basename
from PyQt5.QtGui import QIcon
from PyQt5.QtCore import Qt
from PyQt5 import uic
import configparser
class ElementTypeInput(QDialog):
def __init__(self, *args, **kwargs):
sup... | atbrandao/OpenPulse_f | pulse/uix/user_input/elementTypeInput.py | elementTypeInput.py | py | 2,166 | python | en | code | null | github-code | 36 | [
{
"api_name": "PyQt5.QtWidgets.QDialog",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "PyQt5.uic.loadUi",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "PyQt5.uic",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtGui.QIcon",... |
72416805225 | # -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import numpy as np
def approach_angle_reward(roll,pitch):
if np.abs(roll) + np.abs(pitch) < 0.174:
return 100*np.exp((7.0*(0.174-np.abs(roll) - np.abs(pitch)))**1)
if (np.abs(roll) + np.abs(pitch)<=1.55)and(np.abs(roll) + np.abs(pitch) >=0.174)... | Zbigor/DeepRL_UAV_landing | drl_landing/rl_pipeline/catkin_ws/src/hummingbird/scripts/plot_reward_functions.py | plot_reward_functions.py | py | 2,384 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "numpy.abs",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.abs",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.abs",
"line_number": 11,
"... |
15991499425 | import os
import argparse
import torch
from torch import nn
import torch.backends.cudnn as cudnn
from torch.utils.data.distributed import DistributedSampler
from torch.utils.data import DataLoader
import numpy as np
import cv2
from seg_metric import SegmentationMetric
import random
import shutil
import setproctitle
imp... | zyxu1996/Efficient-Transformer | train.py | train.py | py | 21,965 | python | en | code | 67 | github-code | 36 | [
{
"api_name": "torch.nn.Module",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "loss.CrossEntropyLoss",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "loss.Edge_loss",
... |
13535976062 | import csv
import json
from collections import OrderedDict
def import_jsonfile_as_OrderedDict(json_filepath):
f = open(json_filepath, "r")
return json.loads(f.read(), object_pairs_hook = OrderedDict)
def export_dict_to_jsonfile(dic, json_filepath, indent = 2, separators=(',', ': ')):
outstr = json.dumps(d... | tyjyang/CampaignManager | lib/io_tools.py | io_tools.py | py | 944 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "json.loads",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "json.dumps",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_nu... |
2403860193 | from decimal import Decimal
from django.test import TestCase
from parameterized import parameterized
from calculator.calculation import calculate_total_cost
from calculator.exceptions import StateNotFound
from calculator.repository import Repository
from calculator.tests.common import fill_db
class CalculateTotalCo... | SpiritD/tax_calculator | tom_project/calculator/tests/total_costs.py | total_costs.py | py | 1,659 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.test.TestCase",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "calculator.tests.common.fill_db",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "calculator.repository.Repository",
"line_number": 30,
"usage_type": "call"
},
{
... |
30249155883 | import cv2
import os
import numpy as np
import PIL.Image
from PIL import ImageEnhance
# per ogni immagine presente nella cartella crea una foto piรน luminosa e una meno luminosa
def imageBrightener(pathImmagine, pathContorno, pathSalvataggio, pathSalvataggioContorno):
os.chdir(pathImmagine)
files = os.listdir(... | ApulianGCC/TesiSegmentazionePinna | data_augmentation.py | data_augmentation.py | py | 6,913 | python | it | code | 0 | github-code | 36 | [
{
"api_name": "os.chdir",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "PIL.Image.Image.open",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "PIL.Image.Image",
"line_... |
43296965814 | # spaceconfig = {"usemodules" : ["_collections"]}
from _collections import deque
from pytest import raises
def test_basics():
assert deque.__module__ == 'collections'
d = deque(xrange(-5125, -5000))
d.__init__(xrange(200))
for i in xrange(200, 400):
d.append(i)
for i in reversed(xrange(-2... | mozillazg/pypy | pypy/module/_collections/test/apptest_deque.py | apptest_deque.py | py | 7,397 | python | en | code | 430 | github-code | 36 | [
{
"api_name": "_collections.deque.__module__",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "_collections.deque",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "_collections.deque",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": ... |
70606154344 | __all__ = (
'Persistor',
'SQLPersistor',
'SQLitePersistor',
)
try:
import sqlite3
except Exception:
sqlite3 = None
class Persistor(object):
"""
Class providing methods for persisting input (persistence occurs when the
`persist` method is called on a `Model` instance)
"""
def ... | jzaleski/formulaic | formulaic/persistors.py | persistors.py | py | 9,411 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "sqlite3.connect",
"line_number": 299,
"usage_type": "call"
}
] |
36117885682 | """
Revision ID: a93cd7e01a93
Revises: 6052d96d32f0
Create Date: 2020-06-28 16:58:12.857105
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'a93cd7e01a93'
down_revision = '6052d96d32f0'
branch_labels = None
depends_on = None
def upgrade():
# ### commands ... | lianjy357/vue-element-admin-fastapi | backend/app/alembic/versions/a93cd7e01a93_.py | a93cd7e01a93_.py | py | 1,142 | python | en | code | 14 | github-code | 36 | [
{
"api_name": "alembic.op.create_table",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integ... |
5035742744 | import os
import sys
from ase import io
#color can be
# - A color is specified either as a number between 0 and 1 (gray value),
# three numbers between 0 and 1 (red, green, blue values or RGB),
# or as a color name from the file /usr/lib/X11/rgb.txt (or similar).
xbs_file = open("new_xbs.bs",'w')
xbs_str="atom ... | Montmorency/imeall | imeall/tbe_tools/xyz_xbs.py | xyz_xbs.py | py | 1,503 | python | en | code | 8 | github-code | 36 | [
{
"api_name": "ase.io.read",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "ase.io",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "sys.argv",
"line_number": 25,
"usage_type": "attribute"
}
] |
6200744085 | import torch
import torch.nn as nn
from attention import NewAttention
from language_model import (
WordEmbedding,
QuestionEmbedding,
TemporalConvNet,
BertEmbedding,
)
from classifier import SimpleClassifier
from fc import FCNet
class BaseModel(nn.Module):
def __init__(self, w_emb, q_emb, v_att, q_... | cliziam/VQA_project_Demo | demo-vqa-webcam/base_model.py | base_model.py | py | 2,732 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.nn.Module",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "torch.nn.ReLU",
"line_number": 56,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line... |
17848204772 | #! /usr/bin/env python3
import os
import re
from azure.identity import DefaultAzureCredential
from azure.mgmt.compute import ComputeManagementClient
# Variables
subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID")
location = "eastus"
publisher_name = "PaloAltoNetworks"
# Acquire a credential object
token_creden... | jamesholland-uk/pan-os-versions-in-public-cloud-providers | azure-processing.py | azure-processing.py | py | 3,946 | python | en | code | 5 | github-code | 36 | [
{
"api_name": "os.environ.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "azure.identity.DefaultAzureCredential",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "az... |
12835968022 | import time
from itertools import chain
import email
import imaplib
import smtplib
from readair import Log
MY_NAME="Nile Walker"
MY_ADDRESS = 'nilezwalker@gmail.com'
PASSWORD = input('Enter the password for {}\n'.format(MY_ADDRESS))
MY_NUMBER='410-805-0012'
SUBJECT="Google Housing Request"
SERVER_ADDRESS="smtp.gmail.c... | NWalker4483/FlightRegister | main.py | main.py | py | 2,831 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "imaplib.IMAP4_SSL",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "email.message_from_bytes",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "readair.Log",
"line_number": 65,
"usage_type": "call"
}
] |
40306764598 | import numpy as np
import pandas as pd
from collections import OrderedDict
def loss(h,y):
return ( -y * np.log(h) - ( 1- y )*(np.log(1-y)) ).mean()
def add_intercept(X):
intercept = np.ones((X.shape[0],1))
X= np.reshape(X,(-1,1))
#print('intercept',intercept,X)
return np.concatenate((intercept, X)... | guruprasaad123/ml_for_life | from_scratch/logistic_regression/Newtons method/hessian.py | hessian.py | py | 2,333 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "numpy.log",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.reshape",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.concatenate",
"line_number... |
8550138978 | from urllib.request import urlopen
import plotly.graph_objs as go
import plotly.express as px
import pandas as pd
import plotly
import json
import os
data_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..\..', 'data'))
usa_data_dir = os.path.join(data_dir, 'usa')
csv_dir = os.path.join(usa_data_dir, '... | vinitshah24/Coronavirus-Analysis | src/usa/data_plots.py | data_plots.py | py | 3,402 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.abspath",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_nu... |
6742324568 | # -*- coding: utf-8 -*-
# file docbook2epub.py
# This file is part of LyX, the document processor.
# Licence details can be found in the file COPYING.
#
# \author Thibaut Cuvelier
#
# Full author contact details are available in file CREDITS
# Usage:
# python docbook2epub.py java_binary saxon_path xsltproc_path xsl... | cburschka/lyx | lib/scripts/docbook2epub.py | docbook2epub.py | py | 7,833 | python | en | code | 33 | github-code | 36 | [
{
"api_name": "sys.argv",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 46... |
27941614537 | from itertools import chain
from itertools import islice
from itertools import repeat
from math import ceil
import numpy as np
from scipy.sparse import issparse
from sklearn.metrics.pairwise import pairwise_distances
from sklearn.metrics.pairwise import pairwise_kernels
from sklearn.neighbors import kneighbors_graph
f... | ohlerlab/SEMITONES | src/SEMITONES/_utils.py | _utils.py | py | 4,987 | python | en | code | 8 | github-code | 36 | [
{
"api_name": "sklearn.neighbors.kneighbors_graph",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.pairwise.pairwise_distances",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.pairwise.pairwise_kernels",
"line_number": 49,... |
30438808856 | """
TFE - Chatbot Tifi - Technifutur
by Nicolas Christiaens
"""
from datasets import Dataset
from FineTuning import STSBTrainingModel
from torch.utils.data import DataLoader
import pandas as pd
from Preprocessing import Preprocessing
from transformers import AdamW,get_constant_schedule
from transformers imp... | TheCricri/TFE_Chatbot_Tifi | CustomFineTuning.py | CustomFineTuning.py | py | 4,735 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.read_excel",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "Preprocessing.Preprocessing",
"line_number": 20,
"usage_type": "argument"
},
{
"api_name": "Preprocessing.Preprocessing",
"line_number": 21,
"usage_type": "argument"
},
{
... |
74050038184 | import numpy as np
from typing import Iterable, List
from nltk.stem import PorterStemmer
from parlai.crowdsourcing.utils.acceptability import (
AcceptabilityChecker,
normalize_answer,
)
import parlai.utils.logging as logging
# Bad persona violations
PERSONA_REPEATS_PROMPT = 'repeated the prompt text'
ASKED_WI... | facebookresearch/ParlAI | parlai/crowdsourcing/projects/wizard_of_internet/acceptability.py | acceptability.py | py | 7,697 | python | en | code | 10,365 | github-code | 36 | [
{
"api_name": "parlai.crowdsourcing.utils.acceptability.normalize_answer",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "parlai.utils.logging.warning",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "parlai.utils.logging",
"line_number": 65,
"usage_t... |
22355326575 | import pathlib
from contextlib import nullcontext as does_not_raise
import pytest
import mlrun.runtimes.generators
@pytest.mark.parametrize(
"strategy,param_file,expected_generator_class,expected_error,expected_iterations",
[
(
"list",
"hyperparams.csv",
mlrun.run... | mlrun/mlrun | tests/runtimes/test_generators.py | test_generators.py | py | 2,780 | python | en | code | 1,129 | github-code | 36 | [
{
"api_name": "mlrun.runtimes.generators.model.RunSpec",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "mlrun.runtimes.generators.model",
"line_number": 69,
"usage_type": "attribute"
},
{
"api_name": "mlrun.runtimes.generators",
"line_number": 69,
"usage_type":... |
26921499285 | import random
import json
import datetime
from flask import Flask, request, render_template
from flask_cors import CORS, cross_origin
from nltk.chat.util import Chat, reflections
app = Flask(__name__)
cors = CORS(app)
app.config["CORS_HEADERS"] = "Content-Type"
current_date = datetime.datetime.now().strftime("%A, %B ... | sinde530/python | pino-chatbot/flask_test.py | flask_test.py | py | 3,170 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
... |
31064293035 |
from ..utils import Object
class Photo(Object):
"""
Describes a photo
Attributes:
ID (:obj:`str`): ``Photo``
Args:
has_stickers (:obj:`bool`):
True, if stickers were added to the photoThe list of corresponding sticker sets can be received using getAttachedStickerSets
... | iTeam-co/pytglib | pytglib/api/types/photo.py | photo.py | py | 1,177 | python | en | code | 20 | github-code | 36 | [
{
"api_name": "utils.Object",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "utils.Object.read",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "utils.Object",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "utils.Object.read",
"l... |
33516010146 | # -*- coding: utf-8 -*-
from collective.es.index.interfaces import IElasticSearchClient
from elasticsearch import Elasticsearch
from zope.component import provideUtility
from zope.interface import directlyProvides
class ElasticSearchIngressConfFactory(object):
def __init__(self, section):
self.section = ... | collective/collective.es.index | src/collective/es/index/components.py | components.py | py | 1,379 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "elasticsearch.Elasticsearch",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "elasticsearch.Elasticsearch",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "zope.interface.directlyProvides",
"line_number": 39,
"usage_type": "call"
},
... |
31063179375 |
from ..utils import Object
class GroupCallParticipantVideoInfo(Object):
"""
Contains information about a group call participant's video channel
Attributes:
ID (:obj:`str`): ``GroupCallParticipantVideoInfo``
Args:
source_groups (List of :class:`telegram.api.types.groupCallVideoSour... | iTeam-co/pytglib | pytglib/api/types/group_call_participant_video_info.py | group_call_participant_video_info.py | py | 1,336 | python | en | code | 20 | github-code | 36 | [
{
"api_name": "utils.Object",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "utils.Object.read",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "utils.Object",
"line_number": 37,
"usage_type": "name"
}
] |
71079803305 | import gzip
import json
import numpy as np
import pandas as pd
from tqdm.notebook import tqdm
from datetime import datetime
from sklearn.preprocessing import StandardScaler
from sklearn.cluster import KMeans
from collections import Counter
#Funciones.
def jl_to_list(fname):
output = []
with gzip.open(fname, 'r... | estereotipau/meli_challenge_2020 | simple_cluster_EG.py | simple_cluster_EG.py | py | 6,186 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "gzip.open",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pandas.factorize",
"line_num... |
73933034022 | import sys
import datetime
import socket, time
from PyQt5.QtWidgets import *
from PyQt5.QtGui import QPixmap, QImage
from PyQt5.QtCore import *
from PyQt5.QtCore import pyqtSlot
from PyQt5.QtCore import QTimer, QTime
from PyQt5.QtCore import pyqtSignal, QObject
from PyQt5 import QtCore, QtGui, QtWidgets
fro... | 0sun-creater/golf_swing_coaching_program | python/GUI.py | GUI.py | py | 17,024 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "serial.Serial",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
... |
17106921371 | import os
from dataclasses import dataclass, field
from typing import List
with open(os.path.join(os.path.dirname(__file__), "input"), "r") as inputFile:
inputLines = [line.strip() for line in inputFile.readlines() if line]
@dataclass
class Signal:
cycle: int
register: int
strength = 0
def __pos... | mmmaxou/advent-of-code | 2022/day-10/answer.py | answer.py | py | 2,140 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.join",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "dataclasses.dataclass",
"l... |
17232778502 | import cv2
import numpy as np
def bitmap(n):
map = []
for i in range(256):
if i & pow(2, n-1) == pow(2, n-1):
map.append(255)
else:
map.append(0)
print(map)
return map
def bitimage(x, n):
image = x.copy()
height, width = image.shape
... | VJaGG/digital-image-processing | chapter2/3.2.4.2ใbitmaplayer.py | 3.2.4.2ใbitmaplayer.py | py | 1,805 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "cv2.imread",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "cv2.IMREAD_GRAYSCALE",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "cv2.imshow",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"li... |
16140910097 | """
Recognizes the mine board from screenshot.
"""
import os
import sys
import numpy as np
from scipy.spatial.distance import cdist
import cv2
from PIL import Image
from solverutils import CID
import pyautogui as pg
IMGDIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'imgs')
# related to board cells... | kkew3/sat-minesweeper | vboard.py | vboard.py | py | 20,542 | python | en | code | 6 | github-code | 36 | [
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.realpath",
"lin... |
41801368948 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 9 14:49:52 2023
@author: intern
"""
import cv2
kernel = np.ones((3, 3), dtype=np.uint8)
erosion = cv2.erode(im0, kernel, iterations=1)
plt.imshow( erosion[:,:,0:3])
#%%
erosion = cv2.morphologyEx(im0, cv2.MORPH_OPEN, kernel, 1)
plt.imshow( erosi... | xsmsh7/label-color | filterblackedge.py | filterblackedge.py | py | 436 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "cv2.erode",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.morphologyEx",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.MORPH_OPEN",
"line_number": 15,
"usage_type": "attribute"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.