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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
22878649457 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import random
try:
from urllib.parse import quote, unquote
except ImportError:
from urllib import quote, unquote, urlopen
import hashlib
import os
from django.db.models import Q
from future.builtins import str
from collections import defaultdic... | back1992/fireaws | web/frontend/templatetags/myfilters.py | myfilters.py | py | 11,734 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "mezzanine.template.Library",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "mezzanine.template",
"line_number": 36,
"usage_type": "name"
},
{
"... |
28949062163 | import cv2
import numpy as np
# 读取图像
img = cv2.imread('image.jpg')
# 转换为灰度图像
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
# 维纳滤波
ksize = 5 # 滤波器大小
sigma = 1 # 高斯核标准差
snr = 0.5 # 信噪比
h = int(sigma * snr * 255) ** 2 # 维纳滤波参数
filtered = cv2.fastNlMeansDenoising(gray, h=h, templateWindowSize=ksize, searchWindowSize=ksiz... | pksolar/sailus | bleeding/img_process/winner_opencv.py | winner_opencv.py | py | 509 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "cv2.imread",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "cv2.fastNlMeansDenoising... |
72160617014 | from collections import defaultdict
def run(n, an):
_an = sorted(list(set(an)))
d = {}
l = len(_an)
for i,e in enumerate(_an):
d[e] = l-(i+1)
ans = defaultdict(int)
for e in an:
ans[d[e]] += 1
for i in range(n):
print(ans[i])
if __name__ == '__main__':
... | NozomiTakiguchi/atcoder | src/ABC273/c.py | c.py | py | 394 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.defaultdict",
"line_number": 10,
"usage_type": "call"
}
] |
33477534684 | # python3
from collections import namedtuple
from itertools import combinations
from math import sqrt
from random import randint
Point = namedtuple('Point', 'x y')
def distance_squared(first_point, second_point):
return (first_point.x - second_point.x) ** 2 + (first_point.y - second_point.y) ** 2
def minimum_d... | Wei-Mao/Assignments-for-Algorithmic-Toolbox | Divide-and-Conquer/Closest Points/closest_points.py | closest_points.py | py | 2,867 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.namedtuple",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "itertools.combinations",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "random.ra... |
32218541963 |
""" Contains code for displaying data """
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
import numpy as np
def displayWindMapPlot(vdata,udata, lons, lats,):
""" TODO add a docstring! """
#plt.clf()
#pc = plt.contourf(lons, lats, data, 20)
#plt.colorbar(pc, orientation='hori... | chiluf/Environmental-Data-Exploration-Visualization | plotting.py | plotting.py | py | 4,935 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "mpl_toolkits.basemap.Basemap",
"line_number": 20,
"usage_type": "call"
},
{
"api_nam... |
39180447488 | # %% libraries
from gensim.models.phrases import Phrases, ENGLISH_CONNECTOR_WORDS
# %% train a toy phrase model on our training corpus
def extract_ngrams(tkn_docs):
"""[summary]
Args:
tkn_docs ([type]): [description]
common_terms ([type]): [description]
"""
bigrams = Phrases(
... | simoneSantoni/DrSnow | workingPapers/santoni-sieweke-zhou-nes/companionCode/nlp/dataTransformation/ngrams.py | ngrams.py | py | 711 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "gensim.models.phrases.Phrases",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "gensim.models.phrases.ENGLISH_CONNECTOR_WORDS",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "gensim.models.phrases.Phrases",
"line_number": 19,
"usage_typ... |
42305181165 | #!/usr/bin/env python
# coding: utf-8
import traceback
import functools
import os
import operator
import threading
import multiprocessing as mp
import numpy as np
from multiprocessing import shared_memory
def gen_name(name, suffix = None) :
shm_name = '{}_{}_{}'.format(
name, os.getpid(), threading.curr... | YellowOldOdd/SDBI | SimpleDBI/shm_handler.py | shm_handler.py | py | 1,401 | python | en | code | 142 | github-code | 21 | [
{
"api_name": "os.getpid",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "threading.currentThread",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "functools.reduce",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "operator.mul",
... |
36636600570 | import time
import datetime
import constants
from game.casting.actor import Actor
from game.scripting.action import Action
from game.shared.point import Point
class Timer():
def __init__(self):
self._now = datetime.datetime.now()
self._later = datetime.datetime.now()
self._diff_delta = sel... | FairlyFormal/CSE210-Group3-Wint22 | zorldo/zorldo/game/scripting/timer.py | timer.py | py | 2,436 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "datetime.datetime.now",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.now",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "da... |
34136022385 | import rclpy
from rclpy.node import Node
from std_msgs.msg import String
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
from vision_msgs.msg import Classification2D, ObjectHypothesis
from classification_service.srv import GetClassification
import sys
import cv2
import time
import numpy... | comau-na/edo-ROS2 | ROS2/edo_calibration/edo_calibration/edo_scan.py | edo_scan.py | py | 6,045 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "rclpy.node.Node",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "sensor_msgs.msg.Image",
"line_number": 38,
"usage_type": "argument"
},
{
"api_name": "cv_bridge.CvBridge",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "cv_bridg... |
24946261463 | import numpy as np
import cv2
# Camera 0 is the integrated web cam on my netbook
camera_port = 0
#Number of frames to throw away while the camera adjusts to light levels
ramp_frames = 30
# Now we can initialize the camera capture object with the cv2.VideoCapture class.
# All it needs is the index to a camera port.... | MurphyTech/OpenCV | Exploration/FaceDetect/faceDetectPicture.py | faceDetectPicture.py | py | 1,523 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.CascadeClassifier",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "cv2.CascadeClassifier",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "cv2.cvtC... |
12579158543 | import argparse
import glob
import numpy as np
import os
import matplotlib.pyplot as plt
def render(x, y, t, p, shape):
img = np.full(shape=shape + [3], fill_value=255, dtype="uint8")
img[y, x, :] = 0
img[y, x, p] = 255
return img
if __name__ == "__main__":
parser = argparse.ArgumentParser("""Gen... | uzh-rpg/rpg_vid2e | viz_events.py | viz_events.py | py | 950 | python | en | code | 254 | github-code | 21 | [
{
"api_name": "numpy.full",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_... |
42825932803 | import hashlib
import threading
from pathlib import Path
from pywebio import *
from pgpl.advance_page import AdvancePage
from pgpl.console import *
from pgpl.webio_utils import *
from pgpl.managers import *
class ShowProcess():
PROCESSBAR_PYTHON_MANAGER = AN()
PROCESSBAR_STAGE = AN()
SCOPE_PROGRESS... | infstellar/python-git-program-launcher | pgpl/pages.py | pages.py | py | 35,074 | python | en | code | 93 | github-code | 21 | [
{
"api_name": "threading.Thread",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "pgpl.advance_page.AdvancePage",
"line_number": 102,
"usage_type": "name"
},
{
"api_name": "pgpl.advance_page.AdvancePage.__init__",
"line_number": 121,
"usage_type": "call"
},
... |
74518101812 | import requests
from bs4 import BeautifulSoup
import pprint
import re
import pandas as pd
import json
import states
pd.set_option('display.max_rows', 500)
pd.set_option('display.max_columns', 500)
pd.set_option('display.width', 1000)
def celc(f):
'''Convert fahrenheit to celcius'''
return (f - 32) * 5.0 / 9.0... | JakubPluta/Scrapers-Projects | Weather.gov Scraper/Weather.py | Weather.py | py | 2,546 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.set_option",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "requests.get",
... |
73033692213 | #!/usr/bin/env python
# encoding: utf-8
"""
@version: ??
@author: liangliangyy
@license: MIT Licence
@contact: liangliangyy@gmail.com
@site: https://www.lylinux.org/
@software: PyCharm
@file: context_processors.py
@time: 2016/11/6 下午4:23
"""
from .models import Category, Article, Tag
from django.conf import settings
... | LiuFang816/SALSTM_py_data | python/liangliangyy_DjangoBlog/DjangoBlog-master/blog/context_processors.py | context_processors.py | py | 1,398 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "DjangoBlog.utils.cache.get",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "DjangoBlog.utils.cache",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "DjangoBlog.utils.logger.info",
"line_number": 25,
"usage_type": "call"
},
{
"ap... |
40174125595 | import argparse
import spacy
from spacy.util import compile_infix_regex
nlp = spacy.load('en_core_web_sm', disable=['parser', 'ner'])
all_stopwords = nlp.Defaults.stop_words
def get_concreteness():
con = {}
with open(args.concrete_file, 'r') as c:
for line in c:
line = line.strip().split('... | ruisi-su/concrete_dep | data/proc_data/align.py | align.py | py | 4,740 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "spacy.load",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "spacy.util.compile_infix_regex",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 107,
"usage_type": "call"
},
{
"api_name": "spa... |
16713045718 | from django.db import models
class Task(models.Model):
Category=[("l", 'Библиотека'),("5", '5класс'),("6", '6класс'),("8", '8класс'),('9', '9класс'),\
("7", '7класс'),("10", '10класс'),("11", "11класс")]
article_type = models.CharField(max_length=2, choices=Category, default='l')
title = mode... | Medvedeva-J/mathLite-clone | myfirst/main/models.py | models.py | py | 615 | python | ru | code | 0 | github-code | 21 | [
{
"api_name": "django.db.models.Model",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "... |
32712740607 | import os
import sys
import re
import gc
from subprocess import Popen, PIPE
from nltk.internals import find_binary
from nltk.tag.api import TaggerI
_opennlp_languages = ['da', 'de', 'en', 'es', 'nl', 'pt', 'se']
class OpenNLPTagger(TaggerI):
def __init__(self, path_to_bin=None, path_to_model=None, language='en',... | paudan/opennlp_python | nltk_opennlp/taggers.py | taggers.py | py | 2,855 | python | en | code | 27 | github-code | 21 | [
{
"api_name": "nltk.tag.api.TaggerI",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "os.path",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "sys.platform.startswith",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "sys.platfor... |
12233563568 | #!/usr/bin/python3
"""A recursive function that returns a list
containing the titles of all hot articles
for a given subreddit."""
import requests
def recurse(subreddit, hot_list=[]):
"""quering the reddit api recursively"""
if subreddit is None and not isinstance(subreddit, str):
return 0
... | Patrick-052/alx-system_engineering-devops | 0x16-api_advanced/2-recurse.py | 2-recurse.py | py | 824 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 17,
"usage_type": "call"
}
] |
5183181082 | import json
from blue_ros2_bridge.util import BaseNode
from std_msgs.msg import Float64
import rclpy
from rclpy.node import Node
import zmq
class ServoCommander(BaseNode):
def __init__(self, node):
super().__init__(node)
servo_count = self.get_parameter('servos_count', default=8)
ser... | merose/blue_ros2_bridge | blue_ros2_bridge/servo_commander.py | servo_commander.py | py | 1,850 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "blue_ros2_bridge.util.BaseNode",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "zmq.Context",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "zmq.PUB",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "std_msgs.msg.... |
27710744967 | import typed_ast.ast3 as ast
from typing import Union, Tuple
from moz_sql_parser import ast_nodes
import pyarrow as pa
from .BaseTransform import BaseTransform
from fletcherfiltering import settings
from fletcherfiltering.common import debug
from ..exceptions import *
from .helpers import grouped
import copy
class Con... | abs-tudelft/FletcherFiltering | src/fletcherfiltering/codegen/transformations/ConstantPropagationTransform.py | ConstantPropagationTransform.py | py | 8,863 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "BaseTransform.BaseTransform",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "pyarrow.Schema",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "copy.deepcopy",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "copy.de... |
35690880048 | # -*- coding: utf-8 -*-
"файл для работы с базой"
from models import InstLocations, db_session
from sqlalchemy.exc import OperationalError, IntegrityError
def db_add(location_id, location_name, lttd, lngt, owner_id, post_id,
caption, picture, comments_count, likes_count):
'Функция для добавления данных... | xalpy/instaloc | work.py | work.py | py | 676 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "models.InstLocations",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "models.db_session.add",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "models.db_session",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "models.db... |
32695960476 | # coding:utf-8
from PySide6.QtCore import Qt
from PySide6.QtWidgets import QWidget, QStackedWidget, QVBoxLayout, QHBoxLayout, QLabel
from qfluentwidgets import TabBar, TabCloseButtonDisplayMode, qrouter, FluentIcon
from app.components.table_frame import TableFrame
style = """
PivotInterface QLabel,
TabInterface QLabe... | HentaiMikuy/MikuScanner | app/components/table_bar.py | table_bar.py | py | 4,358 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "PySide6.QtWidgets.QWidget",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "PySide6.QtWidgets.QVBoxLayout",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "PySide6.QtWidgets.QWidget",
"line_number": 54,
"usage_type": "call"
},
{
... |
5158161394 | """Use the hdf5 data to create pre-processed features."""
# import argparse
# import pickle
# import cPickle as pickle
import sys
import numpy
# from scipy import signal
import helpers.paths as paths
import helpers.git_helper as git_helper
import os
import h5py
import gflags
# from sklearn.decomposition import Incremen... | iskwak/DetetctingActionStarts | helpers/create_base_hantman_hdf.py | create_base_hantman_hdf.py | py | 8,081 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "gflags.DEFINE_string",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "gflags.DEFINE_string",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "gflags.FLAGS",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "helpers.a... |
18224352185 | import unittest
import logging
import sys
from gi.repository import Gtk
sys.path.append('../../src')
sys.path.append('../../src/GrampsLogger')
logger = logging.getLogger('Gramps.Tests.GrampsLogger')
import const
const.rootDir = "../../src"
from GrampsLogger import GtkHandler, RotateHandler
class GtkHandlerTest(un... | arunkgupta/gramps | test/GrampsLogger/GtkHandler_Test.py | GtkHandler_Test.py | py | 1,183 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "sys.path.append",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_numbe... |
26720948703 | import logging
from flask import request
from flask_restplus import Resource
from celery import states
from celery.result import AsyncResult
from sample2.api.math.serializers import math_job
from sample2.api.restplus import api
from sample2.back import backapp
log = logging.getLogger(__name__)
ns = api.namespace('mat... | StudioEtrange/celery-flask-samples | sample2/api/math/endpoints/jobs.py | jobs.py | py | 3,650 | python | en | code | 10 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sample2.api.restplus.api.namespace",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sample2.api.restplus.api",
"line_number": 12,
"usage_type": "name"
},
{
"api... |
41404609514 | #
# Common code for Kodi related stuff
#
import xbmc, xbmcaddon
import pickle
import os
import errno
import hue
import huecontrol
import json
ADDON_ID = 'service.huecontrol'
__addon__ = xbmcaddon.Addon(id=ADDON_ID)
__addonpath__ = xbmc.translatePath(__addon__.getAddonInfo('path')).decode("utf-8") # Translate path ... | mvdwetering/service.huecontrol | xbmccommon.py | xbmccommon.py | py | 4,332 | python | en | code | 14 | github-code | 21 | [
{
"api_name": "xbmcaddon.Addon",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "xbmc.translatePath",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_n... |
27813241948 | from sklearn.datasets import load_boston
from sklearn.neighbors import KNeighborsRegressor
from sklearn.externals import joblib
if __name__ == '__main__':
boston = load_boston()
X = boston.data
y = boston.target
model = KNeighborsRegressor()
model.fit(X, y)
joblib.dump(model, '../models/model... | gitter-badger/Skater | examples/python-deployed-model/bin/train.py | train.py | py | 327 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sklearn.datasets.load_boston",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sklearn.neighbors.KNeighborsRegressor",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sklearn.externals.joblib.dump",
"line_number": 13,
"usage_type": "call"... |
20280674350 | # References:
# GPIO → https://sourceforge.net/p/raspberry-gpio-python/wiki/PWM/
# sudo apt-get install rpi.gpio Does not workon
# pip install RPi.GPIO For python 2.7
# pip3 install RPi.GPIO For python 3.... | 2020dataanalysis/Sentinel | ftp_snapshot.py | ftp_snapshot.py | py | 4,057 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "os.path.exists",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number":... |
13673848655 | import csv
import sys
import os
import math
from datetime import datetime
from pytz import timezone
# with open('eggs.csv', newline='') as csvfile:
# spamreader = csv.reader(csvfile, delimiter=' ', quotechar='|')
# for row in spamreader:
# print(', '.join(row))
#
# with open('names.csv', 'w', newline='... | jahn122/trust | data_processor.py | data_processor.py | py | 5,023 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "math.floor",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "math.ceil",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "math.floor",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "csv.DictWriter",
"line_number": 3... |
17521848014 | from pynput import keyboard
def on_press(key):
print(key)
# print(key.char)
# print(key.vk)
# if key.vk == 97:
# print('a')
print(type(key))
with keyboard.Listener(on_press=on_press) as listener:
listener.join() | Leon-Shang/tools | note_relevant/keyboard.py | keyboard.py | py | 246 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pynput.keyboard.Listener",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pynput.keyboard",
"line_number": 11,
"usage_type": "name"
}
] |
23134054282 | # -*- coding:utf-8 -*-
# @Author : Cheng
# @Time : 2022/1/12 10:08
from typing import List
class Solution:
def increasingTriplet(self, nums: List[int]) -> bool:
l = len(nums)
if l < 3 or len(set(nums)) < 3:
return False
first, second = nums[0], float('inf')
for i in ran... | chengcct/Algorithmic-exercises | leetcode/334. 递增的三元子序列.py | 334. 递增的三元子序列.py | py | 626 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "typing.List",
"line_number": 8,
"usage_type": "name"
}
] |
11808298774 | import torch
import torch.nn as nn
import torch.nn.functional as F
class TextCnnModel(nn.Module):
def __init__(self, config, vocab_size=None, word_vectors=None):
super(TextCnnModel, self).__init__()
self.config = config
self.vocab_size = vocab_size
self.word_vectors = word_vectors
... | NeuSyz/NLP-Learning | NLP-文本分类/code/text_classifier_torch/models/textcnn.py | textcnn.py | py | 1,261 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "torch.nn.Module",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.nn.Embedding.from_pretrained",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.... |
38718292216 | import telebot
from data_base import DataServer
with DataServer() as db:
query = f"SELECT * FROM telegram_data"
mycursor = db.cursor()
mycursor.execute(query)
for i in mycursor:
token, chat_id = i[0], i[1]
bot = telebot.TeleBot(token)
chat_id = chat_id
def alert_message(name, price, percent,... | yevhenii-memruk/UpworkProjects | PriceChecker project/main/telegram_alarm.py | telegram_alarm.py | py | 845 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "data_base.DataServer",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "telebot.TeleBot",
"line_number": 11,
"usage_type": "call"
}
] |
7186112217 | import json
from collections.abc import Callable, Iterable
from typing import Any, TypeVar, overload
from typing_extensions import Literal
from django.db.models import lookups
from django.db.models.expressions import Combinable
from django.db.models.lookups import PostgresOperatorLookup, Transform
from . import Field... | blakeNaccarato/pylance-stubs-unofficial | django-stubs/db/models/fields/json.pyi | json.pyi | pyi | 7,055 | python | en | code | 5 | github-code | 21 | [
{
"api_name": "typing.TypeVar",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "typing.Any",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "mixins.CheckFieldDefaultMixin",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "django.db.mod... |
878500507 | # coding: utf-8
from __future__ import absolute_import
from flask import json
from six import BytesIO
from rsvp_server.models.error import Error # noqa: E501
from rsvp_server.models.invitation import Invitation # noqa: E501
from rsvp_server.test import BaseTestCase
class TestDefaultController(BaseTestCase):
... | aaronlauterer/rsvp-backend | flask-server/rsvp_server/test/test_default_controller.py | test_default_controller.py | py | 2,129 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "rsvp_server.test.BaseTestCase",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "rsvp_server.models.invitation.Invitation",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "flask.json.dumps",
"line_number": 25,
"usage_type": "call"
},
... |
3485597572 | """
Created on Aug 28, 2018
@author: mjasnik
"""
# import section
import dbus
import time
from gi.repository import GLib
# timekpr imports
from timekpr.common.constants import constants as cons
from timekpr.common.log import log
from timekpr.common.utils import misc
class timekprUserLoginManager(object):
"""Cl... | polesapart/timekpr-next | server/interface/dbus/logind/manager.py | manager.py | py | 18,484 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "timekpr.common.log.log.log",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "timekpr.common.log.log",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "timekpr.common.constants.constants.TK_LOG_LEVEL_INFO",
"line_number": 23,
"usage_type":... |
22875703991 | #! /usr/bin/env python
#-*- coding: utf-8 -*-
import sys, string
import re, pprint
import codecs
import glob
import json
import datetime
from dateutil.relativedelta import *
import matplotlib
matplotlib.use("Agg")
import matplotlib.dates as dates
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
X = []
Y... | shimizu-hayato/niconico | coment_view.py | coment_view.py | py | 1,674 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "matplotlib.use",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "datetime.datetim... |
28479476853 | """
Various one-off functions that are imported to the trm.utils
top level.
"""
import numpy as np
from scipy import interpolate
from scipy.optimize import brentq
from astropy.time import Time
from astropy.coordinates import SkyCoord, EarthLocation
import astropy.units as u
__all__ = (
'centroid', 'splfit', 'sty... | trmrsh/trm-utils | trm/utils/core.py | core.py | py | 11,851 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.power",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "numpy.power",
"line_number": 83,
... |
6244109098 | import re
import os
import six
import sys
import yaml
import types
import inspect
import logging
import threading
import traceback
from six.moves.queue import Queue
from collections import defaultdict
from functools import reduce, partial
from syn.globals import test_logger
#-------------------------------------------... | mbodenhamer/syn | syn/base_utils/py.py | py.py | py | 15,179 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "six.moves",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "six.PY2",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "types.MethodType",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "types.BuiltinMethod... |
18239365161 | from collections import deque
n, m, l = map(int, input().split())
a = [list(map(int, list(input()))) for _ in range(n)]
d = [[[[0] * 2] * (l+1) for _ in range(m)] for _ in range(n)]
night = 0
q = deque()
q.append((0, 0, 0, night))
dx = [0, 0, 1, -1]
dy = [1, -1, 0, 0]
d[0][0][0][0] = 1
while q:
x, y, z, night =... | yeonnseok/ps-algorithm | 2019 baekjoon/Graph/16933_wallbreaking3.py | 16933_wallbreaking3.py | py | 1,113 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "collections.deque",
"line_number": 8,
"usage_type": "call"
}
] |
9697703342 | # -*- coding: utf-8 -*-
"""
Created on Sat Jan 07 17:51:08 2017
@author: xiaomuliu
"""
from GroupData import group_temporal_data
from datetime import datetime
import cPickle as pickle
import re
import sys
sys.path.append('..')
from Misc.ComdArgParse import ParseArg
args = ParseArg()
inpat... | xiaomuliu/SpatioTemporalPredictiveModeling | StructureData/GroupWeatherData.py | GroupWeatherData.py | py | 1,268 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "sys.path.append",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "Misc.ComdArgParse.ParseArg",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "re.match",
... |
10387653203 | import numpy as np
import skimage.io as io
import matplotlib.pyplot as plt
import scipy.ndimage as ndi
c = io.imread('C://Users//kamel//Music//misc//7.2.01.tiff')
plt.subplot(2,2,1)
plt.imshow(c)
c=c.astype('bool')*1
c2=np.pad(c,[1,1],mode='constant').astype('float64')
c2[np.where(c2==0)]=float('inf')
c2[np.where(c2... | KameliaZaman/DIP-Lab | RnD/distanceMetric.py | distanceMetric.py | py | 687 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "skimage.io.imread",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "skimage.io",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.subplot",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot... |
39904643912 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import requests
import json
import time
import copy
from thirdparty.douyin import douyin_headers
from thirdparty.douyin.urls import Urls
from thirdparty.douyin.result import Result
from thirdparty.common import utils
class DouyinApi(object):
def __init__(se... | opennaslab/kubespider | downloaders/tiktok-dlp/app/thirdparty/douyin/douyinapi.py | douyinapi.py | py | 14,939 | python | en | code | 1,636 | github-code | 21 | [
{
"api_name": "thirdparty.douyin.urls.Urls",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "thirdparty.douyin.result.Result",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 25,
"usage_type": "call"
},
{
"api_name":... |
4912042533 | """empty message
Revision ID: 342231b35e42
Revises: d3b3a568f57e
Create Date: 2021-06-10 22:07:08.724732
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '342231b35e42'
down_revision = 'd3b3a568f57e'
branch_labels = None
depends_on = None
def upgrade():
# ... | fquintana93/evaluador | migrations/versions/342231b35e42_.py | 342231b35e42_.py | py | 1,108 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "alembic.op.batch_alter_table",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.TEXT",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "alembic.op.ba... |
23484356842 | from __future__ import print_function
import sys
import json
import os
import boto3
import botocore.exceptions
import lambda_mgn_template
import lambda_mgn_launch
import logging
import multiprocessing
from botocore import config
from policy import MFAuth
MGN_ACTIONS = [
'Validate Launch Template',
'Launch Test... | aws-solutions/cloud-migration-factory-on-aws | source/integrations/mgn/lambdas/lambda_mgn.py | lambda_mgn.py | py | 23,040 | python | en | code | 54 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
... |
70567549173 | import numpy as np
import cv2
red, blue, cyan = (0,0,255), (255,0,0), (255,255,0)
white, black = (255,255,255), (0,0,0)
image = np.full((300, 700, 3), white, np.uint8) # 가로 700 세로 300 캔버스 생
center = (image.shape[1]//2,image.shape[0]//2)
center1 = (image.shape[1] - 60 //2,image.shape[0]//2)
center2 = ((image.shape[1... | ch0ijihwan/Image_Processing | 0403_5/training_chap04/num_18.py | num_18.py | py | 1,147 | python | ko | code | 0 | github-code | 21 | [
{
"api_name": "numpy.full",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "cv2.ellipse",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.ellipse",
"line_number"... |
29141951301 | import serial
import time
def read_serial_data(port, baudrate=115200, timeout=1):
while True:
try:
# 시리얼 포트 연결
ser = serial.Serial(port, baudrate, timeout=timeout)
print("Connected to", port)
# 데이터 읽기
while True:
try:
... | WKDev/sid-uwln-v3 | fw_check.py | fw_check.py | py | 754 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "serial.Serial",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "serial.SerialException",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "time.sleep",
"line_number": 21,
"usage_type": "call"
}
] |
41929711052 | #!/usr/bin/python3
"""
This class script a state that contain "a"
in database using ORM
"""
from sys import argv
from model_state import Base, State
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
if __name__ == "__main__":
"""
Access the database and listing the state
"""
... | MrkielCode/alx-higher_level_programming | 0x0F-python-object_relational_mapping/9-model_state_filter_a.py | 9-model_state_filter_a.py | py | 707 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.orm.sessionmaker",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "model_s... |
6108226434 | from rest_framework import viewsets, permissions
from .models import Amenity, Hotel, Room, Booking, HotelAmenity, Client
from . import serializers, config, forms
from django.shortcuts import render, redirect
from django.core.validators import validate_email
from django.urls import reverse
from django.db import models, ... | annashutova/django_hotels | hotels/hotels_app/views.py | views.py | py | 15,268 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.db.models.Model",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "rest_framework.viewsets.ModelViewSet",
"line_number": 25,
"usage_type": "attribute"
},
{... |
9120222035 | import warnings
from collections import OrderedDict
from distutils.version import LooseVersion
import numpy as np
from . import dtypes, duck_array_ops, utils
from .dask_array_ops import dask_rolling_wrapper
from .ops import (
bn, has_bottleneck, inject_coarsen_methods,
inject_bottleneck_rolling_methods, injec... | timothyyu/ml_monorepo | xarray/xarray/core/rolling.py | rolling.py | py | 19,677 | python | en | code | 59 | github-code | 21 | [
{
"api_name": "ops.has_bottleneck",
"line_number": 54,
"usage_type": "name"
},
{
"api_name": "distutils.version.LooseVersion",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "ops.bn.__version__",
"line_number": 55,
"usage_type": "attribute"
},
{
"api_nam... |
10769235161 | import os
import pandas as pd
import requests
from bs4 import BeautifulSoup
def extract_article_text(url, url_id):
try:
response = requests.get(url)
response.raise_for_status()
soup = BeautifulSoup(response.content, 'html.parser')
# Remove unwanted elements like head... | Utsav-x/Blackcoffer_assignment_data-engineer | extract_articles.py | extract_articles.py | py | 1,915 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.read_excel",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
... |
5448358676 | from tkinter import *
from tkinter.messagebox import *
import tkinter.messagebox
import sqlite3
from datetime import datetime
import os
import calendar
self_directory = os.path.dirname(os.path.abspath(__file__))
def calculate_rent_cost(pick_up_date, drop_off_date):
cost_of_day = 40
cost_for_month = 400
... | kolyasalubov/UA-12-10-23.PythonFundamentals | VHanna/Final Project/carrental.py | carrental.py | py | 10,000 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "os.path.dirname",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime"... |
21631102867 | import os, sys
import shutil
import subprocess
from zipfile import ZipFile
from urllib import request
from urllib.parse import unquote
from configparser import RawConfigParser
from threading import Thread
from .dosbox import get_dosbox_path
DOSBOX = get_dosbox_path()
class Game:
def __init__(self, path):
... | rtts/ialauncher | ialauncher/game.py | game.py | py | 7,070 | python | en | code | 66 | github-code | 21 | [
{
"api_name": "dosbox.get_dosbox_path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.basename",
... |
36000609247 | #import argparse
import collections
from datetime import datetime
import hashlib
import os.path
import random
import re
import sys
#import tarfile
import tensorflow as tf
#from tensorflow.python.framework import graph_util
#from tensorflow.python.framework import tensor_shape
from tensorflow.python.platform import gfi... | cy5e/lm_proj | create_image_lists.py | create_image_lists.py | py | 1,665 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "tensorflow.python.platform.gfile.Exists",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "tensorflow.python.platform.gfile",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "tensorflow.logging.error",
"line_number": 23,
"usage_type": "cal... |
23023374056 | # Databricks notebook source
# MAGIC %md
# MAGIC # Extract Model Lifecycle Information into Delta Lake
# COMMAND ----------
from pyspark.sql.types import *
from pyspark.sql.functions import *
from delta.tables import *
import json, datetime, os, sys, pickle
import mlflow
import requests
import pandas as pd
# COMMAND... | mpfis/unified-ml-monitoring-on-databricks | Lab/02-ETL-Model-Metrics-to-Delta.py | 02-ETL-Model-Metrics-to-Delta.py | py | 9,370 | python | en | code | 12 | github-code | 21 | [
{
"api_name": "mlflow.get_experiment_by_name",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "json.loads",
... |
6132899111 | import json
import sys
class Bounds:
def __init__(self):
self.minlat = 43.591495
self.minlon = -79.650423
self.maxlat = 43.909681
self.maxlon = -79.12274
def scale(self, point):
x = (point['lon'] - self.minlon) / (self.maxlon - self.minlon)
y = 1 - (point['lat']... | edkins/bus_map | setup/osm_svg.py | osm_svg.py | py | 814 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "json.load",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 20,
"usage_type": "attribute"
}
] |
73287304692 | '''
@author: Alister Maguire
Basic test for the IOManager object.
'''
import os
import argparse
import sys
#python doesn't allow fo importing modules from other
#directories, so I'm bypassing this.
curpth = os.path.dirname(os.path.abspath(__file__))
targetpth1 = curpth + '/../../src/'
targetpth2 = curpth + '/../... | garetroy/TeamBuilder2.0 | test/tests/iotest1.py | iotest1.py | py | 1,053 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "os.path.dirname",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.path.insert",
"l... |
31237410280 | import os
import json
from flask import Flask, request, jsonify
from flask import Blueprint, abort
from flask_sqlalchemy import SQLAlchemy
from flask_jwt_extended import *
from libs import db, services, schemas
from . import services as svc, schemas as sch
# from apps import jwt
blueprint = Blueprint('doctor', __... | nugrahari/Belajar-Flask-API | api/app/apps/app_doctor/main.py | main.py | py | 2,379 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Blueprint",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "libs.db.session",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "libs.db",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "json.dumps",
"line_number... |
9775142979 | from django.shortcuts import render, redirect
from django.contrib.auth.models import User
from django.http import HttpResponse
from django.core.mail import send_mail
from django.conf import settings
from isoconsult.models import Contact
#ฟังก์ชัน HomePage
def HomePage(request):
all_contact = Contact.objects.all()
... | Tyne14x/Tyne14x-ISOconsultOnline | isoconsult/views.py | views.py | py | 5,411 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "isoconsult.models.Contact.objects.all",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "isoconsult.models.Contact.objects",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "isoconsult.models.Contact",
"line_number": 10,
"usage_type":... |
37405381225 | from __future__ import print_function
import distutils.core
import json
import mock
import os
import pkg_resources
import runpy
import setuptools
import sys
import types
def ensure_list(obj):
result = []
for pkg in pkg_resources.parse_requirements(obj):
result.append({
'name': pkg.key,
... | crepererum/eprc | eprc/extractors/setup_py.py | setup_py.py | py | 3,532 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pkg_resources.parse_requirements",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "mock._is_magic",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "mock.MagicMock",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name... |
20763478334 | import seaborn as sns
import matplotlib.pyplot as plt
# Measurement of different flowers
iris = sns.load_dataset('iris')
print(iris.head())
# Pair Grid
g = sns.PairGrid(iris)
# Plot a scatter plot on the created grid
# g.map(plt.scatter)
# Plot dist plots on grid
g.map_diag(sns.distplot)
g.map_upper(plt.scatter)
g... | Hereiam123/Python-Data-Excercises | Data Visualization with Seaborn/Seaborn Grids.py | Seaborn Grids.py | py | 591 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "seaborn.load_dataset",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "seaborn.PairGrid",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "seaborn.distplot",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "matplotlib... |
42062150512 | #Import the necessay packages
import numpy as np
from keras.preprocessing import image
from keras.applications import vgg16
import matplotlib.pyplot as plt
import cv2
import os, os.path
#Load the vgg model from keras
model = vgg16.VGG16()
#image path and valid extensions- Setting the directory where we have stored... | HarshSingh16/Deep-Learning | Code_Image_Recognition_vgg16.py | Code_Image_Recognition_vgg16.py | py | 1,724 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "keras.applications.vgg16.VGG16",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "keras.applications.vgg16",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "os.listdir",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os... |
23853548490 | import pytest
import torch as th
import syft as sy
from syft.generic.frameworks.types import FrameworkTensor
from syft.generic.pointers.pointer_protocol import PointerProtocol
from syft.generic.pointers.pointer_tensor import PointerTensor
def _create_inc_protocol():
@sy.func2plan(args_shape=[(1,)])
def inc1(... | SanaAwan5/transfer_learning_on_mnist_spdz | test/execution/test_protocol.py | test_protocol.py | py | 5,065 | python | en | code | 6 | github-code | 21 | [
{
"api_name": "syft.func2plan",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "syft.func2plan",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "syft.func2plan",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "syft.Protocol",
"lin... |
36332068440 | from pathlib import Path
from scipy import misc
import os
from os.path import join as pjoin
import pandas as pd
import csv
import re
# p = Path('/Users/lingmou/Desktop/python-script/movetoonefoler/sourcefolder')
p = Path('/Users/lingmou/Desktop/python-script/fromOldToNewIndex/sourcefolder')
data_dir = '/Users/lingmou/... | xytysingle/AnnotationTool | python-script/fromOldToNewIndex/fromOldToNewIndex.py | fromOldToNewIndex.py | py | 1,290 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pathlib.Path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "scipy.misc.imread",
"line_numbe... |
3353427027 | import pandas as pd
import numpy as np
import pickle
from optimizeLibrary import library
import json
import argparse
import os
import matplotlib.pyplot as plt
class libDecisionMaker():
def __init__(self, rows, columns, TreeDepth=0, rng_seed=123):
self.depth = TreeDepth
self.rows = rows
... | SeemonJ/combinatorial-library-design-dpp | main.py | main.py | py | 4,295 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.read_csv",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_n... |
14129671932 | import numpy as np
import pandas as pd
import pickle
import sys
import os
import matplotlib.pyplot as plt
import seaborn as sns
# mpl.use('QtAgg')
path = os.path.join(os.path.dirname(__file__), '..', 'ex08')
sys.path.insert(1, path)
from my_logistic_regression import MyLogisticRegression as MyLogR
path = os.path.join... | madvid/ml_module_04 | ex09/solar_system_census.py | solar_system_census.py | py | 13,197 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.path.join",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.path.insert",
"line... |
74373389171 | ####################################################################################
#
# 모노카메라를 통한 거리검출(예측)
#
# 작성자 : 백장현
# 수정일 : 2020/09/22
#
# find T for estimate real location using pixel location
#
# Pixel location (in screen) : (Px,Py)
# Real location (in real world) : (Rx,Ry)
# we assume camera's location as (0... | baek0307/IncidentPredictionSystem | distance_estimate_monocam/estimate_distance_using_darknet/gen_matrix_usining_marker.py | gen_matrix_usining_marker.py | py | 6,198 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "ar_markers.detect_markers",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
... |
16056338623 | import os
import re
import shutil
from functools import partial
import codecs
import json
import scrapy
from jinja2 import Template
from BeautifulSoup import BeautifulSoup
from pycookiecheat import chrome_cookies
PAGE_TEMPLATE="""<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//D... | hei209/safaribooks | safaribook/spiders/safaribooks.py | safaribooks.py | py | 3,247 | python | en | code | null | github-code | 21 | [
{
"api_name": "scrapy.Spider",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "shutil.rmtree",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "shutil.copytree",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "scrapy.Request",
... |
74133994291 | import math
from pathlib import Path
import cv2
import numpy as np
from PIL import Image
from tqdm import tqdm
from artifactID.common import data_ops
def main(path_read_data: Path, path_save_data: Path, patch_size: list):
arr_rot_range = np.hstack((np.arange(-15, 0), np.arange(1, 16)))
arr_rot_range = list(... | imr-framework/artifactID | artifactID/datagen/rigidmotion_datagen.py | rigidmotion_datagen.py | py | 2,031 | python | en | code | 5 | github-code | 21 | [
{
"api_name": "pathlib.Path",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "numpy.hstack",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "artifactID.common.data_ops.glo... |
13653122291 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
@File : hospital_ranking.py
@Author: Fengjicheng
@Date : 2020/3/10
@Desc : 中国医院排行 http://rank.cn-healthcare.com/hospital
'''
import scrapy
import json
from yiyao.items import YiyaoHospRankItem
class HospRank(scrapy.Spider):
name = 'hospital_ranking'
url = '... | FJCAAAAA/scrapy_yiyao | yiyao/yiyao/spiders/hospital_ranking.py | hospital_ranking.py | py | 2,456 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "scrapy.Spider",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "scrapy.Request",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "scrapy.Request",
"li... |
9370602030 | from flask import Flask, url_for, render_template, request, redirect, session
import sqlite3 as sql3
from datetime import datetime
import timeago
from slugify import slugify
import hashlib
app = Flask(__name__)
app.secret_key = b'b\xf9\xd5\xee\xc2\xb2\xf2^`\x1fBM\xbd%`0'
def md5(strVal):
return hashlib.md5(strVa... | xrwy/Blog_Script_Application_with_Flask_ | Blog_Script _App_with_Flask.py | Blog_Script _App_with_Flask.py | py | 9,177 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "hashlib.md5",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_nu... |
70898087093 | # Text Classification
import nltk
import random
from nltk.corpus import movie_reviews
import pickle
'''
Movie Reviews datasets
the code is translated to: In each category (we have pos or neg),
take all of the file IDs (each review has its own ID),
then store the word_tokenized... | istiakahmad/Natural-Language-Processing | Include/TextClassification.py | TextClassification.py | py | 2,934 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "nltk.corpus.movie_reviews.words",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.movie_reviews",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "nltk.corpus.movie_reviews.categories",
"line_number": 15,
"usage_type": "call"
... |
72065644534 | from lib.umqtt import MQTTClient
from lib.utils import load_env_vars
import ujson as json
import urandom
def rand_str(l=10):
return "".join([chr(urandom.randint(80, 120)) for i in range(l)])
def default_sub_cb(topic, msg):
print(topic, msg)
env_vars = load_env_vars("lib/.env")
def setup_mqtt_client(cli... | JamesTev/EEG-decoding | micropython/lib/networking.py | networking.py | py | 1,254 | python | en | code | 19 | github-code | 21 | [
{
"api_name": "urandom.randint",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "lib.utils.load_env_vars",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "lib.umqtt.MQTTClient",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "utime.tic... |
6922532560 | from importlib import import_module
from time import time
class Stopwatch():
def __init__(self):
self.is_running = False
self.laps = []
self.precision = 3
def start(self):
self.is_running = True
self.laps.append(time())
def lap(self):
if not self.is_running... | ony3000/project-euler | measurement.py | measurement.py | py | 1,677 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "time.time",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "importlib.import_module",
"line_num... |
19362816857 | import pytest
import unittest
import logging
logging.basicConfig()
logger=logging.getLogger(__name__)
logger.setLevel(logging.INFO)
import os,sys
sys.path.append('..')
if not os.path.exists('workflow'):
os.chdir('..')
def dlog(msg):
logger.info(msg)
class TestClass(unittest.TestCase):
def test_back... | jacky892/sectorRotationHeatmap | tests/test_backtester.py | test_backtester.py | py | 1,916 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "logging.basicConfig",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append"... |
28431137545 | from django.shortcuts import render
import requests
from binance.client import Client
import pandas as pd
import numpy as np
import time
import datetime
from tradingview_ta import TA_Handler, Interval, Exchange
# from .models import UserInfo
from django.shortcuts import redirect
#Дефолтные ключи
#Используются если в... | EdgarAbramian/FastTrade | FastTrade/TradeApp/views.py | views.py | py | 6,554 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "binance.client.Client",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "numpy.where... |
11059846712 | import logging,sys
from datetime import datetime
def create_logger():
logger = logging.getLogger("exc_logger")
logger.setLevel(logging.INFO)
logfile = logging.FileHandler("exc_logger.log")
fmt = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
formatter = logging.Formatter(fmt)
logfil... | subashkonar13/evaluation | func/writeData.py | writeData.py | py | 659 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "logging.FileHandler",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "logging.Formatte... |
25538976152 | #--------------------Sobel Filter------------------------
import numpy as np
import cv2
import matplotlib.pyplot as plt
img= cv2.imread('f16.jpg')
n,m,d=img.shape
# defining vertical and horizontal sobel filters
vertical_filter= [[-1,-2,-1],[0,0,0],[1,2,1]]
horizontal_filter=[[-1,0,1],[-2,0,2],[-1,0,1]]
... | nalin2002/Image-Processing-with-python | Edge Detection.py | Edge Detection.py | py | 675 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "cv2.imread",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 15,
"usage_type": "call"
}
] |
16715278419 | # coding: utf-8
""" Command line interface for the Test Management Tool """
import collections
import dataclasses
import os
import subprocess
import sys
from typing import TYPE_CHECKING, Any, DefaultDict, List, Optional, Set
import click
import fmf
from click import echo, style
from fmf.utils import listed
import t... | danmyway/tmt | tmt/cli.py | cli.py | py | 54,036 | python | en | code | null | github-code | 21 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "tmt.plugins.explore",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "tmt.plugins",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "tmt.log",
... |
24766496831 | #F1 Bot Functionality
import sys
#Vivenv pathing issue. Hacky Fix.
#Zack's PC Path
sys.path.append(r'c:\users\zacha\appdata\local\programs\python\python310\lib\site-packages')
#Alex's Pc Path
#sys.path.append(r'c:\users\daric\appdata\local\programs\python\python310\lib\site-packages')
import discord
import regex as ... | billathekilla737/Daddy-Bot | Daddy-Bot-env/Assets/F1_Functions.py | F1_Functions.py | py | 10,379 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "sys.path.append",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pytz.timezone",
"line_numbe... |
31928299124 | # import modules
import requests
from bs4 import BeautifulSoup
import datetime
import pandas as pd
import sys
import re
import string
import nltk
import spacy
from nltk.corpus import stopwords
#list declaration
cus_res1=[]
cus_res2=[]
cus_res3=[]
cus_res4=[]
cus_res5=[]
cus_res6=[]
#function to parse the required data... | keshav263/sentinic | scraper.py | scraper.py | py | 4,265 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "r... |
15417829459 | from django.urls import path, re_path
from base.views import order_views as views
urlpatterns = [
path('create_payment_intent/', views.create_payment, name='create_payment_intent'),
path('myorders/', views.getMyOrders, name='get_my_orders'),
path('<str:pk>', views.getOrderById, name='get_order_byid'),
... | elliehkim/django-ecommerce | base/urls/order_urls.py | order_urls.py | py | 452 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "base.views.order_views.create_payment",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "base.views.order_views",
"line_number": 7,
"usage_type": "name"
},
{
"a... |
9011408936 | import database
from FileSystemObject import File, Directory
import datetime
import os
def createFSO(relPath, rootAbsPath):
absPath = rootAbsPath + "/" + relPath
# print(absPath)
f = None
if(os.path.isfile(absPath)):
f = File(relPath, datetime.datetime.now(), False, False, datetime.datetime.now(... | QuentinCovert/SyncOrSwim | src/lib/databaseTest.py | databaseTest.py | py | 952 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.path.isfile",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "FileSystemObject.File",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.n... |
22286564225 | # necessary imports
import time
import boto3
import pandas as pd
# function for sending data to Kinesis at the absolute maximum throughput
def send_to_kinesis(kinesis_client, kinesis_stream_name, kinesis_shard_count, data):
kinesisRecords = [] # empty list to store data
(rows, columns) = data.shape # get ... | sheikhoque/python-examples | kinesis-write.py | kinesis-write.py | py | 3,262 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "time.time",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number":... |
36053303748 | #!/usr/bin/env python3
"""Importing"""
# Importing External Packages
from pytube import YouTube
from pyrogram.types import CallbackQuery
from ffmpeg import input, concat
# Importing Inbuilt packages
from shutil import rmtree
from uuid import uuid4
from time import time
from os import makedirs, path
# Importing Comm... | REX-BOTZ/MegaUploaderbot-1 | plugins/callbackYTDL.py | callbackYTDL.py | py | 6,897 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pyrogram.types.CallbackQuery",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "uuid.uuid4",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
... |
27707465676 | # -*- coding: utf-8 -*-
#
# File: testWorkflows.py
#
# GNU General Public License (GPL)
#
from AccessControl import Unauthorized
from imio.actionspanel.utils import unrestrictedRemoveGivenObject
from imio.helpers.cache import cleanRamCacheFor
from imio.history.utils import getLastWFAction
from OFS.ObjectManager import... | IMIO/Products.PloneMeeting | src/Products/PloneMeeting/tests/testWorkflows.py | testWorkflows.py | py | 54,708 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "Products.PloneMeeting.tests.PloneMeetingTestCase.PloneMeetingTestCase",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "Products.CMFCore.permissions.View",
"line_number": 56,
"usage_type": "argument"
},
{
"api_name": "Products.CMFCore.permissions.AccessCo... |
74127657651 | from app import app1
from flask import request, render_template, jsonify
from app import nlp_obj
@app1.route('/check', methods=['GET'])
def check():
return jsonify({'status': 'ok'})
@app1.route("/")
def hello():
return render_template("index.html")
@app1.route("/sentiment", methods=["POST", "GET"... | ashishu007/NLP-Tasks | flask/app/main.py | main.py | py | 1,612 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "flask.jsonify",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "app.app1.route",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "app.app1",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "flask.render_template",
"line_... |
10672951992 | import logging
import os
import matplotlib.pyplot as plt
import pandas as pd
from base_function import BaseFunction
class MonthlyReportException(Exception):
pass
class MonthlyReport(BaseFunction):
"""
get necessary data to create Monthly Reports.
"""
DEPENDENT_VARIABLES = ['OrderTurnOver', 'Ord... | vincentclaes/sales_report | sales_report/report_functions/monthly.py | monthly.py | py | 3,877 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "base_function.BaseFunction",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "logging.info",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "os.path.splitext",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
15005713471 | import os
import re
import textwrap
import pyperclip
import pytest
from reprexpy import reprex
skip_on_github = pytest.mark.skipif(
'CI' in os.environ,
reason='Skipping during Github workflow.'
)
def _read_reprex_file(file):
with open(file) as fi:
lns = fi.read()
return lns.rstrip('\n')... | crew102/reprexpy | tests/test_reprexpy.py | test_reprexpy.py | py | 3,393 | python | en | code | 86 | github-code | 21 | [
{
"api_name": "pytest.mark.skipif",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
... |
34080659497 | def exchange():
import datetime
now = datetime.datetime.now()
timestamp = (now.strftime(f"%I:%M %p, %A, %B %d, %Y"))
ratedate = 'Friday, May 24th 2019'
from decimal import getcontext
getcontext().prec = 3
currency = ['\t\tCanadian Dollars', '\t\tEuro', '\tIndian Rupee', '\tJapanese Yen', '\t... | mjroney/First-Programming-Class | currency.py | currency.py | py | 857 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "datetime.datetime.now",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "decimal.getcontext",
"line_number": 7,
"usage_type": "call"
}
] |
36384273367 | import string
import random
import requests
import subprocess
import sys
words_list = []
wordlist = sys.argv[1]
with open(wordlist, "r") as handle:
while True:
line = handle.readline()
if not line:
break
words_list.append(line)
url_prefix = "/watch?v="
s = requests.Session()
ra... | aedancullen/pma-experiments | dlrandom-wordlist.py | dlrandom-wordlist.py | py | 1,193 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.argv",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "requests.Session",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "random.shuffle",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "subprocess.run",
"li... |
70018102132 | import json
import logging
import threading
import pandas as pd
import datetime as dt
from time import *
import time
import alpaca_trade_api as tradeapi
from Alpaca_config import *
import utils_for_alpaca
alpaca = tradeapi.REST(API_KEY_PAPER, API_SECRET_PAPER, API_BASE_URL_PAPER, api_version='v2')
mail_subject = "Tra... | alexanu/alpaca_snippets | Intraday_10min_breakout.py | Intraday_10min_breakout.py | py | 5,067 | python | en | code | 7 | github-code | 21 | [
{
"api_name": "alpaca_trade_api.REST",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "utils_for_alpaca.sent_alpaca_email",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "alpaca_trade_api.stream2.StreamConn",
"line_number": 46,
"usage_type": "call"
... |
18353243543 | import phonenumbers
import folium
from myNumber import number
from phonenumbers import geocoder
key = '64ab9397459249f793e1f22adc74c244'
#To show the country name (CH=country history)
samNumber = phonenumbers.parse(number)
yourlocation = geocoder.description_for_number(samNumber, "en")
print(yourlocation)
#To show th... | atirek-pro/TrackingPhonenumberlocation | main.py | main.py | py | 989 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "phonenumbers.parse",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "myNumber.number",
"line_number": 8,
"usage_type": "argument"
},
{
"api_name": "phonenumbers.geocoder.description_for_number",
"line_number": 9,
"usage_type": "call"
},
{
"... |
15932821891 |
import os
import sys
from tensorflow.python.keras.utils.io_utils import path_to_string
from tensorflow.python.util import nest
from tensorflow.python.util.tf_export import keras_export
try:
import pydot_ng as pydot
except ImportError:
try:
import pydotplus as pydot
except ImportError:
try:
import p... | Mockingbird01001/NLG-code-generator-LSTM | work/data/data_model/batch_0/vis_utils.py.transformed.py | vis_utils.py.transformed.py | py | 9,197 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pydot.Dot.create",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pydot.Dot",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "pydot.InvocationException",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "tensor... |
7166607023 | from flask import Flask, render_template, request
#! TURN THIS FILE INTO A FLASK APPLICATION
app = Flask(__name__)
#! We then use the route() decorator to tell Flask what URL should trigger our function.
@app.route("/", methods=["GET", "POST"])
def homePage():
if request.method == "GET":
return render_t... | ZoranUTF8/cs50 | Week 9 Flask/app.py | app.py | py | 479 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "flask.render_templ... |
5965667194 | # https://www.acmicpc.net/problem/19237
# 그냥 존나 힘들다.... 중간에 변수 뭐 빠뜨렸는지 몰라서 헤맴 3시간 보다가 sharks_looking 초기화를 안시킨거였음.
# 빡구현 빡치네, graph도 만들어놓고 보니 쓸데도 없었음. 그냥 smell_graph만 써도 됐음.
# 청소년 상어 때처럼 한마리씩 움직이는게 아니라 전부다 동시에 움직이기 때문에 new_graph를 만들어서 위치를 초기화 시켜야 했다. 그래서 graph를 안씀
# 그냥 코드가 거지같다. 근데 다시 풀고 싶지는 않음.
from collections ... | kylew1004/algorithm | Baekjoon/구현/19237.py | 19237.py | py | 3,630 | python | ko | code | 0 | github-code | 21 | [
{
"api_name": "collections.deque",
"line_number": 38,
"usage_type": "call"
}
] |
12227788138 | import spotipy
from spotipy.oauth2 import SpotifyClientCredentials
class SpotifyTool:
def __init__(self, id, secret):
self.sp = spotipy.Spotify(auth_manager=SpotifyClientCredentials(client_id=id,
client_secret=secret))
async def get_song_info(self, search):
# Get the song info --> get the song... | patrick-aoc/VentiBot | src/songs/Spotify.py | Spotify.py | py | 974 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "spotipy.Spotify",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "spotipy.oauth2.SpotifyClientCredentials",
"line_number": 7,
"usage_type": "call"
}
] |
31469632518 | import os
from flask import render_template, flash, redirect, url_for, request
from flask_misaka import markdown
from .. import app, db
from ..auth import current_user, roles_required
from werkzeug.utils import secure_filename
from wtforms import SelectField
from ..database import Task, Room, TaskText, Equipment, User,... | stripemsu/StudentTasks | todolist/tasks/task_admviews.py | task_admviews.py | py | 15,751 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "database.Facility",
"line_number": 16,
"usage_type": "argument"
},
{
"api_name": "database.Task.query.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "database.Equipment",
"line_number": 16,
"usage_type": "argument"
},
{
"api_name": ... |
27525554426 | """ Analyzes the word frequencies in a book downloaded from
Project Gutenberg """
import string
import random
import math
from random import randint
import requests
herland_full_text = requests.get('http://www.gutenberg.org/files/32/32-0.txt').text
#print(herland_full_text)
def get_word_list(herland_full_text):
... | MargaretRosner/ToolBox-WordFrequency | frequency.py | frequency.py | py | 2,307 | python | en | code | null | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "string.punctuation",
"line_number": 35,
"usage_type": "attribute"
}
] |
33898051453 | import datetime
from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union, cast
import attr
from dateutil.parser import isoparse
from ..models.fulfillment_action import FulfillmentAction
from ..models.fulfillment_order_status import FulfillmentOrderStatus
from ..models.fulfillment_policy import Fulfillm... | milyord/sp-api | sp/fulfillment_outbound_2020_07_01/models/fulfillment_order.py | fulfillment_order.py | py | 11,220 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "typing.TypeVar",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 58,
"usage_type": "attribute"
},
{
"api_name": "models.shi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.