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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
27529647062 | import argparse
import os
import pandas as pd
import numpy as np
from save_data_as_csv import save_data_as_csv
# Checking GDD values. If the value < 0 than value = 0.
def checkGDD(values):
GDD = []
item = 0
for i in values:
if i >= 0:
item += i
GDD.append(item)
return GDD
... | sheykholeslam/P6950T3 | source/calculate_GDD.py | calculate_GDD.py | py | 1,798 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
... |
73819802106 | import keras
import pandas as p
import numpy as np
import keras as k
# from scipy.stats import zscore # zscore(data(n,w), axis=1, ddof=1)
from framework.experimental.nn.features.post_processing.nnpostprocutils import min_max_scaling
# da Castelnuovo e
# https://stanford.edu/~shervine/blog/keras-how-to-gener... | GAntonacci95/room_shape_classification | src/framework/experimental/nn/usage/batch_generation2.py | batch_generation2.py | py | 3,012 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "keras.utils",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pandas.DataFrame",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "numpy.floor",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",... |
15086809964 | import os
import cv2
import time
import numpy as np
from getkeys import key_check
from screengrab import grab_screen
def keys_to_output(keys):
'''Convert keys to a multi-hot array boolean values.
[W,S,A,D,8,4,5,6]'''
output = [0,0,0,0,0,0,0,0]
if 'W' in keys:
output[0] = 1
i... | mehta-raghav/fred-pygtav | get_data.py | get_data.py | py | 2,175 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.isfile",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "numpy.load",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number"... |
29814710672 | # pipenv run python botAiogram.py
import asyncio
import logging
# from aiogram import Bot, Dispatcher, types
# from aiogram.filters import Command, CommandObject
from aiogram import Bot, Dispatcher, executor, types
from dotenv import dotenv_values
config = dotenv_values(".env")
try:
if not config['BOT_TOKEN']:
... | aliaksei-dunets-public/trading-tool-bot | app.py | app.py | py | 1,231 | python | ru | code | 0 | github-code | 6 | [
{
"api_name": "dotenv.dotenv_values",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "aiogram.Bot",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "aiogram.Dispatcher",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "logging.basicConfi... |
73987007549 | #! /usr/bin/env python
# ROS
import rospy
import actionlib
# OpenCV for images
import cv2
# rosmsg
from sensor_msgs.msg import Image, CompressedImage, RegionOfInterest
from std_msgs.msg import String, Header
import std_msgs.msg
import inference_server.msg
from inference_server.srv import *
# System
import os
# Ten... | pal-robotics/inference_server | src/inference_server_node.py | inference_server_node.py | py | 5,015 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "cv2.CV_LOAD_IMAGE_COLOR",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "actionlib.SimpleActionServer",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "inference_server.msg.msg",
"line_number": 36,
"usage_type": "attribute"
},
... |
40894634993 | import itertools
m = []
a = []
c = []
f =[(i) for i in range (1,10)]
s = [(i) for i in range (0,10)]
##initial two digits
b =[e for e in itertools.product(f,s)]
##middle digits to list m from
for x in s:
m.append((x,x))
##incorporate the middle digits (from m), and reverse of initial two digits
for o in m:
f... | jmpilot/Project-Euler | eu_4.py | eu_4.py | py | 658 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "itertools.product",
"line_number": 13,
"usage_type": "call"
}
] |
15802589480 | '''
data folder contains some data sets downloaded from https://data.worldbank.org/indicator
Data Sets are related to Science and Technology.
Data sets are the following:
- Charges for the use of intellectual property, payments (BoP, current US$)
- High-technology exports (% of manufactured exports)
- Research and... | ZsoltToth/artificial-intelligence | pandasExample/main.py | main.py | py | 5,770 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "pandas.read_excel",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pandas.read_excel",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pandas.read_excel",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pandas.read_exc... |
12772839680 | import re
import json
def is_valid_cds(sequence):
if len(sequence) % 3 != 0:
return False
translated_seq = sequence.translate()
translated_seq_str = str(translated_seq)
return (
translated_seq_str[-1] == '*' and
'*' not in translated_seq_str[:-1]
)
def parse_location(s... | srom/rna_learn | preprocessing/sequence_utils.py | sequence_utils.py | py | 4,530 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "re.match",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 39,
"usa... |
21002967377 | from __future__ import absolute_import
from rest_framework.response import Response
from sentry.api.bases import OrganizationEventsEndpointBase, OrganizationEventsError, NoProjects
from sentry.snuba import discover
class OrganizationEventsMetaEndpoint(OrganizationEventsEndpointBase):
def get(self, request, orga... | Zarathustra2/sentry | src/sentry/api/endpoints/organization_events_meta.py | organization_events_meta.py | py | 875 | python | en | code | null | github-code | 6 | [
{
"api_name": "sentry.api.bases.OrganizationEventsEndpointBase",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "sentry.api.bases.OrganizationEventsError",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "rest_framework.response.Response",
"line_number": 14,... |
69953146107 | from inspect import Parameter
import requests
import os
class DataManager:
#This class is responsible for talking to the Google Sheet.
def __init__(self) -> None:
self.data = {}
self.posturl = os.environ["posturl"]
self.puturl = os.environ["puturl"]
def fetch(self) -> list:
... | chl1221/Flight-Deal-Finder | data_manager.py | data_manager.py | py | 804 | 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": "requests.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "requests.put",
"line_... |
15551652788 | import multiprocessing
import os
import threading
import unittest
from src.application.google_find import GoogleSearchError
from src.application import google_find
class TestGoogleFind(unittest.TestCase):
def setUp(self) -> None:
pass
def test_google_api_params(self):
expected = {"query": "t... | lukaszmichalskii/recommender-system | test/application/test_google_find.py | test_google_find.py | py | 2,119 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "unittest.TestCase",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "src.application.google_find.google_api_params",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "src.application.google_find",
"line_number": 19,
"usage_type": "name... |
33783224557 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
raw = pd.read_csv('http://hilpisch.com/pyalgo_eikon_eod_data.csv', index_col=0, parse_dates=True).dropna()
print(raw.info())
symbol = 'EUR='
data = pd.DataFrame(raw[symbol])
data.rename(columns={symbol: 'price'}, inplace=True)
lags = 5
cols = []
f... | tkaden/AlgoTrading | pred_index.py | pred_index.py | py | 1,658 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.lstsq",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
... |
17689664792 | from imageData import ImageData
from torch.utils.data import DataLoader
from hypParam import *
import matplotlib.pyplot as plt
from datetime import datetime
import os
dataset = ImageData(val_data_path, training =False)
loader = iter(DataLoader(dataset, 1, shuffle=True, pin_memory=True))
def tensorToImage(tens):
r... | abed11326/Training-a-Super-Resolution-GAN-for-4x-image-upscaling | evaluation.py | evaluation.py | py | 1,465 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "imageData.ImageData",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.utils.data.DataLoader",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 15,
"usage_type": "call"
},
{
"api_name":... |
34336479554 | from django.shortcuts import render, redirect
from numpy import negative
from requests import session
from .forms import TweetUrlForm
from .models import TwitterData
from users.models import User
from .tasks import tweetanalysis
import json
# Create your views here.
def dashboard(request):
if request.session.get(... | rushabh2390/twitter-replyisentimate-analysis-django | twittersentimateanalysis/tweetsreplyanalysis/views.py | views.py | py | 2,862 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "users.models.User.get_user",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "users.models.User",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "forms.TweetUrlForm",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "forms... |
11037636465 | #!/bin/python3
#
# Author: Panagiotis Chartas (t3l3machus)
# https://github.com/t3l3machus
from http.server import HTTPServer, BaseHTTPRequestHandler
import gnureadline as global_readline
import ssl, sys, re, os, argparse
import netifaces as ni
from warnings import filterwarnings
from datetime import date, datetime
fr... | t3l3machus/Synergy-httpx | synergy_httpx.py | synergy_httpx.py | py | 23,969 | python | en | code | 109 | github-code | 6 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "netifaces.ifaddresses",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "netifaces.AF_INET",
"line_number": 51,
"usage_type": "attribute"
},
{
"api_name": "... |
27639280764 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
import scipy.io as sio
from scipy.linalg import block_diag
from ops import image_embedding
from ops import image_processing
from ops... | xthan/polyvore | polyvore/polyvore_model_siamese.py | polyvore_model_siamese.py | py | 10,629 | python | en | code | 157 | github-code | 6 | [
{
"api_name": "tensorflow.TFRecordReader",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "tensorflow.random_uniform_initializer",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "ops.image_processing.process_image",
"line_number": 76,
"usage_type": "ca... |
25869742212 | #This code is uses K-Nearest Neighbors (KNN) and matrix factorization for finding users that
#like similar movies
import pandas as pd
import numpy as np
from scipy.sparse import csr_matrix
import sklearn
from sklearn.decomposition import TruncatedSVD
from sklearn.neighbors import NearestNeighbors
#import movies... | Fremont28/movie_recommender- | user_similarities.py | user_similarities.py | py | 2,563 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "scipy.sparse.csr_matrix",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "sklearn.neig... |
36696924955 | from typing import Dict, List
from tips.framework.actions.clone_table_action import CloneTableAction
from tips.framework.actions.sql_action import SqlAction
from tips.framework.actions.sql_command import SQLCommand
from tips.framework.metadata.additional_field import AdditionalField
from tips.framework.metadata.... | ProjectiveGroupUK/tips-snowpark | tips/framework/actions/merge_action.py | merge_action.py | py | 6,309 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "tips.framework.actions.sql_action.SqlAction",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "tips.framework.metadata.table_metadata.TableMetaData",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 18,
"usage_... |
27234879661 | #!/usr/bin/env python
import time
from pathlib import Path
# from pudb import set_trace as bp # noqa:F401
import yaml
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
from selenium.webdriver.firefox.options import Options
from selenium.w... | GregoireHENRY/grobbed | grobbed.py | grobbed.py | py | 3,649 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pathlib.Path",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "yaml.safe_load",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.firefox.o... |
26194941803 | import pygame
import os
import sys
import random
pygame.init()
size = width, height = 600, 600
END = False
win_on = False
screen = pygame.display.set_mode(size)
clock = pygame.time.Clock()
music1 = 'main_1.mp3'
music2 = 'main_2.mp3'
pygame.display.set_caption('64.0')
color_friend = random.choice(['red'... | MAXUTKA228/PygameProject | Игра/Project.py | Project.py | py | 10,537 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.init",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pygame.time.Cl... |
73845403069 | import copy
import numpy as np
import pandas as pd
from tqdm import tqdm
import matplotlib.pyplot as plt
from sklearn.model_selection import StratifiedKFold
from xgboost import XGBClassifier
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelEncoder
from sklearn.metrics import ... | YZY-stack/bigdata-stock-prediction | lstm_attn_stock_pred.py | lstm_attn_stock_pred.py | py | 5,643 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "pandas.concat",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"l... |
25195224707 | import json
import base64
from enum import Enum
import numpy as np
class MessageType(Enum):
"""
Message Type
Message Types that the service can work with.
"""
REGISTER = "REGISTER"
NEW_SESSION = "NEW_SESSION"
NEW_WEIGHTS = "NEW_WEIGHTS"
class Message:
"""
Message
Base cla... | DiscreetAI/cloud-node | cloud-node/message.py | message.py | py | 2,978 | python | en | code | 24 | github-code | 6 | [
{
"api_name": "enum.Enum",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "json.dumps",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 78,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 102,
... |
8034407373 | import logging
from telegram import Update
from telegram.ext import CallbackContext, Updater, CommandHandler
from urllib.parse import quote
# Enable logging
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO)
# Define the handler for the file command
def file_ha... | SawadaBreastfeeder/Blah | main.py | main.py | py | 2,847 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.basicConfig",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "telegram.Update",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "telegram.ext.Ca... |
7297737492 | import os
import random
import string
import httplib2
import json
import requests
from flask import Flask, Blueprint, render_template, request, redirect
from flask import url_for, flash, make_response
from flask import session as login_session
from oauth2client.client import flow_from_clientsecrets
from oauth2client.cl... | ay1man4/CatalogApp | app/auth/views.py | views.py | py | 6,131 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Blueprint",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"l... |
20324864111 | #!/bin/python
# apt_pkg.version_compare(a: str, b: str) → int
# requires python-apt or equiv. package
# https://pypi.python.org/pypi/apt
import apt_pkg
import argparse
apt_pkg.init_system()
aparser = argparse.ArgumentParser(description="Comare debian versions")
aparser.add_argument('-a', help="version a")
aparser.ad... | mdeguzis/python | utilities/ver-compare.py | ver-compare.py | py | 586 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "apt_pkg.init_system",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "apt_pkg.version_compare",
"line_number": 19,
"usage_type": "call"
}
] |
27716626333 | import os
import time
import datetime
import subprocess
from statistics import mean
from tabulate import tabulate
def runCommand(command):
st = time.time()
result = subprocess.run([command, ""], shell = True, stdout=subprocess.PIPE)
print(result.stdout.decode('utf-8'))
et = time.time()
result = et... | edentorres/verisol-test | Time.py | Time.py | py | 2,520 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "time.time",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "subprocess.run",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "time.time",
"line_nu... |
72014799868 | import os
from scipy.io import loadmat
from Dataset.Datasets import Dataset
from enum import Enum
import numpy as np
class SignalsUSCHAD(Enum):
acc_front_right_hip_X = 0
acc_front_right_hip_Y = 1
acc_front_right_hip_Z = 2
gyr_front_right_hip_X = 3
gyr_front_right_hip_Y = 4
gyr_front_right_hip_... | jesimonbarreto/SensorsDataset | frankDataset/Dataset/Uschad.py | Uschad.py | py | 2,297 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "enum.Enum",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "Dataset.Datasets.Dataset",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "os.walk",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_nu... |
40634522861 | """Useful functions for the library"""
import colorsys
import numpy
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
from matplotlib.ticker import MaxNLocator
from ..biotools import extract_graphical_translation
from ..compute_features_levels import compute_features_levels
from ..GraphicFeature ... | daveuu/DnaFeaturesViewer | dna_features_viewer/GraphicRecord/matplotlib_plots.py | matplotlib_plots.py | py | 19,305 | python | en | code | null | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "matplotlib.colors.colorConverter.to_rgb",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "matplotlib.colors.colorConverter",
"line_number": 31,
"usage_type": "name"
},
{
... |
16606345298 | #!/usr/bin/env python3
import json
from rich import print
def file_opener(filename):
with open(filename) as f:
return f.read()
def data_parser(json_data):
parsed_data = {}
for e in json_data:
if e['protocol'] != 'L':
new_dict = {}
new_dict['nexthop_interface'] ... | caseymorris87/pynet_test2 | complex_data_struct/struct_ex1.py | struct_ex1.py | py | 901 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.loads",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "rich.print",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "rich.print",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "rich.print",
"line_number": 33,
... |
21353821385 | from typing import List
from functools import cache
class Solution:
def stoneGameII(self, piles: List[int]) -> int:
n = len(piles)
# 只返回sum!!
# 傻呗做法
@cache
def dfs(beg_idx: int, M: int) -> (int, int, int):
if beg_idx + 2*M >= n:
... | Alex-Beng/ojs | FuckLeetcode/1140. 石子游戏 II.py | 1140. 石子游戏 II.py | py | 1,443 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "functools.cache",
"line_number": 9,
"usage_type": "name"
}
] |
36946984736 | import serial
import Adafruit_BBIO.UART as UART
class Pololu():
cmds = {
"fwd": 10,
"rev": 9,
}
def __init__(self, Beagle_UART="UART2", port="ttyO2", address=13):
"""
Beagle_UART - UART0, UART1 or UART2 on BeagleBone Black to use
port ... | computer-whisperer/floyd_py | pololu.py | pololu.py | py | 1,578 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "Adafruit_BBIO.UART.setup",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "Adafruit_BBIO.UART",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "serial.Serial",
"line_number": 24,
"usage_type": "call"
}
] |
1293808131 | import itertools
import numpy as np
import onnx
from tests.tools import expect
class Transpose:
@staticmethod
def export_default(): # type: () -> None
shape = (2, 3, 4)
data = np.random.random_sample(shape).astype(np.float32)
node = onnx.helper.make_node(
'Transpose', i... | gglin001/onnx-jax | tests/node/test_transpose.py | test_transpose.py | py | 1,331 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "numpy.random.random_sample",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "numpy.float32",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "onnx.... |
5037908767 | import opt
import torch
from torch import nn
import torch.nn.functional as F
from torch.nn import Module, Parameter
class GNNLayer(Module):
def __init__(self, in_features, out_features):
super(GNNLayer, self).__init__()
self.in_features = in_features
self.out_features = out_features
... | WxTu/DFCN | IGAE.py | IGAE.py | py | 3,880 | python | en | code | 67 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "opt.args",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Tanh",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numbe... |
19325518284 | from dateutil.parser import parse
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import pandas as pd
#plt.rcParams.update({'figure.figsize': (10, 7), 'figure.dpi': 120})
import scipy.stats as stats
from scipy.stats import normaltest
from scipy.stats import kurtosis
f... | gsilva49/timeseries | H/python_code/histograms_boxcox.py | histograms_boxcox.py | py | 1,397 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "scipy.stats.normaltest",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "scipy.stats.boxcox",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "scipy.stats... |
8538408463 | import RPi.GPIO as GPIO
import threading
import time
import requests
import json
from urllib import request, parse
from time import sleep, strftime
import busio
import digitalio
import board
import adafruit_pcd8544
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
headers = {
"accept": "app... | ArneVangheel/SE-PROJECT | raspberry's/raspberry2.py | raspberry2.py | py | 2,954 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.post",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number... |
34451431320 | import numpy as np
import json
import glob
import re
import os
import pickle
import time
from copy import deepcopy
from utils import fvecs_read,calculate_centroids,get_euclid_dist
from nsg import load_NSG,query_NSG
from medioids import get_medioids
def search(query,path_to_shards,k=5,num_shards_query=2):
# T... | bwu2018/CS-490-DiskANN | disk-ann/nsg-py/union_search.py | union_search.py | py | 4,562 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "utils.calculate_centroids",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.norm",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "medioid... |
13095077474 | import torch.nn as nn
import numpy as np
#No comment just print the model to see its layers
class cnn(nn.Module):
def __init__(self, nc, nf, extra_layers, use_sigmoid=True):
super(cnn, self).__init__()
num_downs = 6
submodule = None
for i in range(0,extra_layers):
if i =... | cherrymcgerry/CallTechNet | Model/ConvNet3.py | ConvNet3.py | py | 2,115 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sigmoid",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_num... |
19272944921 | #!/usr/bin/env python3
from socket import SHUT_RDWR, create_connection
from time import sleep
from tokenize import cookie_re
import requests as req
import re
from math import floor, gcd
vulnerable = [103]
def intToFlag(i):
a = i % 52
b = floor(i / 52) % 52
c = floor(i / (52**2)) % 52
d = floor(i / (52**3)) %... | n1kPLV/IT-Sec-CTF-Scripts | deepsql/attackv2.py | attackv2.py | py | 1,954 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "math.floor",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "math.floor",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "math.floor",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "math.floor",
"line_number": 17,
... |
74153179387 | from lxml import etree
import urllib
import urllib.request
def removekey(d, key):
r = dict(d)
del r[key]
return r
with urllib.request.urlopen("http://localhost:8888/search_playlist/?artist=&title=&channel=53&month=&date=&shour=&sampm=&stz=&ehour=&eampm=") as url:
s = url.read()... | tomj0101/satellite-radio-sync | siriously.py | siriously.py | py | 1,456 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "urllib.request",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "lxml.etree.HTML",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "lxml.etree... |
27835473276 | import cv2
import numpy as np
from tkinter import *
from tkinter import ttk
from tkinter import filedialog
from PIL import Image, ImageTk
yolo = cv2.dnn.readNet("yolov4.weights", "yolov4.cfg")
classes = []
def object_detection(name):
with open("coco.names", "r") as file:
classes = [line.stri... | amdk1/YOLOv4-Object-Detection-Script | ObejctDetection.py | ObejctDetection.py | py | 2,627 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.dnn.readNet",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.dnn",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "cv2.imread",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "cv2.dnn.blobFromImage",
"li... |
74222900988 | from django.contrib import admin
from django.urls import path
from django.conf.urls import url, include
from django.conf import settings
from rest_framework import permissions
from drf_yasg.views import get_schema_view
from drf_yasg import openapi
schema_view = get_schema_view(
openapi.Info(
title="Health... | Sharif-University-ESRLab/project-team-2 | Code/backend/health/urls.py | urls.py | py | 971 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "drf_yasg.views.get_schema_view",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "drf_yasg.openapi.Info",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "drf_yasg.openapi",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": ... |
38473592020 |
__author__ = 'christiaan'
import numpy as np
from sklearn.model_selection import train_test_split
import pandas as pd
from sklearn.preprocessing import normalize
from sklearn import preprocessing
import tensorflow as tf
import tempfile
titanicDF = pd.read_csv('/Users/christiaan/Downloads/ML/Exercice/titanic.csv',n... | chrike-platinum/tensorflow | tensorEasy.py | tensorEasy.py | py | 3,572 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.MinMaxScaler",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing",
"line_number": 51,
"usage_type": "name"
},
{
"api_name... |
4376940910 | import re
import sqlite3
from dictmaster.util import CancelableThread, find_synonyms, FLAGS
from pyquery import PyQuery as pq
from lxml import etree
class Processor(CancelableThread):
plugin = None
auto_synonyms = True
data = None
_conn = None
_c = None
_curr_row = None
_i = 0
def _... | tuxor1337/dictmaster | dictmaster/stages/processor.py | processor.py | py | 9,057 | python | en | code | 32 | github-code | 6 | [
{
"api_name": "dictmaster.util.CancelableThread",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "sqlite3.connect",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "dictmaster.util.FLAGS",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": ... |
71148383548 | from flask import Flask, request, jsonify
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.ext.declarative import declarative_base
from flask_jsontools import JsonSerializableBase
from sqlalchemy.inspection import inspect
import os
app = Flask(__name__)
basedir = os.path.abspath(os.path.dirname(__file__))
app.... | drewsoske/sports-pools-REST-API | models.py | models.py | py | 3,925 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_n... |
19929528193 | import pygame
from vector import Point
GRID_COLOR = 100,100,100
AXES_COLOR = 155,155,155
OBSTACLE_COLOR = 0,140,0
BOT_COLOR = 255,0,0
TARGET_COLOR=255,255,0
SENSOR_COLOR=50,50,155
TARGET_RADIUS = 5
DRAW_COORD_GRID = False
DRAW_SENSOR_RANGE = True
DRAW_SENSOR_RAYS = False
DRAW_VELOCITY = True
DRAW_DIRECTION = False
... | sempav/potential_field | engine/graphics.py | graphics.py | py | 3,070 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "pygame.draw.circle",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pygame.draw",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "pygame.draw.line",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pygame.draw",
... |
33490878165 | import json
import traceback
from datetime import date, timedelta
from apscheduler.schedulers.background import BackgroundScheduler
import mysql.connector
from databaseConnection import getCredentials
from encryption import *
import numpy as np
import pandas as pd
from sklearn import tree
import requests
from xml.et... | DominikBazan/asthma-support-web-service | db_operations.py | db_operations.py | py | 22,597 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "mysql.connector.connection.cursor",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "mysql.connector.connection",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "mysql.connector",
"line_number": 18,
"usage_type": "name"
},
{
... |
26112910255 | __authors__ = ["T. Vincent"]
__license__ = "MIT"
__date__ = "26/04/2018"
import logging
import numpy
import collections
from typing import Union
import silx
from .. import qt
from .. import colors
from .. import icons
from . import items, PlotWindow, PlotWidget, actions
from ..colors import Colormap
from ..colors i... | silx-kit/silx | src/silx/gui/plot/ImageView.py | ImageView.py | py | 37,887 | python | en | code | 106 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.nansum",
"line_number": 87,
"usage_type": "call"
},
{
"api_name": "numpy.nansum",
... |
355173022 | from datetime import datetime
from decimal import Decimal
from flask import Blueprint, render_template, session, url_for, flash, redirect, abort
from flask_mail import Message
from nuts_and_bolts.config import Config
from nuts_and_bolts.cart.forms import CartForm
from nuts_and_bolts import db, mail
from nuts_and_bolts.... | wmcgee3/capstone-b01-yellow | nuts_and_bolts/cart/routes.py | routes.py | py | 4,711 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "flask.Blueprint",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "nuts_and_bolts.cart.forms.CartForm",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "nuts_and_bolts.db.session.query",
"line_number": 18,
"usage_type": "call"
},
{
... |
71840532987 | from credentials import github_token
import requests
import pandas as pd
import csv
import json
import time
def scrape_email(url):
data = requests.get(url).text
user_json = json.loads(data)
try:
login = user_json['login']
email = user_json['email']
return (login, email)
except:
if user_json['message'] == ... | haoshuai999/Master-project | email_address.py | email_address.py | py | 1,103 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "credentials.github_token",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "pandas.DataFrame",
... |
28919591690 | import numpy as np
import networkx as nx
import gym
import hashlib
GAMMA = 1
# import gym env variables
env = gym.make()
env.seed(1)
ACTION_SPACE = env.action_space.n
OBS_SPACE = env.observation_space
graph = nx.DiGraph()
###############################
# perform in 'incomplete knowledge'
# environment.
# Perform... | dGomez7/NeurIPS-2019-submission | TdZero/index.py | index.py | py | 4,536 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "gym.make",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "networkx.DiGraph",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.random.random",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"lin... |
7194885381 | '''
Sample predictive model.
You must supply at least 4 methods:
- fit: trains the model.
- predict: uses the model to perform predictions.
- save: saves the model.
- load: reloads the model.
'''
import numpy as np # We recommend to use numpy arrays
from os.path import isfile
from preprocess import preprocess
from sk... | Fanoa/Taxi | starting_kit/sample_code_submission/model.py | model.py | py | 3,650 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "sklearn.base.BaseEstimator",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "preprocess.preprocess",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "modelRegressor.modelRegressor",
"line_number": 28,
"usage_type": "call"
},
{
"ap... |
1853102170 | import matplotlib.pyplot as plt
import numpy as np
import scipy.optimize as scio
data_290K = np.loadtxt('~/Documents/Bachelor_Projekt/RITA_PG/RITA-2-PG_as_analyzer_20210312_102231/mccode.dat')
Ei_290K = []
I_290K = []
I_err_1 = []
for i in data_290K:
Ei_290K.append(i[0]-5)
for i in data_290K:
if i[11] <= ... | KristineKrighaar/PG_project | Original_McStas_Files/RITA_PG/RITA_Data_behandling.py | RITA_Data_behandling.py | py | 2,318 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.loadtxt",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number"... |
34733523547 | from os import environ
from unittest import mock
import dataset
import pytest
import app
DATABASE_URL = environ.get('TEST_DATABASE_URL', default='sqlite:///:memory:')
db = dataset.connect(DATABASE_URL, engine_kwargs=app.engine_config)
@pytest.fixture
def msg():
_msg = mock.Mock()
_msg.chat.id = 1
_msg.... | joaorafaelm/telegram-tldr-bot | test_app.py | test_app.py | py | 3,136 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "os.environ.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "dataset.connect",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "app.engine_config",
"line... |
28421339090 | # -*- coding: utf-8 -*-
# @Time : 2020/3/8 18:14
# @Author : Marko Li 'lxh800109@gmail.com'
# @Site :
# @File : urls.py
# @Software: PyCharm
# __create_data__=2020/3/8 18:14
# @Description: add Description
from django.conf.urls import url
from django.contrib import admin
from django.urls import path
from vot... | SuperTrampAI/base_demo_django | vote/urls.py | urls.py | py | 873 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "vote.views.show_teachers",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "vote.views",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "django.urls... |
7123385140 | import os
import discord
import requests
from dotenv import load_dotenv
load_dotenv()
client = discord.Client()
BASE_URL = os.getenv('BASE_URL')
PLEX_API_TOKEN = os.getenv('PLEX_API_TOKEN')
SONARR_API_TOKEN = os.getenv('SONARR_API_TOKEN')
DISCORD_API_TOKEN = os.getenv('DISCORD_API_TOKEN')
QUERY_RECENTS = "/library/re... | asood92/PlexBot | app.py | app.py | py | 2,898 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "discord.Client",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number... |
39123913010 | import logging
from typing import Any
from fastapi import HTTPException, status
from configs.database import create_session
from repositories.user_master import (
confirm_email_user,
create_user_master,
delete_user_master_object,
get_single_user_email,
get_single_user_id,
get_user_id,
upda... | Dimaps716/prueba_backend_R5 | src/services/users_master.py | users_master.py | py | 4,457 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "configs.database.create_session",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "repositories.user_master.get_single_user_id",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "fastapi.HTTPException",
"line_number": 37,
"usage_type": "cal... |
6587870634 | import pandas
import numpy as np
import plotly.graph_objs as go
from signal import signal
from datetime import datetime
from plotly.offline import plot
DATA = None
LAMBDA = None
def absorbance(amount):
global DATA, LAMBDA
# getting last 'amount' measurements
amount *= -1
DATA = pandas.read_csv('dat... | Physiolution-Polska/ASpecPy | Flask_Plotly/plots.py | plots.py | py | 4,522 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.fromtimestamp",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "plo... |
43956051430 | import pandas as pd
from sqlalchemy import create_engine
from apyori import apriori
engine = create_engine('postgresql://postgres:postgres@193.37.212.191:5432/postgres')
def remove_trans(li):
for l in li:
l[:] = (ele for ele in l if ((ele != None) and (str(ele) != 'nan') and (str(ele) != 'None')))
# Dat... | AsianMiracle/LeadersHack | apriori_script.py | apriori_script.py | py | 1,443 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pandas.read_sql",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.read_sql",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pandas.read_s... |
11933556994 | '''Unit testing get_customer_projects.py file.'''
import pytest
from flask import request
from customer_onboarding.apis.get_customer_projects import getCustomerProjects
from customer_onboarding.database.Customer_Onboarding_db import CustomerOnboarding_db
from tests.mock import mock_get, mock_flask_app, mock_get_sqlalch... | syedkaiser123/Customer-Onboarding | customer-onboarding-backend/tests/apis/test_get_customer_projects.py | test_get_customer_projects.py | py | 3,630 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.request.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.request",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "flask.request.get",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "flask.request",
... |
9897808141 | # stable diffusionのモデルをopenvino用のモデルに変換するツール。
# 一回diffusersの形式を経由する。
# SD-safetensors -> diffusers -> openvino ir という流れで変換する。
import os
import argparse
import pathlib
import shutil
from optimum.intel import OVStableDiffusionPipeline
from diffusers import StableDiffusionPipeline
def main(args):
safetensors_to_ov(... | nuuuuume/sd-ov-tools | convert_safetensors_to_ov.py | convert_safetensors_to_ov.py | py | 2,999 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.isfile",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
26990530820 | from flask import Flask, request, jsonify, render_template
from utils import get_transcript_from_url
import os
app = Flask(__name__)
# url = "https://youtube.com/watch?v=ePj9P3pJkJ0"
@app.route('/')
def index():
return render_template('index.html')
@app.route('/get_video_text/', methods=['POST',])
def get_text(... | oluwakayode-a/Youtube-Captions | app.py | app.py | py | 778 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.request.json",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "flask.reques... |
14448513308 |
from openprompt.utils.logging import logger
from openprompt.data_utils.data_utils import InputExample, InputFeatures
from typing import *
from transformers.tokenization_utils import PreTrainedTokenizer
from openprompt import Template
class ManualTemplate(Template):
"""
Args:
tokenizer (:obj:`PreTr... | jiachenwestlake/PDA | openprompt/prompts/manual_template.py | manual_template.py | py | 5,359 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "openprompt.Template",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "transformers.tokenization_utils.PreTrainedTokenizer",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "openprompt.data_utils.data_utils.InputExample",
"line_number": 36,
... |
38185519920 | from __future__ import print_function
#import pyzbar.pyzbar as pyzbar
from pyzbar import pyzbar
import numpy as np
import cv2
import requests
state_old = "undetected"
state_new = "undetected"
'''
Start
-> undetected
User shows QR-code
-> detected
-> send_request_to_server
Use... | trmario/flask_qrcode | test_qrcode_gui.py | test_qrcode_gui.py | py | 2,081 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pyzbar.pyzbar.decode",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pyzbar.pyzbar",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "cv2.convexHull",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"... |
41389753767 | from datetime import datetime
import json
from PIL import Image, ImageDraw, ImageFont
import os,uuid
import re
global_json_logs = dict()
def sanitize(inputString):
inputString = inputString.replace(" ","_")
inputString = inputString.replace("/",",")
inputString = inputString.replace("-","_")
inputStri... | johnanthonyraluta/Port_Mapping | Resources/utilities/export/logs.py | logs.py | py | 3,089 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "datetime.datetime.now",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "json.dumps",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "PIL.ImageFont.true... |
9272789216 | from bs4 import BeautifulSoup
import os, sys, io
import codecs
import json
import string
import re
directory = sys.path[0] + "\\htmls\\" # directory
common_words_file = sys.path[0] + "\\files\\common_words.txt"
index = {}
# function to open files in the corpus folder
def indexer():
stopwords = stopwords_list(com... | nancyagrwal/Information-Retrieval | Project/indexer_with_stopping.py | indexer_with_stopping.py | py | 2,473 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "sys.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "sys.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "codecs.open",
"line_number":... |
70317037308 | import boto3
client = boto3.resource('ec2',region_name='us-west-2')
for instances in client.instances.filter(Filters=[
{
'Name': 'availability-zone',
'Values': ['us-west-2a']
}
]):
print ('The instance is {} and instances type is {}'.format(instances.instance_id,instances.instance_type))
| anandvamsi/pythonScripts | Boto3-resources-ec2.py | Boto3-resources-ec2.py | py | 316 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "boto3.resource",
"line_number": 2,
"usage_type": "call"
}
] |
35417203188 | import csv
import os
from typing import Iterable
from ..configs import Configs
from ..errors import InvalidDamageValueError, SeedNotFoundError
from ..tracker import FFXRNGTracker
from ..utils import s32
from .constants import GameVersion
def get_seed(damage_values: Iterable[int]) -> int:
damage_values_needed = D... | coderwilson/FFX_TAS_Python | tracker/ffx_rng_tracker/data/seeds.py | seeds.py | py | 6,033 | python | en | code | 14 | github-code | 6 | [
{
"api_name": "typing.Iterable",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "configs.Configs.game_version",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "configs.Configs",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "err... |
32636415760 | import json
from mock import Mock
from c7n.config import Bag
from c7n.exceptions import PolicyValidationError
from c7n.resources import aws
from c7n import output
from .common import BaseTest
class TraceDoc(Bag):
def serialize(self):
return json.dumps(dict(self))
class OutputXrayTracerTest(BaseTest)... | LRuttenCN/cloud-custodian | tests/test_aws.py | test_aws.py | py | 4,744 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "c7n.config.Bag",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "json.dumps",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "common.BaseTest",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "c7n.resources.aws.XrayEmitt... |
36377038229 | from flask import Flask, render_template, request, redirect
from flask_restful import Resource, Api
from flask import flash
from werkzeug.datastructures import FileStorage
app = Flask(__name__)
api = Api(app)
@app.route("/", methods=['POST', 'GET'])
def index():
if request.method == 'POST':
#print(request.form)... | dongzhang84/BookReco | Flask/app_test.py | app_test.py | py | 870 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask_restful.Api",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "flask.request",... |
73944978108 | from .video_transcode import transcode_aws
from .search import index_video
from celery.decorators import task
from .models import Video
from .text_processing import process_text_to_get_topics, summarize_video_text
@task()
def parse_video_upload(s3_file_name, video_id):
video_result = transcode_aws(s3_file_name)
... | colanconnon/cs410project | cs410videosearchengine/videosearchengine/tasks.py | tasks.py | py | 665 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "video_transcode.transcode_aws",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "text_processing.process_text_to_get_topics",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "text_processing.summarize_video_text",
"line_number": 15,
"usage... |
16267655399 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import render_template, request, redirect, url_for, flash, Blueprint, jsonify, current_app
from sqlalchemy import func
from guitarfan.models import *
from guitarfan.extensions.flasksqlalchemy import db
from guitarfan.extensions.flaskcache import cache
bp_site... | lowrain/GuitarFan | guitarfan/controlers/site/index.py | index.py | py | 1,618 | python | en | code | 48 | github-code | 6 | [
{
"api_name": "flask.Blueprint",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "guitarfan.extensions.flasksqlalchemy.db.session.query",
"line_number": 28,
"usage_type": "call"
}... |
11968559269 | import warnings
import os
import shutil
# 忽视警告
warnings.filterwarnings('ignore')
import cv2
from PIL import Image
import torch
from torch_py.FaceRec import Recognition
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
# 确认我们的电脑支持CUDA,然后显示CUDA信息:
#print(device)
pnet_path =... | spicy-dog/Crop-face-using-MTCNN | face_cropper.py | face_cropper.py | py | 1,625 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "torch.device",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.cud... |
35416562968 | import logging
import math
import battle.main
import memory.main
import pathing
import vars
import xbox
from paths import Airship
logger = logging.getLogger(__name__)
game_vars = vars.vars_handle()
FFXC = xbox.controller_handle()
def air_ship_path(version):
memory.main.click_to_control()
distiller_purchase... | coderwilson/FFX_TAS_Python | airship_pathing.py | airship_pathing.py | py | 10,626 | python | en | code | 14 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "vars.vars_handle",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "xbox.controller_handle",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "memory.main... |
6711790930 | import requests
APIkey = "648ddc0322fabc7ef11a2732cfe14cb9"
def get_data(place, forecast_days=None):
url = f"http://api.openweathermap.org/data/2.5/forecast?q={place}&appid={APIkey}&units=metric"
response = requests.get(url)
data = response.json()
filtered_data = data["list"]
nr_values = 8 * forec... | joaoZumbi/App7_weather_forecast_data_app | backend.py | backend.py | py | 491 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 7,
"usage_type": "call"
}
] |
33056338255 | import openai
import discord
openai.api_type = "azure"
openai.api_version = "2023-03-15-preview"
# specifying our server
GUILD = "{Creative-Tech-Apprenticeship}"
# create an object that will control our discord bot
client = discord.Client(intents=discord.Intents.default())
with open("keys.txt") as f:
# converting ... | katsully/chatgpt-discord-bot | 09_BotDallE.py | 09_BotDallE.py | py | 1,343 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "openai.api_type",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "openai.api_version",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "discord.Client",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "discord.Int... |
71882597308 |
from tool.storage import*
chargeurstorage()
#importation des libs
import pygame,sys
from GameData.Niveaux.World_1.niveau_1.niveau_1 import niveau_1
niveau1 = niveau_1()
#importation des outils
from tool.button import Button
#initialisation des composant de pygame
pygame.init()
#definition de la fenètre du jeux
scre... | albator105/Fight-of-mighty | Fight_of_Mighty.py | Fight_of_Mighty.py | py | 14,480 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "GameData.Niveaux.World_1.niveau_1.niveau_1.niveau_1",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.init",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 16,
"usage_type": "call"
},
{... |
42948353150 | from common.lib.servers.Pulser2.pulse_sequences.pulse_sequence import pulse_sequence
from labrad.units import WithUnit
class optical_pumping_133(pulse_sequence):
required_parameters = [
('OpticalPumping133', 'channel_493'),
('OpticalPumping133', 'frequency_4... | barium-project/barium | lib/scripts/pulse_sequences/depreciated/OpticalPumping133_old.py | OpticalPumping133_old.py | py | 7,273 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "common.lib.servers.Pulser2.pulse_sequences.pulse_sequence.pulse_sequence",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "labrad.units.WithUnit",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "labrad.units.WithUnit",
"line_number": 43,
... |
730928254 | """
Dummy delete of duplicate lines in google spreadsheet.
"""
import gspread
from oauth2client.service_account import ServiceAccountCredentials as ServiceAC
def main():
scope = ['https://spreadsheets.google.com/feeds',
'https://www.googleapis.com/auth/drive']
credentials = ServiceAC.from_js... | pavelpy/hacker-laws-ru | tools/google_spreadsheet_del_dub.py | google_spreadsheet_del_dub.py | py | 956 | python | en | code | 19 | github-code | 6 | [
{
"api_name": "oauth2client.service_account.ServiceAccountCredentials.from_json_keyfile_name",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "oauth2client.service_account.ServiceAccountCredentials",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "gspread.auth... |
20519967120 | """!
@brief Templates for tests of Local Excitatory Global Inhibitory Oscillatory Network (LEGION).
@authors Andrei Novikov (pyclustering@yandex.ru)
@date 2014-2020
@copyright BSD-3-Clause
"""
from pyclustering.nnet.legion import legion_network;
from pyclustering.nnet import conn_type;
from pycluste... | annoviko/pyclustering | pyclustering/nnet/tests/legion_templates.py | legion_templates.py | py | 1,835 | python | en | code | 1,113 | github-code | 6 | [
{
"api_name": "pyclustering.nnet.legion.legion_network",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pyclustering.nnet.conn_type.LIST_BIDIR",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "pyclustering.nnet.conn_type",
"line_number": 21,
"usa... |
34476281654 | from dataclasses import dataclass
import sys
import os
INPUT = open(os.path.join(sys.path[0], 'input')).read()
@dataclass
class Node:
id: str
parents: []
children: []
depth: 0
def tree_from_input(input: str):
edges = input.split('\n')
tree = {}
for edge in edges:
parent_child ... | jfoltyn/adventofcode_2019 | puzzle_6/puzzle_6_2.py | puzzle_6_2.py | py | 1,039 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "sys.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "dataclasses.dataclass",
"lin... |
811940356 | # N-ary Tree Level Order Traversal - https://leetcode.com/problems/n-ary-tree-level-order-traversal/
'''Given an n-ary tree, return the level order traversal of its nodes' values.
Nary-Tree input serialization is represented in their level order traversal, each group of
children is separated by the null value (See exa... | Saima-Chaity/Leetcode | Tree/N-ary Tree Level Order Traversal.py | N-ary Tree Level Order Traversal.py | py | 1,124 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.deque",
"line_number": 26,
"usage_type": "call"
}
] |
36995272858 | from django.contrib import admin
from scoap3.authors.models import Author, AuthorIdentifier
class AuthorAdmin(admin.ModelAdmin):
list_display = ["id", "article_id", "first_name", "last_name"]
search_fields = ["article_id"]
raw_id_fields = ["article_id"]
class AuthorIdentifierIdentifierAdmin(admin.Model... | SCOAP3/scoap3 | scoap3/authors/admin.py | admin.py | py | 582 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 12,
"usage_type": "attribute"
... |
39865290420 | import json
from pathlib import Path
from shutil import move
from typing import Union
from loguru import logger
from src.data import DATA_DIR
with open(DATA_DIR / 'extensions.json') as f:
file_extensions = json.load(f)
class OrganizeFiles():
def __init__(self, extensions=file_extensions):
extensions... | AlirezaMirkazemi/clean_directory | src/Organize.py | Organize.py | py | 1,201 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "src.data.DATA_DIR",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "json.load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "typing.Union",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_numb... |
21090303604 | from replit import clear
#HINT: You can call clear() to clear the output in the console.
def bid_calculate():
greatest=0
winner=""
for key in bidders:
if bidders[key]>greatest:
greatest=bidders[key]
winner=key
print(f"The winner is {winner} with a bid of {greatest}")
bidders={}
flag='yes'
from ... | Faranheit15/100-Days-of-Code | Day 09/Secret_Bidding.py | Secret_Bidding.py | py | 588 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "art.logo",
"line_number": 15,
"usage_type": "argument"
},
{
"api_name": "replit.clear",
"line_number": 22,
"usage_type": "call"
}
] |
26948940623 | # import the necessary packages
import numpy as np
import cv2
import glob
import os
from skimage.measure import compare_ssim
from sklearn.metrics import jaccard_similarity_score
# paths and directories
pathToPatterns = './multi_label/'
pathToMyMasks = './my_masks/'
pathToResults = './ComparisionMasks/'
# read the pa... | Walczi123/Image-Processing-and-Computer-Vision | Project I/maskComparison.py | maskComparison.py | py | 6,471 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.imread",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "cv2.threshold",
"... |
35130944264 | # -*- coding: utf-8 -*-
"""
Extract attribution data CTS-Compliant TEI XML
"""
import json
import logging
import os
import re
from collections import Counter, OrderedDict, defaultdict
import yaml
from scaife_viewer.atlas import constants
from scaife_viewer.atlas.conf import settings
from scaife_viewer.atlas.models imp... | scaife-viewer/scaife-viewer | sv_pdl/atlas/extractors/attributions.py | attributions.py | py | 11,641 | python | en | code | 74 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "scaife_viewer.atlas.conf.... |
29713362228 | # -*- coding: utf-8 -*-
import numpy as np
# import tensorflow as tf
import keras
from keras.layers import Input, Dense, GaussianNoise, Lambda, Dropout
from keras.models import Model
from keras import regularizers
from keras.layers.normalization import BatchNormalization
from keras.optimizers import Adam, SGD... | FassyGit/ML-in-physical-layer | AveragePower.py | AveragePower.py | py | 6,323 | python | en | code | 10 | github-code | 6 | [
{
"api_name": "numpy.random.seed",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "tensorflow.set_random_seed",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.log2",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.random.... |
29767560344 | from __future__ import print_function
import os, sys, imp, json, subprocess
import validate_all_scripts
from argparse import ArgumentParser
def execute(message, command_line, return_='status', until_successes=False, terminate_on_failure=True, silent=False, silence_output=False):
if not silent: print(message); p... | MedicaicloudLink/Rosetta | main/rosetta_scripts_scripts/tests/verify_all_scripts_accounted_for.py | verify_all_scripts_accounted_for.py | py | 4,635 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "sys.stdout.flush",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "subprocess.Popen",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
... |
17814155302 | """
Summary
-------
See Also
--------
"""
#********** Import major pakage or module **********
from numba.experimental import jitclass
from numba import types, typed
#********** Import orizinal module **********
#********** Constant Value **********
__all__ = ["TowardStableModel"]
#********** Class **********
#... | SS310/phasepy | phasepy/martensite/variable/define/_model.py | _model.py | py | 1,284 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "numba.typed.Dict",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "numba.typed",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "numba.experimental.jitclass",
"line_number": 26,
"usage_type": "call"
}
] |
41022566014 | import os
from datetime import datetime
import click
import numpy as np
import pandas as pd
import torch
import wandb
from torch.utils.data import DataLoader, SubsetRandomSampler
from transformers import AdamW, get_scheduler
from transformers import logging as hf_logging
from tqdm import tqdm
from config import MODE... | Weber12321/image_ai_playground | run_trocr.py | run_trocr.py | py | 9,476 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.environ",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "transformers.logging.set_verbosity_error",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "transformers.logging",
"line_number": 44,
"usage_type": "name"
},
{
"api... |
14325580378 | from logic import tickets
from services.elasticsearch import eservice
import os
import config
if __name__ == "__main__":
def client_job():
director = tickets.Director()
builder = tickets.ConcreteBuilder1()
director.builder = builder
director.build_file_to_upload()
Upload ... | MiklukhoPognaly/vacation-planner-middleware | client.py | client.py | py | 689 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logic.tickets.Director",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logic.tickets",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "logic.tickets.ConcreteBuilder1",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "l... |
41686909998 | from Simulator import Simulation, getTargetSize
from Agent import Agent
import websockets
import asyncio
import json
import os
FPS = int(os.environ.get('FPS', 30))
FRAMESKIP = int(os.environ.get('FRAMESKIP', 10))
WS_PORT = int(os.environ.get('WS_PORT', 8081))
sim = Simulation()
sockets = set()
size = getTargetSize(... | burnpiro/airport-ai | simulator/simulation_server.py | simulation_server.py | py | 1,724 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "os.environ.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_num... |
39259160716 | from django.db.models import Count
from rest_framework.response import Response
from rest_framework import serializers
from rest_framework.routers import DefaultRouter
from rest_framework.viewsets import ModelViewSet
from eums.api.filter.filter_mixin import RequestFilterMixin
from eums.api.standard_pagination import St... | unicefuganda/eums | eums/api/release_order/release_order_endpoint.py | release_order_endpoint.py | py | 3,755 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.CharField",
"line_number": 13,
"usa... |
31592824879 | from audioop import avg
import cv2
import os
import numpy as np
from sklearn import svm
from sklearn.ensemble import RandomForestClassifier
from xgboost import XGBClassifier
from sklearn.naive_bayes import GaussianNB
from sklearn.utils import shuffle
from sklearn.metrics import confusion_matrix
from sklearn.neural_netw... | EduardoH0/deepfakes_detection | testing_models.py | testing_models.py | py | 3,952 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "numpy.concatenate",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "numpy.concatenate",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "sklearn.svm.SVC",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "sklearn.svm",
... |
34004762312 | from collections import deque
def solution(x, y, n):
def bfs(x, y, n):
q = deque()
dist[x] = 1
q.append(x)
while q:
x = q.popleft()
if 0 <= x + n <= 1000000 and dist[x + n] == 0:
dist[x + n] = dist[x] + 1
q.append(x + n)
... | jinman-kim/algo | 숫자 변환하기.py | 숫자 변환하기.py | py | 761 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.deque",
"line_number": 6,
"usage_type": "call"
}
] |
23642610514 | # -*- coding:utf-8 -*-
#@Time : 2020/5/3 14:51
#@Author: Triomphe
#@File : mod_get_config.py
import configparser
from modules import mod_get_rootPath
import logging
def getConfig(section, key=None):
"""
获取配置信息
:param section: ini的section
:param key: 默认为None 则返回整个section,否则返回section的某个key
:return:... | TriompheL/Ratel | modules/mod_get_config.py | mod_get_config.py | py | 719 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "modules.mod_get_rootPath.get_root_path",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "modules.mod_get_rootPath",
"line_number": 19,
"usage_type": "name"
},
... |
37325249850 | import matplotlib.pyplot as plt
year = [2011,2012,2013,2014,2015]
player1 = [8,10,12,7,9]
player2 = [7,12,5,15,21]
player3 = [18,20,22,25,19]
#Stack Plot
plt.plot([],[],color="pink",label="player")
plt.plot([],[],color="red",label="player")
plt.plot([],[],color="blue",label="player")
plt.stackplot(year,player1,pla... | ErenBtrk/Python-Fundamentals | Matplotlib/graphs.py | graphs.py | py | 458 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matpl... |
26624940996 | ####################################################################
# Last step in the order process - confirm the info and process it
#####################################################################
from django.core import urlresolvers
from django.http import HttpResponseRedirect
from django.shortcuts import re... | dokterbob/satchmo | satchmo/apps/payment/views/confirm.py | confirm.py | py | 10,359 | python | en | code | 30 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "livesettings.config_value",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "satchmo_utils.dynamic.lookup_template",
"line_number": 108,
"usage_type": "call"
},
{
... |
17639641477 | import random
from random import randrange
from math import gcd, log
from collections import namedtuple
import binascii
hexlify, unhexlify = binascii.hexlify, binascii.unhexlify
from base64 import *
import string
import pickle
import idlelib
import os
import string
Key = namedtuple('Key', 'exponent modulus')
KeyPair =... | 3DCoded/rsa | rsa.py | rsa.py | py | 4,823 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "binascii.hexlify",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "binascii.unhexlify",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "collections.namedtuple",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "co... |
35413636321 | import zmq
from zmq.eventloop.ioloop import IOLoop
from .serializer import PickleSerializer
#-----------------------------------------------------------------------------
# RPC base class
#-----------------------------------------------------------------------------
class RPCBase(object):
def __init__(self, lo... | ellisonbg/zpyrpc | zpyrpc/base.py | base.py | py | 1,892 | python | en | code | 13 | github-code | 6 | [
{
"api_name": "zmq.eventloop.ioloop.IOLoop.instance",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "zmq.eventloop.ioloop.IOLoop",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "zmq.Context.instance",
"line_number": 29,
"usage_type": "call"
},
{
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.