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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
71707177064 | import openai
import csv
import argparse
from collections import Counter
from typing import List
from data.discourse_connectors import discourse_connectors
# Ihr OpenAI GPT-3 API-Schlüssel
api_key = "[insert your API KEY here]"
def parse_arguments() -> argparse.Namespace:
"""CLI-Argumente parsen."""
parser = ... | SandroWick/gpt_discourseconnectives_counter | gpt_discourseconnectives_project.py | gpt_discourseconnectives_project.py | py | 4,623 | python | de | code | 0 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "argparse.Namespace",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "collections.Counter",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "c... |
26610494943 | # This class implements the adaptive rank transformation used in classifier ANOVA_subset_ranking_lr
import sklearn.base as base
import scipy
import time
import logging
import torch
from utilities.optirank.ranking_multiplication import ranking_transformation
import numpy as np
import statsmodels.api as sm
from statsmod... | paolamalsot/optirank | utilities/ANOVA_subset_ranking.py | ANOVA_subset_ranking.py | py | 6,722 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.DataFrame",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "statsmodels.formula.api.ols",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "statsmodels.api.stats.anova_lm",
"line_number": 29,
"usage_type": "call"
},
{
"api_n... |
6254269803 | from __future__ import unicode_literals
from django.shortcuts import render, get_object_or_404, redirect
from .models import Post, Tag
from .forms import PostAddForm
from django.contrib.auth.decorators import login_required
# Create your views here.
@login_required
def delete(request, post_id):
post = get_object_o... | Naoshin-hirano/blog_app | blog/blog_app/views.py | views.py | py | 2,376 | python | ja | code | 0 | github-code | 36 | [
{
"api_name": "django.shortcuts.get_object_or_404",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "models.Post",
"line_number": 10,
"usage_type": "argument"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 12,
"usage_type": "call"
},
{
"api_... |
41721739407 | # -*- coding:UTF-8 -*-
import numpy as np
import xlrd as xlrd
from scipy.stats import norm
import matplotlib
import matplotlib.pyplot as plt
import pandas as pd
import sys
import importlib
# 参数1 Excel文件位置 参数2 选择要作图的表格 参数3、4、5 xy轴代表含义以及标题文字 参数6列数 函数可以选择某地址文件某一个表格某一列来操作
class Make_figure:
def result_pic(address, E... | 357734432/Supervised-Blockchain-Simulator | Data_Output/Make_figure.py | Make_figure.py | py | 1,617 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "importlib.reload",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_nam... |
35742603936 | #!/usr/bin/env python3
import jetson.inference
import jetson.utils
import rospy
import os
import numpy as np
import cv2
import ctypes
from sensor_msgs.msg import Image, CameraInfo
from cv_bridge import CvBridge, CvBridgeError
class semanticSegmentation:
def __init__(self, topics_to, network, labels_file, camera_info... | ZiadGhanem/Adaptive-Cruise-Control-Application | graduation_project_pkgs/graduation_project_simulation/scripts/semantic_segmentation/semantic_segmentation.py | semantic_segmentation.py | py | 4,078 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "jetson.inference.inference.segNet",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "jetson.inference.inference",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "jetson.inference",
"line_number": 29,
"usage_type": "name"
},
{
... |
37417551271 | import os
from os.path import join
import sys
import json
import numpy as np
# from .read_openpose import read_openpose
import utils.segms as segm_utils
def db_coco_extract(dataset_path, subset, out_path):
# convert joints to global order
joints_idx = [19, 20, 21, 22, 23, 9, 8, 10, 7, 11, 6, 3, 2, 4, 1, 5, 0]... | HongwenZhang/DaNet-DensePose2SMPL | datasets/preprocess/dp_coco.py | dp_coco.py | py | 5,303 | python | en | code | 208 | github-code | 36 | [
{
"api_name": "os.path.join",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.reshape",
"line_number"... |
21577757864 | from imath.Trainer import Trainer
import torch
import imath as pt
import os
import torch.nn as nn
import numpy as np
class VAETrainer(Trainer):
def __init__(self, optim, lant_dim, criterion, **kwargs):
super(VAETrainer, self).__init__(**kwargs)
self.lant_dim = lant_dim
self.Distribute =... | IMath123/imath | Trainer/VAETrainer.py | VAETrainer.py | py | 1,621 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "imath.Trainer.Trainer",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torch.randn",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "torch.exp",
"line_number": 34,
"usage_type": "call"
}
] |
9487574383 | import os, glob
from sqlalchemy import *
import sqlalchemy.exc
from sqlalchemy.orm import sessionmaker
from parse import *
from lxml import etree
from datetime import datetime, date, time
step_types = {
'given': 0,
'when': 1,
'then': 2
}
curpath = os.path.basename(os.getcwd())
if curpath == 'steps':
o... | AlexandrMov/sqlbehave | sqlbehave/testmodule.py | testmodule.py | py | 5,971 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.basename",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number":... |
1858113091 | import subprocess
import os
import simplejson
import base64
import socket
from util import kg
import time
import threading
import pyttsx3
from PIL import ImageGrab
import sys
import shutil
import cv2
from util import sound_record
import tkinter
ip = "192.168.1.105" #Change this value according to yours... | st4inl3s5/kizagan | kizaganEN.py | kizaganEN.py | py | 11,980 | python | en | code | 72 | github-code | 36 | [
{
"api_name": "threading.Thread",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "util.kg.kg_Start",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "util.kg",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "socket.socket",
"l... |
16931221429 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 24 23:39:39 2018
@author: yorklk
"""
import os
import numpy as np
from skimage.morphology import label
from keras.models import Model, load_model
from keras.layers import Input, Activation, Add, BatchNormalization
from keras.layers.core import Dro... | yorklk/dsb2018-U-Net | U-Net.py | U-Net.py | py | 13,208 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.load",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number... |
8293997114 | # -*- coding: utf-8 -*-
"""
Created on Fri Sep 17 13:44:46 2021
@author: bfeng1
"""
import json
import sys
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import numpy as np
from scipy.signal import savgol_filter
from sklearn.utils import resample
from sklearn.metrics import a... | bfeng1/Jump-Classification-Project | aim2.py | aim2.py | py | 12,898 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "scipy.signal.savgol_filter",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "sklearn.utils.resample",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "mat... |
12118485844 | """Training a Transformer Builder model to be used for adversarial attacks."""
import argparse
import random
from functools import partial
from typing import Dict
import numpy as np
import torch
from sklearn.metrics import precision_recall_fscore_support, confusion_matrix
from torch.utils.data.sampler import BatchSamp... | copenlu/fever-adversarial-attacks | builders/train_transformer.py | train_transformer.py | py | 8,288 | python | en | code | 11 | github-code | 36 | [
{
"api_name": "torch.nn",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "torch.utils.data.sampler.BatchSampler",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "torch.optim",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "... |
16534298320 | import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
class VizHelp():
# Additional Usefull Display Methods
def plotPredictions(self, predictions, targets, decoder_steps, epochs, file_name, show=True):
stock_name = file_name.split('.')[0].upper()
if '/' in stock_name:
stoc... | rvariverpirate/TRN_StockPrediction | VisualizationHelpers.py | VisualizationHelpers.py | py | 1,429 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "seaborn.set",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot... |
16515258502 | """
ARGUMENTS: python3 ParseMetaFilesUpdated.py <path-to-jstor-data> <which-part> <how-many-parts> <output-path>
<how-many-parts>: for parallel processing, this should be the number of workers available to run the program; 1 if not running in parallel.
<which-part>: for parallel processing, this should be a uni... | h2researchgroup/dictionary_methods | code/ParseMetaFilesUpdated.py | ParseMetaFilesUpdated.py | py | 5,612 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.argv",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
4615311890 | from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name = "home"),
path('shop/', views.shop, name = "shop"),
path('about/', views.about, name = "about"),
path('contact/', views.contact, name = "contact"),
path('faq/', views.faq, name = "faq"),
] | brownlenox/djangostaticfiles | mainapp/urls.py | urls.py | py | 302 | python | en | code | 0 | github-code | 36 | [
{
"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",
... |
39647238473 |
from django.urls import path
from .views import newpost_add, post_list, post_detail, post_update,post_delete,about_page, post_like
urlpatterns = [
path('add', newpost_add, name='add'),
path('', post_list, name='list'),
path('detail/<int:id>', post_detail, name='detail'),
path('update/<int:id>', post_u... | yildirimesutx/Django_Blog_Project_102 | blog/urls.py | urls.py | py | 501 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "views.newpost_add",
"line_number": 6,
"usage_type": "argument"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "views.post_list"... |
16772279994 | import urllib
import boto3
from botocore.exceptions import ClientError
ec2 = boto3.client("ec2")
def get_my_public_ip():
external_ip = urllib.request.urlopen(
'https://ident.me').read().decode('utf8')
print('Public ip - ', external_ip)
return external_ip
def create_key_pair(name):
try:
... | annatezelashvili/AWS_Python_Automation | Tasks/Task10-11/create_ec2.py | create_ec2.py | py | 3,423 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "boto3.client",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "urllib.request.urlopen",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "urllib.request",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "botocore.excepti... |
6697035634 | from models.arch.network import Network
from torch.nn import functional as F
import torch
model = Network(stage=2, depth=8).cuda()
model.set_query_codebook()
model.load_state_dict(torch.load("./pretrained_models/LOLv1.pth"))
x = torch.ones(1, 3, 256, 256).cuda()
with torch.no_grad():
M = F.relu(x - mo... | TaoHuang95/RQ-LLIE | test.py | test.py | py | 1,359 | python | en | code | null | github-code | 36 | [
{
"api_name": "models.arch.network.Network",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "torch.load",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.ones",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.no_grad",
"l... |
17176681083 | import os
import logging
from logging import handlers
from api.common.jsonFormatter import JsonFormatter
# json形式で出力するログファイル
class Api_logger_json():
def __init__(self, name):
super().__init__()
# ログ取得
self.log = logging.getLogger(name + "_json")
if not self.log.hasHandlers():
... | war-bonds-rx78/python_flask_db_sample | api/common/logger_json.py | logger_json.py | py | 1,381 | python | ja | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "logging.handlers.TimedR... |
35217252222 | from enum import IntEnum
import requests
from urllib.request import urlopen
import urllib
from selenium import webdriver
from bs4 import BeautifulSoup
import http.client
from openpyxl import Workbook
from openpyxl import load_workbook
from openpyxl.writer.excel import ExcelWriter
from openpyxl.cell.cell import ILLEGAL_... | Just-Doing/python-caiji | src/work/20210807/otcuncedu.py | otcuncedu.py | py | 3,301 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "http.client.client",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "http.client",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "urllib.request.build_opener",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "urlli... |
16277554121 | import pygame
from constants import *
import numpy
class Board:
# Initializing the board with screen as an input
def __init__(self, screen) -> None:
self.screen = screen
self.game_array = numpy.zeros((WINDOW_SIZE // CUBE_SIZE, WINDOW_SIZE // CUBE_SIZE))
self.draw_board()
self.tu... | szczepanspl/tic_tac_toe | board.py | board.py | py | 5,668 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.zeros",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pygame.draw.line",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pygame.draw",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "pygame.draw.line",
"... |
34109397178 | import requests
from tunga_tasks import slugs
EVENT_PUSH = 'push'
EVENT_CREATE = 'create'
EVENT_DELETE = 'delete'
EVENT_COMMIT_COMMENT = 'commit_comment'
EVENT_PULL_REQUEST = 'pull_request'
EVENT_PULL_REQUEST_REVIEW_COMMENT = 'pull_request_review_comment'
EVENT_ISSUE = 'issue'
EVENT_ISSUE_COMMENT = 'issue_comment'
EV... | jonathanzerox/tunga-api | tunga_utils/github.py | github.py | py | 3,509 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "tunga_tasks.slugs.BRANCH",
"line_number": 79,
"usage_type": "attribute"
},
{
"api_name": "tunga_tasks.slugs",
"line_number": 79,
"usage_type": "name"
},
{
"api_name": "tunga_tasks.slugs.TAG",
"line_number": 80,
"usage_type": "attribute"
},
{
"api_na... |
42350249999 | from flask import jsonify
from pyspark.sql import SparkSession
import matplotlib.pyplot as plt
import pandas as pd
import io
spark = SparkSession \
.builder \
.appName("Tweets Analysis using Python Saprk") \
.getOrCreate()
# spark is an existing SparkSession
df = spark.read.json("importedtweetsdata.json")
... | pujithasak/TweetsAnalysisPythonProject | AnalysisQuery4.py | AnalysisQuery4.py | py | 1,055 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pyspark.sql.SparkSession.builder.appName",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pyspark.sql.SparkSession",
"line_number": 6,
"usage_type": "... |
9157699619 | import argparse
from typing import List
import config
import mysql.connector
from collections import OrderedDict
from binance_data import BinanceData
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
def load(data: List['BinanceData']):
# db connection
# db batch insert new table
... | Sherry-W071/Real-time-Cryptocurrency-Data-Aggregation-and-Processing-Pipeline | transform_load.py | transform_load.py | py | 9,045 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "typing.List",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "mysql.connector.connector.connect",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "mysql.connector.connector",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_... |
34729716556 | #!/usr/bin/python3
from twitter import *
import time
import json
with open('./conf.json') as file: conf = json.load(file)
tw = Twitter(auth=OAuth(conf['token'], conf['token_key'], conf['con_sec'], conf['con_sec_key']))
maxcount = 5000
friends = []
followers = []
res = tw.friends.ids(count=maxcount)
cursor = -1
while ... | jdxlabs/twitter_diff | remove_friendsonly.py | remove_friendsonly.py | py | 1,048 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "json.load",
"line_number": 5,
"usage_type": "call"
}
] |
8402296505 | from argparse import ArgumentParser
import json, logging
import seeker.podSeeker as Seeker
import judge.simpleJudge as Judge
import updater.simpleUpdater as Updater
class installed_query_info():
def __init__(self, query_id, src_id, dst_id):
self.query_id = query_id
self.src_id = src_id
sel... | In-Net/NQATP | stimulator/easy_seeker.py | easy_seeker.py | py | 3,891 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "json.lo... |
20528044643 | import pika
connection = pika.BlockingConnection( #建立连接
pika.ConnectionParameters(host='localhost')
)
channel = connection.channel() #声明一个管道
#声明QUEUE
channel.queue_declare(queue='hello2',durable=True)
channel.basic_publish(exchange='',
routing_key='hello2',
body='Hello World!',
properties... | chenyaqiao0505/Code111 | RabbitMQ/producter.py | producter.py | py | 572 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pika.BlockingConnection",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "pika.ConnectionParameters",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pika.BasicProperties",
"line_number": 15,
"usage_type": "call"
}
] |
25952738898 | #encoding utf-8
from openpyxl import load_workbook
from openpyxl import Workbook
from openpyxl.worksheet.table import Table, TableStyleInfo
import os
import re
def salvar_email():
path = 'E:/4 - ARQUIVO\PROJETOS\motor\email.xlsx'
arquivo_excel = load_workbook(path)
separados = arquivo_excel... | ricardocvel/buscarEmail_excel- | inteirarExcel.py | inteirarExcel.py | py | 2,400 | python | pt | code | 0 | github-code | 36 | [
{
"api_name": "openpyxl.load_workbook",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "re.IGNORECASE",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "re.search",
"... |
10022682639 | import os
import re
import openai
from dotenv import load_dotenv
load_dotenv()
openai.api_key = os.environ['OPENAI_API_KEY']
def request_chatgpt(messages: list):
return openai.ChatCompletion.create(
model="gpt-3.5-turbo",
messages=messages,
)
def analyze_toots(mastodon_timelines: list) -> t... | mio256/mastardon | page/chatgpt_func.py | chatgpt_func.py | py | 1,302 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "openai.api_key",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "openai.ChatComple... |
26896963958 | #!/usr/bin/env python3
import sys
import time
import socket
import yaml
from dataclasses import asdict
import ipywidgets.widgets as widgets
from IPython.display import display
print(sys.executable)
from ecat_repl import ZmsgIO
from ecat_repl import FoeMaster
from ecat_repl import CtrlCmd
from ecat_repl import SdoCmd... | alessiomargan/Ecat-repl | ecat_repl/test/ecat_advr.py | ecat_advr.py | py | 1,873 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.executable",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "ecat_repl.ZmsgIO",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "ecat_repl.master_cmd_stop",
"line_number": 53,
"usage_type": "argument"
},
{
"api_name": "ec... |
2286638164 | from collections import Counter
def get_hints(word: str, secret_word: str):
word = word.lower()
result = [""] * len(word)
missing_indexes = []
secrect_counter = Counter(secret_word)
for idx, c in enumerate(word):
if c == secret_word[idx]:
result[idx] = "green"
sec... | pythonfoo/rest-wordle | rest_wordle/utils.py | utils.py | py | 712 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "collections.Counter",
"line_number": 9,
"usage_type": "call"
}
] |
7158973131 | import os
import shutil
from pathlib import Path
from os import system
from shutil import rmtree
import shutil
mi_ruta = Path(Path.home(), '\Programacion-Cursos-Desarrollador\Python\Python-proyecto1\Dia7\Banco')
class Persona:
def __init__(self, nombre, apellido):
self.nombre = nombre
self.apelli... | Alexa-Silvermoon/curso-python-proyectos-udemy-federico | Dia7/ProyectoDelDia7 - mejorada cuenta bancaria.py | ProyectoDelDia7 - mejorada cuenta bancaria.py | py | 3,868 | python | es | code | 0 | github-code | 36 | [
{
"api_name": "pathlib.Path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pathlib.Path.home",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_nu... |
3829108374 | # coding: utf-8
# 前端测试是否眨眼,用于活体检测 Front-end test blinks for biopsy
from scipy.spatial import distance as dist
from imutils import face_utils
import time
import dlib
import cv2
def eye_aspect_ratio(eye):
# 计算两只眼睛之间的垂直欧式距离
A = dist.euclidean(eye[1], eye[5])
B = dist.euclidean(eye[2], eye[4])
# 计算两眼之间的水... | HollowMan6/Lanck-Face-Recognition-Lock-Competition-Backend-Code | Development-Board/DetectBlinks.py | DetectBlinks.py | py | 4,286 | python | en | code | 22 | github-code | 36 | [
{
"api_name": "scipy.spatial.distance.euclidean",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "scipy.spatial.distance",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "scipy.spatial.distance.euclidean",
"line_number": 13,
"usage_type": "call"
},
... |
35658691918 | """The filtersets tests module."""
import pytest
from django.db.models.query import QuerySet
from django.http import HttpRequest
from communication.serializer_fields import (ParentMessageForeignKey,
UserReviewForeignKey)
from conftest import OBJECTS_TO_CREATE
pytestmark = ... | webmalc/d8base-backend | communication/tests/serializer_fields_tests.py | serializer_fields_tests.py | py | 1,305 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pytest.mark",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django.db.models.query.QuerySet",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "communication.serializer_fields.UserReviewForeignKey",
"line_number": 15,
"usage_type": ... |
41165135533 | # -*- coding: utf-8 -*-
'''
This file is part of Habitam.
Habitam is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
Habitam is distr... | habitam/habitam-core | habitam/downloads/balance.py | balance.py | py | 6,509 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "reportlab.lib.pagesizes.A4",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "reportlab.lib.pagesizes.A4",
"line_number": 39,
"usage_type": "name"
},
{
"api_name"... |
23400353850 | import cv2
import numpy as np
from matplotlib import pyplot as plt
import os
os.chdir('C:\\Users\\sachi\\.vscode\\GitHubRepos\\OSCV_Exercises')
exetasknum = 1
# Contours can be explained simply as a curve joining all the continuous points (along the boundary), having same color or intensity. The contours are a useful ... | sachingadgil/OSCV_Exercises | OpenCV_Python_Tutorials/017 Contours Getting Started.py | 017 Contours Getting Started.py | py | 1,930 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.chdir",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number... |
34162683454 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import tempfile
from subprocess import PIPE, Popen
import os
import random
import codecs
import math
from sklearn.pipeline import FeatureUnion
from sklearn.pipeline import Pipeline
from resources import SEMEVAL_SCORER_PATH
logger = logging.getLogger(__na... | daimrod/opinion-sentence-annotator | utils.py | utils.py | py | 7,027 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sklearn.pipeline.FeatureUnion",
"line_number": 36,
"usage_type": "argument"
},
{
"api_name": "sklearn.pipeline.Pipeline",
"line_number": 40,
"usage_type": "argument"
},
{
... |
5986988615 | from albert import *
import os
import pathlib
import shlex
import subprocess
md_iid = '1.0'
md_version = "1.8"
md_name = "Locate"
md_description = "Find and open files using locate"
md_license = "BSD-3"
md_url = "https://github.com/albertlauncher/python/tree/master/locate"
md_bin_dependencies = "locate"
class Plugin... | m0lw9re/albert | plugins/python/plugins/locate/__init__.py | __init__.py | py | 2,227 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pathlib.Path",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "shlex.split",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "subprocess.run",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line_n... |
30942866367 | from rest_framework import serializers
from .models import Product, Ingredient
class IngredientSerializer(serializers.ModelSerializer):
class Meta:
model = Ingredient
fields = ('title', 'price')
class ProductSerializer(serializers.ModelSerializer):
ingredients = IngredientSerializer(read_onl... | Dawid-Dahl/stereo-nightclub-api | api/serializers.py | serializers.py | py | 495 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "models.Ingredient",
"line_number": 7,
"usage_type": "name"
},
... |
71713005863 | import requests
class ApiBaseActions:
def __init__(self, base_url):
if base_url.endswith("/"):
self.base_url = base_url
else:
self.base_url = base_url + "/"
self.session = requests.Session()
def make_request(self, method: str, route_url: str = None, **kwargs):
... | HarshDevSingh/python-behave | api/api_base.py | api_base.py | py | 906 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.Session",
"line_number": 10,
"usage_type": "call"
}
] |
75215887145 | import streamlit as st
from transformers import pipeline
# 👈 Add the caching decorator
@st.cache(allow_output_mutation=True)
def load_model():
return pipeline("sentiment-analysis")
model = load_model()
query = st.text_input("Your query")
if query:
result = model(query)[0] # 👈 Classify the query text
... | Jaggusms/sentiment_analysis_higgingFace | app.py | app.py | py | 349 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "transformers.pipeline",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "streamlit.cache",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "streamlit.text_input",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "streamlit.wr... |
10691268780 | import sqlite3 as sql
from sqlite3 import OperationalError
from pythonobjet.exo1_formesgeometriques.point.Point import Point
class PointDao:
"""Ma classe"""
def __init__(self):
pass
def initialisation(self):
connecteur = sql.connect("donnee.db")
curseur = connecteur.cursor()
... | silvaplana/pythontraining | pythonobjet/exo1_formesgeometriques/point/PointDao.py | PointDao.py | py | 1,627 | python | fr | code | 0 | github-code | 36 | [
{
"api_name": "sqlite3.connect",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sqlite3.OperationalError",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "sqlite3.connect",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "sqlite3.conn... |
3314005552 | import time, json, os, logging, requests
from cumulocityAPI import C8Y_BASEURL, C8Y_TENANT, C8Y_HEADERS, CumulocityAPI
from arguments_handler import get_profile_generator_mode
from oeeAPI import OeeAPI
def try_int(value):
try:
return int(value)
except:
return None
PROFILES_PER_DEVICE = try_i... | SoftwareAG/oee-simulators | simulators/main/profile_generator.py | profile_generator.py | py | 5,006 | python | en | code | 8 | github-code | 36 | [
{
"api_name": "os.environ.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_... |
70874377705 | from decimal import Decimal
from random import random
from unittest.mock import ANY, Mock
from uuid import UUID, uuid4
from fastapi import FastAPI
from injector import InstanceProvider
from mockito import when
from pytest import fixture, mark
from currency import Currency
from ordering import Service as OrderingServi... | lzukowski/workflow | tests/application/test_api.py | test_api.py | py | 5,764 | python | en | code | 5 | github-code | 36 | [
{
"api_name": "factories.ApiCreateBuyOrderRequestFactory",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "factories.ApiCreateBuyOrderRequestFactory",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "factories.ApiCreateBuyOrderRequestFactory",
"line_number"... |
30591789155 | from __future__ import annotations
from grammar import Grammar, reduce_left_recursion, chomsky_normal_form
from dacite import from_dict
import json
def main():
filename = input("Input file name:") or "data.json"
print(f'using file {filename}')
with open(filename, "r") as f:
data = json.load(f)
... | fairay/Compilers | lab2/main.py | main.py | py | 682 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "json.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "dacite.from_dict",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "grammar.Grammar",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "grammar.reduce_left_recurs... |
9211558964 | import sys
import os
import time
import traceback
import pandas as pd
import seaborn as sns
import pydotplus
import matplotlib.pyplot as plt
import numpy as np
from sklearn.tree import export_graphviz
from sklearn import tree
from sklearn.model_selection import train_test_split
from sklearn.model_selection import Gri... | sarah-antillia/SOL4Py_V4 | ml/DecisionTreeClassifier.py | DecisionTreeClassifier.py | py | 8,676 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.path.append",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "traceback.print_exc",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets.lo... |
42262216968 | import os
import math
import multiprocessing
from tqdm import tqdm
from argparse import Namespace
from typing import Iterable, Optional
mp = multiprocessing.get_context("spawn")
from utils import _create_model_training_folder
import torch
import torch.nn.functional as F
import torchvision
from torch.nn.parameter impo... | kaist-ina/TSPipe | benchmarks/byol/trainer.py | trainer.py | py | 13,650 | python | en | code | 6 | github-code | 36 | [
{
"api_name": "multiprocessing.get_context",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.utils.tensorboard.SummaryWriter",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "utils._create_model_training_folder",
"line_number": 36,
"usage_type": "... |
20353033243 | from __future__ import absolute_import
import itertools
from django import forms
from .models import Episode
class ScoreboardForm(forms.Form):
def __init__(self, *args, **kwargs):
classes = kwargs.pop("classes")
super(ScoreboardForm, self).__init__(*args, **kwargs)
classes_choices = [(c.... | ocadotechnology/rapid-router | game/forms.py | forms.py | py | 1,935 | python | en | code | 53 | github-code | 36 | [
{
"api_name": "django.forms.Form",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.forms.MultipleChoiceField",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "dj... |
10623176651 | """An AWS Python Pulumi program"""
import pulumi
from pulumi_aws import eks
import networking
config = pulumi.Config();
environment = config.require('environment');
instance_size = config.require('instance-size');
eks_service_role = config.require('eks-service-role');
node_instance_role = config.require('node-instan... | dtorresf/iac | pulumi/eks/__main__.py | __main__.py | py | 1,663 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pulumi.Config",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pulumi_aws.eks.Cluster",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pulumi_aws.eks",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "pulumi_aws.eks.Clu... |
14159899947 | from seqeval.metrics import classification_report
from seqeval.metrics import f1_score
from typing import List
import os
# the order for evaluating the script is in the main function
def create_fake_conll_form_without_iob_to_emNER_input():
"""tokenized sentences for emNER
input: iob format"""
with open("... | huspacy/huspacy-resources | scripts/benchmark/emNER_eval.py | emNER_eval.py | py | 3,617 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.exists",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
26419246863 | import cv2
import numpy as np
from functions import top_offset
class SceneMoments():
def __init__(self, sections_img, color, min_contour_size=1000, type_object="", offset=True, compl=False):
self.min_contour_size = min_contour_size
self.type_object = type_object
self.bw = np.all... | onmax/Robotics | scene-detection/detection/scene_moments.py | scene_moments.py | py | 3,808 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.all",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "functions.top_offset",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "cv2.waitKey",
"li... |
12083042499 | import json
import logging
from django.contrib import messages
from django.contrib.auth.decorators import login_required, user_passes_test
from django.core.management import call_command
from django.http import HttpRequest, HttpResponse
from django.http.response import HttpResponseRedirect
from django.urls import reve... | yunojuno/django-linear | linear/views.py | views.py | py | 2,704 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.http.HttpRequest",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "django.contrib.messages.add_message",
"line_number": 23,
"usage_type": "call"
},
{
"api... |
451100359 | #!/usr/bin/python3
from __future__ import division
from core.class_utils import MalwareUrl
from core.config_utils import get_base_config
from datetime import datetime, timedelta
from core.dns_utils import resolve_dns
from core.log_utils import get_module_logger
from core.virus_total import get_urls_for_ip
import dat... | phage-nz/ph0neutria | core/plugins/cymon.py | cymon.py | py | 8,062 | python | en | code | 299 | github-code | 36 | [
{
"api_name": "os.path.dirname",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"... |
71104422184 | #!/usr/bin/env python
# -*- coding=UTF-8 -*-
# Created at Mar 20 19:50 by BlahGeek@Gmail.com
import sys
if hasattr(sys, 'setdefaultencoding'):
sys.setdefaultencoding('UTF-8')
import logging
from datetime import datetime, timedelta
from treehole.renren import RenRen
import os
from treehole.models import ContentMod... | blahgeek/treehole | treehole/utils.py | utils.py | py | 2,317 | python | en | code | 30 | github-code | 36 | [
{
"api_name": "sys.setdefaultencoding",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "treehole.models.ContentModel.objects.filter",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "treehole.models.ContentModel.objects",
"line_number": 17,
"usage_type":... |
13070318133 | import time, collections
class RateLimiter:
def __init__(self, max_number, interval):
self.timeStamp = collections.defaultdict(collections.deque)
self.interval = interval
self.max_number = max_number
def call(self, id):
currTime = time.time()
if len(self.timeStamp[id]) ... | Jason003/Interview_Code_Python | stripe/rate limiter.py | rate limiter.py | py | 813 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "collections.defaultdict",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "time.time",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "time.sleep",
... |
9385088011 | # -*- coding: utf-8 -*-
"""
Created on Wed Jul 27 01:30:02 2022
@author: Syeda Fatima Zahid
"""
import time
import datetime
import pandas as pd
ticker = 'MSFT'
period1 = int(time.mktime(datetime.datetime(2020, 12, 1, 23, 59).timetuple()))
period2 = int(time.mktime(datetime.datetime(2020, 12, 31, 23, 59).timetuple())... | syedafatimah/Stock-Price-Analyzer | Prediction Using Numerical Data/Data Extraction.py | Data Extraction.py | py | 576 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "time.mktime",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "time.mktime",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"li... |
41614185208 | from django.shortcuts import HttpResponseRedirect
from django.http import JsonResponse
from urllib.parse import quote
class AuthRequiredMiddleware(object):
def __init__(self, get_response):
self.get_response = get_response
def __call__(self, request):
# Code to be executed for each request be... | comiconomenclaturist/django-icecast-stats | stats/middleware.py | middleware.py | py | 1,051 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "django.http.JsonResponse",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "urllib.parse.quote",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.HttpResponseRedirect",
"line_number": 22,
"usage_type": "call"
}
] |
36255089286 | import setuptools
NAME = "oka"
VERSION = "0.2108.0"
AUTHOR = 'Rafael A. Bizao, Davi P. dos Santos'
AUTHOR_EMAIL = 'rabizao@gmail.com'
DESCRIPTION = 'Python client for oka'
with open('README.md', 'r') as fh:
LONG_DESCRIPTION = fh.read()
LICENSE = 'GPL3'
URL = 'https://github.com/davips/lange'
DOWNLOAD_URL =... | rabizao/oka | setup.py | setup.py | py | 1,764 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "setuptools.setup",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 58,
"usage_type": "call"
}
] |
13782320879 | from fastapi import APIRouter
from conn import conn
from model.kitchen import Kitchen
kitchen_router = APIRouter(
prefix="/kitchen",
tags=["kitchen"],
)
@kitchen_router.get("/")
async def read_items(attr: list, where: dict):
cursor = conn.cursor()
sql = Kitchen.querySql(attr=attr, where=where)
cur... | JulioHey/Banco-de-Dados---EP | server/router/kitchen.py | kitchen.py | py | 1,060 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "conn.conn.cursor",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "conn.conn",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "model.kitchen.Kitchen.que... |
36899051077 | import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
import math
import matplotlib.animation as animation
from mpl_toolkits.mplot3d import Axes3D
from mpl_toolkits.mplot3d import Axes3D
#Global Variables
num_iter=0
saved_theta=np.zeros((2, 1))
cost=np.zeros(1)
def h(X, theta):
return np.dot(X, ... | ashishgupta97/Machine-Learning | LinearRegression.py | LinearRegression.py | py | 2,417 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.zeros",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.dot",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 16,
... |
31410757057 | from django.db import models
from django.contrib.auth import get_user_model
# Create your models here.
class MailList(models.Model):
"""
database table that stores all
users that subscribe to recieve notifications
"""
user = models.ForeignKey(get_user_model(), on_delete=models.CASCADE)
recieve... | andela/ah-backend-valkyrie | authors/apps/notify/models.py | models.py | py | 1,042 | python | en | code | 0 | github-code | 36 | [
{
"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.ForeignKey",
"line_number": 11,
"usage_type": "call"
},
{
"api_name":... |
16117948354 | import os
from builtins import classmethod, int
from datetime import datetime
from models.country import Country
from es import es
class State:
def __init__(self):
pass
@classmethod
def list(cls, country):
if country != "":
state_data = es.search(
index=os.en... | RakeshMallesh123/flask-elasticsearch | models/state.py | state.py | py | 3,380 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "es.es.search",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "es.es",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "os.environ.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 18,... |
31282026948 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import re
import tensorflow as tf
from bs4 import BeautifulSoup
from pagi.utils.embedding import Embedding
def main(args):
print("Args:", args)
# data_dir = '/home/dave/agi/ptb_err'
# count_file = ... | Cerenaut/rsm | rsm/scripts/preprocess_reuters.py | preprocess_reuters.py | py | 5,812 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "pagi.utils.embedding.Embedding",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 111,
"usage_type": "call"
},
{
"api_name": "tensorflo... |
38384503953 | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import logging
import datetime
logname = "Trying"+datetime.date.today().strftime("%d-%m-%Y")+".log"
logging.basicConfig(filename=logname,
filemode='a',
format='%(asctime)s,%(msecs)d %(... | amynav/Testing_repo | trying.py | trying.py | py | 1,339 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "datetime.date.today",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "logging.basicConfig",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "logging.INFO"... |
40600848751 | from django.core.exceptions import ObjectDoesNotExist
from django.shortcuts import render
from watchlist.models import Movie
from django.http import JsonResponse
# Create your views here.
def movie_list(request):
movies = Movie.objects.all()
data = {
'movies': list( movies.values() )
}
retur... | shubham2637/DRF | watchmate/watchlist/views.py | views.py | py | 684 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "watchlist.models.Movie.objects.all",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "watchlist.models.Movie.objects",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "watchlist.models.Movie",
"line_number": 11,
"usage_type": "name"
... |
35620233152 | """Runs training and evaluation of Prophet models."""
import importlib
import json
import os
import sys
from pathlib import Path
import click
import matplotlib.pyplot as plt
import mlflow
from dask import distributed
from prophet import plot
from prophet.diagnostics import cross_validation, performance_metrics
from pr... | axiom-data-science/project-s2s-sea-ice-guidance | src/experiments/runner.py | runner.py | py | 6,063 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "utils.read_config",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "importlib.util.spec_from_file_location",
"line_number": 31,
"usage_type": "call"
},
{
"api_name... |
16568956344 | from RW import readAll
import os
import json
from PrettyPrint import pretty, prettyJarInfo, prettyNameSpace1, prettyElementKind
import sys
#pathToRawData = r"C:\Users\t-amketk\RawData\RawData"
def get_all_projects(path):
return readAll("Projects", "Project", pathToProtos=os.path.join(path, "ProtosOut"))
def get... | ameyaKetkar/TypeChangeMiner | scripts/ProtosToJson.py | ProtosToJson.py | py | 4,967 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "RW.readAll",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "RW.readAll",
"line_number": ... |
4472055866 | from math import sin, cos
from components.bubble import Bubble
from components.utils import HF
from data.constants import CONFUSION_COLORS
class EnemyEvent:
def __init__(self, owner, game, data: dict):
self.owner = owner
self.game = game
self.trigger_value = data["trigger value"]
... | IldarRyabkov/BubbleTanks2 | src/components/enemy_event.py | enemy_event.py | py | 1,981 | python | en | code | 37 | github-code | 36 | [
{
"api_name": "data.constants",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "data.constants",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "data.constants",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "components.bubble.Bubble... |
73881050665 | import six
from sse.exceptions import SseException
__all__ = ['MethodNotAllowed', 'NotFound']
class StreamProtocolException(SseException):
"""
To avoid confusing with class naming or maybe I need some brain surgery
"""
def __init__(self, **kwargs):
for key, value in six.iteritems(kwargs):
... | Axik/instamute.io | apps/stream/exceptions.py | exceptions.py | py | 974 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sse.exceptions.SseException",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "six.iteritems",
"line_number": 12,
"usage_type": "call"
}
] |
37393924840 | from django.urls import path
from . import views
app_name = 'tenants'
urlpatterns = [
path('', views.index, name='index'),
path('device_network/', views.device_network, name='device_network'),
path('device_location/', views.device_location, name='device_location'),
path('device/', views.device, name=... | Being-rayhan/iot | tenants/urls.py | urls.py | py | 1,265 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
17956410019 | import pygame as pg
from random import random as r
from neurobiba import Weights, load_weights, save_weights
import copy
import itertools
W, H, size = 100, 60, 10
pg.init()
screen = pg.display.set_mode((W*size, H*size), 0, 32)
pg.display.set_caption('CYBERBIBA')
def update():
nn = Weights([27,3])
canvas1 = [... | displaceman/neurobiba | examples/neural cellular automata/neuroautomata.py | neuroautomata.py | py | 1,435 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "pygame.init",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pygame.display... |
35396799058 | from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
from contextlib import contextmanager
import tempfile
from pex.pex_builder import PEXBuilder
from twitter.common.collections import OrderedSet
from pants.backend.cor... | fakeNetflix/square-repo-pants | src/python/pants/backend/python/tasks/python_task.py | python_task.py | py | 4,295 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pants.backend.core.tasks.task.Task",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "pants.backend.python.interpreter_cache.PythonInterpreterCache",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "twitter.common.collections.OrderedSet",
"lin... |
25523783356 | import os
from flask import Flask, make_response, request, redirect, url_for, send_from_directory
from werkzeug.utils import secure_filename
from database import app
UPLOAD_FOLDER = './uploads'
ALLOWED_EXTENSIONS = { 'png', 'jpg', 'mp3' } #to change for music files
app.config['UPLOAD_FOLDER'] = os.path.join(os.getcwd... | arkea-tech/YEP_EpiKodi3_2020 | server/file_transfer/views.py | views.py | py | 1,512 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "database.app.config",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "database.app",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_n... |
5762295604 | import os
import sys
from datetime import datetime, timedelta
from airflow.models import DAG
from airflow.operators.python import PythonOperator
from airflow.utils.dates import days_ago
PARENT_DIR = os.path.dirname(
os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
)
sys.path.append(PARENT_DIR)
from c... | bhuiyanmobasshir94/Apache-Airflow-Starter | airflow/dags/aflow_dag.py | aflow_dag.py | py | 823 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.dirname",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numb... |
34743814847 | from typing import List
file = "input02.txt"
with open(file, "rt") as f:
ids = f.readlines()
# Part 1
doubles = 0
triples = 0
for id in ids:
double_found = False
triple_found = False
for c in id:
reps = id.count(c)
if reps == 2 and not double_found:
doubles += 1
... | acanizares/advent_of_code | day02.py | day02.py | py | 1,405 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "typing.List",
"line_number": 45,
"usage_type": "name"
}
] |
12859158519 | import torch
import numpy as np
import matplotlib.pyplot as plt
print("PyTorch Version:", torch.__version__)
if torch.backends.mps.is_available():
mps_device = torch.device("mps")
print(mps_device)
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
X, Y = np.mgrid[-4.0:4:0.01, -4.0:4:0.0... | rwardd/comp3710 | prac1/gaussian.py | gaussian.py | py | 509 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.__version__",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.backends.mps.is_available",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.backends",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name"... |
21374477352 | from django import template
register = template.Library()
import nltk
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
@register.filter
def first_letter_word(value):
stop_words = set(stopwords.words('english'))
word_tokens = word_tokenize(value)
filtered_sentence = [w for w in wor... | 4akhilkumar/akira_project | akira_apps/staff/templatetags/first_letter_word.py | first_letter_word.py | py | 744 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.template.Library",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 2,
"usage_type": "name"
},
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "nlt... |
22017042868 | # -*- coding: utf-8 -*-
"""
Created on Wed Jul 15 11:48:04 2020
@author: Paradeisios
"""
from utils.computeCost import computeCost
import numpy as np
def gradientDescent(X,y,theta,alpha, iterations):
m = len(y)
J_history = np.zeros((iterations,1))
derivative = 0
for i in range(iterations):
... | paradeisios/Coursera_Machine_Learning | week2/python/utils/gradientDescent.py | gradientDescent.py | py | 514 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.zeros",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "utils.computeCost.computeCost",
"line_number": 20,
"usage_type": "call"
}
] |
42356364206 | import os
import tensorflow as tf
from tensorflow.keras.callbacks import EarlyStopping
from utils.callbacks import ModelCheckpoint, TimeHistory
from engine.metrics import (jaccard_index, jaccard_index_softmax, IoU_instances,
instance_segmentation_loss, weighted_bce_dice_loss)
def prepare_... | lijunRNA/EM_Image_Segmentation | engine/__init__.py | __init__.py | py | 3,725 | python | en | code | null | github-code | 36 | [
{
"api_name": "tensorflow.keras.optimizers.SGD",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.keras.optimizers.Adam",
"line_number": 29,
"usage_type": "call"
},
{... |
192760992 | from flask import Flask, render_template, url_for, request, redirect
from flask_sqlalchemy import SQLAlchemy
from datetime import datetime
import requests
import paralleldots
import stripe
app = Flask(__name__)
pub_key = ''
secret_key = ''
stripe.api_key = secret_key
class Analyze:
report_key = ''
sentiment... | mikeyj777/siraj_midterm_take3 | app.py | app.py | py | 1,955 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "stripe.api_key",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "paralleldots.set_api_key"... |
21365635224 | import numpy as np
from dptb.utils.tools import j_must_have
from dptb.utils.make_kpoints import ase_kpath, abacus_kpath, vasp_kpath
from ase.io import read
import ase
import matplotlib.pyplot as plt
import matplotlib
import logging
log = logging.getLogger(__name__)
from matplotlib.ticker import MultipleLocator, Format... | deepmodeling/DeePTB | dptb/postprocess/bandstructure/band.py | band.py | py | 6,701 | python | en | code | 21 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "ase.io.read",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "ase.Atoms",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "dptb.utils.make_kpoints.a... |
6128705889 | import random
import unittest
from music21 import base # for _missingImport testing.
from music21 import repeat
from music21 import exceptions21
from music21 import corpus
from music21 import environment
_MOD = 'contour.py'
environLocal = environment.Environment(_MOD)
#-----------------------------------------------... | cuthbertLab/music21-tools | contour/contour.py | contour.py | py | 30,165 | python | en | code | 37 | github-code | 36 | [
{
"api_name": "music21.environment.Environment",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "music21.environment",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "music21.exceptions21.Music21Exception",
"line_number": 14,
"usage_type": "attribute"
... |
39086540253 | import logging
import sys
def two_sum_sorting(numbers_set, range_start, range_end):
logger.info('Started function that uses sorting')
numbers_sorted = sorted(numbers_set)
logger.info('Done sorting')
start = 0
end = len(numbers_set) - 1
result = set()
logger.info('Entering main while loop'... | nickslavsky/Algorithms-pt1 | Week 6/2sum.py | 2sum.py | py | 2,209 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 54,
"usage_type": "attribute"
},
{
"api_name": "logging.StreamHandler",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "sys.stdout"... |
4255371054 | from typing import List
from data_structures.list_node import ListNode
from heapq import *
class Solution:
def mergeKLists(self, lists: List[ListNode]) -> ListNode:
min_heap = []
for i in range(len(lists)):
curr_list = lists[i]
if curr_list:
heappush(min_heap... | blhwong/algos_py | leet/merge_k_sorted_lists/main.py | main.py | py | 844 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "typing.List",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "data_structures.list_node.ListNode",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "data_structures.list_node.ListNode",
"line_number": 21,
"usage_type": "call"
},
{
"a... |
34463656888 | import mainBMRSA as Bmrsa
import mainBRSA as Brsa
import matplotlib.pyplot as plt
from useful import funcs
# number of bs
bsize = 1
while bsize < 4:
# Start from prime size = 10 bits
# mrsa and bmrsa time
itr = 10
mrsa = []
bmrsa = []
# points needed to be marked on graph
pts = [1024]... | SUMUKHA-PK/RSA-efficient-variants | src/BMRSA/main.py | main.py | py | 1,574 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "useful.funcs.generate_primes",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "useful.funcs",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "useful.funcs.generate_message",
"line_number": 38,
"usage_type": "call"
},
{
"api_name"... |
4502539107 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import sys
import os
from service.singleton import Singleton
class Config(Singleton):
def __init__(self):
parser = self.__get_praser()
self.args = parser.parse_args()
self.port = self.args.port
self.token = self.args.... | comzyh/VerifyBot | service/config.py | config.py | py | 1,711 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "service.singleton.Singleton",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.absp... |
10741283794 | from __future__ import unicode_literals
import os
import unittest
import tempfile
import textwrap
import decimal
import shutil
import transaction as db_transaction
class TestAlembic(unittest.TestCase):
def setUp(self):
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_sessio... | vdt/billy | billy/tests/functional/test_alembic.py | test_alembic.py | py | 4,718 | python | en | code | null | github-code | 36 | [
{
"api_name": "unittest.TestCase",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "tempfile.mkdtemp",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.environ",
... |
23080854641 | from consts import piConst, hwConst
from spa.serverside import CSocketProServer, CSocketProService,\
CClientPeer, BaseServiceID, Plugin
from spa.clientside import CAsyncQueue, CStreamingFile, CMysql, COdbc, CSqlite, CSqlServer, CPostgres
from spa.udb import DB_CONSTS
from pub_sub.ps_server.hwpeer import CHelloWorld... | udaparts/socketpro | tutorials/python/all_servers/all_servers.py | all_servers.py | py | 7,957 | python | en | code | 27 | github-code | 36 | [
{
"api_name": "sys.platform",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "sys.platform",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "sys.platform",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "sys.platform",
"line_numbe... |
34980505423 | #存在重复
# 给定一个整数数组,判断是否存在重复元素。
# 如果任何值在数组中出现至少两次,函数返回 true。如果数组中每个元素都不相同,则返回 false。
#===============================================================================
# 输入: [1,2,3,1]
# 输出: true
#===============================================================================
from collections import Counter
class Solution:
... | huowolf/leetcode | src/array/containsDuplicate.py | containsDuplicate.py | py | 775 | python | fr | code | 0 | github-code | 36 | [
{
"api_name": "collections.Counter",
"line_number": 15,
"usage_type": "call"
}
] |
9744073954 | import sys
import os
import logging
import urllib
from datetime import datetime, timedelta
from google.appengine.ext import ndb
from google.appengine.api import users
from google.appengine.ext import blobstore
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from common.arguments import *
from common.... | AegisTools/aegis-appengine | modules/assets/assets_private.py | assets_private.py | py | 5,339 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.path.append",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
35622258622 | import boto3
import base64
import os
ENDPOINT_NAME = os.environ['ENDPOINT_NAME']
def lambda_handler(event, context):
""" Handler of the lambda function """
# The SageMaker runtime is what allows us to invoke the endpoint that we've created.
runtime = boto3.Session().client('sagemaker-runtime')
# ... | jorgeramirezcarrasco/udacity-capstone-project-dog-breed-classifier | lambda/lambda_function.py | lambda_function.py | py | 1,216 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.environ",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "boto3.Session",
"line_number": 10,
"usage_type": "call"
}
] |
29540265563 | import telebot
from telebot import types
bot = telebot.TeleBot('1507860102:AAH3y4nFwQgnYJCFP49PMRRqQVEvhIGrLmw')
user_dict = {}
class User:
def __init__(self, name):
self.name = name
self.age = None
self.sex = None
# Handle '/start' and '/help'
@bot.message_handler(commands=['help', 'st... | HKarpenko/teleBot | main.py | main.py | py | 2,905 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "telebot.TeleBot",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "telebot.types.ReplyKeyboardMarkup",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "telebot.types",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "telebo... |
32542353820 | from google.cloud import storage
from configparser import ConfigParser
from google.oauth2 import service_account
from googleapiclient.discovery import build
from utils.demo_io import (
get_initial_slide_df_with_predictions_only,
get_fovs_df,
get_top_level_dirs,
populate_slide_rows,
get_histogram_df,... | alice-gottlieb/nautilus-dashboard | examples/spot_cropping_example.py | spot_cropping_example.py | py | 2,247 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "gcsfs.GCSFileSystem",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "google.oauth2.service_account.Credentials.from_service_account_file",
"line_number": 34,
"u... |
20471993107 | from pprint import pprint
from bs4 import BeautifulSoup
import requests
import pandas as pd
import pprint
election = []
user_agent = "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.37"
URL = "https://en.wikipedia.org/wiki/List_of_United_States_presidential_e... | Eleanor-Shellstrop/presidents | python/elections.py | elections.py | py | 1,183 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 30,
"usage_type": "call"
}
] |
5547367389 | """
Tests for Voting 21/06/2022 [Lido app for Goerli].
"""
import pytest
from brownie import interface
from scripts.vote_2022_06_21_goerli_lido_app import (
start_vote,
get_lido_app_address,
get_lido_app_old_version,
)
from utils.test.tx_tracing_helpers import *
from utils.config import network_name
from ... | lidofinance/scripts | archive/tests/test_2022_06_21_2_goerli_lido_app.py | test_2022_06_21_2_goerli_lido_app.py | py | 3,523 | python | en | code | 14 | github-code | 36 | [
{
"api_name": "utils.config.network_name",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "utils.config.network_name",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "utils.config.network_name",
"line_number": 28,
"usage_type": "call"
},
{
"api... |
31353500311 | #!/usr/bin/env python3
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import os
import sys
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
from colorama import Fore
import config
from da... | KoapT/img_classification_pytorch | main.py | main.py | py | 7,409 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "torch.device",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "args.arg_parser.... |
12760265976 | import numpy as np
import matplotlib.pyplot as plt
sp_LL=np.loadtxt('spline_LL.txt')
sp_LH=np.loadtxt('spline_LH.txt')
sp_HT=np.loadtxt('spline_HT.txt')
sp_R=np.loadtxt('spline_R.txt')
##
AA=np.loadtxt('HT_p_T_c')
BB=np.loadtxt('LH_p_T_c')
CC=np.loadtxt('R_p_T_c')
DD=np.loadtxt('LL_p_T_c')
EE=np.loadtxt('TP_T-x-Perr-... | yufang67/CO2-look-up-table | program/isotherm.py | isotherm.py | py | 7,331 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "numpy.loadtxt",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_numb... |
3859314216 | import cv2
import numpy as np
from matplotlib import pyplot as plt
img = cv2.imread('../Images/abc.png')
kernel = np.ones((9, 9), np.float32) / 10
print(kernel)
dst = cv2.filter2D(img, -1, kernel)
cv2.imshow("imange",dst)
cv2.waitKey(0)
cv2.destroyAllWindows() | trunghopro098/Image-Processing | ProcessImg/Filter2D.py | Filter2D.py | py | 263 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "cv2.imread",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "cv2.filter2D",
"line_number... |
21253725938 | from objdetection1 import *
import cv2 as cv
import numpy as np
from PIL import Image
import random
import math
def make_cluster(img):
Z = img.reshape((-1,3))
# convert to np.float32
Z = np.float32(Z)
# define criteria, number of clusters(K) and apply kmeans()
criteria = (cv.TERM_CRITERIA_EPS + ... | DvnGBulletZz/Computer_Vision_Kenan | Eind_Opdracht/clustering.py | clustering.py | py | 2,219 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.float32",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.TERM_CRITERIA_EPS",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "cv2.TERM_CRITERIA_MAX_ITER",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name... |
31875266103 | # from .word2vec_functions.text_processing_functions import *
from .word2vec_functions.word2vec_companion import similar_words
from gensim.models import Word2Vec
import json
BASE_PATH = 'w2v/word2vec_functions/'
def load_filters():
with open(BASE_PATH + 'Raw Data/test_data.json', 'r') as file:
test_data ... | CarsonDavis/InteractiveWord2VecWebsite | w2v/utils.py | utils.py | py | 1,911 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "json.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "gensim.models.Word2Vec.load",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "gensim.models.Word2Vec",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "gensim.m... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.