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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
30461892433 | import csv
import base64
import pprint
import mysql.connector
from time import sleep as s
from functions import files, getLinesFromFile, getIPs, nmapScan, toLogFile
#fromLogs
#+---------------+--------------+------+-----+-------------------+-------------------+
#| Field | Type | Null | Key | Default ... | sschatz1997/Sams_website | py_MySQL/IPcount.py | IPcount.py | py | 2,677 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "base64.b64decode",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "mysql.connector.connector.connect",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "mysql.connector.connector",
"line_number": 27,
"usage_type": "attribute"
},
{
... |
3225854902 | #!/usr/bin/python2.7
from functools import wraps
from flask import Flask, request, jsonify, Response, abort, json
import MySQLdb, collections
app = Flask(__name__)
MYSQL_DATABASE_HOST = "127.0.0.1"
MYSQL_DATABASE_USER = "twitter"
MYSQL_DATABASE_PASSWORD = "DF7U7q2yy6pUPSn3"
MYSQL_DATABASE_DB = "twitter"
db = MySQ... | brianfife/twitterapi | twitter.py | twitter.py | py | 8,268 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "MySQLdb.connect",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask.request.args.get",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "flask.request.args"... |
20629891320 | import argparse
import json
from collections import OrderedDict
import kernel_tuner as kt
import common
# Parse command line arguments
def parse_command_line():
parser = argparse.ArgumentParser(description='Tuning script for add_fluxes_kernel kernel')
parser.add_argument('--tune', default=False, action='store... | earth-system-radiation/rte-rrtmgp-cpp | tuning_kernels_cuda/add_fluxes_kernel.py | add_fluxes_kernel.py | py | 3,673 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "kernel_tuner.run_kernel",
"line_number": 23,
"usage_type": "call"
},
{
"api_name"... |
26626842826 | from django.shortcuts import render_to_response
from django.template import RequestContext
from product.models import Product
from satchmo_store.shop import signals
from signals_ahoy.signals import application_search
def search_view(request, template="shop/search.html"):
"""Perform a search based on keywords and c... | dokterbob/satchmo | satchmo/apps/satchmo_store/shop/views/search.py | search.py | py | 1,013 | python | en | code | 30 | github-code | 6 | [
{
"api_name": "signals_ahoy.signals.application_search.send",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "product.models.Product",
"line_number": 22,
"usage_type": "argument"
},
{
"api_name": "signals_ahoy.signals.application_search",
"line_number": 22,
"usa... |
70101306109 | """Control api connections and information gathering."""
import os
import requests
from constants.endpoints import endpoints
from typing import Tuple, Optional
class Binance:
"""Class to manage connection with Binance and data retrieving and inputting."""
def __init__(self, api_type: str = 'prod', endpoints = ... | cthadeufaria/redesigned-pas-trading | src/utils/api.py | api.py | py | 2,165 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "constants.endpoints.endpoints",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "constants.e... |
17396933652 | from django.http import HttpResponse
def hello(req):
return HttpResponse('Hello, World !!')
def hello_html(req):
src = []
src.append('<!doctype html>')
src.append('<html>')
src.append('<head>')
src.append('<meta charset="utf-8">')
src.append('<title>Hello, World</title>')
src.append('</h... | RyoJ/hellopython | hello/views.py | views.py | py | 853 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.http.HttpResponse",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "django.http.HttpResponse",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "django.views.generic.TemplateView",
"line_number": 23,
"usage_type": "name"
},
{
... |
34670400006 | import json
from app_logic_extractor import app_logic_extractor
from lib.entity import App, Device, Net
from lib.util import convert_to_prolog_symbol, convert_to_prolog_var
from vul_analyzer import vul_analyzer
from vul_scanner import vul_scanner
def translate_vul_exists(prolog_dev_name, cve_id):
"""
Given a... | pmlab-ucd/IOTA | python/translator.py | translator.py | py | 8,669 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "lib.entity.App",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "lib.entity.Device",
"line_numb... |
7935100756 | # -*- coding: utf-8 -*-
#import sys
#reload(sys)
#sys.setdefaultencoding('utf-8') #gb2312
import codecs
import random
import numpy as np
from tflearn.data_utils import pad_sequences
from collections import Counter
import os
import pickle
import json
import jieba
from predictor.data_util_test import pad_truncate_list
P... | 201520815029009/Text-classification-augmented-with-label-definitions | cnn_classification/data_util.py | data_util.py | py | 11,736 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.exists",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
71362243707 | import networkx as nx
import config.config as config
def graph_kernel_map_to_nodetypes(_graph):
"""
NOT SUPPORTED AFTER GRAPH ENCODING CHANGE.
A pre-processing step to collapse nodes to their model types.
:param _graph:
:return:
"""
graph_relabelled = nx.relabel_nodes(_graph, {no... | benjimaclellan/aesop | algorithms/assets/graph_edit_distance.py | graph_edit_distance.py | py | 2,807 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "networkx.relabel_nodes",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "config.config.NODE_TYPES_ALL.values",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "config.config.NODE_TYPES_ALL",
"line_number": 13,
"usage_type": "attribute"
... |
18705309300 | from time import sleep
import csv
import requests
from lxml import etree
from datetime import datetime
import pytz
urls = ['https://www.eclatparis.com/produits',
'https://www.eclatparis.com/produits?offset=200',
'https://www.eclatparis.com/produits?offset=400',
'https://www.eclatparis.com/p... | qingyi-er-san/aprizo_codes | eclat数据爬取/eclat_云端版.py | eclat_云端版.py | py | 3,460 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "lxml.etree.HTML",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"line_number... |
42663404209 | import copy
import math #needed for calculation of weight and bias initialization
import numpy as np
import pandas as pd
from torch.utils.data import Dataset, DataLoader
import torch, torch.nn as nn, torch.nn.functional as F
import torchvision
from torchvision import transforms, models, utils
#Set seeds
np.random.see... | rachellea/explainable-ct-ai | src/models/custom_models_diseasereps.py | custom_models_diseasereps.py | py | 21,347 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "numpy.random.seed",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "torch.manual_seed",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.cuda.manu... |
74187907709 | #Richard Janssen <richardnjanssen@gmail.com>
#28/07/2023
#CS50 Introduction to Programming with Python
#File Input/Output
#This program expect for two command-line arguments, the first one is a image file input and the second
#is the output file name or path. This program overlay a "shirt image" on the given input file... | richardnj14/CS50_python | file_input_output/shirt/shirt.py | shirt.py | py | 1,411 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image.open",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_num... |
39747449584 | """Training and Predicting Cifar10 with Mutant Networks.
The networks mutate their architecture using genetic algorithms.
Author: Lucas David -- <ld492@drexel.edu>
Licence: MIT License 2016 (c)
"""
import logging
import artificial as art
import numpy as np
import tensorflow as tf
from artificial.utils.experiments i... | lucasdavid/unicamp-ia004-neural-networks-2 | mutant-networks/experiments/cifar-hill-climbing/experiment.py | experiment.py | py | 3,372 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "mutant.Environment",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.logging.info",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "tensorflow.logging",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name"... |
72453926907 | # -*- coding: utf-8 -*-
import pymysql
from pymongo import MongoClient
class MiddleTable(object):
def __init__(self):
self.mysql_host = "192.168.10.121"
self.mysql_user = 'hzyg'
self.mysql_password = '@hzyq20180426..'
self.MONGO_HOST = '127.0.0.1'
self.MONGO_PORT = 27017
... | cyndi088/MiddleTables | mongo_to_mysql.py | mongo_to_mysql.py | py | 3,882 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pymysql.connect",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 21,
"usage_type": "call"
}
] |
19416857297 | """Visualises the range of potentials relative to demand in each municipality."""
from itertools import chain, repeat
import click
import pandas as pd
import geopandas as gpd
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
import pycountry
from src.vis import RED, GREEN, BLUE
SORT_QUANTILE =... | timtroendle/possibility-for-electricity-autarky | src/vis/potentials_normed_boxplot.py | potentials_normed_boxplot.py | py | 3,114 | python | en | code | 10 | github-code | 6 | [
{
"api_name": "seaborn.set_context",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "geopandas.read_file",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pycountry.co... |
42673179666 | import graphene
from graphene_django.types import DjangoObjectType
from graphql import GraphQLError
from .models import *
from django.contrib.auth.models import User
class user(DjangoObjectType):
class Meta:
model = User
class task(DjangoObjectType):
class Meta:
model = Task
class Query(o... | neelansh/Todo_app_graphql | todo/app/schema.py | schema.py | py | 879 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "graphene_django.types.DjangoObjectType",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.models.User",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "graphene_django.types.DjangoObjectType",
"line_number": 14,
"usage... |
10754618870 | from nltk.corpus import stopwords
import pandas as pd
from nltk.stem.snowball import SnowballStemmer
import re
import nltk
class ngrams:
def __init__(self, df,column,n=10):
texto = " ".join(str(x) for x in df[column].values)
tokens = texto.split()
tokens=[x.lower() for x in tokens]
stopset = set(stop... | omedranoc/ThesisPreprocessing | model/ngrams.py | ngrams.py | py | 1,850 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "nltk.stem.snowball.SnowballStemmer",
"line_number": 14,
"usage_type": "call"
},
{
... |
39870180773 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import imageio
import scipy.misc
import numpy as np
import videostyletransfer as vst
video_id = 'temple_2'
content_path = os.getcwd() + '/input/' + video_id + '/'
style_path = os.getcwd() + '/style-images/starry_night.jpg'
flow_path = os.getcwd() + '/flow/' +... | tomstrident/Video-Style-Transfer | video_style_transfer_demo.py | video_style_transfer_demo.py | py | 986 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.getcwd",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "imageio.imread",
"line_number": 25,... |
26986931486 | # -*- coding: utf-8 -*-
import itertools
import struct
import pytest
from mock import Mock, call, patch
from nameko_grpc.errors import GrpcError
from nameko_grpc.streams import (
STREAM_END,
ByteBuffer,
ReceiveStream,
SendStream,
StreamBase,
)
class TestByteBuffer:
def test_peek(self):
... | nameko/nameko-grpc | test/test_streams.py | test_streams.py | py | 15,281 | python | en | code | 57 | github-code | 6 | [
{
"api_name": "nameko_grpc.streams.ByteBuffer",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "nameko_grpc.streams.ByteBuffer",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "nameko_grpc.streams.ByteBuffer",
"line_number": 37,
"usage_type": "call"
... |
9087413248 | import librosa
import librosa.display
import matplotlib.pyplot as plt
import numpy as np
import os
import json
import math
import random, os
import shutil
# Extract and save MFCCs from audiofiles
def save_mfcc(dataset_path, json_path, n_mfcc=20, n_fft=2048, hop_length=1024, num_segments=1):
data = ... | NOR2R/ML_miniproject | pythonScripts/MFCCExtraction_SaveJson.py | MFCCExtraction_SaveJson.py | py | 2,349 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "math.ceil",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 31,
"... |
1073007549 | import traceback
from selenium.webdriver.common.by import By
from traceback import print_stack
import utilities.logger as log
import logging
class SeleniumDriver():
log = log.myLogger(logging.DEBUG)
def __init__(self, driver):
self.driver = driver
def getByType(self, locatorType):
locato... | rchroy/SamsungPhoneTest | base/my_selenium_driver.py | my_selenium_driver.py | py | 3,365 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "utilities.logger",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "utilities.logger.myLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "selenium.w... |
75234645628 | from odoo import models, fields, api, exceptions, _
from odoo.exceptions import Warning, ValidationError
import datetime
from dateutil.relativedelta import relativedelta
class ExtraContractInherit(models.Model):
_inherit = 'hr.contract'
date_of_birth = fields.Date(string='تاريخ ميلاد الموظف', compute='cal_co... | emadraafatgad/visoneer | hr_insurance/models/employee_contract.py | employee_contract.py | py | 14,406 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "odoo.models.Model",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "odoo.models",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "odoo.fields.Date",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "odoo.fields",
"... |
10417120713 | from __future__ import annotations
import argparse
from argparse import ArgumentParser
def render_region_graph_logic(args):
import hashlib
import re
import graphviz
from randovania.game_description import default_database
from randovania.game_description.db.dock_node import DockNode
from ra... | randovania/randovania | randovania/cli/commands/render_regions.py | render_regions.py | py | 6,961 | python | en | code | 165 | github-code | 6 | [
{
"api_name": "randovania.game_description.default_database.game_description_for",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "randovania.game_description.default_database",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "randovania.games.game.RandovaniaGa... |
34381391905 | """
Compile QEMU Version 5.1.0 or newer. 5.1.0 is when AVR support was introduced.
.. code-block:: console
$ wget https://download.qemu.org/qemu-6.1.0.tar.xz
$ tar xvJf qemu-6.1.0.tar.xz
$ cd qemu-6.1.0
$ ./configure --target-list="avr-softmmu"
$ make -j $(($(nproc)*4))
Change directory to this... | sedihglow/braccio_robot_arm | python/archive/QEMU_arduino_serial_testing/test_cmd_msg.py | test_cmd_msg.py | py | 3,529 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pathlib.Path",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "tempfile.TemporaryDirectory",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "subprocess.Pope... |
72532766909 | """
Functions and models to query scicrunch service REST API (https://scicrunch.org/api/)
- http client for API requests
- Error handling:
- translates network errors
- translates request error codes
Free functions with raw request scicrunch.org API
- client request context
- ra... | ITISFoundation/osparc-simcore | services/web/server/src/simcore_service_webserver/scicrunch/_rest.py | _rest.py | py | 3,706 | python | en | code | 35 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "pydantic.Field",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "typing.Any",
... |
6358696084 | #!/usr/bin/env python3
import json
from statistics import median
from datetime import datetime, timedelta
SENT_MESSAGE = "Sent message"
RECEIVED_MESSAGE = "Received message"
TRANSACTION_INIT = "Initialising transaction"
TRANSACTION_COMMIT = "Delivered transaction"
WITNESS_SET_SELECTED = "Witness set selected"
WITNESS_... | interestIngc/simulation-analyzer | logs_analyzer.py | logs_analyzer.py | py | 12,715 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "datetime.datetime.fromtimestamp",
"line_number": 199,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 199,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.max",
"line_number": 210,
"usage_type": "attribute"
},
{
"a... |
30791829002 | from scipy.fftpack import dct, idct
# implement 2D DCT
def dct2(a):
return dct(dct(a.T, norm='ortho').T, norm='ortho')
# implement 2D IDCT
def idct2(a):
return idct(idct(a.T, norm='ortho').T, norm='ortho')
import cv2
import numpy as np
import matplotlib.pylab as plt
# read lena RGB image a... | NadiaFaramarzi/ClassicalObjectDetection | Codes/DCT(discrete cosine transform).py | DCT(discrete cosine transform).py | py | 1,048 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "scipy.fftpack.dct",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "scipy.fftpack.idct",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line... |
75224158908 | from asyncio import run
import discord
from discord import app_commands
from discord import Interaction
from discord import Intents
from discord.ext import commands, tasks
import os
import asqlite
# Import the Guild ID
from misc.load import TEST_SERVER_ID
# Import the bot token
from Secure import BOT_TOKEN
# Bot... | Alexici/discordpybot | main.py | main.py | py | 12,874 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "discord.Intents.default",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "discord.Intents",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "discord.ext.commands.Bot",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "disc... |
31841821973 | from rest_framework.views import APIView
from app.super_admin.controller import SuperAdminController
from common.django_utility import send_response
from rest_framework_simplejwt.authentication import JWTAuthentication
from rest_framework.permissions import IsAuthenticated
from dateutil.parser import parse
superAdmin... | ayush431/m_56studios | m56studios_be/app/super_admin/views.py | views.py | py | 1,194 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "app.super_admin.controller.SuperAdminController",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "rest_framework.views.APIView",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "rest_framework_simplejwt.authentication.JWTAuthentication",
"line... |
19026984837 | from django.shortcuts import render,redirect
import json
from django.conf import settings
import redis
from rest_framework.response import Response
from django.http import HttpResponse
from django.http import JsonResponse
import requests
from .forms import SomeForm
from django.views.decorators.csrf import csrf... | nischithmk/freshworks_assignment | app1/views.py | views.py | py | 2,317 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "redis.StrictRedis",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.REDIS_HOST",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 16,
"usage_type": "name"
},
{
"api_n... |
73203288508 | from konlpy.tag import Kkma
from konlpy.tag import Twitter
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.preprocessing import normalize
import numpy as np
import pymongo
from pymongo import MongoClient
import pymysql
class SentenceT... | hanseul1/Text-summarize-with-TextRank | main.py | main.py | py | 4,729 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "konlpy.tag.Kkma",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "konlpy.tag.Twitter",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sklearn.feature_extraction.text.TfidfVectorizer",
"line_number": 42,
"usage_type": "call"
},
{
... |
16782914255 | import torch
import random
import gc
import optuna
import pandas as pd
import numpy as np
from utils import map3, compute_metrics, set_seed
from config3 import CFG
from config import CFG1
from datasets import Dataset
from torch.optim import AdamW
from pathlib import Path
from transformers import AutoModelForMultipleCho... | zdhdream/LLM-Science-Exam | Hyperparameter-Search.py | Hyperparameter-Search.py | py | 11,550 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "transformers.AutoModelForMultipleChoice.from_pretrained",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "transformers.AutoModelForMultipleChoice",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "datasets.Dataset.from_pandas",
"line_number":... |
13083798365 | # -*- coding: utf-8 -*-
import re
from setuptools import setup
version = re.search(
'^__version__\s*=\s*"(.*)"',
open('pushscreeps/pushscreeps.py').read(),
re.M
).group(1)
with open("README.rst", "rb") as f:
long_description = f.read().decode("utf-8")
setup(
name="pushscreeps",
packages... | mboehn/pushscreeps | setup.py | setup.py | py | 744 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "re.search",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "re.M",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "setuptools.setup",
"line_number": 16,
"usage_type": "call"
}
] |
8293013280 | import cv2
import math
path = "img/angle.jpg"
img = cv2.imread(path)
pointsList = []
def mousePoints(event, x, y, flags, params):
if event == cv2.EVENT_LBUTTONDOWN:
size = len(pointsList)
if size != 0 and size % 3 != 0:
cv2.line(img, tuple(pointsList[round((size-1)/3)*3]), (x,y), (0,0,... | Demohack2022/hacktoberfest2022 | Contributors/angle-finder.py | angle-finder.py | py | 1,095 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "cv2.imread",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.EVENT_LBUTTONDOWN",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "cv2.line",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.circle",
"line_n... |
3715152381 | """
A simple event-sourced user service
"""
import datetime
import functools
import logging
import typing
import aiohttp.web
import faust
import strawberry
import strawberry.asgi.http
import strawberry.asgi.utils
import strawberry.graphql
import strawberry.types.datetime
from faust_avro import App, Record
class Us... | trauter/faust-avro | examples/event_sourced_user.py | event_sourced_user.py | py | 9,993 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "faust_avro.Record",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "datetime.datetime",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "faust_avro.Record",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "faust_avro... |
23055518013 | """
Creation:
Author: Martin Grunnill
Date: 2023-01-25
Description: Derivation of Basic Reproductive Number (R0) and beta given R0 for model described in manuscript.
For methods see:
Diekmann, O., Heesterbeek, J. A. P., & Roberts, M. G. (2010). The construction of next-generation matri... | LIAM-COVID-19-Forecasting/Modelling-Disease-Mitigation-at-Mass-Gatherings-A-Case-Study-of-COVID-19-at-the-2022-FIFA-World-Cup | meta_population_models/reproductive_numbers/MGE_single_population_derivation.py | MGE_single_population_derivation.py | py | 3,417 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sympy.Matrix",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sympy.Matrix",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "sympy.simplify",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "sympy.symbols",
"line_nu... |
37319818 | from IPython import get_ipython
from IPython.core.magic import Magics, magics_class, cell_magic
from IPython.core.magic_arguments import argument, magic_arguments, parse_argstring
import mamo
@magics_class
class MamoMagics(Magics):
@cell_magic
@magic_arguments()
@argument("name", type=str, default=None, h... | BlackHC/mamo | mamo/support/ipython.py | ipython.py | py | 678 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "IPython.core.magic.Magics",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "IPython.core.magic_arguments.parse_argstring",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "mamo.run_cell",
"line_number": 18,
"usage_type": "call"
},
{
... |
19637216652 | import pickle
import lasagne
import numpy as np
import theano as th
import theano.tensor as T
import lasagne.layers as ll
from data_reader import load
from settings import DATA_DIR
from inception_v3 import build_network, preprocess
def extract(data, layer, batch_size):
nr_batches_train = int(data.shape[0]/batch... | maciejzieba/svmCIFAR10 | extract_inception.py | extract_inception.py | py | 1,602 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "theano.tensor.tensor4",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "theano.tensor",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "lasagne.layers.get_output",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "lasagne... |
10876951886 | import yaml
import json
import os
import subprocess
class MLOps(object):
spool_dir = "/tmp/ta"
agent_dir = "/opt/mlops-agent"
mlops_dir_name = "datarobot_mlops_package-8.1.2"
total_dir_path = agent_dir + "/" + mlops_dir_name
def __init__(self, api_token, path):
self.token = api_token
... | algorithmiaio/algorithmia-adk-python | adk/mlops.py | mlops.py | py | 2,766 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "os.path.exists",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number":... |
25032770232 | #pip install dash dash-renderer dash-html-components dash-core-components plotly
import dash
import dash_core_components as dcc
import dash_html_components as html
app = dash.Dash()
app.layout = html.Div(children=[
html.H1("Consumo dos clientes"), #separando elementos dos childs por virgula
dcc.Dropdown(
... | grupoflux/dashboard | dashboard.py | dashboard.py | py | 1,527 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "dash.Dash",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "dash_html_components.Div",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "dash_html_components.H1",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "dash_core_co... |
23007800095 | import numpy as np
from keras.utils import to_categorical
def create_labels(train_positives, train_negatives=None, flag=False):
''' This function creates labels for model training '''
if flag == False :
# only positive data in trainings
labels = np.zeros(train_positives.shape[0])
la... | nikitamalviya/user-authentication-using-siamese | features_and_labels.py | features_and_labels.py | py | 1,281 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.zeros",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.expand_dims",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_numb... |
35176426735 | '''
Organisation Model.py file
'''
import uuid
from django.db import models
class Organisation(models.Model):
'''
Organisation Table
id - Organisations ID
name - Organisations Name (Max length of 255 characters)
'''
id = models.UUIDField(
primary_key=True,
default=uuid.uuid4... | Code-Institute-Submissions/Support-Software-Inc | organisations/models.py | models.py | py | 590 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.db.models.Model",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.db.models.UUIDField",
"line_number": 17,
"usage_type": "call"
},
{
"api_name"... |
19528086110 | # -*- coding: utf-8 -*-
__author__='zhaicao'
from PyQt5 import QtCore, QtGui, QtWidgets
from frameUI.CreateControls import TraceControlsUI
from frameUI.CreateTextUI import TraceCreateTextUI
from frameUI.MainData import TraceObjItems
from eventAction.DefinedActions import TraceActions
from eventAction.DefinedSolot imp... | zhaicao/pythonWorkspace | DeployTool/frameUI/mainUI.py | mainUI.py | py | 15,888 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "frameUI.CreateControls.TraceControlsUI",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "frameUI.CreateTextUI.TraceCreateTextUI",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "frameUI.MainData.TraceObjItems",
"line_number": 14,
"usage_... |
38882380606 | from django.db import models
from imagekit.models import ImageSpecField
from imagekit.processors import ResizeToFill
class ImageList(models.Model):
def __str__(self):
return self.file_name
file_path = models.CharField(
verbose_name='ファイルパス',
max_length=1000,
blank=False,
... | hogendan/SuzuImage | imagelist/models.py | models.py | py | 1,294 | python | ja | code | 0 | github-code | 6 | [
{
"api_name": "django.db.models.Model",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": ... |
27143309324 | #!/usr/bin/env python3
from PIL import Image
import os
path = os.getenv('HOME') + '/supplier-data/images/'
for file in os.listdir(path):
if (file.endswith('.tiff')):
shortFileName = file.rstrip('.tiff')
with Image.open(path + file) as im:
im.resize((600, 400)).convert('RGB').save(pat... | Mark-C-Hall/Google-IT-Automate-Final | changeImage.py | changeImage.py | py | 357 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.getenv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 12,
... |
1008840332 | '''Problem 62 cubic permutations'''
import time
from itertools import permutations
t1 = time.time()
cubes = [x**3 for x in range(1001,10000)]
def make_list(cube):
cubestring = str(cube)
#print(cubestring)
cubelist = [int(x) for x in cubestring]
cubelist.sort()
return cubelist#.so... | hackingmath/Project-Euler | euler62.py | euler62.py | py | 1,623 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "time.time",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "itertools.permutations",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 71,
"usage_type": "call"
}
] |
39583332735 | # -*- coding:utf-8 -*-
from flask import json
from DataSet import db
from DataSet.fastdfs.view import fun
from DataSet.models import Image, Label
def storage(up_file, collection, file_name):
try:
image_status = fun.upload(up_file, file_ext_name='jpg')
image = Image()
image.name = file_nam... | limingzhang513/lmzrepository | data_module/src/Data_Processing/DataSet/utils/change_json_file.py | change_json_file.py | py | 4,014 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "DataSet.fastdfs.view.fun.upload",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "DataSet.fastdfs.view.fun",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "DataSet.models.Image",
"line_number": 12,
"usage_type": "call"
},
{
"api... |
35145658447 | import pytest
from .task import in_component
class Case:
def __init__(self, name: str, n: list, vertices: list, edges: list,
answer: bool):
self._name = name
self.n = n
self.vertices = vertices
self.edges = edges
self.answer = answer
def __str__(self)... | renesat/Base-Graph-Contest | tasks/task4/test_public.py | test_public.py | py | 1,283 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "task.in_component",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 62,
"usage_type": "attribute"
}
] |
39441351801 | import re
import spacy
from bpemb import BPEmb
from mlearn import base
from string import punctuation
from ekphrasis.classes.tokenizer import SocialTokenizer
from ekphrasis.classes.preprocessor import TextPreProcessor
class Preprocessors(object):
"""A class to contain preprocessors and wrap preprocessing function... | zeeraktalat/mlearn | mlearn/data/clean.py | clean.py | py | 12,772 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "spacy.load",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "mlearn.base.Callable",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "mlearn.base",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "mlearn.base.DocType"... |
22075010385 | from flask import Flask, request, jsonify
from flask_cors import CORS
import sqlite3
import base64
app = Flask(__name__)
CORS(app)
@app.route('/')
def index():
return 'Index Page'
@app.route('/deleteUser', methods=['DELETE'])
def delete_user():
print("Petición DELETE")
try:
data = request.get... | DevEliezerMartinez/PosMABG | Back-end/server.py | server.py | py | 5,235 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.request.get_json",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "flask.request",
... |
25893346960 | import pygame
from pygame.draw import *
from random import randint
pygame.init()
FPS = 60 #число новых кругов в секунду
number_of_balls=4 #число обычных шаров
points=0 #счетчик очков
base_points_multiplier=100 #базовый множитель начисления очков
x_res,y_res=1920/1.25, 1080/1.25 #разрешение
res=[x_res,y_res]
sp_mult=0.... | furs-aka-beast/mipt_inf | 1_sem/Lab8/balls.py | balls.py | py | 3,786 | python | ru | code | 0 | github-code | 6 | [
{
"api_name": "pygame.init",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "random.randint... |
43627131674 | import heapq
import collections
class Solution:
def assignBikes(self, workers, bikes):
dist_map = collections.defaultdict(list)
m, n = len(workers), len(bikes)
for i in range(m):
for j in range(n):
w = workers[i]
b = bikes[j]
dis... | MichaelTQ/LeetcodePythonProject | solutions/leetcode_1051_1100/LeetCode1057_CampusBikes.py | LeetCode1057_CampusBikes.py | py | 986 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.defaultdict",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "heapq.heappush",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "heapq.heappop",
"line_number": 27,
"usage_type": "call"
}
] |
3480622108 | from __future__ import division
import torch
import torch.nn as nn
import torch.nn.functional as F
from .quant_func import fix_quant as quant
### ==============================================================================###
### quant for different data types ###
###... | jmluu/ICAIS_ML.Pytorch | Quantization/modules/qlayers.py | qlayers.py | py | 14,252 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "quant_func.fix_quant",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "quant_func.fix_quant",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "quant_func.fix_quant",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.... |
18483249694 | import pygame
import random
import sys
from pygame.locals import *
from config import (
FPS,
MODIFIER,
WIDTH,
HEIGHT,
LINETHICKNESS,
PADDLESIZE,
PADDLEOFFSET,
BLACK,
GREY,
ORIGIN_X,
ORIGIN_Y,
DIFFICULTY,
MAX_SCORE
)
def drawArena():
DISPLAYSURF.fill((0, 0, 0))
... | samuele-mattiuzzo/pongame | pongame.py | pongame.py | py | 6,281 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.draw.rect",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "config.GREY",
"line_number": 26,
"usage_type": "argument"
},
{
"api_name": "pygame.draw",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "config.WIDTH",
... |
38255085940 | from django.shortcuts import reverse
from django.views.generic import TemplateView
from django.utils import timezone
from hknweb.utils import (
method_login_and_permission,
get_semester_bounds,
)
from hknweb.events.constants import ATTR
from hknweb.events.models import Event, EventType
from hknweb.events.utils... | Gabe-Mitnick/hknweb | hknweb/events/views/aggregate_displays/tabular.py | tabular.py | py | 2,679 | python | en | code | null | github-code | 6 | [
{
"api_name": "django.views.generic.TemplateView",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "hknweb.utils.get_semester_bounds",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "django.utils.timezone.now",
"line_number": 23,
"usage_type": "call"
... |
22837988470 | import pandas as pd
import networkx as nx
import pickle
import ast
def save_obj(obj, name ):
with open(name + '.pkl', 'wb') as f:
pickle.dump(obj, f, pickle.HIGHEST_PROTOCOL)
def load_obj(name ):
with open(name + '.pkl', 'rb') as f:
return pickle.load(f)
df1 = pd.read_csv('../reading_and_cle... | brooksjaredc/podcast_network_analysis | analyzing_functions/set_top_podcast.py | set_top_podcast.py | py | 2,778 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "pickle.dump",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pickle.HIGHEST_PROTOCOL",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pickle.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
... |
4311447480 | from keras.preprocessing.image import ImageDataGenerator
from keras.models import Sequential
from keras.layers import Conv2D, MaxPooling2D
from keras.layers import Activation, Dropout, Flatten, Dense
from keras import backend as K
import numpy as np
###################################
#### Constants #################... | psrikanthm/satellite-image-classification | src/simple_arch.py | simple_arch.py | py | 2,151 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "keras.models.Sequential",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "keras.layers.Conv2D",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "keras.layers.Activation",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "k... |
38238085136 | import csv
from PIL import Image
import numpy as np
import os
X = []
index = 0
for img in os.listdir("base224/"):
if img[-3:] == "jpg":
image = Image.open("base224/" + img)
img2 = image.transpose(Image.FLIP_LEFT_RIGHT)
img2.save("base224flip/" + img, "JPEG", quality=224, optimize=True, prog... | PKUGoodSpeed/FashionAiContest | Kedan/flip_images.py | flip_images.py | py | 395 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "os.listdir",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "PIL.Image.FLIP_LEFT_RIGHT",
"l... |
72013269309 | import numpy as np
from collections import deque
from segment_tree import SumSegmentTree,MinSegmentTree
class ReplayBuff(object):
def __init__(self,max_size,observation_shape):
self.max_size=max_size
self.observations=np.zeros([max_size,observation_shape],dtype=np.float32)
self.actions=np.... | linnaeushuang/RL-pytorch | value-based/rainbow/memory.py | memory.py | py | 6,851 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "numpy.zeros",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.int",
"line_number... |
74288480507 | from django.urls import include, path
from rest_framework.routers import DefaultRouter
from seeds.api.views import AudioClipViewSet, BlobViewSet, SuiteViewSet, UserViewSet
from seeds.views import index, register
router = DefaultRouter()
router.register(r"users", UserViewSet, basename="User")
router.register(r"suites"... | jacobshandling/soundseeker | backend/seeds/urls.py | urls.py | py | 697 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rest_framework.routers.DefaultRouter",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "seeds.api.views.UserViewSet",
"line_number": 8,
"usage_type": "argument"
},
{
"api_name": "seeds.api.views.SuiteViewSet",
"line_number": 9,
"usage_type": "argume... |
37430808138 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
name: TRS wcm 6.x版本infoview信息泄露
referer: http://www.wooyun.org/bugs/wooyun-2012-012957
author: Lucifer
description: 文件infoview.do中导致信息泄露。
'''
import sys
import requests
class trs_wcm_infoview_disclosure_BaseVerify:
def __init__(self, url):
self.url = url
... | iceyhexman/onlinetools | scanner/plugins/cms/trs/trs_wcm_infoview_disclosure.py | trs_wcm_infoview_disclosure.py | py | 1,115 | python | en | code | 1,626 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 34,
"usage_type": "attribute"
}
] |
29564634745 | #!/usr/bin/python
# -*- encoding: utf-8 -*-
from api.thanos_http import xtthanos_user_http, request_data
from api.http_api import ResultBase
from common.logger import logger
from common.get_signature import generate_auth_info
def adjust_leverage(leverage,positionSide,symbol):
'''调整杠杆倍数'''
result = ResultBase(... | shiqilouyang/thanos_test | operation/contract/client/position/adjust_leverage.py | adjust_leverage.py | py | 1,084 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "api.http_api.ResultBase",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "api.thanos_http.request_data.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "api.thanos_http.request_data",
"line_number": 12,
"usage_type": "name"
},
{
... |
41978223591 | from pyspark.sql.types import StructType, StructField, StringType, DateType, FloatType
from pyspark.sql import SparkSession
from datetime import datetime
from task_4 import get_min_or_max_by_ppu
import pytest
# create a spark session
spark = SparkSession.builder.appName("task_0").getOrCreate()
# create a... | rkrvchnk/pyspark_tasks | tests/test_task_4.py | test_task_4.py | py | 1,784 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pyspark.sql.SparkSession.builder.appName",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pyspark.sql.SparkSession",
"line_number": 10,
"usage_type"... |
12449590446 | from distutils.errors import LibError
from tabnanny import verbose
from time import timezone
from django.db import models
from django.forms import CharField
from django.contrib.auth.models import User
from datetime import datetime,date, time
from django.utils import timezone
# Create your models here.
class TipoVeh... | xpilasi/segundo_liquidadora | web_base/models.py | models.py | py | 8,166 | python | es | code | 0 | github-code | 6 | [
{
"api_name": "django.db.models.Model",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 16,
"usage_type": "call"
},
{
"api_name"... |
14536874544 | # Callbacks
from dash import Input, Output, State
from dash.exceptions import PreventUpdate
def sidebar_callbacks(app, df):
@app.callback(
[
Output("brand_dropdwn", 'options'),
Output("brand_dropdwn", 'value')
],
[
State("date_picker", "start_date"),
... | jmalcovich21/ds4a_tiendareg | callbks/sidebar_calls.py | sidebar_calls.py | py | 1,794 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "dash.exceptions.PreventUpdate",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "dash.Output",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "dash.Output",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "dash.State",
... |
5584993015 | import asyncio
import httpx
from .._utils import chunk_file, format_locations
from .._exceptions import UploadException, LocationRetrieveException
class ConcatenateUploader:
default_concatenate_headers = {
"Tus-Resumable": "1.0.0",
"Upload-Concat": "partial",
}
default_chunk_size = 4 * 1... | LesPrimus/aiotusx | aiotusx/_uploaders/concatenate.py | concatenate.py | py | 3,146 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "_utils.format_locations",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "httpx.Response",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "_exceptions.LocationRetrieveException",
"line_number": 46,
"usage_type": "call"
},
{
... |
1068937513 | import numpy as np
import gymnasium as gym
from pendulum_model import PendulumModel
import cvxpy as cp
dt3g2l = 3 * 10 / (2 * 1) * 0.05
dt = 0.05
dt3ml2 = 3 * 0.05 / (1 * 1 * 1)
class CVX_SQP:
def __init__(self):
self.N = 30
self.theta_cost_weight = 1
self.theta_dot_cost_weight = 0.1
... | CarlDegio/SQP_Pendulum | cvx_main.py | cvx_main.py | py | 4,654 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.zeros",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": ... |
35813238442 | import typing
from typing import Optional
from sqlalchemy.ext.asyncio import AsyncEngine, AsyncSession, create_async_engine, async_sessionmaker
from sqlalchemy.orm import declarative_base
from backend.services.database import db
if typing.TYPE_CHECKING:
pass
class Database:
def __init__(self, url: str):
... | jendox/tg_bot | backend/services/database/database/base.py | base.py | py | 883 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "typing.Optional",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.ext.asyncio.AsyncEngine",
"line_number": 16,
"usage_type": "name"
},
{
"api_n... |
38890746457 | import dialogflow_v2 as dialogflow
import os
path_key = "C:\wilasinee_pj\pj\python\ggthaluangbot-a6aed6caf27a.json"
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = path_key
#*****************************************************************
project_id = "thaluangbot-lhrv"
session_id = "82d12b78-40b4-4028-a8f7-3a6a479c... | wilasineePE/chatbot | index.py | index.py | py | 1,363 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.environ",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "flask.Flask",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "dialogflow_v2.SessionsClient",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "dialogflow_v2... |
24354798885 | import os
import torch
import gym
import gym_donkeycar
import time
from env.vae_env import VaeEnv
from vae.vae import VAE
from stable_baselines.sac.policies import MlpPolicy
from stable_baselines import SAC
VARIANTS_SIZE = 32
DONKEY_SIM_PATH = f"/Applications/donkey_sim.app/Contents/MacOS/sdsim"
SIM_HOST="127.0.0.1"... | masato-ka/sac-car-racing | run_donkey.py | run_donkey.py | py | 1,406 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "vae.vae",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "vae.vae.VAE",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "vae.vae.load_state_dict",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "vae.vae",
"line_numbe... |
12569604796 | from rest_framework import permissions
from rest_framework.permissions import BasePermission
# this class will findout if the user has permission to delete or update the post , to check if logged in user and post owner is same or not
class IsOwnerOrReadOnly(BasePermission):
message = "you must be the owner of th... | Maniabhishek/ContentManagementSystem | appcms/api/permissions.py | permissions.py | py | 639 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rest_framework.permissions.BasePermission",
"line_number": 7,
"usage_type": "name"
}
] |
11735637618 | """Add md5 and sha256 columns to File
Revision ID: d128b94f9a63
Revises: 59d249ebf873
Create Date: 2021-10-24 14:54:30.381535
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd128b94f9a63'
down_revision = '59d249ebf873'
branch_labels = None
depends_on = None
... | retroherna/rhinventory | alembic/versions/d128b94f9a63_add_md5_and_sha256_columns_to_file.py | d128b94f9a63_add_md5_and_sha256_columns_to_file.py | py | 806 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "alembic.op.add_column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.LargeBi... |
70865858108 | # -*- coding: utf-8 -*-
"""
Created on Wed Dec 18 21:54:40 2019
@author: dingxu
"""
from astropy.io import fits
import numpy as np
import matplotlib.pyplot as plt
from photutils import DAOStarFinder
from astropy.stats import sigma_clipped_stats
from photutils import CircularAperture
import cv2
#import scipy.signal as... | dingxu6207/newcode | newB4SIFT.py | newB4SIFT.py | py | 4,808 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "astropy.io.fits.open",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "astropy.io.fits",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "numpy.copy",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"... |
35571671171 | import urllib.request as urllib2 #import the library used to query a website
from bs4 import BeautifulSoup #import the Beautiful soup functions to parse the data returned from the website
import pandas as pd #import pandas to convert list to data frame
from openpyxl import load_workbook
# INPUT VARIABLES SPECIFIED BY... | rich-coleman-gh/Html_scraping_project | main.py | main.py | py | 4,466 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.ExcelFile",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "urllib.request.Request",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "urllib.request",
"line_number": 74,
"usage_type": "name"
},
{
"api_name": "urllib.request... |
5707554791 | '''
activation_key module
'''
from dataclasses import dataclass
from sqlalchemy import Integer, Column, String, ForeignKey
from databases.models.user import User
from config.db import db
@dataclass
class ActivationKey(db.Model): # pylint: disable=too-few-public-methods
'''
activation_key model class... | Dolzhenkov-Andrii/api | databases/models/activation_key.py | activation_key.py | py | 681 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "config.db.db.Model",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "config.db.db",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Int... |
18515188174 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 21 16:49:53 2017
@author: mducoffe
appendix : expansion operator for convolutional KFAC
"""
from keras.models import Model, Sequential
from keras.layers import Dense
import keras.backend as K
from keras.layers.merge import Concatenate
from keras.e... | mducoffe/Active_Learning_Variational_Inference_Deep_Networks | appendix.py | appendix.py | py | 1,264 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "keras.backend.image_dim_ordering",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "keras.backend",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "keras.backend.concatenate",
"line_number": 35,
"usage_type": "call"
},
{
"api_name... |
34653033371 | import math, os
from dataclasses import dataclass
import pygame
from const import *
@dataclass
class Position:
sector: int
layer: int
index: int
x: float
y: float
def __init__(self, sector, layer, index):
self.sector = sector
self.layer = layer
self.index = index
... | martin-hanekom/persian-silver-2 | src_old/tools.py | tools.py | py | 1,951 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "math.pi",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "math.pi",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "math.sin",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "math.cos",
"line_number": 21,
... |
6194000945 | import os
import json
from dotenv import load_dotenv
load_dotenv()
chinput = os.getenv('CHATINPUT')
chinput = '-1001799753250 -1001574745581 -1001322515232 -1001725353361'
channel_input = [int(i) for i in chinput.split(' ')]
choutput = os.getenv('CHATOUTPUT')
choutput = '-1001802541407'
channel_output = [int(i) for i... | Lj6890/Forwarded | config.py | config.py | py | 513 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 1... |
23715644007 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from event.models import Event
# Create your models here.
class Episode(models.Model):
event = models.ForeignKey(
Event,
on_delete=models.CASCADE,
related_name='episode')
session_id = models.... | emilarran/channelshowdown | channelshowdown/livestream/models.py | models.py | py | 396 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.db.models.Model",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "event.models",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.db.m... |
21043710164 | from datetime import datetime, time
from typing import Dict
# getting info from administrator
def getting_payload() -> Dict:
"""
this function takes nothing and return a dictionary of the users answers
:return: id, company_name, departure_time, arrival_time
"""
temp_id = int(input("Enter the new p... | Mohamad-Hachem/Airplane_Booking_System | utils/getting_airplane_information.py | getting_airplane_information.py | py | 1,567 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "datetime.time",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "datetime.d... |
3423610291 | import json
from functools import wraps
from flask import request
from flask.ext.restful import reqparse, Api, Resource
from api_json_example import app
# Database? We don't need no stinkin database
db = {}
api = Api(app)
def accept_json(func):
"""
Decorator which returns a 406 Not Acceptable if the cli... | sjl421/thinkful-python-code-examples | flask/api_json_example/api_json_example/api.py | api.py | py | 2,931 | python | en | code | null | github-code | 6 | [
{
"api_name": "flask.ext.restful.Api",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "api_json_example.app",
"line_number": 14,
"usage_type": "argument"
},
{
"api_name": "functools.wraps",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "flask.... |
37431367661 | # -*- coding: utf-8 -*-
"""
Created on Wed Dec 9 14:32:30 2020
@author: zjerma1
"""
import numpy as np
import matplotlib.pyplot as plt
from sklearn.preprocessing import PolynomialFeatures
from sklearn.linear_model import Ridge
from sklearn.model_selection import cross_val_score
from mlxtend.evalu... | zjermain/Math-7390-Machine-Learning-Jermain | Homework 2-Bias Variance Decomp.py | Homework 2-Bias Variance Decomp.py | py | 2,428 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.linspace",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.sin",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "numpy.linspace",
"line_num... |
20843364345 | import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim.lr_scheduler import CosineAnnealingLR
from torch.utils.data import DataLoader
from torch.utils.data.sampler import WeightedRandomSampler
import math
from network import Network
from losses import WalkerVisitLosses
from input_pipeline impor... | TropComplique/associative-domain-adaptation | train.py | train.py | py | 4,289 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "torch.device",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "input_pipeline.get_datasets",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "utils.make_weights_for_balanced_classes",
"line_number": 42,
"usage_type": "call"
},
{
"... |
35395868914 | from django.db import models
from django.urls import reverse
from phone_field import PhoneField
# Create your models here.
class Department(models.Model):
"""Отдел компании"""
name = models.CharField(max_length=200, verbose_name="Название отдела")
class Meta:
db_table = 'department'
orde... | zarmoose/eastwood_test | employees/models.py | models.py | py | 1,894 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.db.models.Model",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": ... |
29702682927 | #!/usr/bin/env python3
import os
import numpy as np
import matplotlib.pyplot as plt
import sklearn
import pandas as pd
from pandas import DataFrame as df
from sklearn import svm
from sklearn.model_selection import KFold, cross_val_score
from scipy import stats
import seaborn as sns
from sklearn.linear_model ... | maybje/Fake-News-Detection | logistic.py | logistic.py | py | 3,056 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.chdir",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number... |
11779793970 | import os
from scripts.util import read_supertopics, SuperTopic, get_spottopics, DateFormat, read_temp_dist, smooth
import numpy as np
from plotly.subplots import make_subplots
import plotly.graph_objects as go
BOOST = ['raw', # 0
'retweets', # 1
'replies', # 2
'likes', # 3
'r... | TimRepke/twitter-climate | code/figures/supertopics/stacked_area_charts_interactive_separate.py | stacked_area_charts_interactive_separate.py | py | 3,987 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "scripts.util.read_supertopics",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "scripts.util.read_temp_dist",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "scripts.util.SuperTopic",
"line_number": 35,
"usage_type": "name"
},
{
... |
14594650315 | import tensorflow as tf
import pathlib
import os
import cv2
import numpy as np
import tqdm
import argparse
class TFRecordsGAN:
def __init__(self,
image_dir="/volumes2/datasets/horse2zebra/trainA",
tfrecord_path="data.tfrecords",
img_pattern="*.jpgg"):
"""... | AhmedBadar512/Badr_AI_Repo | utils/create_gan_tfrecords.py | create_gan_tfrecords.py | py | 5,294 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "tensorflow.io.FixedLenFeature",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "tensorflow.io",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.string",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name"... |
24526724853 | import json
from arXivo.models import ArXivoUser
from arXivo.serializers import ArXivoUserSerializer, SearchSerializer
from arXivo.utils import get_tokens_for_user
from django.conf import settings
from django.contrib.auth import authenticate
from django.http.response import JsonResponse
from django.middleware import c... | DebadityaPal/arXivo | backend/arXivo/views.py | views.py | py | 6,438 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "rest_framework.views.APIView",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "arXivo.serializers.ArXivoUserSerializer",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "django.middleware.csrf.get_token",
"line_number": 24,
"usage_type": ... |
33068133857 | import sys
import argparse
import importlib
commands = {
'train': {
'script': 'ocr4all_pixel_classifier.scripts.train',
'main': 'main',
'help': 'Train the neural network. See more via "* train --help"'
},
'predict': {
'script': 'ocr4all_pixel_classifier.scripts.predict',
... | OMMR4all/ommr4all-page-segmentation | ocr4all_pixel_classifier/scripts/main.py | main.py | py | 2,358 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 56,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 57,
"usage_type": "attribute"
},
{
"api_name": "importlib.import_... |
19304565869 |
# -*- coding: utf-8 -*-
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from time import sleep
from selenium.webdriver.chrome.options import Options
import pandas as pd
import requests
"""
options = webdriver.ChromeOptions()
options.add_argument('--headless')
options.add_argumen... | satoshi-python/109 | train_sele.py | train_sele.py | py | 2,427 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.chrome.options.Options",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 30,
"usage_type": "name"
},
{... |
38152844484 | from typing import List
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.chrome.options import Options
class PathsParser:
def __init__(self): # if url changed replace it
caps =... | stolzor/test_task | models/paths_parser.py | paths_parser.py | py | 2,546 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "selenium.webdriver.common.desired_capabilities.DesiredCapabilities",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.chrome.options.Options",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"lin... |
42123297938 | from collections import namedtuple
import numpy as np
from ...utils.interpolation.levels import ( # noqa
LevelsDefinition as ConversionLevelsDefinition,
)
INPUT_REQUIRED_FIELDS = dict(
export_format=str,
levels_method=(None, str),
levels_number=(None, int),
levels_dzmin=(None, float),
levels... | EUREC4A-UK/lagtraj | lagtraj/forcings/conversion/input_definitions.py | input_definitions.py | py | 2,969 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "numpy.nan",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "numpy.nan",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "numpy.nan",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "numpy.nan",
"line_nu... |
27577948701 | from django.urls import path
from .views import (HomePageView, MessageView, UserProfile, delete_message,
spam_message, AddReview, AbouUs, ContactUs, ReviewView, SettingsView, EditProfile)
urlpatterns = [
path('', HomePageView.as_view(), name='home'),
path('profile/', UserProfile.as_view(), ... | Afeez1131/Anonymous-v1 | anonymous/urls.py | urls.py | py | 954 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "views.HomePageView.as_view",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "views.HomePageView",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.ur... |
22905238470 | import tensorflow as tf
import argparse
import sys
sys.path.insert(0, "../CycleGAN-TensorFlow")
import model # nopep8
# Transform image bitstring to float tensor
def preprocess_bitstring_to_float_tensor(input_bytes, image_size):
input_bytes = tf.reshape(input_bytes, [])
# Transform bitstring to uint8 tensor... | tmlabonte/tendies | minimum_working_example/export_graph_for_serving.py | export_graph_for_serving.py | py | 6,953 | python | en | code | 37 | github-code | 6 | [
{
"api_name": "sys.path.insert",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.reshape",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tensorflow.image.decod... |
27580622561 | from django.shortcuts import render, HttpResponse, get_object_or_404, HttpResponseRedirect
from .models import fizzURL
from django.views import View
from fiz.utils import create_shortcode
from .forms import SubmitURLForm
class HomeView(View):
'''
for a CBV, post and get function will be written separately, unl... | Afeez1131/shortener | fiz/views.py | views.py | py | 1,203 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.views.View",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "forms.SubmitURLForm",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "django.shortcuts.render",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "forms.Su... |
34252791072 | import argparse
import json
import os
from flask import Flask, render_template, request
import openai
import requests
import base64
app = Flask(__name__)
# Configure OpenAI API credentials
openai.api_key = 'OPEN_API_KEY'
@app.route('/')
def index():
return render_template('index.html')
@app.route... | Guhan-jb/HippoGPT | Hippo_GPT/main.py | main.py | py | 2,661 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "openai.api_key",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "flask.render_template",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.request.fo... |
20513626833 | from selenium import webdriver
from time import sleep
# validateText = "Option3"
driver = webdriver.Chrome(executable_path="/home/chaitanya/Documents/software/drivers/chromedriver_linux64/chromedriver")
driver.get("https://rahulshettyacademy.com/AutomationPractice/")
# Positive case
driver.find_element_by_css_selecto... | ChaithanyaRepo/PythonTesting | PythonSelenium/alerts.py | alerts.py | py | 788 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "time.sleep",
... |
37204853562 | import logging
import logging.config
import os
import yaml
from commons.path import LOG_PATH, CONFIG_PATH
class MyLog:
def __init__(self, file_name, config_path=CONFIG_PATH, handel_name='server', level=logging.INFO):
"""
自定义日志对象
:param config_path: 自定义日志配置文件
:param file_name: 自定义日志... | tangjikuo/pdfHandlerSite | commons/logs.py | logs.py | py | 1,948 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "commons.path.CONFIG_PATH",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "logging.INFO",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "commons.path.LOG_PATH",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "os.get... |
70472477627 | import numpy as np
import matplotlib.pyplot as plt
# data to plot
n_groups = 5
meso4 = (0.5, 0.65, 0.84, 0.7,0.51)
capsule = (0.84, 0.89, 0.96, 0.95, 0.88)
xception = (0.93, 0.97, 0.98, 0.95, 0.88)
gan = (0.72, 0.73, 0.86, 0.86, 0.72)
spectrum = (0.81, 0.83, 0.98, 0.67, 0.57)
headpose = (0.64, 0.64, 0.64, 0.... | phuc180155/GraduationThesis | dfd_benchmark/plot_image/more_bar_chart.py | more_bar_chart.py | py | 981 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "numpy.arange",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "matplotlib.... |
1068948273 | import numpy as np
from matplotlib import pyplot as plt
from scipy.optimize import minimize
import gymnasium as gym
import imageio
from pendulum_model import PendulumModel
# Constants
g = 10.0 # gravitational acceleration
l = 1.0 # length of the pendulum
m = 1.0 # mass of the pendulum
dt = 0.05 # time step
n = 100... | CarlDegio/SQP_Pendulum | scipy_trust.py | scipy_trust.py | py | 4,069 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.zeros",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "numpy.sum",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.sin",
"line_number": 43... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.