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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
24406127839 | from torch.nn import Module
from torch import nn
import torch
# import model.transformer_base
import math
from model import GCN
import utils.util as util
import numpy as np
import torch.nn.functional as F
# torch.autograd.set_detect_anomaly(True)
#parameters
# input = 20
# input_attention = 40
# output_attention = 2... | leob03/human_motion_forecasting | scripts/model/RNNAttModel1.py | RNNAttModel1.py | py | 9,218 | python | en | code | 5 | github-code | 97 | [
{
"api_name": "torch.nn.Module",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv1d",
"l... |
16243637524 | import dash
from dash import dcc, html
dash.register_page(__name__, path="/")
# Import image
pic_link = "https://images.unsplash.com/photo-1606768666853-403c90a981ad?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8NXx8ZmxpZ2h0fGVufDB8fDB8fA%3D%3D&w=1000&q=80"
# ------- App Layout ----------
layout = html.Div(
child... | austinloh/dsa3101-2220-03-airline | frontend/pages/home.py | home.py | py | 2,060 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "dash.register_page",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "dash.html.Div",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "dash.html",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "dash.html.Div",
"line_n... |
23965255712 | #!/usr/bin/python
# python3
from apiclient.discovery import build
from apiclient.errors import HttpError
from oauth2client.tools import argparser
import os
# important Constants
DEVELOPER_KEY = "AIzaSyCYa3J7eFc1tK5HUZDuUWV9_tY58dU3CSY"
YOUTUBE_API_SERVICE_NAME = "youtube"
YOUTUBE_API_VERSION = "v3"
def GetChannelId... | Kamirus/youtube-video-organizer | api/DajeMiListeFilmowILinkowPoUserName.py | DajeMiListeFilmowILinkowPoUserName.py | py | 2,274 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "apiclient.discovery.build",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "apiclient.discovery.build",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "oauth2c... |
29984203336 | #!/usr/bin/env python
import pickle
import sklearn
import numpy as np
import scipy
from sklearn import feature_extraction, ensemble, tree, neighbors, model_selection, svm, naive_bayes
import sys
import util
def main():
feature_extract("train", "test")
def feature_extract(train_path, test_path):
NUM_FEATURES ... | Shwam/toxicity | train.py | train.py | py | 1,978 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "util.preprocessed",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "util.labels",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "util.preprocessed",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "util.labels",
"li... |
28794402854 | #!/usr/bin/env python3
from __future__ import print_function
# Copyright (C) 2015 Vibhav Pant <vibhavp@gmail.com>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License... | vibhavp/dotty | dotty.py | dotty.py | py | 4,035 | python | en | code | 55 | github-code | 97 | [
{
"api_name": "sys.stderr",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "os.path.expanduser",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "os.path.isdir",
"line_... |
36629565809 | # Dependencies
import numpy as np
import pandas as pd
import datetime as dt
import sqlalchemy
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, func, inspect
from flask import Flask, jsonify
#Create engine to SQLite database file
engine = create... | hsnguyen1995/uci_hw | Unit10Advanced-Data-Storage-and-Retrieval/app.py | app.py | py | 3,279 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.ext.automap.automap_base",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.Session",
"line_number": 26,
"usage_type": "call"
},
{
... |
28570713247 | #!/usr/bin/python3
import pygame
from pygame.locals import *
####################### Paramètres du jeu ##########################
title = "Zelda Laby"
image_icone = "images/link_right.gif"
image_intro = "images/intro.jpg"
image_back = "images/back.jpg"
image_wall = "images/wall.gif"
image_start = "images/thumb_Hole... | CodingClub-Montpellier/Camp-5-13-2017 | CodingDayProject/codingday.py | codingday.py | py | 4,372 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pygame.image.load",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.load",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "pygame.image",
... |
20119061427 | from selenium import webdriver
from WebAddressChanger import WebAddressChanger as wac
options = webdriver.ChromeOptions()
options.add_argument("--headless") #It prevent web browser window from appearing
driver = webdriver.Chrome(executable_path="C:/Users/Maliccy/AppData/Local/Programs/chromedriver.exe", chrome_options... | malmat94/WebCodeEXTR | site_code_extractor.py | site_code_extractor.py | py | 904 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "selenium.webdriver.ChromeOptions",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 6,
"usage_type": "call"
},
{
"api_na... |
28917984141 | # -*- coding: utf-8 -*-
import maya.cmds as cmds
def undoWrapper(function):
"""
undo wrapper (used in decorator)
"""
def wrapper(*args, **kwargs):
cmds.undoInfo(ock=True)
result = function(*args, **kwargs)
cmds.undoInfo(cck=True)
return result
return wrapper
de... | akasaki1211/maya_expressionCollision | expCol/utils.py | utils.py | py | 2,698 | python | en | code | 22 | github-code | 97 | [
{
"api_name": "maya.cmds.undoInfo",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "maya.cmds",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "maya.cmds.undoInfo",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "maya.cmds",
"line_n... |
25614596892 | """Flask app for Cupcakes"""
from flask import Flask, json, request, jsonify, render_template
from flask.globals import session
from forms import *
from models import *
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql:///cupcake_db'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
app.co... | TheLordZee/cupcakes | app.py | app.py | py | 2,072 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"l... |
10550613036 | from torch.utils.data import Dataset
import os
import cv2
import sys
sys.path.append("..")
from config import cfg
import numpy as np
from util.meteo import dBZ2Pixel
def load_rain_f_data():
train_data = Data(mode='train')
test_data = Data(mode='test')
return train_data, test_data, test_data
... | mazhf/MS-RNN | util/load_rain_f.py | load_rain_f.py | py | 1,912 | python | en | code | 19 | github-code | 97 | [
{
"api_name": "sys.path.append",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.utils.data.Dataset",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "os.path.join",
... |
40489524816 | import sqlite3
from os import path
from typing import Callable, Optional
from siebenapp.autolink import AutoLink, AutoLinkData
from siebenapp.domain import Graph
from siebenapp.enumeration import Enumeration
from siebenapp.goaltree import Goals
from siebenapp.layers import all_layers, get_root
from siebenapp.zoom impo... | ahitrin/SiebenApp | siebenapp/system.py | system.py | py | 7,998 | python | en | code | 12 | github-code | 97 | [
{
"api_name": "siebenapp.domain.Graph",
"line_number": 112,
"usage_type": "name"
},
{
"api_name": "os.path.isfile",
"line_number": 113,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 113,
"usage_type": "name"
},
{
"api_name": "sqlite3.connect",
... |
7976718771 | import streamlit as st
import json
import pandas as pd
import matplotlib.pyplot as plt
st.title("ESG Risk Assessment Summary for Darling Ingredients")
# Load data
esg_summary_file = "esg_summary.json"
esg_scores_file = "esg_scores.json"
plot_filename = "yearly_esg_risks_plot.png"
with open(esg_summary_file, 'r') as ... | lalamm/sus_detective | summary.py | summary.py | py | 3,400 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "streamlit.title",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame.from_dict",
"... |
2940218319 | import os
import requests
import sys
import tempfile
import zipfile
try:
import pathlib
except ImportError:
import pathlib2 as pathlib
headers = {'X-API-Key': os.getenv('BUNGIE_API_KEY')}
MANIFEST_URL = 'https://bungie.net/Platform/Destiny2/Manifest/'
response = requests.get(MANIFEST_URL, headers=headers)
m... | nrb/destiny2_api_tools | get_manifest.py | get_manifest.py | py | 1,010 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.getenv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pathlib2.Path",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 22... |
73251082878 | import numpy as np
import scipy.io as sio
import os
from skewt import SkewT
from matplotlib.pyplot import rcParams,figure,show,draw, subplot
from datetime import datetime, timedelta
import matplotlib.pyplot as plt
from matplotlib.ticker import ScalarFormatter, MultipleLocator
base_dir = os.path.expanduser('~')
#******... | franciscolang/Southern_Ocean_BL | Python/Profiles/Old/Soundings/subplot_skwet_cases.py | subplot_skwet_cases.py | py | 4,314 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.path.expanduser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "scipy.io.loadmat",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "scipy.io",
"line... |
2377481163 | import tensorflow as tf
from sklearn.datasets import load_sample_images
import tensorflow_datasets as tfds
def sample_resnet():
model = tf.keras.applications.ResNet50(weights="imagenet")
images = load_sample_images()["images"]
images_resized = tf.keras.layers.Resizing(height=224, width=224,
... | rickhall2000/sabbatical-2022 | Second-Hand-Machine-Learning/ch14_pretrained.py | ch14_pretrained.py | py | 3,135 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "tensorflow.keras.applications.ResNet50",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "sklearn.datasets.load_sample_images",
"line_number": 8,
"usage_type": "call"
... |
39114022987 |
import logging
logging.basicConfig(filename='debug.log', level=logging.DEBUG)
def factorial(n=10):
"""Calculates factorials with log messages."""
i = 1
factorial = 1
while i < n:
logging.info('starting iteration {}'.format(i))
factorial *= i
logging.debug('new factorial: {}'... | krother/advanced_python | error_handling/logging_example.py | logging_example.py | py | 561 | python | en | code | 122 | github-code | 97 | [
{
"api_name": "logging.basicConfig",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "logging.info",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.debug",
... |
23726843618 | '''
This is a file to run the ELden Ring Object Detection model
It used multiprocessing to split capturing, processing, and running the model into different
processes to speed things up.
'''
import torch
import time
from PIL import ImageGrab
import numpy as np
import cv2
import torch.multiprocessing as mp
class ... | mattjax16/CS337-Operating-Systems | Projects/Proj9/EldenRingAi/runModelParallel.py | runModelParallel.py | py | 9,725 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "torch.multiprocessing.Process",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "torch.multiprocessing",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "torch.multiprocessing.Process.__init__",
"line_number": 22,
"usage_type": "call"... |
29397966223 | from netaddr import IPAddress, IPNetwork
from spiderfoot import SpiderFootEvent, SpiderFootPlugin
class sfp_blocklistde(SpiderFootPlugin):
meta = {
'name': "blocklist.de",
'summary': "Check if a netblock or IP is malicious according to blocklist.de.",
'flags': [],
'useCases': ["I... | smicallef/spiderfoot | modules/sfp_blocklistde.py | sfp_blocklistde.py | py | 7,145 | python | en | code | 10,704 | github-code | 97 | [
{
"api_name": "spiderfoot.SpiderFootPlugin",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "netaddr.IPNetwork",
"line_number": 93,
"usage_type": "call"
},
{
"api_name": "netaddr.IPAddress",
"line_number": 95,
"usage_type": "call"
},
{
"api_name": "spider... |
31149982091 | # SPDX-License-Identifier: GPL-2.0-or-later
__author__ = "Nutti <nutti.metro@gmail.com>"
__status__ = "production"
__version__ = "6.6"
__date__ = "22 Apr 2022"
import bpy
from mathutils import Vector
from bpy.props import EnumProperty, BoolProperty, FloatVectorProperty
import bmesh
from .. import common
from ..utils... | nutti/Magic-UV | src/magic_uv/op/align_uv_cursor.py | align_uv_cursor.py | py | 10,953 | python | en | code | 601 | github-code | 97 | [
{
"api_name": "utils.compatibility.check_version",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "utils.compatibility",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "mathutils.Vector",
"line_number": 56,
"usage_type": "call"
},
{
"api_name":... |
12669162923 | from os.path import abspath
import pyspark
from delta import configure_spark_with_delta_pip
from tabledancer.dancers.deltabricks.dancer import DeltabricksBackend
from tabledancer.dancers.deltabricks.dancer import \
DeltabricksDancer as _DeltabricksDancer
class DeltaSparkBackend(DeltabricksBackend):
def __in... | codeBehindMe/tabledancer | tabledancer/dancers/deltaspark/dancer.py | dancer.py | py | 979 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "tabledancer.dancers.deltabricks.dancer.DeltabricksBackend",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "pyspark.sql.SparkSession.builder.appName",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pyspark.sql",
"line_number": 14,
"usag... |
70767344959 | #coding:utf-8
from django.shortcuts import render
from django.shortcuts import render,HttpResponse
import json
from core import data_optimization
from core import data_processing
from monitor.chart_api import get_ladata_series_key_list
from monitor.controller.client_handler import ClientHandler
from django.views.decor... | zhaobin022/oms | monitor/views.py | views.py | py | 4,855 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "utils.redis_conn.redis_conn",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "oms.settings",
"line_number": 14,
"usage_type": "argument"
},
{
"api_name": "utils.redis_conn",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "monitor... |
654485014 | from .fuzzy_sets import FuzzySet, MF_object, Triangular_MF, SingletonsSet
from .rule_parsing import recursive_parse, preparse, postparse
from numpy import array, linspace, meshgrid, geomspace, log10, finfo, float64
from scipy.interpolate import interp1d
from copy import deepcopy
from collections import defaultdict, Ord... | aresio/simpful | simpful/simpful.py | simpful.py | py | 43,016 | python | en | code | 102 | github-code | 97 | [
{
"api_name": "matplotlib.pyplot",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "string.ascii_letters",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "string.... |
42581653533 | import math
from collections import defaultdict
# 木を出力
def s_exps(sym_i_j):
sym, i, j = sym_i_j.split(' ')
if sym_i_j in best_edge: # 非終端記号
return f'({sym} {s_exps(best_edge[sym_i_j][0])} {s_exps(best_edge[sym_i_j][1])})'
else: # 終端記号
return f'({sym} {words[int(i)]})'
# 文法を読み込む
# gramme... | kokeman/NLPtutorial | tutorial10/cky.py | cky.py | py | 2,620 | python | ja | code | 0 | github-code | 97 | [
{
"api_name": "collections.defaultdict",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "math.log2",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "math.log2",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",... |
22318542587 | import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
# file list
fileList = {
"i_70_72": "CRD_scripts/files_for_python/70_72.ALLchr.module.merged.intersect.bed",
"i_70_73": "CRD_scripts/files_for_python/70_73.ALLchr.module.merged.intersect.bed",
"i_72_73": "CRD_scrip... | dianamatata/CRDs_nov20 | A_CRDs/11_compute_bp_intersect.py | 11_compute_bp_intersect.py | py | 1,907 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pandas.DataFrame",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.around",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "seaborn.set",
"line... |
15917945820 | import pygame
from os import path
img_dir = path.join(path.dirname(__file__), 'img5')
snd_dir = path.join(path.dirname(__file__), 'snd4')
pygame.display.set_caption('Выше-ниже')
FPS = 60
WIDTH = 900
HEIGHT = 575
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
GRAY = (125, 125, 125)
LIGHT_BLUE = (64, 128, 255)
GREEN = (0,... | Handsomeneness/DiplomGame | Diplom/vishe_nisze.py | vishe_nisze.py | py | 3,908 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.path.join",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 5... |
26328310384 | """Test Force."""
from asyncio import sleep
from typing import List, Union, Tuple, Optional
from opentrons.hardware_control.ot3api import OT3API
from opentrons.hardware_control.types import GripperJawState
from hardware_testing.drivers import find_port, list_ports_and_select
from hardware_testing.drivers.mark10 impor... | Opentrons/opentrons | hardware-testing/hardware_testing/production_qc/gripper_assembly_qc_ot3/test_force.py | test_force.py | py | 8,022 | python | en | code | 363 | github-code | 97 | [
{
"api_name": "typing.List",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "hardware_testing.opentrons_api.types.Point",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "ty... |
38654708099 | import datetime
import os
File = os.path.basename(__file__)
EPS = 1e-8
def make_orders(order_books, pair, current_balance, need_base, need_quote):
"""
makes orders to rebalance assets
:param order_books: see example at the beginning of this file
:param pair: pair or currencies to balance assets for
... | LabMazurokCom/Blockchain | Arbitrage/ArbitrageBot/rebalancing.py | rebalancing.py | py | 5,944 | python | en | code | 8 | github-code | 97 | [
{
"api_name": "os.path.basename",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.utcnow",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "datetime.datetim... |
25462974997 | # This script uses Bayesian Optimization to navigate in the face Space.
# It allows to add a figure (in folder 'new_face') in order to add them
# in real time to the space.
import numpy as np
import os
import sys
import glob
import time
import argparse
import joblib
from PIL import Image
from sklearn.gaussian_process... | PedroFerreiradaCosta/NeuroadaptiveEEG | 1dBO_optm_signal.py | 1dBO_optm_signal.py | py | 10,523 | python | en | code | 5 | github-code | 97 | [
{
"api_name": "os.path.exists",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
... |
41089841435 | import datetime
# CAST DATE STRING INTO DATETIME
def parse_date(date_string):
if date_string is None:
return None
split_date = date_string.split('-')
parsed_date = [int(n) for n in split_date]
return datetime.datetime(*parsed_date)
# REFORMAT PHONE NUMBER STRING FROM '(xxx) xxx-xxxx' to 'xxx... | maxwelljmckee/TheDemocracyProject | backend/app/utils/string_parsers.py | string_parsers.py | py | 700 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "datetime.datetime",
"line_number": 10,
"usage_type": "call"
}
] |
38565687930 | from django.core.management import BaseCommand
import time
from core.models import ProductPicture, Product, Vendor
import requests
import tempfile
from django.core import files
import concurrent.futures
from django.core.files.uploadedfile import InMemoryUploadedFile
from django.core.files.base import ContentFile
from P... | webclinic017/DjangoImageSystem | Old_commands/test.py | test.py | py | 3,038 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.core.management.BaseCommand",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "io.BytesI... |
22098425260 | from typing import Any, Optional
import pytest
from fastapi.testclient import TestClient
from merino.main import app
from merino.providers import get_providers
from tests.unit.web.util import filter_caplog
from tests.unit.web.util import get_providers as override_dependency
client = TestClient(app)
app.dependency_ov... | 0c0w3/merino-py | tests/unit/web/test_geolocation.py | test_geolocation.py | py | 2,778 | python | en | code | null | github-code | 97 | [
{
"api_name": "fastapi.testclient.TestClient",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "merino.main.app",
"line_number": 11,
"usage_type": "argument"
},
{
"api_name": "merino.main.app.dependency_overrides",
"line_number": 12,
"usage_type": "attribute"
}... |
18530417366 | #!/usr/bin/env python
import os, time, json
from re import match, split
from tqdm import tqdm
from argparse import ArgumentParser
# https://dboyliao.medium.com/python-%E8%B6%85%E5%A5%BD%E7%94%A8%E6%A8%99%E6%BA%96%E5%87%BD%E5%BC%8F%E5%BA%AB-argparse-4eab2e9dcc69
argp = ArgumentParser()
argp.add_argument("-s", "--source... | ZoneTwelve/NLP_Researchs | src/word2vector_2/main.py | main.py | py | 1,448 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_numb... |
35987457471 | from __future__ import print_function
import json
from optparse import make_option
from django.core.management.base import NoArgsCommand, CommandError
from disqus.api import DisqusClient
class Command(NoArgsCommand):
option_list = NoArgsCommand.option_list + (
make_option('--indent', default=None, dest... | arthurk/django-disqus | disqus/management/commands/disqus_dumpdata.py | disqus_dumpdata.py | py | 2,248 | python | en | code | 328 | github-code | 97 | [
{
"api_name": "django.core.management.base.NoArgsCommand",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.core.management.base.NoArgsCommand.option_list",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "django.core.management.base.NoArgsCommand",
... |
71529861759 | import cv2
import random
import math
import numpy as np
def augment_img(image2aug, method_selector=-1):
#Applies one of three methods of image augmentation and returns the augmented image
'''
method_selector options:
1 - perspective transformation
2- image translation
3- image rotation
'''
if (metho... | abdullaayyad96/CarND-Traffic-Sign-Classifier-Project | image_edit.py | image_edit.py | py | 2,602 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "random.randint",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "math.ceil",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_nu... |
26252274798 | def allcard(xdata,zdata,xval,zval,**kwargs):
# enumerate all model cardinalities via ccmiqp and
# use validation/cross-validaiton to determine
import alamopy
from alamopy.writethis import writethis
import numpy as np
import math
import sympy
import random
from random import shuffle... | kmair/Graduate-Research | alamo_python/alamopy/allcard.py | allcard.py | py | 8,395 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "random.seed",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.shape",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.shape",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "math.factorial",
"line_number... |
32878549111 | import base64
import hashlib
import json
import os
import random
from io import BytesIO
from django.forms import model_to_dict
from apps.user.models import Book, Code, Role
from apps.user.models import User
from django.http import HttpResponse
from django.core import serializers
from django.core.paginator import Pagi... | blackttea/pythonAdmin | apps/user/views.py | views.py | py | 8,562 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "apps.user.models.User",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "apps.user.models.Role",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "json.lo... |
22465768971 | # Data App - Dashboard Interativo Para Avaliação das Temperaturas Máximas Ano a Ano com H2O Wave
# Imports
import warnings
warnings.filterwarnings('ignore')
import pandas as pd
import numpy as np
import scipy.stats as stats
from pmdarima.utils import diff_inv
from scipy.linalg import pinv
from json import load
from s... | michelrribeiro/app_wave_temperaturas | app.py | app.py | py | 15,206 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pandas.to_dat... |
5586293391 | from pathlib import Path
import environ
env = environ.Env()
BASE_DIR = Path(__file__).resolve().parent.parent
INSTALLED_APPS = [
"django.contrib.admin",
"django.contrib.contenttypes",
"django.contrib.staticfiles",
]
STATIC_URL = "/static/"
STATICFILES_DIRS = [BASE_DIR / "static"]
STATIC_ROOT = BASE_DI... | i-dot-ai/one-big-thing | one_big_thing/settings_base.py | settings_base.py | py | 419 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "environ.Env",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 8,
"usage_type": "call"
}
] |
6981061079 | #!/usr/bin/env python3
import re
import argparse
from pprint import pprint
import numpy as np
import pandas
import wandb
from tabulate import tabulate
HUMAN_ATARI_SCORES = {
'Alien': 7127.7,
'Amidar': 1719.5,
'Assault': 1496,
'Asterix': 8503.2,
'BankHeist': 753.1,
'BattleZone': 37800,
'Bo... | anthliu/plot-utils | table.py | table.py | py | 7,558 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "wandb.Api",
"line_number": 126,
"usage_type": "call"
},
{
"api_name": "numpy.nan",
"line_number": 142,
"usage_type": "attribute"
},
{
"api_name": "numpy.nanmax",
"line_number": 145,
"usage_type": "call"
},
{
"api_name": "numpy.nanmean",
"line_nu... |
29789979926 | import datetime
from pprint import pprint
import re
from django.db import models
from django.utils.translation import ugettext as _
from django_baseline.forms import CrispyModelForm
from . import ServicePlugin, ServiceIsDown, ServiceCheckFailed, PluginConfigurationError
from ..models import ServicePluginConfigurati... | theduke/arguswatch | arguswatch/argus_services/plugins/sql_query.py | sql_query.py | py | 8,075 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "models.ServicePluginConfiguration",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "django.db.models",
"line_number": 19,
"usage_type": "name"
},
{
"api... |
27535843310 | from rest_framework import viewsets
from cars.models import Car, Brand, Dealer, Listing
from cars.serializers import CarSerializer, BrandSerializer, DealerSerializer, ListingSerializer
from rest_framework.response import Response
from rest_framework.decorators import action
class CarViewSet(viewsets.ModelViewSet):
... | pablopadulles/sc-django-challenge | cars/views.py | views.py | py | 2,117 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "rest_framework.viewsets.ModelViewSet",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.viewsets",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "cars.models.Car.objects.all",
"line_number": 9,
"usage_type": "call"
},... |
25419216771 | import yaml
from loguru import logger
def load_config():
try:
config = yaml.full_load(open("src/resource/configs/dev-config.yaml"))
return config["invalid_reprocess_indexer"]
except Exception as e:
logger.error(e)
raise Exception("Config not found")
| abhitdas-inviz-BackendEngg/insearch-service-reprocess | src/main/config/parser.py | parser.py | py | 291 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "yaml.full_load",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "loguru.logger.error",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "loguru.logger",
"line_number": 9,
"usage_type": "name"
}
] |
18381773316 | from StringIO import StringIO
import os
import yaml
def test_util_ravel_dict():
from wdfwd.util import ravel_dict
data = dict(
a=dict(
b=0
),
c=[1, 2, 3]
)
ret = ravel_dict(data)
assert ret['a_b'] == 0
assert ret['c'] == [1, 2, 3]
assert 'a' not in ret
... | haje01/wdfwd | wdfwd/tests/test_util.py | test_util.py | py | 6,219 | python | en | code | 9 | github-code | 97 | [
{
"api_name": "wdfwd.util.ravel_dict",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "yaml.load",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "StringIO.StringIO",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "wdfwd.util.iter_tai... |
30082506659 | from myTools import *
import numpy as np
import matplotlib.pyplot as plt
from time import sleep
def getRange(dataset):
'''
获取dataset的数据在各个维度(特征)上的跨度
输入一个二维列表,存放数据
输入一个二维列表,每个元素是该维度上的最小值和最大值
'''
datamat = np.mat(dataset).T.tolist()
dimen_range = []
for dimension in datamat:
max... | proTao/Machine-Learning-in-Action | kMeans.py | kMeans.py | py | 5,261 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.mat",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "random.uniform",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "numpy.mat",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 73... |
15700994670 | from matplotlib.figure import Figure
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk
import matplotlib
import pandas as pd
import numpy as np
from tkinter import filedialog
from tkinter import simpledialog
import tkinter as tk
matplotlib.use("TkAgg")
class Normalizer():
def _... | jishnusen/nmr-python | normalizer.py | normalizer.py | py | 2,351 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "matplotlib.use",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tkinter.filedialog.askopenfilename",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tki... |
9465940431 | import streamlit as st
import yfinance as yf
import pandas as pd
import numpy as np
import plotly.express as px
import plotly.graph_objects as go
from datetime import date
from stocknews import StockNews
from sklearn.linear_model import LinearRegression
st.title('Stock Price Prediction')
st.sidebar.header('BlamerX')
... | BlamerX/Stock-Price-Prediction-WebSite | app.py | app.py | py | 6,331 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "streamlit.title",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "streamlit.sidebar.header",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "streamlit.sidebar",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "strea... |
3221681173 | from rest_framework import routers
from django.conf.urls import url, include
from django_todolist.api import views
router = routers.DefaultRouter(trailing_slash=False)
router.register(r'todos', views.TodoViewSet)
urlpatterns = [
url(r'^', include(router.urls)),
url(r'^api-auth/',
include('rest_framew... | andresgz/django_todolist | django_todolist/api/urls.py | urls.py | py | 362 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "rest_framework.routers.DefaultRouter",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "rest_framework.routers",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django_todolist.api.views.TodoViewSet",
"line_number": 7,
"usage_type": "attrib... |
36366620993 |
from classes.player import Player
import pygame
from pygame.sprite import Sprite
from classes.game_object import GameObject
class Monster(GameObject):
"""Monster abstract obj"""
sprite = None
sound = None
horizontal_direction = 0
vertical_direction = 0
def __init__(self, x: int, y: int, spe... | MarcinDadura/Shamboogeon | classes/monster.py | monster.py | py | 2,582 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "classes.game_object.GameObject",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "pygame.image.load",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "pyg... |
41107668037 | # 2022.02.02
# 백준 1157 단어공부
from collections import Counter
li_text = [i for i in input().upper()] # 문자를 리스트로 입력받는다.
most = Counter(li_text).most_common(2) # 최빈값 두개를 비교하기 위해 부름
if most[0][1] == most[1][1]: # 최빈값이 겹치는지 비교
print("?")
else:
print(f'{most[0][0]}') # 최빈값 출력
# 2022.02.04
# 백준 1316번 그룹단어 체커
# 실패
... | youngchurl/Coding-Study | Coding Practice/BOJ/Febuary/3week.py | 3week.py | py | 2,755 | python | ko | code | 1 | github-code | 97 | [
{
"api_name": "collections.Counter",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 60,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 61,
"usage_type": "call"
}
] |
41777128332 | # This function describes the environment for a perpendicular parking scenario and executes it.
import trailer_hybrid_a_star
import matplotlib
import math
import time
import rs_path
matplotlib.use('GTK3Agg')
from matplotlib import pyplot as plt
def main():
"""
Function to fully execute a given scenario.
... | NickSipes/TruckMotionPlanning | Integration/perpendicular_parking.py | perpendicular_parking.py | py | 3,748 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "matplotlib.use",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "math.radians",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "math.radians",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "math.radians",
"line_numb... |
75061595199 | import os
import pytest
from slack_sdk import WebClient
from slack_bolt import App
@pytest.fixture
def mocked_slack_app(monkeypatch):
signing_secret = "secret"
valid_token = "xoxb-valid"
mock_api_server_base_url = "http://localhost:8888"
web_client = WebClient(
token=valid_token,
bas... | maksx/slack_bot | tests/conftest.py | conftest.py | py | 491 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "slack_sdk.WebClient",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "slack_bolt.App",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 8,
"usage_type": "attribute"
}
] |
5371459197 | import pygame
from pygame import *
from entities import constants
from levels import Level
from .entity import Entity
def draw_sprite(TILE_X, TILE_Y):
image_file = "images/sprites/items/ladderMid.png"
temp = pygame.image.load(image_file)
temp = pygame.transform.scale(temp, (TILE_X, TILE_Y))
return te... | rocalabern/pygame_winx | entities/stairsblock.py | stairsblock.py | py | 1,887 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pygame.image.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pygame.transform.scale",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pygame.tra... |
1059047518 | from django.shortcuts import render
from django.shortcuts import render, get_object_or_404
from django.views.generic import TemplateView # テンプレートタグ
from .forms import AccountForm, AddAccountForm # ユーザーアカウントフォーム
from st.models import Account, MAC
from django.contrib.auth import authenticate, login, logout
from django.ht... | Takatsuji228/syututaikin | st/views.py | views.py | py | 9,362 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.contrib.auth.authenticate",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.login",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "django.http.HttpResponseRedirect",
"line_number": 33,
"usage_type": "call"
}... |
8134941958 | # Crie um programa que tenha uma função chamada "voto()" que vai receber
# como parâmetro o ano de nascimento de uma pessoa, retornando um valor literal
# indicando se a pessoa tem voto NEGADO, OPCIONAL ou OBRIGATÓRIO nas eleições.
# FUNÇÕES UTILIZADAS NA ESTÉTICA DO PROGRAMA
cor = {'azul': '\033[1:34m',
... | leorodrigues91/Exercicios_Python | ex101 - Funções para votação.py | ex101 - Funções para votação.py | py | 1,169 | python | pt | code | 0 | github-code | 97 | [
{
"api_name": "datetime.date.today",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 24,
"usage_type": "name"
}
] |
13218439400 | import glob
from flask import Flask, render_template, request
app = Flask(__name__)
@app.route("/")
def index_():
articles = get_articles()
return render_template("index.html", articles=articles)
@app.route("/articles")
def articles_():
path = request.args.get("title")
if path:
article = g... | lafixier/myctf-problems | src/web/blog/app/app.py | app.py | py | 998 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask.request.args.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask.request... |
6527357608 | import torch.nn as nn
class SingleLayerClassifier(nn.Module):
def __init__(self, input_size, hidden_size, number_of_classes, linear=False):
super(SingleLayerClassifier, self).__init__()
self.input_size = input_size
self.hidden_size = hidden_size
self.feature_extractor = FeatureExtr... | LuisaMaerz/RuleAdversarialLearning | models/feed_forward_blocks.py | feed_forward_blocks.py | py | 1,751 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "torch.nn.Module",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "torch.nn.Module",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line... |
42300809496 | #!/usr/bin/env python3
import sys
import os
import time
import signal
import socket
import argparse
import json
import syslog
from threading import Thread, Timer
from gpuctl import logger
from gpuctl import ShellCmdMixin as sc
__all__ = ['EthCtl', 'scan_miner']
HOST, PORT = "localhost", 3333
MAX_DATA = 512
RX_TIME... | Ed-Yang/gpuctl | gpuctl/eth_ctl.py | eth_ctl.py | py | 11,095 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "socket.socket",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 62,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_STREAM",
"line_number": 62,
"usage_type": "attribute"
},
{
"api_name": "json.loads"... |
19297957760 | import pygame
from player import *
from pygame.locals import (
K_UP,
K_DOWN,
K_LEFT,
K_RIGHT,
K_ESCAPE,
KEYDOWN,
QUIT,
)
SCREEN_SIZE = [1080, 720]
screen = pygame.display.set_mode(SCREEN_SIZE)
def main():
pygame.init()
player = Player()
running = True
while running:
... | camdendavis99/survivor-game | main.py | main.py | py | 787 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pygame.display.set_mode",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "pygame.init",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pygame.event.... |
14955028078 | from collight.models.customer import Customer
from collight.serializers import CustomerSerializer
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import filters, permissions, viewsets
class CustomerViewset(viewsets.ModelViewSet):
serializer_class = CustomerSerializer
que... | stercustodio/codigo_s | collight/views/customer_views.py | customer_views.py | py | 706 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "rest_framework.viewsets.ModelViewSet",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.viewsets",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "collight.serializers.CustomerSerializer",
"line_number": 9,
"usage_type":... |
44117213092 | #WIP
import pandas as pd
import sqlite3
import os
from datetime import datetime
path = os.getcwd()
print(path)
print("Beginning connection...")
con = sqlite3.connect("ChatStorage.sqlite")
print("Connection successful, querying...")
tables = pd.read_sql_query("SELECT name FROM sqlite_master WHERE type='table... | teksta7/AccessSqliteDB_python | ALT.py | ALT.py | py | 1,739 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.getcwd",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.read_sql_query",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.read_sql_query"... |
29777979866 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sn
from statsmodels.tsa.seasonal import seasonal_decompose
import statsmodels.api as sm
from sklearn.cluster import KMeans
import plotly.graph_objects as go
from sklearn.preprocessing import StandardScaler
import matplotlib.cm as c... | ShubhamGarg9060/Crime-Forecasting-in-INDIA | Crime Forecasting Project/Crimes In India.py | Crimes In India.py | py | 66,314 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "pandas.read_csv",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "geopandas.read_file",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "plotly.graph_objects.Figure",
"line_number": 204,
"usage_type": "call"
},
{
"api_name": "plot... |
18781609569 | __author__ = 'achmed'
import config
class ConfigWrapper(config.Config):
'''
use to bless config.Mapping objects into Config objects to provide getByPath
'''
def __init__(self, streamOrFile=None, parent=None, other=None):
if other:
super(ConfigWrapper, self).__init__()
... | xandercrews/griffinmcelroy | python/griffinmcelroy/config/configwrapper.py | configwrapper.py | py | 832 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "config.Config",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "config.ConfigError",
"line_number": 23,
"usage_type": "attribute"
}
] |
18744425667 | from datetime import datetime as dt, date as d
import pandas as pd
import dash
import dash_table
import dash_html_components as html
import dash_core_components as dcc
import dash_bootstrap_components as bootstrap
from connection import *
from dash.dependencies import Input, Output, State
from flask import Flask
from f... | betterthanever2/lifespan | main.py | main.py | py | 14,924 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "datetime.datetime.strftime",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "flask.Flask",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "dash.Dash",
... |
22708081442 | #-*- coding: utf-8 -*-
from __future__ import print_function, absolute_import # For Py2 retrocompatibility
from builtins import str
from django.http import HttpResponse,Http404,JsonResponse
from django.shortcuts import render,redirect
# For the API
from django.views.decorators.csrf import csrf_exempt
from rest_framewo... | Frix-x/semiotweet | api/views.py | views.py | py | 16,976 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "django.http.JsonResponse",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "models.User.objects.get",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "models.User.objects",
"line_number": 57,
"usage_type": "attribute"
},
{
"api_nam... |
70697942720 | import os
import logging
import json
import requests
import sys
from urlparse import urljoin
class CaptainHooksClientException(Exception):
pass
class CaptainHooksClient:
CAPTAIN_HOOKS_URL = os.getenv('CAPTAIN_HOOKS_URL', 'http://localhost:5000')
COOKIE_JWT = 'access_token'
HEADER_CSRF = 'X-CSRFTok... | nuxeo/nuxeo-tools-hooks | nuxeo-tools-hooks/nxtools/hooks/client.py | client.py | py | 1,525 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "os.getenv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "urlparse.urljoin",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "logging.critical",
"line_... |
30685661190 | """Administrative command-line interface."""
from __future__ import annotations
import json
import sys
from pathlib import Path
import click
import structlog
import uvicorn
from cryptography.fernet import Fernet
from fastapi.openapi.utils import get_openapi
from safir.asyncio import run_with_asyncio
from safir.click... | lsst-sqre/gafaelfawr | src/gafaelfawr/cli.py | cli.py | py | 8,652 | python | en | code | 5 | github-code | 97 | [
{
"api_name": "click.group",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "click.version_option",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "click.Context",
"line_number": 50,
"usage_type": "attribute"
},
{
"api_name": "safir.click.displ... |
18871178497 | from keras.models import Model
from keras.layers import Input, Conv1D, BatchNormalization, MaxPool1D, Conv2D, Deconv2D, Concatenate, Lambda, MaxPooling2D, ZeroPadding2D, Reshape, Activation, Conv2DTranspose
from keras import backend as K
from keras_layers.keras_layer_AnchorBoxes import AnchorBoxes
from keras_layers.k... | dtczhl/dtc-pointpillars-keras | model.py | model.py | py | 10,188 | python | en | code | 5 | github-code | 97 | [
{
"api_name": "keras.layers.Input",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "keras.layers.Conv1D",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "keras.layers.BatchNormalization",
"line_number": 18,
"usage_type": "call"
},
{
"api_name":... |
24027553340 | from django.urls import path
from . import views
urlpatterns = [
path('signup/', views.signup, name='signup'),
path('login/', views.do_login, name='login'),
path('logout/', views.do_logout, name='logout'),
path('profile/<int:primary_key>/', views.profile, name='profile'),
path('rate/<int:primary_key>/', vie... | OlivierGL/Marketplace | Marketplace/Users/urls.py | urls.py | py | 352 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
1447365163 | # The selenium module
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import requests, time, re
import ExcelOperations as EO
from bs4 import BeautifulSoup
import DownloadImage as downloader
already_found_url = []
def get_html(url):
error_count = 0
error = True
page_... | usama124/DIY-Scrapper | Scrape_categories.py | Scrape_categories.py | py | 13,083 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_numb... |
26602921674 | from django.core.management.base import BaseCommand, CommandError
import logging
logger = logging.getLogger('labsmanager')
from django.db.models import Q
from fund.models import AmountHistory
class Command(BaseCommand):
help = 'remove duplicate in AmountHistory'
# def add_arguments(self, pars... | Bbillyben/labsmanager | fund/management/commands/remove_duplicate.py | remove_duplicate.py | py | 1,373 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "fund.models.AmountHistory.objects.values",
"line_number": 25,
"usage_type": "call... |
14910992744 | import flask
from flask import request, url_for, redirect
from flask.ext.jwt import current_user
from segue.core import db, config
from segue.factory import Factory
from segue.decorators import jsoned, jwt_only
from segue.responses import Response
from jwt import Signer
from models import Account, ResetPassword
from ... | softwarelivre/segue | segue/account/controllers.py | controllers.py | py | 3,609 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "services.AccountService",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "flask.ext.jwt.current_user",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "flask.abort",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "segue.... |
14090297906 | import asyncio
import nest_asyncio
nest_asyncio.apply()
import ccxt.async_support as ccxta
import time
import numpy as np
import pandas as pd
async def async_client(exchange_id, run_time: int, symbol: str):
orderbook = None
exchange = getattr(ccxta, exchange_id)()
time_1 = time.time()
time_f = 0
... | AndresGonzalezLuna/Lab4_AndresGL_AndresR | data.py | data.py | py | 4,069 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "nest_asyncio.apply",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "ccxt.async_support",
"line_number": 12,
"usage_type": "argument"
},
{
"api_name": "time.time",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.round",
... |
5516805307 | from bs4 import BeautifulSoup
import requests
import pprint
from scrapers.base_scraper import BaseScraper
class CNAScraper(BaseScraper):
@classmethod
def get_text(cls, url):
res = requests.get(url, allow_redirects=False)
soup = BeautifulSoup(res.text, 'html.parser')
print("Prasing article..")
pri... | shydefoo/topic-modelling-101 | scrapers/cna_scraper.py | cna_scraper.py | py | 679 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "scrapers.base_scraper.BaseScraper",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "argpar... |
30184355402 | #!/usr/bin/python3
"""Script that fetches https://alx-intranet.hbtn.io/status"""
import requests
import sys
if __name__ == "__main__":
res_msg = requests.get(sys.argv[1])
response = res_msg.status_code
if response >= 400:
print(f"Error code: {response}")
else:
print(res_msg.text)
| Ian-Musima/alx-higher_level_programming | 0x11-python-network_1/7-error_code.py | 7-error_code.py | py | 315 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 8,
"usage_type": "attribute"
}
] |
67166552 | import pygame_toolbox.graphics as ptg
import pygame_toolbox.graphics.widgets as ptgw
import pygame, sys, random
def close():
pygame.quit()
sys.exit()
class Screen_1(ptg.Menu):
def __init__(self):
self.header = ['Screen 1']
self.buttons = [['Screen 2',lambda:2],['Quit',close]]
ptg.M... | jbm950/personal_projects | General Python/widgets develop/widgets checkbox.py | widgets checkbox.py | py | 1,367 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pygame.quit",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame_toolbox.graphics.Menu",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pygame_toolbox.gr... |
74609678720 | """
Plot adaptive experimental results
"""
import pickle
import matplotlib.pyplot as plt
from matplotlib.ticker import MaxNLocator
import numpy as np
import pandas as pd
import os
import glob
import math
import scipy.interpolate as interp
font = {'family' : 'DejaVu Sans',
# 'weight' : 'bold',
'size' :... | timcast725/LESS-VFL | plot_feature_comm.py | plot_feature_comm.py | py | 7,177 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "matplotlib.pyplot.rc",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "glob.glob",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"lin... |
13050039983 | from mathutils import Vector
from array import array
import bpy
from .Branch import Branch
from .Leaf import Leaf, l
from bpy.props import BoolProperty
from math import sqrt
import math
from functools import partial
from random import randint, random, uniform
from copy import copy, deepcopy
#from .scaoperator import bp... | crobbiani/Space-Colonizaton-Algorithm | tree.py | tree.py | py | 7,227 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "mathutils.Vector",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 9... |
32887089906 | from numpy import *
import matplotlib.pyplot as plt
from pandas import *
from math import *
from numpy.linalg import inv
def findRMSE(n,err):
return ((1/n)*dot(err.transpose(),err))**0.5
def gradientDescent(x,y,theta,iterations,learning_rate):
rmse=zeros(iterations)
n=len(x)
y=y.reshape(y.shape[0],1)
for i in ra... | viditjain99/Machine-Learning | lin_reg_gd.py | lin_reg_gd.py | py | 3,124 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 68,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.title",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "ma... |
69900990079 | from django.shortcuts import render
from .forms import StudentForm
from .models import Studentmodel
from django.http import JsonResponse
# Create your views here.
def home(request):
# if request.method == 'POST':
form = StudentForm(request.POST)
stud = Studentmodel.objects.all()
return render (request,... | exusnraul/CRUD-Ajax-Django | CRUD_Ajax/enroll/views.py | views.py | py | 1,761 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "forms.StudentForm",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "models.Studentmodel.objects.all",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "models.Studentmodel.objects",
"line_number": 10,
"usage_type": "attribute"
},
{
... |
74909252799 | from flask import Flask, jsonify, request
from flask_cors import CORS
from llama_cpp import Llama
import re
llm = Llama(model_path="./vicuna-7b-1.1.ggmlv3.q4_K_S.bin")
# llm = Llama(model_path="./ggjtv1-model-q4_0.bin")
# llm = Llama(model_path="./Wizard-Vicuna-13B-Uncensored.ggmlv3.q4_K_S.bin")
app = Flask(__name__)... | Architect1st/e-Hospital-Chatbot-backend | flask-backend.py | flask-backend.py | py | 1,392 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "llama_cpp.Llama",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_num... |
43644822268 | import os
import sys
import json
import warnings
warnings.filterwarnings("ignore")
import math
import time
import random
import argparse
import numpy as np
from copy import deepcopy
from tqdm import tqdm
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision im... | sungnyun/openssl-simcore | downstream/opensemi/train.py | train.py | py | 29,364 | python | en | code | 17 | github-code | 97 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "math.ceil",
"line_number": 117,
"usage_type": "call"
},
{
"api_name": "os.path.joi... |
40053943925 | """ Portlet for content
"""
from zope.component import getMultiAdapter
from zope.publisher.browser import BrowserPage
from allen.utils.cache import servercache
from zope.traversing.browser import absoluteURL
class ContentPortlet(BrowserPage):
""" Display content as a 5 items portlet.
"""
def news(self, max... | avoinea/stiamro | src/stiamro/portlets/content.py | content.py | py | 1,449 | python | en | code | 6 | github-code | 97 | [
{
"api_name": "zope.publisher.browser.BrowserPage",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "zope.component.getMultiAdapter",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "zope.component.getMultiAdapter",
"line_number": 25,
"usage_type": "call"... |
27940779811 | import os;
import sqlite3;
from sqlite3 import Error;
from shutil import copyfile
from datetime import datetime
from prettytable import PrettyTable
MONTHS = {'JAN': '01', 'FEB': '02', 'MAR': '03', 'APR': '04', 'MAY': '05', 'JUN': '06', 'JUL': '07', 'AUG': '08', 'SEP' : '09', 'OCT': '10', 'NOV': '11', 'DEC': '12... | tarikkdiry/spring2018-ssw555 | unused/spring2018-ssw555-master/gedcom.py | gedcom.py | py | 13,026 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.listdir",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_... |
29151589119 | import json
import psycopg2
from utilities.conn_util_sm import get_conn_string
def lambdaHandler(event, context):
sql_1 = {
'text': 'select * from public.get_students()',
'params': ()
}
sql_2 = {
'text': 'select * from public.get_a_student(%s)',
'params': (1,)
}
s... | BigMountainTiger/aws-terraform-examples | api-gw/api-method-example/lambdas/postgres-experiment-lambda/src/app_sm.py | app_sm.py | py | 849 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "utilities.conn_util_sm.get_conn_string",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "psycopg2.connect",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "utilities.conn_util_sm.get_conn_string.cache_clear",
"line_number": 32,
"usage_ty... |
1823653169 |
from collections import namedtuple
from typing import Dict, Tuple, List, Any, Callable
from overrides import overrides
from parser.utils.utils_conllu import parse_line, DEFAULT_FIELDS, process_multiword_tokens
from conllu import parse_incr
from allennlp.common.file_utils import cached_path
import logging
from allennlp... | idiap/g2g-transformer | parser/utils/dataset.py | dataset.py | py | 6,806 | python | en | code | 48 | github-code | 97 | [
{
"api_name": "collections.namedtuple",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "allennlp.common.file_utils.cached_path",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "conllu.parse_incr",
"line_number": 29,
"usage_type": "call"
},
{
"a... |
4376081135 | from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
path('productos', views.productos, name='productos'),
path('horarios', views.horarios, name='horarios'),
path('registro', views.registro, name='registro'),
path('chango', views.chango, name='chango... | martindipeco/05-farmacia-poison-app | locallibrary/catalog/urls.py | urls.py | py | 614 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
22392391151 | # -------------------------------------------------------------------------------------------------------------
# Exercise #16: Map, Filter, Reduce
# Developer: Amr Gaafer
# Date: 10.09.2022
# -------------------------------------------------------------------------------------------------------------
impor... | AmrGaafer/PythonLearning | 3.Functions/Exercices/Exercise16.py | Exercise16.py | py | 1,729 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "os.system",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "functools.reduce",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "functools.reduce",
"line_number": 52,
"usage_type": "call"
}
] |
23800614222 | #!/usr/bin/env python3
##!/bin/sh
#"exec" "python3" "-m" "scoop" "$0"
from collections import Counter
from datetime import datetime
from deap import creator, base, tools, algorithms
from deap.tools.emo import assignCrowdingDist
from itertools import count
from numpy.random import randint, random, seed
from pathways im... | jachymb/pathways | evolver.py | evolver.py | py | 8,885 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sys.argv",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.randint",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.uint32",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "numpy.full",
... |
15148474013 | # Ball Catcher - Chytač míčů
import pygame
import random
# Inicializace hry
pygame.init()
# Obrazovka
width = 1200
height = 700
screen = pygame.display.set_mode((width, height))
pygame.display.set_caption("Ball catcher")
# Nastavení hry
clock = pygame.time.Clock()
fps = 60
# Barvy
green = (14, 116, 0)
# Classy
cl... | Miras222/ball_catcher_game | main.py | main.py | py | 14,824 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pygame.init",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pygame.display... |
73751898237 | from django.shortcuts import render, redirect
from phones.models import Phone
def index(request):
return redirect('catalog')
def show_catalog(request):
template = 'catalog.html'
sort = request.GET.get("sort", "id")
if sort == 'max_price':
sort = "-price"
elif sort == 'min_price':
... | dmdelicates/Django3 | phones/views.py | views.py | py | 636 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.shortcuts.redirect",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "phones.models",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "phones.models.Phone.objects.order_by",
"line_number": 16,
"usage_type": "call"
},
{
"api_n... |
27378806447 | import pandas as pd
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.metrics.pairwise import cosine_similarity
# Load dataset
recipes_df = pd.read_csv('indian_dishes.csv')
# Define vectorizer object
vectorizer = CountVectorizer()
# Create ingredient list string for each recipe
recipes_df['ing... | mkswagger/faded_flavours_bon_hacketit | recipe_recommender/recipe_recommender.py | recipe_recommender.py | py | 1,871 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sklearn.feature_extraction.text.CountVectorizer",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.pairwise.cosine_similarity",
"line_number": 30,
"usage_type... |
26180777369 | #####################################################################################################################
# inversion: This module provide specialized functions for computing node inverses and localized inverses. #
# It is part of the Cuicuilco framework ... | AlbertoEsc/cuicuilco | inversion.py | inversion.py | py | 11,516 | python | en | code | 8 | github-code | 97 | [
{
"api_name": "mdp.nodes",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "mdp.hinet",
"line_number": 62,
"usage_type": "attribute"
},
{
"api_name": "mdp.nodes",
"line_number": 105,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line... |
34901558230 | from PIL import Image
import numpy as np
from scipy.ndimage import filters
import matplotlib.pyplot as plt
# Not complete yet
##Apply the label() function to a thresholded image of your choice. Use histograms
##and the resulting label image to plot the distribution of object sizes in the image.
def label(image = Non... | huylb289/OpenCV-Python | CHAPTER1-Basic Image Handling and Processing/ex6.py | ex6.py | py | 846 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.array",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "numpy.gradient",
"line_numbe... |
40357421607 | import os
import json
import boto3
from aws_lambda_powertools import Logger, Tracer
sns_client = boto3.client("sns")
TOPIC_ARN = os.environ.get("SNS_TOPIC_ARN")
# Initialize Logger and Tracer
tracer = Tracer()
logger = Logger()
@tracer.capture_lambda_handler
def lambda_handler(event, context):
print(json.dumps(e... | msharma24/serverless-microservices | lambda/DynamodbStreamLambda/lambda_function.py | lambda_function.py | py | 1,309 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "boto3.client",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "aws_lambda_powertools.Tracer... |
21801543411 | from random import choice
import os
import argparse
dir_path = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(dir_path, 'safe.txt'), encoding='utf-8') as f:
safe_facts = [
fact.rstrip('\r\n ')
for fact in f.readlines()
if fact.rstrip('\r\n ') != ''
]
with open(os.path.join(dir_path, 'unsa... | TabulateJarl8/randfacts | randfacts/randfacts.py | randfacts.py | py | 1,775 | python | en | code | 16 | github-code | 97 | [
{
"api_name": "os.path.dirname",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_n... |
37264368196 | import spin_scale as m1
import numpy as np
import matplotlib.pyplot as plt
plt.rcParams['figure.facecolor'] = '0.2'
f = lambda scalex, scaley: m1.transformation(m1.scaleM(250, 250, scalex, scaley))
f2 = lambda mx, my: m1.transformation(m1.translationM(mx, my))
f3 = lambda angle: m1.transformation(m1.rotateM(200,200, a... | agentzero001/more-python | functions/main1.py | main1.py | py | 1,420 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "spin_scale.transformation",
"line_number": 6,
"usage_type": "call"
},
{
"api_name... |
852654620 | from dataclasses import dataclass, field
from typing import Any, Callable, Optional, Type, Mapping, AbstractSet
from grongier.dacite.cache import Cache
from grongier.dacite.frozen_dict import FrozenDict
@dataclass
class Config:
type_hooks: Mapping[Type, Callable[[Any], Any]] = field(default_factory=dict)
cas... | mwaseem75/iris-energy-isodata | src/python/grongier/dacite/config.py | config.py | py | 786 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "typing.Mapping",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.Type",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.Callable",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_num... |
45413394972 | from collections import Counter
class Solution(object):
def countCharacters(self, words, chars):
"""
:type words: List[str]
:type chars: str
:rtype: int
"""
count = Counter(chars)
ans=0
for word in words:
tempCount = count.copy()
... | eoghks/leetcode | easy/FindWordsThatCanBeFormedbyCharacters.py | FindWordsThatCanBeFormedbyCharacters.py | py | 544 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "collections.Counter",
"line_number": 9,
"usage_type": "call"
}
] |
72457735998 | import os
from typing import Union
import kachery_cloud as kcl
from .Figure import Figure
class MultiTimeseries:
def __init__(self, *, label: str) -> None:
self._label = label
self._panels = []
def add_panel(self, figure: Figure, *, relative_height: Union[float, None]=None):
self._pane... | magland/sortingview | sortingview/SpikeSortingView/MultiTimeseries.py | MultiTimeseries.py | py | 1,137 | python | en | code | 20 | github-code | 97 | [
{
"api_name": "Figure.Figure",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "Figure.Figure",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "Figure.Figure",
"line_nu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.