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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
21971690182 | import json
from collections import OrderedDict
from operator import itemgetter
TEAMS = None
MATCHES = {}
def get_other(t, title):
t1, t2 = title.split("-")
if t in t1:
return get_team(t2)
return get_team(t1)
def get_team(t):
for team in TEAMS:
if team in t:
return team
... | mfkaptan/fixture-visualizer | lig.py | lig.py | py | 1,026 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.loads",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "json.loads... |
72313218748 | from flask import Flask, jsonify,request,json
from scrapper import scrap_cards
from config import *
from flask_cors import CORS
app = Flask(__name__)
CORS(app)
@app.route('/')
def hello_world():
return 'Hello World!'
@app.route('/scrap', methods = ['POST'])
def generate_json():
req = request.get_json(force=Tr... | mage1711/flask-scrapers-api | app.py | app.py | py | 495 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.request.get_json",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.request",
... |
13194360101 | # -*-coding=utf-8-*-
# @Time : 2019/1/28 14:19
# @File : youtube_downloader.py
import subprocess
import sys
import pymongo
import re
import codecs
def extract_link(filename='web.html'):
with codecs.open(filename, 'r', encoding='utf8') as f:
content = f.read()
try:
result = re.findall('\{"v... | leegb/online_video_download | youtube_downloader.py | youtube_downloader.py | py | 2,952 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "codecs.open",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "subprocess.Popen",
"li... |
20143445172 | """Views for Learning Journal."""
from pyramid.view import view_config
from pyramid.httpexceptions import HTTPFound
from pyramid.httpexceptions import HTTPNotFound
from anna_journal.models import Journals
from pyramid.security import remember, forget
from anna_journal.security import check_credentials
@view_config(ro... | Bonanashelby/pyramid-learning-journal | anna_journal/anna_journal/views/default.py | default.py | py | 2,855 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "anna_journal.security.check_credentials",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pyramid.security.remember",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pyramid.httpexceptions.HTTPFound",
"line_number": 18,
"usage_type": "ca... |
19672334600 | import pytest
from bfprt.algo import insertion_sort, partition, select, swap
class TestInternal:
def test_swap(self):
items = [4, 1, 2, 5, 9, 8]
swap(items, 2, 3)
assert items == [4, 1, 5, 2, 9, 8]
@pytest.mark.parametrize("items, pivot_index, expected_items, expected_index", [
... | gregorybchris/bfprt | tests/test_internal.py | test_internal.py | py | 1,139 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "bfprt.algo.swap",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "bfprt.algo.partition",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pytest.m... |
71804916988 | from __future__ import print_function
import argparse
import torch
from torch import nn, optim
from torch.autograd import Variable
from torch.nn import functional as F
from config import params, data
class VAE(nn.Module):
def __init__(self):
super(VAE, self).__init__()
self.fc1 = nn.Linear(params... | hoxmark/Deep_reinforcement_active_learning | selection_strategies/models/vae.py | vae.py | py | 3,987 | python | en | code | 17 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
39255470036 | from django.conf import settings
from django.core.cache import cache
from django.utils import timezone
from proco.utils.tasks import update_cached_value
class SoftCacheManager(object):
CACHE_PREFIX = 'SOFT_CACHE'
def get(self, key):
value = cache.get('{0}_{1}'.format(self.CACHE_PREFIX, key), None)
... | unicef/Project-Connect-BE | proco/utils/cache.py | cache.py | py | 1,625 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "django.core.cache.cache.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.core.cache.cache",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "django.utils.timezone.now",
"line_number": 16,
"usage_type": "call"
},
{
"api... |
74637089147 | # TODO: (only sent audio, still need sync) receive audio packets and sync with video
# DONE: try to connect to host AFTER clicking on 'start' button
# TODO: fix crash when video is ended or trying to reconnect
import base64
import os
import socket
import sys
import numpy as np
from PyQt5 import QtGui, QtCore, QtWidget... | shully899509/OpenParty | pyqt player client.py | pyqt player client.py | py | 10,093 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.basicConfig",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtCore.QThread",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCo... |
19528069970 | # -*- coding: utf-8 -*-
# 基础公共模块
__author__='zhaicao'
import pymssql
from PyQt5 import QtWidgets, QtGui, QtCore
from PyQt5.QtCore import Qt
import winreg
import os
import sys
import webbrowser
# SqlServer访问类
class MSSQL:
def __init__(self,**kwargs):
self.dbInfo = kwargs
def __GetConnect(self):
... | zhaicao/pythonWorkspace | DeployTool/eventAction/Utils.py | Utils.py | py | 6,744 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pymssql.connect",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QComboBox",
"line_number": 61,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 61,
"usage_type": "name"
},
{
"api_name": "PyQt5.... |
19054013888 | """
Scripts to align sequences and transoform them into 1-hot encoding
"""
# Author: Alessio Milanese <milanese.alessio@gmail.com>
import shutil
import time
import subprocess
import shlex
import os
import errno
import sys
import tempfile
import numpy as np
import re
from stag.helpers import is_tool, read_fasta
#===... | zellerlab/stag | stag/align.py | align.py | py | 8,980 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "sys.stderr.write",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "sys.stderr",
"line_number": 7... |
29259984179 | import os
import sys
from datetime import datetime
from glob import glob
from re import split
from numpy import asarray, savetxt
class iGrav:
# find all the .tsf inside the input directory (even in the sub directory)
def get_all_tfs(self, input_folder):
paths_list = glob(input_folder + "/**/*.tsf", r... | lucamir/iGravToCSV | main.py | main.py | py | 4,775 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "glob.glob",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "re.split",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "re.split",
"line_number": 79,
"us... |
24692323834 | #Import libraries
import sys
import pandas as pd
from sqlalchemy import create_engine
def load_data(messages_filepath, categories_filepath):
'''
Function for loading disaster reponse messages_filepath
Arguments:
messages_filepath: File path to file containing disaster
... | Rmostert/Disaster-response-pipeline | data/process_data.py | process_data.py | py | 3,414 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pandas.merge",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"lin... |
6919943057 | import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, GdkPixbuf
class View(Gtk.Window):
# TODO: Make GUI prettier - low priority
# TODO: Change metric to *C and imperial to *F
def __init__(self):
super().__init__(title='Weather Forecast')
self._box = Gtk.Box(orientati... | lukasz130/WeatherForecast | sources/view.py | view.py | py | 4,949 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "gi.require_version",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "gi.repository.Gtk.Window",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "gi.repository.Gtk",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "gi.re... |
7926234515 | import pandas as pd
import yfinance as yf
# Read the symbols from a CSV file
symbols_df = pd.read_csv("symbols.csv")
symbols = symbols_df["Symbol"].tolist()
# Specify the years
years = [2021, 2022]
# Create an empty list to store the dataframes for each stock
dfs = []
# Iterate over the symbols
for symbol in symbol... | kmlspktaa/data-analytics | economics/dividends-trading/development/dividend-stocks.py | dividend-stocks.py | py | 2,490 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "yfinance.Ticker",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"... |
25875757160 | from numba import jit
import numpy as np
from obspy.taup import TauPyModel
import os
@jit(nopython=True, fastmath=True)
def coords_lonlat_rad_bearing(lat1, lon1, dist_deg, brng):
"""
Returns the latitude and longitude of a new cordinate that is the defined distance away and
at the correct bearing from the ... | eejwa/Array_Seis_Circle | circ_array/geo_sphere_calcs.py | geo_sphere_calcs.py | py | 9,707 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "numpy.radians",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.radians",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.radians",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.radians",
"line_n... |
20824483233 | import inflect
def main():
p = inflect.engine()
names = []
while True:
try:
name = input("Name: ")
names.append(name)
except(EOFError, KeyboardInterrupt):
names = p.join(names)
print("Adieu, adieu, to " + names)
... | lauriwesterlund/CS50P | Solutions/adieu.py | adieu.py | py | 341 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "inflect.engine",
"line_number": 5,
"usage_type": "call"
}
] |
38259209826 | import cv2
#Configurable Parameters
inputValue = int(input("Enter the scale value to resize the image: (0 - 100): "))
if inputValue >= 0 and inputValue <= 100:
source = "wx.jpg"
destination = 'newImage.png'
scale_percent = inputValue
src = cv2.imread(source, cv2.IMREAD_UNCHANGED)
#cv2.imshow("tit... | sundaram-sharma/image-resizer-python | main.py | main.py | py | 715 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.imread",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.IMREAD_UNCHANGED",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "cv2.resize",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "cv2.imwrite",
"li... |
16908443054 | # -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
import sys
import os
from os import path
import numpy as np
from PIL import Image
import datetime
import matplotlib.pyplot as plt
import time
sys.path.append(os.getcwd() + "/lib/wordcloud")
from wordcloud import WordCloud
text = "初鳩,初花,初... | PL2GroupJ/PyWordCloud | wc.py | wc.py | py | 5,758 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_n... |
22378324072 | from rest_framework.response import Response
from rest_framework.decorators import api_view
from .serializers import PersonSerializer
from .models import Person
from rest_framework import status
from rest_framework.permissions import IsAdminUser
from rest_framework.decorators import api_view, permission_classes
@api_... | sinajamshidi247/django_rest_framework | A/home/views.py | views.py | py | 1,392 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rest_framework.response.Response",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "rest_framework.response.Response",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "rest_framework.decorators.api_view",
"line_number": 10,
"usage_type": "... |
10422627143 | from __future__ import annotations
import asyncio
import dataclasses
import logging
import uuid
from typing import TYPE_CHECKING, Self
from PySide6.QtCore import QObject, Signal
from randovania.bitpacking.json_dataclass import JsonDataclass
from randovania.interface_common.players_configuration import INVALID_UUID
f... | randovania/randovania | randovania/interface_common/world_database.py | world_database.py | py | 4,141 | python | en | code | 165 | github-code | 6 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "randovania.lib.migration_lib.get_version",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "randovania.lib.migration_lib",
"line_number": 22,
"usage_type": "name"
},... |
39627693477 | # __author__ = "Chang Gao"
# __copyright__ = "Copyright 2018 to the author"
# __license__ = "Private"
# __version__ = "0.1.0"
# __maintainer__ = "Chang Gao"
# __email__ = "chang.gao@uzh.ch"
# __status__ = "Prototype"
import sys
import os
import torch as t
import torch.nn.functional as F
f... | SensorsINI/DeltaGRU-cartpole | modules/util.py | util.py | py | 10,645 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.splitext",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "torch.save",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path.splitext",
"line... |
36568700730 | # -*- coding: utf-8 -*-
from odoo import models, fields, api
from odoo import exceptions
from odoo.exceptions import ValidationError
import json
import datetime
import string
import requests
from datetime import date
import logging
_logger = logging.getLogger(__name__)
class hr_report(models.Model):
... | AMohamed389/airport4 | hr_extend_minds/models/hr_report.py | hr_report.py | py | 2,381 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "odoo.models.Model",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "odoo.models",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "odoo.fields.Sele... |
301052917 | import yaml
import glob
import dropbox
import os
import sys
import time, threading
import RPi.GPIO as GPIO
import time
import pygame
import sentry_sdk
from sentry_sdk import start_transaction
def loadConfig(file):
with open(file, 'r') as stream:
config_dict = yaml.safe_load(stream)
return config_di... | soundtecas/elevator | elevator.py | elevator.py | py | 3,991 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "yaml.safe_load",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.remove",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sentry_sdk.start_transaction",
... |
24255674964 | from selenium import webdriver
import csv
import config
import time
class instaInfo:
def __init__(self):
"""
init webdriver
"""
self.driver = webdriver.Chrome('chromedriver')
self.profile_url = ''
self.followers_count = 0
self.ask_url()
def ask_url(self... | bfesiuk/InstagramInfo | info.py | info.py | py | 4,293 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "config.INSTAG... |
37340652783 | from input import Input
from word import Word
from data import Data
from display import Display as dp
from colorama import Fore
import numpy as np
# The Game Object
class LeWord:
# Only gets the mode,
def __init__(self, mode):
self.mode = mode
# The joker of a word is the count of vowels and con... | mburaozkan/LeWord-The-Word-Game | game.py | game.py | py | 14,751 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "display.Display.display_joker",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "display.Display",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "display.Display.display_joker",
"line_number": 48,
"usage_type": "call"
},
{
"api_n... |
34338376065 | # -*- coding: utf-8 -*-
import contextlib
import json
import logging
import re
import starlette_werkzeug_debugger
from starlette.applications import Starlette
from starlette.middleware import Middleware
from starlette.responses import JSONResponse
from starlette.routing import Route
from starlette.testclient import Te... | mireq/starlette-werkzeug-debugger | tests/test_debugger.py | test_debugger.py | py | 4,009 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "starlette.responses.JSONResponse",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "contextlib.asynccontextmanager",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "starlette.middleware.Middleware",
"line_number": 37,
"usage_type": "... |
11313840170 | import numpy as np
from sklearn.preprocessing import LabelEncoder
import pandas as pd
import string
import tqdm
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.feature_extraction.text import CountVectorizer
class preprocessing:
# Dimension adalah dimensi vektor embedding yang digunakan
... | dryantl/product-title-classification | preprocessing_pipeline.py | preprocessing_pipeline.py | py | 10,629 | python | id | code | 0 | github-code | 6 | [
{
"api_name": "tqdm.tqdm",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "sklearn.feature_extraction.text.CountVe... |
25070989865 | import logging
from django.urls import path
from rest_framework import status
from rest_framework.response import Response
from rest_framework.request import Request
from drf_yasg.utils import swagger_auto_schema
from drf_yasg import openapi
from purplship.server.core.views.api import APIView
from purplship.server.pro... | danh91/purplship | server/modules/proxy/purplship/server/proxy/views/pickup.py | pickup.py | py | 3,927 | python | en | code | null | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "purplship.server.core.serializers.MODELS.keys",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "purplship.server.core.serializers.MODELS",
"line_number": 26,
"usage_type... |
12938444153 | from django.conf.urls import url
from django.contrib.auth.decorators import login_required
from jeopardy.views import (
QuestionList,
QuestionById,
QuestionRandom,
PlayerList,
PlayerByName,
PlayerById,
PlayerQuestionById,
PlayerQuestionByName,
)
from rest_framework.urlpatterns import for... | ryanwholey/jeopardy_bot | trabek_bot/jeopardy/urls.py | urls.py | py | 982 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "django.conf.urls.url",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "jeopardy.views.QuestionList.as_view",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "jeopardy.views.QuestionList",
"line_number": 16,
"usage_type": "name"
},
{
... |
12864757051 | import streamlit as st
import pandas as pd
import numpy as np
import re
import json
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import cosine_similarity
import math
import warnings
warnings.filterwarnings('ignore')
from PIL import Image
# Page setup
st.set_pag... | smsraj2001/MINI-SEARCH-ENGINE | app.py | app.py | py | 14,858 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "streamlit.set_page_config",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "streamlit.title",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pan... |
20968158774 | import math
from flask import Flask, render_template, request, jsonify
import pickle
import pandas as pd
import numpy as np
import mariadb
import jinja2
conn = mariadb.connect(
user="root",
password="root",
host="localhost",
database="pal_taqdeer")
cur = conn.cursor()
app = Flask(__name__)
@app.rout... | sondosaabed/PalTaqdeer | app.py | app.py | py | 2,489 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "mariadb.connect",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"l... |
26013197336 | from homeassistant.config_entries import ConfigEntry
from .const import (
PLATFORM,
PRESET_MODE_HOLIDAY,
PRESET_MODE_MANUAL,
PRESET_MODE_SCHEDULE_1,
PRESET_MODE_SCHEDULE_2,
PRESET_MODE_SCHEDULE_3,
PRESET_MODE_TEMP_OVERRIDE,
PRESET_MODE_ANTIFROST,
BAXI_PRESET_MANUAL,
BAXI_PRESET_S... | vipial1/BAXI_thermostat | custom_components/baxi_thermostat/helper.py | helper.py | py | 2,194 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "const.PRESET_MODE_MANUAL",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "const.PRESET_MODE_TEMP_OVERRIDE",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "const.PRESET_MODE_ANTIFROST",
"line_number": 29,
"usage_type": "name"
},
{
... |
23713666857 | # -*- coding: utf-8 -*-
"""
Created on Wed Jun 7 22:16:45 2023
@author: EMILIANO
"""
import openpyxl
import pandas as pd
##Workbook va en mayusculas la primera
from openpyxl import Workbook
Excelworkbook=openpyxl.load_workbook("H:\Documentos\Practica Pyhton Bond Arg\Dataset bonos arg usd.xlsx")
Excelsheet=Excelwor... | emilapuente1/Practica-Pyhton-Bond-Arg | Bondarg.py | Bondarg.py | py | 1,510 | python | es | code | 0 | github-code | 6 | [
{
"api_name": "openpyxl.load_workbook",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 20,
"usage_type": "call"
}
] |
17646581677 | import boto3
from flask import Flask, request
import json
import os
app = Flask(__name__)
REGION = 'eu-north-1'
TESTING_URL = 'http://localhost:4566' # os.environ['LOCAL_TESTING']
TOPIC_ARN = 'arn:aws:sns:eu-north-1:000000000000:techtalk-sns'
@app.route('/')
def demo_homepage():
return "Welcome to Anusha`s LocalS... | anushacassum/mylocalstack | app.py | app.py | py | 1,458 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "boto3.session.Session",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "boto3.session",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "flask.request.dat... |
36060772305 | # #!/usr/bin/env python3
import json
import socket
from utils.save_json import save_json
def initSocket(ip, port, diretorio):
dir = 'src/json/'+diretorio+'.json'
dicionario = ''
try:
tcp = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
tcp.bind((ip, port))
tcp.listen(2)
w... | AntonioAldisio/FSE-2022-2-Trabalho-1 | src/servidor/servidor.py | servidor.py | py | 847 | python | pt | code | 0 | github-code | 6 | [
{
"api_name": "socket.socket",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_STREAM",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "utils.save_... |
25785453821 | '''
the application of the matrix
'''
import xlrd
import matplotlib.pyplot as plt
from config import *
from model import Dmu
# plt.rcParams['text.usetex']=True
# # Place the command in the text.latex.preamble using rcParams
# plt.rcParams['text.latex.preamble']=r'\makeatletter \newcommand*{\rom}[1]{\bfseries\expandaft... | gaufung/CodeBase | PDA/matrix/app.py | app.py | py | 6,090 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.xkcd",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "xlrd.open_workbook",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "model.Dmu... |
38610058452 | import subprocess
import re
import skia
import io
from platform import system
from pathlib import Path
from PIL import Image
from xml.etree import ElementTree as ET
from typing import Any, Tuple, Union, List
class SVG:
"""SVG class to load, edit, render, and export svg files using pillow and inkscape."""
i... | jlwoolf/pillow-svg | PILSVG/SVG.py | SVG.py | py | 20,691 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "platform.system",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "typing.Union",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_nu... |
73931882429 | #!python
"""
A natural number, N, that can be written as the sum and product of a given set of at least two natural numbers, {a1, a2, ... , ak} is called a product-sum number: N = a1 + a2 + ... + ak = a1 × a2 × ... × ak.
For example, 6 = 1 + 2 + 3 = 1 × 2 × 3.
For a given set of size, k, we shall call the smallest N ... | DanMayhem/project_euler | 088.py | 088.py | py | 2,498 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "functools.reduce",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "operator.mul",
"line_number": 30,
"usage_type": "argument"
},
{
"api_name": "pe.prime_factors",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "functools.lru_cach... |
30984637396 | from datetime import datetime
from constants import ProducerTypes
from events.producers import get_producer
from events.utils import get_routing_key
from models import (
Task,
TaskCost,
)
from popug_schema_registry.models.v1.task_cost_added_event_schema import (
TaskCostAddedEventSchema,
)
def send_task... | Drozdetskiy/popug_jira | popug_accounting/src/events/taskcost/send_event.py | send_event.py | py | 857 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "models.TaskCost",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "models.Task",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "events.producers.get_producer",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "constants.P... |
10747823823 | '''S3 uploader module'''
import os
import time
import signal
import sys
import boto3
# This module seems to have some issues. pylint ignore them
from setproctitle import setproctitle, getproctitle # pylint: disable=E0611
from kafkatos3.ThreadPool import ThreadPool
def upload_file(self, filename):
'''horrible c... | snowch/kafkatos3 | kafkatos3/S3Uploader.py | S3Uploader.py | py | 2,919 | python | en | code | null | github-code | 6 | [
{
"api_name": "boto3.client",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "os.remove",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 56,... |
34690028943 | from django.contrib import admin
from .models import Service, Category, Feature, FeatureItem
class FeatureItemInline(admin.StackedInline):
model = FeatureItem
@admin.register(Service)
class ServiceAdmin(admin.ModelAdmin):
list_display = ("name", "sub_title")
prepopulated_fields = {"slug": ("name",)}
... | samshultz/techbitsdata | services/admin.py | admin.py | py | 855 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.contrib.admin.StackedInline",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "models.FeatureItem",
"line_number": 7,
"usage_type": "name"
},
{
"api_... |
32371281333 | import cv2
import matplotlib.pyplot as plt
def plotImg(img):
if len(img.shape) == 2:
plt.imshow(img, cmap='gray')
plt.show()
else:
plt.imshow(cv2.cvtColor(img, cv2.COLOR_BGR2RGB))
plt.show()
t=0
img = cv2.imread('cv.png')
gray_img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
binary_... | RisinPhoenix12/Computer-Vision | dots.py | dots.py | py | 818 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.imshow",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.show",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplo... |
34111450286 | """helloworld URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-ba... | githubrghd/mydemo | python-demo/helloworld/helloworld/urls.py | urls.py | py | 1,551 | python | en | code | null | github-code | 6 | [
{
"api_name": "django.conf.urls.url",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "django... |
6589861302 | from elasticsearch import Elasticsearch
import pandas as pd
from contexttimer import Timer
es = Elasticsearch(
"http://rgai3.inf.u-szeged.hu:3427/",
basic_auth=("elastic", "V7uek_ey6EdQbGBz_XHX"),
verify_certs=False
)
def get_highlights(csv, es, size):
# adatok kinyerése pd-ből, a már tisztított kérd... | szegedai/SHunQA | scripts/evals/highlights_score_test_w_preprocessed_questions.py | highlights_score_test_w_preprocessed_questions.py | py | 5,241 | python | hu | code | 0 | github-code | 6 | [
{
"api_name": "elasticsearch.Elasticsearch",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "contexttimer.Timer",
"line_number": 31,
"usage_type": "call"
}
] |
7227006625 | import tqdm
import argparse
import os
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('--src-set', '-src-set', type=str, default=r'/home/v-jiaya/RetrieveNMT/data/MD/en-de/iwslt14-en-de/train/train.en',help='source file')
parser.add_argument('--new-src-set', '-new-tgt-set', t... | CSJianYang/RetrieveNMT | RetrieveNMT/SMT/generate_align_data.py | generate_align_data.py | py | 1,178 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 19,
"usage_type": "call"
}
] |
28326166820 | """
OCR Pagination
"""
from past.utils import old_div
from rest_framework.response import Response
from rest_framework.pagination import PageNumberPagination
from django.conf import settings
from ocr.permission import get_permissions
# -------------------------------------------------------------------------------
# p... | Srinidhi-SA/temp_spark | SPARK_DOCKER/code/mAdvisor-api/ocr/pagination.py | pagination.py | py | 3,723 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rest_framework.pagination.PageNumberPagination",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "django.conf.settings.PAGENUMBER",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 37,
"usage_type... |
17689672862 | import torch
from torch.nn import Module, Conv2d, LeakyReLU, PReLU, BatchNorm2d, Sequential, PixelShuffle, AdaptiveAvgPool2d, Flatten, Linear, Dropout2d, Dropout
class ResidualUnit(Module):
def __init__(self):
super(ResidualUnit, self).__init__()
self.conv1 = Sequential(Conv2d(64, 64, 3, 1, "same")... | abed11326/Training-a-Super-Resolution-GAN-for-4x-image-upscaling | models.py | models.py | py | 2,878 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.nn.BatchNorm2d... |
34351667294 | import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
data = pd.read_csv('CCLhora2.csv')
data1 = pd.read_csv('CCLdia2.csv')
data2 = pd.read_csv('CCLsemana2.csv')
data3 = pd.read_csv('CCLmes2.csv')
data4 = pd.read_csv('CCLaño2.csv')
data["date"] = pd.to_datetime(data["date"], unit='ms')
data1["date"]... | pedrolf8/MastodonTFG | paso.py | paso.py | py | 869 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"l... |
20855466611 | import requests
from requests.exceptions import ConnectionError, Timeout, TooManyRedirects
import json
import os
from decouple import config
from prettyprinter import pprint
import GUI
# For the API documentation go to
# https://coinmarketcap.com/api/documentation/v1/#section/Quick-Start-Guide
API_KEY = config("API... | edumarg/cyrpto_currency_portfolio | main.py | main.py | py | 4,492 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "decouple.config",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "GUI.Frame",
"line_number"... |
17195304707 | #threading better due to network I/O hinderances
#from threading import Thread
#multiprocessing used for cpu intensive processes (no networking hinderances)
from multiprocessing import Process, Queue
from time import time
def check_value_in_list(x, j, num_of_processes, queue):
max_num_to_check = 10**8
lower_bnd = ... | ganton000/Concurrency | multiprocessing-tutorial/main.py | main.py | py | 1,200 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "multiprocessing.Queue",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Process",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "time.time",
... |
44730303411 | import os
import discord
from discord.utils import get
from discord.ext import commands, tasks
from dotenv import load_dotenv
import random
import re
import time
import requests
load_dotenv()
OMDB_KEY = os.getenv('OMDB_KEY')
STREAMING_KEY = os.getenv('STREAMING_KEY')
TOKEN = os.getenv('DISCORD_TOKEN')
GUILD = os.geten... | aburpee/spongebob-text | app.py | app.py | py | 5,748 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number":... |
43633237973 |
from __future__ import absolute_import
#typing
import numpy
#overrides
import torch
from torch.nn.modules.linear import Linear
import torch.nn.functional as F
from allennlp.common.checks import check_dimensions_match
from allennlp.data import Vocabulary
from allennlp.modules import Seq2SeqEncoder, TimeDistributed, T... | plasticityai/magnitude | pymagnitude/third_party/allennlp/models/simple_tagger.py | simple_tagger.py | py | 6,916 | python | en | code | 1,607 | github-code | 6 | [
{
"api_name": "allennlp.models.model.Model",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "allennlp.nn.InitializerApplicator",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "allennlp.modules.TimeDistributed",
"line_number": 50,
"usage_type": "call"
... |
11002868168 | from typing import List
class WordFilter:
def __init__(self, words: List[str]):
self.a ={}
for ind, i in enumerate(words):
for j in range(len(i) + 1):
for k in range(len(i) + 1):
now = i[:j] + '$' + i[k:]
self.a[now] = ind
... | xixihaha1995/CS61B_SP19_SP20 | 745. Prefix and Suffix Search.py | 745. Prefix and Suffix Search.py | py | 702 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 6,
"usage_type": "name"
}
] |
74087520829 | # -*- coding: utf-8 -*-
import re
import datetime
import bs4
import scrapy
from scrapy_wssc.Item.BookContentItem import BookContentItem
from scrapy_wssc.Item.BookItem import BookItem
class mobile_spider(scrapy.Spider):
name = 'mobile_spider'
def __init__(self, bid=None):
"""初始化起始页面和游戏bid
""... | chenrunhu/wssc_scrapy | scrapy_wssc/spiders/mobile_spider.py | mobile_spider.py | py | 4,566 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "scrapy.Spider",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "re.compile",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "scrapy_wssc.Item.BookItem.BookItem",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "date... |
6056727556 | #!/usr/bin/env python3
import re
import collections
import vcf
import sys
import argparse
import copy
def parse_my_args():
parser = argparse.ArgumentParser("Combines a VCF of individual calls into one large VCF for population.")
parser.add_argument("vcf", nargs="?", help="Input VCF file; default stdin.")
... | jgbaldwinbrown/vcfstats | combine_single_indivs.py | combine_single_indivs.py | py | 2,138 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "re.compile",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
... |
23588347895 | from time import sleep
import psycopg2
import os
import subprocess
from datetime import datetime
from pytz import timezone
import filecmp
db_name = os.environ['POSTGRES_DB']
db_user = os.environ['POSTGRES_USER']
db_pass = os.environ['PGPASSWORD']
db_host = os.environ['POSTGRES_HOST']
db_port = os.environ['POSTGRES_PO... | cjrisua/vinomio-api | docker/vinomioHC/app.py | app.py | py | 2,723 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line... |
17944337782 | import json
from django.views.generic import DetailView, ListView, View, CreateView
from django.core.exceptions import ImproperlyConfigured
from django.http import (
HttpResponse,
HttpResponseBadRequest,
HttpResponseRedirect
)
from django.contrib.auth.decorators import login_required
from django.utils.deco... | rvause/djangodash2013 | suggestions/views.py | views.py | py | 6,614 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "django.views.generic.DetailView",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "models.Suggestion",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "models.SuggestionCopy.objects.all",
"line_number": 30,
"usage_type": "call"
},
{
... |
27773506390 | import os
import asyncio
from telepyrobot.setclient import TelePyroBot
from pyrogram import filters
from pyrogram.types import Message, ChatPermissions
from telepyrobot import COMMAND_HAND_LER
from telepyrobot.utils.admin_check import admin_check
__PLUGIN__ = os.path.basename(__file__.replace(".py", ""))
__help__ = f... | Divkix/TelePyroBot | telepyrobot/plugins/chat.py | chat.py | py | 4,652 | python | en | code | 40 | github-code | 6 | [
{
"api_name": "os.path.basename",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "telepyrobot.COMMAND_HAND_LER",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "telepyrobot.... |
12100194486 | import unittest
import itertools
from functools import partial
from bst import BST
def _factory(l):
_b = BST(l[0])
for item in l[1:]:
_b.insert(item)
return _b
class TestBST(unittest.TestCase):
def _check_node(self, node, item, left_child, right_child):
self.assertEqual(item, node.i... | Shaywei/MyDevTools | Python/BasicDataStructures/bst_tests.py | bst_tests.py | py | 5,123 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "bst.BST",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "unittest.TestCase",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "bst.BST",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "bst.BST",
"line_number": 39... |
40201462407 | import cv2
import numpy as np
import pandas as pd
import json
from scipy.spatial.distance import cdist
import os
# Get fps of given video
def getFps(path):
vidObj = cv2.VideoCapture(path)
fps = vidObj.get(cv2.CAP_PROP_FPS)
print("Frames per second using video.get(cv2.CAP_PROP_FPS) : {0}".format(fps))
... | orhungorkem/SIFTDetector | main.py | main.py | py | 11,935 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.CAP_PROP_FPS",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "cv2.imwrite",... |
6114242445 | import argparse
import gym
import numpy as np
from itertools import count
from collections import namedtuple
from functools import reduce
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.distributions import Categorical
from tensorboardX import SummaryWriter
fr... | ltecot/emergence_properties | hebbian_learning/envs/cartpole.py | cartpole.py | py | 4,095 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "gym.make",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "torch.manual_seed",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "tensorboardX.Summa... |
39672933944 | import pytest
import common
@pytest.mark.parametrize(
"data,start,end",
[
("0-0", 0, 0),
("11-22", 11, 22),
],
)
def test_parse(data: str, start: int, end: int):
assert common.SectionRange.parse(data) == common.SectionRange(start, end)
@pytest.mark.parametrize(
"range1,range2,res... | cmatsuoka/aoc | 2022 - expedition/04 - camp cleanup/test_common.py | test_common.py | py | 1,252 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "common.SectionRange.parse",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "common.SectionRange",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 5,
"usage_type": "call"
},
{
"api_nam... |
71456631549 | import boto3
from operator import itemgetter
ecr_client = boto3.client('ecr')
repositories = ecr_client.describe_repositories()['repositories']
if len(repositories) == 0:
print("Repository is empty!")
for repo in repositories:
print(f"Repository name: {repo['repositoryName']}")
query_repository_name = "java... | ArshaShiri/DevOpsBootcampPythonAutomationAssignment | ecr_in_aws.py | ecr_in_aws.py | py | 728 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "boto3.client",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "operator.itemgetter",
"line_number": 27,
"usage_type": "call"
}
] |
12691211626 | import os
from twilio.rest import Client
from urllib.request import urlopen
import re
import time
import smtplib
#need twilio credientials to run
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
twilio_number = os.environ["TWILIO_NUMBER"]
ubc_url = "https://courses.students.... | benkenj/UBCCourseNotifier | UBCCourseNotifierMain.py | UBCCourseNotifierMain.py | py | 3,405 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "twilio.rest.Client",
... |
4732908565 | import xml.etree.ElementTree as ET
from datetime import datetime
from bs4 import BeautifulSoup
class XMLParser:
def __init__(self, file: str):
self.file = file
self.parameters = {'INPUT':{},
'DISCRIMINATOR':{},
'QDC':{},
'SPECT... | Chujo58/ReadROOT | XML_Parser.py | XML_Parser.py | py | 11,752 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "xml.etree.ElementTree.parse",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "xml.etree.ElementTree.parse",
"line_number": 130,
"usage_type": "call"
},
{
"ap... |
3281849942 | import torch
import wandb
from torch import nn
import torchvision.utils as vutils
def get_time_emb(dim, time):
pos = torch.arange(0, time, dtype=torch.float)
omega = torch.arange(dim // 2, dtype=torch.float)
omega /= dim / 2.0
omega = 1.0 / 10000 ** omega
out = torch.einsum("m,d->md", pos, omega)
... | Shimanogov/bert-slots | model.py | model.py | py | 12,552 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.arange",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.float",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "torch.arange",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.float",
"line_numbe... |
27214693785 | """
Overview:
Functions to deal with encoding binary data easily.
"""
import sys
from typing import Optional, List
import chardet
from ..collection import unique
_DEFAULT_ENCODING = 'utf-8'
_DEFAULT_PREFERRED_ENCODINGS = ['utf-8', 'gbk', 'gb2312', 'gb18030', 'big5'] # common encodings for chinese
__all__ = [
... | HansBug/hbutils | hbutils/encoding/decode.py | decode.py | py | 2,040 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "typing.Optional",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "collection.unique",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "sys.getdefaultencoding"... |
6923620355 | #encoding=utf8
import sys
reload(sys)
sys.setdefaultencoding('utf8')
import StringIO
import json
import logging
import random
import urllib
import urllib2
# functions
import responseHandler
# standard app engine imports
from google.appengine.api import urlfetch
from google.appengine.ext import ndb
import webapp2
# ... | eglantine-shell/xiaoyiqingbot-2022 | main.py | main.py | py | 3,527 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.setdefaultencoding",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "config.TOKEN",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "google.appengine.ext.ndb.Model",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name":... |
6420520466 | import time
import datetime
import math
import logging
class Logger():
def __init__(self):
self. start_time = time.time()
self.logger = logging.getLogger()
self.logger.setLevel(logging.INFO)
print('Starting ' + str(datetime.datetime.now()))
@staticmethod
def printLog(*messa... | Script-2020/autoclusteringFinReports | util/Logger.py | Logger.py | py | 1,437 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "time.time",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.now",
... |
16484762613 | import pygame
import time
import random
pygame.init()
screensize = (200,200) # This is a Vector 2 Dimentional Object
screen = pygame.display.set_mode(screensize)
run = True
color = (250, 153, 0)
displacement = 0
x_pos = 200
x_pos_2 = 300
y_pos = 95
pipeno = 0
pipeno2 = 0
gamepipes = 10
loclist = []
for a in ra... | RinUnderscore/LSCC-Pygame-Lesson | main.py | main.py | py | 1,965 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.init",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "random.randint",... |
1790565048 | import pdfplumber
import pandas as pd
from babel.numbers import format_currency
def extrair_tabelas(pdf_path):
with pdfplumber.open(pdf_path) as pdf:
# Inicialize uma lista para armazenar todas as tabelas
todas_tabelas = []
# Itera sobre todas as páginas do PDF
for pagina in pdf.pa... | regis-amaral/python-scripts | fatura-pdf/reader-fatura.py | reader-fatura.py | py | 1,927 | python | pt | code | 0 | github-code | 6 | [
{
"api_name": "pdfplumber.open",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "pandas.notna",
... |
40128810884 | #!/usr/bin/env python3
import itertools
from collections import defaultdict
from heapq import heappush, heappop
import sys
sys.setrecursionlimit(10**6)
input = sys.stdin.buffer.readline
INF = 10 ** 9 + 1 # sys.maxsize # float("inf")
def debug(*x):
print(*x, file=sys.stderr)
def blute_solve(N, AS):
"void(... | nishio/atcoder | abc173/d.py | d.py | py | 2,643 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "sys.setrecursionlimit",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "sys.stderr",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "itertools.permutat... |
16543818867 | from nuitka.nodes.CallNodes import makeExpressionCall
from nuitka.nodes.ConstantRefNodes import makeConstantRefNode
from nuitka.nodes.ContainerMakingNodes import (
makeExpressionMakeTuple,
makeExpressionMakeTupleOrConstant,
)
from nuitka.nodes.DictionaryNodes import makeExpressionMakeDictOrConstant
from nuitka.... | Nuitka/Nuitka | nuitka/tree/ReformulationCallExpressions.py | ReformulationCallExpressions.py | py | 10,742 | python | en | code | 10,019 | github-code | 6 | [
{
"api_name": "TreeHelpers.buildNode",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "nuitka.PythonVersions.python_version",
"line_number": 48,
"usage_type": "name"
},
{
"api_name": "TreeHelpers.getKind",
"line_number": 58,
"usage_type": "call"
},
{
"ap... |
15792066200 | import argparse
from os import listdir, makedirs
from os.path import isfile, join, basename, dirname, isdir
from PIL import Image
from tqdm import tqdm
# folder_path = 'photos'
# left, top, right, bottom = 559, 225, 1361, 0
# -d ./photos -s ./photos2 -c -a 559 225 1361 0
def build_argparse():
parser = argparse.... | zsoman/photo_editing | PhotoCropper.py | PhotoCropper.py | py | 4,114 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"... |
10241474430 | import scipy
import copy
import numpy as np
def gesd(x, **kwargs):
x_ = np.array(x)
alpha = 0.05 if 'alpha' not in kwargs else kwargs['alpha']
n_out = int(np.ceil(len(x_) * 0.1)) if 'n_out' not in kwargs else kwargs['n_out']
outlier_side = 0 if 'outlier_side' not in kwargs else kwargs['outlier_side']
... | WHThhhh/Seeg_prepro | GESD_wht.py | GESD_wht.py | py | 1,421 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.ceil",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "copy.copy",
"line_number": 16,
... |
41211788790 | from keras.applications.resnet50 import ResNet50
from keras.preprocessing import image
from keras.applications.resnet50 import preprocess_input, decode_predictions
import numpy as np
import os
import json
from PIL import Image
import requests
from io import BytesIO
import urllib3
urllib3.disable_warnings(urllib3.exce... | ming19956/PFE | information-retrival-search-engine/informationRetrival/resnet50/resnet50.py | resnet50.py | py | 3,180 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "urllib3.disable_warnings",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "urllib3.exceptions",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "numpy.ndarray",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "n... |
33055278390 | import psycopg2 as psy
import pandas as pd
# Class for connect and write Postgresql
class PsycopgPostgresWarehouse:
def __init__(self, host, database, user, pw, port):
self.host = host
self.database = database
self.user = user
self.pw = pw
self.port = port
# Connect D... | Tana8M/data-engineer-assignment | pipeline/function/postgresql_function/psycopg2_postgresql.py | psycopg2_postgresql.py | py | 4,631 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "psycopg2.connect",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.read_sql",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 35,
"usage_type": "attribute"
}
] |
21640069600 | from django import forms
from django.core.exceptions import ValidationError
from django.utils.translation import gettext_lazy as _
from .models import VideoFile
class VideoFileForm(forms.ModelForm):
"""Form for user file uploading."""
def clean(self):
cleaned_data = super().clean()
original... | sergeybe/video-archive | src/video/forms.py | forms.py | py | 813 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.core.exceptions.ValidationError",
"line_number": 18,
"usage_type": "call"
},
{
"api... |
35424778344 | from art import higher_lower,vs
from game_data import data
import random
import os
#Display art
score = 0
game_continue = True
account_b = random.choice(data)
def format_data(account):
"""Takes the account data and return the printable format"""
account_name = account["name"]
account_desc =... | pav537/Python | Higher_Lower Game.py | Higher_Lower Game.py | py | 1,900 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "random.choice",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "game_data.data",
"line_number": 10,
"usage_type": "argument"
},
{
"api_name": "art.higher_lower",
"line_number": 27,
"usage_type": "argument"
},
{
"api_name": "random.choice",... |
23007665672 | #!/usr/bin/env python
#
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Top levels scripts to extract castro data from an all-sky analysis
"""
import os
import argparse
import numpy as np
import yaml
from astropy import table
from fermipy import fits_utils
from dmpipe import dmp_roi
from dmpi... | fermiPy/dmpipe | dmpipe/scripts/extract_castro_data.py | extract_castro_data.py | py | 3,510 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "astropy.table.Table.read",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "astropy.table.Table",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "astropy.table",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "numpy... |
13305672302 | import cv2
#image read
"""
img = cv2.imread("Resources/lena.png")
cv2.imshow("Output",img)
cv2.waitKey(0)
"""
#video read
"""
cap = cv2.VideoCapture("Resources/test_video.mp4")
while True:
success, img = cap.read()
cv2.imshow("Video",img)
if cv2.waitKey(1) & 0xFF ==ord('q'):
break
... | Umang-Seth/General_OpenCV_Fn | Load_Webcam.py | Load_Webcam.py | py | 543 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line_number": 29,
"usage_type": "call"
}
] |
15309466710 | import asyncio
from misc import dp,bot
from .sqlit import reg_user
from aiogram import types
channel1 = -1001804437355
content_id = -1001165606914
print(1)
markup = types.InlineKeyboardMarkup()
bat_a = types.InlineKeyboardButton(text='Access to group 🔑', url = 'https://t.me/share/url?url=https%3A%2F%2Ft.me%2F%2BH4v... | pytera895143242/spec2rep | handlers/commands_start.py | commands_start.py | py | 1,164 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "aiogram.types.InlineKeyboardMarkup",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "aiogram.types",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "aiogram.types.InlineKeyboardButton",
"line_number": 10,
"usage_type": "call"
},
{
... |
18464161519 | # Libraries
import pandas as pd
import re, sqlite3
# Reading the data
data = pd.read_csv('Digimon_cards.csv')
# Connecting with the database
con = sqlite3.connect('Digimon_Cards.sqlite')
cur = con.cursor()
# Inserting the data
## Card type's table
insert_card_type = 'INSERT INTO Card_types(name) VALUES'... | davidr9708/Digimon_Card_Game | Code/3_Data_insertion.py | 3_Data_insertion.py | py | 4,306 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 54,
... |
29575131193 | import json
from argo_ams_library import AmsException, AmsMessage, ArgoMessagingService
class PullPublish:
def __init__(self, config):
self.pull_sub = config["pull_sub"]
self.pub_topic = config["pub_topic"]
self.pull_topic = config["pull_topic"]
self.ams = ArgoMessagingService(end... | rciam/rciam-federation-registry-agent | ServiceRegistryAms/PullPublish.py | PullPublish.py | py | 2,400 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "argo_ams_library.ArgoMessagingService",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "argo_ams_library.AmsException",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "json.loads",
"line_number": 30,
"usage_type": "call"
},
{
"ap... |
15768547417 | from __future__ import annotations
from typing import TYPE_CHECKING, Any, Type
from django.db.models import JSONField
from django.db.models.lookups import Lookup
from pymilvus.client.types import DataType
from .lookups import get_nearest_n
if TYPE_CHECKING:
from django_milvus.connection import Connection
clas... | kaleido-public/django-milvus | django_milvus/fields.py | fields.py | py | 2,190 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.db.models.JSONField",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "pymilvus.client.types.DataType",
"line_number": 19,
"usage_type": "name"
},
{
"ap... |
31574941802 | from PIL import Image
import sys
import argparse
from os.path import exists
import time
import math
import re
import tkinter as tk
from tkinter import filedialog, ttk
import threading
import population
import province
import vicmap
mod_dir_loc = ""
save_file_loc = ""
map_type = ""
glob... | neopythagorean/vic2mapper | src/mapper.py | mapper.py | py | 12,604 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "os.path.exists",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number":... |
39940042757 | import numpy as np
import matplotlib.pyplot as plt
import os.path
import Style
import sys
zsims = ['3.61', '4.038','5.017']
simnom = ['SAGE']
cm = plt.get_cmap('tab10') # Colour map to draw colours from
path2sim = 'C:/Users/Olivia/TFG-TUT/'
for iiz, zsim in enumerate(zsims):
for sim in simnom:
ffav = path... | Ovive57/TFG-TUT | Dibujo_Medias_corte_10.py | Dibujo_Medias_corte_10.py | py | 2,682 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.get_cmap",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "os.path.path.isfile",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.pat... |
12731720405 | #/usr/bin/python3.8
"""
This example implements the interaction between Qt Widgets and a 2D
matplotlib plot showing a gaussian curve with scipy.
This app displays a graph inside gui
"""
import sys
import numpy as np
from scipy.stats import norm
from matplotlib import pyplot as plt
from matplotlib.figure import Figure
... | ndlopez/learn_python | learn_qt/qt_graph.py | qt_graph.py | py | 2,123 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "PySide6.QtWidgets.QWidget",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "matplotlib.backends.backend_qt5agg.FigureCanvas",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "matplotlib.figure.Figure",
"line_number": 22,
"usage_type": "ca... |
70504080829 | from naman.core.models import VLan
from django.core.exceptions import ImproperlyConfigured
def assign_provisioning_vlan(machine):
print("Entering assign_provisioning_vlan")
prov_vlans = VLan.objects.filter(provisioning_purpose=True)
if prov_vlans.count() == 0:
raise ImproperlyConfigured("Missin... | jpardobl/naman | naman/core/mappings/vlan_actions.py | vlan_actions.py | py | 2,859 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "naman.core.models.VLan.objects.filter",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "naman.core.models.VLan.objects",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "naman.core.models.VLan",
"line_number": 8,
"usage_type": "name"
... |
16257468366 | import re
import pytest
from morphocut import Pipeline
from morphocut.file import Find, Glob
@pytest.mark.parametrize("sort", [True, False])
@pytest.mark.parametrize("verbose", [True, False])
def test_Find(data_path, sort, verbose, capsys):
d = data_path / "images"
with Pipeline() as pipeline:
filen... | morphocut/morphocut | tests/test_file.py | test_file.py | py | 770 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "morphocut.Pipeline",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "morphocut.file.Find",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametr... |
19886899760 | import os
import pytest
from pendulum import datetime
from pathlib import Path
from hypothesis_trio.stateful import (
initialize,
rule,
run_state_machine_as_test,
TrioAsyncioRuleBasedStateMachine,
)
from hypothesis import strategies as st
from guardata.client.types import EntryID, LocalFileManifest, Ch... | bitlogik/guardata | tests/client/fs/workspacefs/test_file_transactions.py | test_file_transactions.py | py | 10,393 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "pendulum.datetime",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "guardata.client.types.LocalFileManifest.new_placeholder",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "guardata.client.types.LocalFileManifest",
"line_number": 50,
"u... |
74530690747 | #!/usr/bin/env python3
"""antipatibot, discord server."""
import asyncio
import logging
import os
import secrets
from dataclasses import dataclass
import discord
from discord.ext import commands
import yt_dlp as youtube_dl
youtube_dl.utils.bug_reports_message = lambda: ''
ytdl_format_options = {
'format': 'besta... | antipatico/antipatibot | antipatibot.py | antipatibot.py | py | 14,449 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "yt_dlp.utils",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "yt_dlp.YoutubeDL",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "discord.PCMVolumeTransformer",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "... |
69877253629 | import torch
from torch import nn
import yaml
import cv2
import numpy as np
from vidgear.gears import CamGear
from matplotlib import pyplot as plt
from IPython.display import Image, clear_output
import argparse
import os
import datetime
import sys
from PIL import ImageFont, ImageDraw, Image
import time
from pathlib imp... | yeonsoo98/yolov5_object_count | detect.py | detect.py | py | 5,852 | python | ko | code | 0 | github-code | 6 | [
{
"api_name": "torch.load",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": ... |
42557211122 | import numpy
from PIL import Image
def histogram(img):
image_gray = img.convert('L')
killy = numpy.array(image_gray)
maximum = numpy.max(killy)
minimum = numpy.min(killy)
dim = maximum - minimum + 1
hist, bins = numpy.histogram(killy, bins=dim)
return hist
image1 = Image.open("image1.jpg... | jouhaina-nasri/Project-Indexation | TP Indexation/Histogramme/app.py | app.py | py | 2,290 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.max",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.min",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.histogram",
"line_number": 11,... |
28427138730 | from smtplib import SMTP
from email.header import Header
from email.mime.text import MIMEText
def main():
# 请自行修改下面的邮件发送者和接收者
sender = 'sunhui@zhongfu.net'
receivers = ['1161186762@qq.com', 'daersunhui@gmail.com']
message = MIMEText('用Python发送邮件的示例代码.', 'plain', 'utf-8')
message['From'] = Header('... | sunhuimoon/Python100Days | day14/day1403.py | day1403.py | py | 772 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "email.mime.text.MIMEText",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "email.header.Header",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "email.header.Header",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "emai... |
38907343805 | from sqlalchemy.exc import IntegrityError
from sqlalchemy import select
from sqlalchemy.orm import selectinload
from app.core.repo.base import BaseSqlalchemyRepo
from app.core.exceptions.repo import RepoException
from .models import Review
class ReviewRepo(BaseSqlalchemyRepo):
model = Review
async def create... | rasimatics/excursio-backend | app/apps/review/repo.py | repo.py | py | 1,901 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "app.core.repo.base.BaseSqlalchemyRepo",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "models.Review",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.exc.IntegrityError",
"line_number": 18,
"usage_type": "name"
},
{
"... |
71316404667 | import requests
from bs4 import BeautifulSoup
import json
def get_pinned(github_user):
URL = f"https://github.com/{github_user}"
page = requests.get(URL)
soup = BeautifulSoup(page.content, "html.parser")
pinned_data = soup.find_all("div", {"class": "pinned-item-list-item-content"})
pinned_posts = ... | HectorPulido/HectorPulido | ReadmeGenerator/scraper.py | scraper.py | py | 3,744 | python | en | code | 10 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"li... |
18100363274 | """
1143. Longest Common Subsequence
https://leetcode.com/problems/longest-common-subsequence/
"""
from typing import Dict, List, Tuple
from unittest import TestCase, main
class Solution:
def longestCommonSubsequence(self, text1: str, text2: str) -> int:
"""
This is a classic DP problem
te... | hirotake111/leetcode_diary | leetcode/1143/solution.py | solution.py | py | 1,955 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "unittest.TestCase",
"line_number": 41,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "unittest.main",
"line_... |
25218471687 | from django.db import models
from article.models import Article
from users.models import User
from ckeditor.fields import RichTextField
from mptt.models import MPTTModel, TreeForeignKey
# Create your models here.
class Comment(MPTTModel):
article = models.ForeignKey(Article, on_delete=models.CASCADE)
user = models.Fo... | MenGG6/personal-blog | comment/models.py | models.py | py | 824 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "mptt.models.MPTTModel",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "article.models",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.db.models.ForeignKey",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "article... |
34045997209 | from faster_rcnn.config import cfg, get_output_dir
import argparse
from utils_py3.timer import Timer
import numpy as np
import cv2
from utils_py3.cython_nms import nms
# from utils_py3.boxes_grid import get_boxes_grid
import pickle
# import heapq
from utils_py3.blob_helper import im_list_to_blob
import os
import math... | hx121071/faster-rcnn-tf-py3 | lib/faster_rcnn/test.py | test.py | py | 8,840 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "numpy.float32",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "faster_rcnn.config.cfg.PIXEL_MEANS",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "faster_rcnn.config.cfg",
"line_number": 36,
"usage_type": "name"
},
{
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.