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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
26123340902 | import numpy as np
import scipy as sp
from numpy import sqrt
from sklearn.metrics.pairwise import rbf_kernel
from numpy.random import permutation
import scipy
from HSIC_IndependenceTest import *
def calculateKernel(patterns1,patterns2,deg = None):
size = len(patterns1)
if deg is None:
xmed = patterns1
G =... | bacisback/TFG | codigo/MMDIndependence.py | MMDIndependence.py | py | 3,249 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "numpy.repeat",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.tril",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.median",
"line_number": ... |
6626602796 | from __future__ import annotations
from collections import defaultdict
import numpy as np
from gym.spaces.utils import flatdim, flatten, flatten_space, unflatten
# hyperparameters
learning_rate = 0.01
n_episodes = 50
start_epsilon = 1.0
epsilon_decay = start_epsilon / (n_episodes / 2) # reduce the exploration over ti... | bit-shift-io/machine-learning-experiments | schedule-generator/qlearn_agent.py | qlearn_agent.py | py | 4,040 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.defaultdict",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.random.random",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 52,
"usage_type": "attribute"
},
{
"api_name": "gym.spa... |
9396081622 | import re
import sys
from operator import add
from typing import DefaultDict
from pyspark.sql import SparkSession
# Format input data.
def parse(line):
res = line.split('\t1\t')
urls = res[1]\
.replace('{','')\
.replace('}','')\
.replace('(','')\
.replace(')',''... | saliou673/pageranking-project | ranker/spark/main.py | main.py | py | 2,010 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "re.split",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder.appName",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder",
"line_number": 38,
"usage_type": "attribute"
},
... |
25070351160 | import torch
import numpy as np
from model import MnistCNN
from dataset import load_test_csv_dataset
def eval_model(model, dataloader):
model.eval()
num_correct = 0
with torch.no_grad():
for x_batch, y_batch in dataloader:
output = model(x_batch)
_, output = torch.max(out... | Burton2000/pytorch_image_classification | evaluate.py | evaluate.py | py | 1,348 | python | en | code | 5 | github-code | 21 | [
{
"api_name": "model.eval",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.no_grad",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.max",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.sum",
"line_number": 17,
... |
25554352197 | """Create initial schema.
Revision ID: 564a9e076693
Revises:
Create Date: 2021-09-10 00:03:46.417048
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "564a9e076693"
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands a... | andrewsmike/jasmine | jasmine-models/migrations/versions/564a9e076693_create_initial_schema.py | 564a9e076693_create_initial_schema.py | py | 4,987 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "alembic.op.create_table",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.BigIn... |
40998720795 | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from msedge.selenium_tools import Edge, EdgeOptions
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
import time
from selenium.common.exceptions import NoSuchElementException
# Function wh... | Eddy-M-K/HP-Support-Community-Bot | Product_Specifications.py | Product_Specifications.py | py | 2,989 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "time.sleep",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "selenium.common.exceptions.NoSuchEle... |
21512277409 | #!/usr/bin/env python
# 2021-02-08 I found it is bad for many pipy packages name has been used but never update.
# doc: https://packaging.python.org/tutorials/packaging-projects/
# python3 setup.py sdist bdist_wheel
# python3 -m twine upload --repository testpypi dist/fs2-0.0.2*
# python3 -m pip install --index-url h... | pythonwood/fs2 | setup.py | setup.py | py | 1,889 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "setuptools.setup",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 50,
"usage_type": "call"
}
] |
21560127213 | """
# -*- coding: utf-8 -*-
# @Time : 2018/8/24 15:36
# @Author : franck
# @Email : franck_gxu@outlook.com
"""
import requests,json
class Spider:
def __init__(self):
self.formdata = {
'params':'jBLRwxQXvkCkQjPo9mHIZL/6ePG2DVW0MQIFoEJBNiMMRzHxJxHItVjuUbc5ynHcdxr+FefqMzlb4R7Z2apacXFD0MSXZyI... | franckisses/python_spider | spider/netease/cloudmusic_comment.py | cloudmusic_comment.py | py | 1,476 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "requests.post",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 23,
"usage_type": "call"
}
] |
40489950332 | """
COMP422 Project 1 Task 2.2: Face Detection
William Wallace
25/08/2020
"""
import scipy.signal
import imageio
import csv
import glob
def main():
train_example = []
for filen in glob.glob('*.pgm'):
img = imageio.imread(filen)
img = img.astype('int32')
train_example.ap... | walwi878/DataMiningImages-COMP422 | 2.2/facedetector.py | facedetector.py | py | 3,760 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "glob.glob",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "imageio.imread",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 19,
"usage_type": "call"
}
] |
40089272056 | from django.urls import include, path
from rest_framework import routers
from api.views import (CategoryViewSet, CommentViewSet, GenreViewSet,
get_token, ReviewViewSet, sign_up,
TitleViewSet, UsersViewSet)
# Версия роутера
router_V001 = routers.DefaultRouter()
# Регистра... | AndreyIzotov/api_yamdb | api_yamdb/api/urls.py | urls.py | py | 993 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "rest_framework.routers.DefaultRouter",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "rest_framework.routers",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "api.views.ReviewViewSet",
"line_number": 14,
"usage_type": "argument"
},
{
... |
22971500189 | from odoo import models, _
from datetime import datetime
import time
import pytz
import logging
import xlsxwriter
_logger = logging.getLogger(__name__)
class ReportProcurementListXlsx(models.AbstractModel):
_name = 'report.vnitpro_procurement.report_gen_procurement_list_xlsx'
_inherit = 'report.vnitpro_procu... | tu2305/VNITPro_erp | vnitpro_procurement/reports/report_procurement_list_xlsx.py | report_procurement_list_xlsx.py | py | 2,695 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "odoo.models.AbstractModel",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "odoo.models",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "odoo._",
... |
71446368052 | # import json
from django.shortcuts import render, redirect
from django.views.generic.edit import CreateView
from django.views.generic.detail import DetailView
from django.contrib.auth.models import User
from django.contrib import messages
from django.contrib.auth import logout, login, authenticate
from django.urls imp... | Aggrey-marvin/HolidayStudy | base/views.py | views.py | py | 7,551 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "forms.SignUpForm",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "forms.SignUpForm",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "django.co... |
27428095727 | from django.contrib import admin
from django.contrib import messages
from .models import Account, Employee, Asset, Category, Payee, Service, Task, Transaction
class AssetAdmin(admin.ModelAdmin):
list_display = ('code', 'name', 'purchase_price')
readonly_fields=('code',)
class TransactionAdmin(admin.ModelAd... | feyton/money-manager | dashboard/admin.py | admin.py | py | 1,415 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 12,
"usage_type": "attribute"
... |
18405897689 | import itertools; import math; import operator; import random; from bisect import *; from collections import deque, defaultdict, Counter, OrderedDict; from heapq import *; import unittest; from typing import List;
def get_sol(): return Solution()
class Solution:
def makesquare(self, A):
def put(index): # df... | afzalsiddique/problem-solving | Problem_Solving_Python/leetcode/lc473.py | lc473.py | py | 4,535 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "typing.List",
"line_number": 53,
"usage_type": "name"
},
{
"api_name": "unittest.TestCase",
"line_number": 77,
"usage_type": "attribute"
}
] |
12734371717 | import torch
import torch.nn as nn
import visualise
class Flatten(nn.Module):
def forward(self, input):
return input.view(input.size(0), -1)
class ResidualBlock(torch.nn.Module):
def __init__(self, kernels_count):
super(ResidualBlock, self).__init__()
self.layers = [
... | michalnand/go_rl | models/mu_zero/model.py | model.py | py | 4,583 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torch.nn.Module",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "torch.nn",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Conv2d",
"line... |
71352241654 | #robot pulisci pavimenti
import pygame #installata
import sys#nativa = preinstallata
from pygame import draw
DIMENSIONI = (600,600)
NERO = (0,0,0)
BIANCO = (255,255,255)
ROSSO = (255,0,0)
OSTACOLO = -1
CELLE_ADIACENTI = [[-1,0],[0,1],[1,0],[0,-1]]
#def controlloCellaAdiacente(p,x,y):
def numeraPias... | FedericoGiraudo/TPSIT_2020-21 | Python/pavimento_1_1.py | pavimento_1_1.py | py | 1,687 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pygame.Rect",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "pygame.draw.rect",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "pygame.draw",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "pygame.Rect",
"line... |
11177472254 | from math import floor
from typing import List
import numpy as np
from math import floor
from typing import List
import numpy as np
class Heap:
def __init__(self, array: List[int]) -> None:
self.elements = array
self.size = len(array) # Number of elements in heap
self.build_heap()
# ... | Adritsheu/Systems_development | homework/HW6/HW6-Final/P2.py | P2.py | py | 4,313 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "typing.List",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "math.floor",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.copy",
"line_number": 78,
"usage_type": "call"
}
] |
21042304725 | import os
import sys
from django.core.files import File
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)) + '/app')))
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings')
import django
django.setup()
from PriceDashBoard.models import MaterialsPriceModel, Materia... | KimChanw/GoldSilver_Price_Visualization_Project | PriceDashBoard/data_preprocess.py | data_preprocess.py | py | 1,926 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.path.append",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
34340618321 | from sklearn.base import is_classifier
from sklearn.multioutput import MultiOutputRegressor as sk_MultiOutputRegressor
from sklearn.multioutput import _fit_estimator
from sklearn.utils.multiclass import check_classification_targets
from sklearn.utils.validation import _check_fit_params, has_fit_parameter
try:
# de... | unit8co/darts | darts/utils/multioutput.py | multioutput.py | py | 3,912 | python | en | code | 6,665 | github-code | 21 | [
{
"api_name": "sklearn.multioutput.MultiOutputRegressor",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "sklearn.base.is_classifier",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "sklearn.utils.multiclass.check_classification_targets",
"line_number": 55... |
41982964983 | import boto3
import os
import subprocess
import time
'''
Steps to set up Apptier
1. Create EC2
ec2 = boto3.client('ec2','us-east-1')
conn = ec2.run_instances(InstanceType="t2.micro",
MaxCount=1,
MinCount=1,
ImageId="ami-0ee8cf7b8a... | yhs97/AWS-AutoScaling | AppTier/AppTier.py | AppTier.py | py | 4,965 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "boto3.resource",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "boto3.resource",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "subprocess.check_output",
... |
5850104710 |
import apache_beam as beam
# section 1 - introduction
def introduction():
print("Counting attendance...")
# creating the pipeline
p1 = beam.pipeline.Pipeline()
attendance_count = (
p1
# create initial p collection
| beam.io.ReadFromText('data/dept_data.txt')
# apply p ... | Peter-Yocum/apache-beam-course | sections/introduction.py | introduction.py | py | 787 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "apache_beam.pipeline.Pipeline",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "apache_beam.pipeline",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "apache_beam.io.ReadFromText",
"line_number": 13,
"usage_type": "call"
},
{
... |
36516637502 | # import the function that will return an instance of a connection
from flask_app.config.mysqlconnection import connectToMySQL
from flask import flash
import re
EMAIL_REGEX = re.compile(r'^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9._-]+\.[a-zA-Z]+$')
from flask_bcrypt import Bcrypt
bcrypt = Bcrypt(app)
# captialize global varia... | teressas/python | flask_mysql/crud/class_demo/flask_app/models/model_movie.py | model_movie.py | py | 4,120 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "re.compile",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask_bcrypt.Bcrypt",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask_app.config.mysqlconnection.connectToMySQL",
"line_number": 36,
"usage_type": "call"
},
{
"api_... |
2701180127 | #!/usr/bin/env python
'''
Mulliken population analysis with meta-Lowdin orbitals
'''
import numpy
from pyscf import gto, scf, lo
x = .63
mol = gto.M(atom=[['C', (0, 0, 0)],
['H', (x , x, x)],
['H', (-x, -x, x)],
['H', (-x, x, -x)],
['H', ( x... | sunchong137/pyscf_2017 | examples/local_orb/01-pop_with_meta_lowdin.py | 01-pop_with_meta_lowdin.py | py | 544 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "pyscf.gto.M",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pyscf.gto",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "pyscf.scf.RHF",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pyscf.scf",
"line_number": 17... |
74793121653 | import itertools
# count会创建一个无限迭代器
natuals = itertools.count(1)
for n in natuals:
print(n)
# cycle()会把传入的序列无线循环下去
cs = itertools.cycle('ABC')
# 字符串也是序列的一种
for c in cs:
print(c)
# repeat()负责把一个元素无限重复下去,第二个参数限定重复次数
ns = itertools.repeat('A', 3) # 重复A三次
for n in ns:
print(n)
# 无限序列虽然可以无限迭代下去,但是我们通常用takewh... | EricGao-Byte/My_Python_Practice | python内建模块练习/itertools.py | itertools.py | py | 1,492 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "itertools.count",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "itertools.cycle",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "itertools.repeat",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "itertools.count",
... |
12407369847 | from pyspark.sql.session import SparkSession
from pyspark.sql.context import SQLContext
from pyspark.sql.types import IntegerType
# create spark session
spark = SparkSession.builder.appName("SparkSql").getOrCreate()
sqlcontext = SQLContext(spark)
# reading from a csv ans turning into a datafram from spark
df... | juanfelipehdezm/Big-Data | Spark/Data_frames/friendsByAge_df.py | friendsByAge_df.py | py | 763 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pyspark.sql.session.SparkSession.builder.appName",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.session.SparkSession.builder",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pyspark.sql.session.SparkSession",
"line_number"... |
896929876 | import pytest
from dishes.email_service.dishes_modified_yesterday.get_email_addresses import GetEmailsAllUsers
from dishes.email_service.dishes_modified_yesterday.get_email_body import GetDataDishesModifiedYesterday
from menus.models import Menu
from users.models import User
from dishes.models import Dish
from datetime... | gregory912/eMenu-django | dishes/tests/test_dishes_modified_yesterday_service.py | test_dishes_modified_yesterday_service.py | py | 2,387 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "users.models.User",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "users.models.User.objects.all",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "users.models.User.objects",
"line_number": 14,
"usage_type": "attribute"
},
{
"ap... |
32852182141 | from corehq.apps.domain.models import Domain
from corehq.apps.users.models import CouchUser
from django_digest.decorators import *
from casexml.apps.phone.restore import RestoreConfig
from django.http import HttpResponse
@httpdigest
def restore(request, domain):
"""
We override restore because we have to supp... | gmimano/commcaretest | corehq/apps/ota/views.py | views.py | py | 1,891 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "corehq.apps.users.models.CouchUser.from_django_user",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "corehq.apps.users.models.CouchUser",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "django.http.HttpResponse",
"line_number": 36,
"usa... |
3848949148 | from config import Config
import pymysql
'''File that builds the database
'''
config = Config()
conn = pymysql.connect(host=config.MYSQL_DATABASE_HOST,
user=config.MYSQL_DATABASE_USER,
password='',
charset='utf8mb4',
cursorcl... | seanngpack/food_chat_app | run_build_db.py | run_build_db.py | py | 1,362 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "config.Config",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pymysql.connect",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "config.MYSQL_DATABASE_HOST",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "config.MYS... |
13811722097 | # -*- coding: utf-8 -*-
import logging
import json
from django.core.serializers.json import DjangoJSONEncoder
from django.forms.formsets import formset_factory
from django.utils import timezone
from django.views.generic.base import TemplateView
from . import signals
from .settings import LOGGER_NAME, ENABLE_LOGGER
from... | moqada/django-js-error-logging | jserrorlogging/views.py | views.py | py | 2,183 | python | en | code | 6 | github-code | 21 | [
{
"api_name": "settings.ENABLE_LOGGER",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "settings.LOGGER_NAME",
"line_number": 15,
"usage_type": "argument"
},
{
"api_name": "dja... |
4776340102 | from core.models import Market
from fastapi import APIRouter,Depends,HTTPException
from typing import List
from core.dependencies import get_db
from sqlalchemy.orm import Session
from core import crud,schemas
market = APIRouter(
prefix="/market",
tags=["market"],
# dependencies=[Depends(get_token_header)]... | oaoxd0314/backtrader_api | routers/market.py | market.py | py | 3,343 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.Session",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "fastapi.Depends",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "core.dependen... |
15121507213 | import asyncio
import logging
import os
from pathlib import Path
from sys import argv
import time
from typing import Literal
from aiohttp import ClientSession
from settings import HEADERS, API_URL, logger, TOKEN
start_time = time.time()
file_tasks = []
async def upload_file(
session: Cli... | saalaus/yasyncio | yandexdisk.py | yandexdisk.py | py | 2,583 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "time.time",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "aiohttp.ClientSession",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "typing.Literal",
"li... |
13515394292 | from robot.errors import PassExecution
from robot.model import TagPatterns
from robot.utils import html_escape, test_or_task
class Failure:
def __init__(self):
self.setup = None
self.test = None
self.teardown = None
self.setup_skipped = None
self.test_skipped = None
... | robotframework/robotframework | src/robot/running/status.py | status.py | py | 10,134 | python | en | code | 8,521 | github-code | 21 | [
{
"api_name": "robot.errors.PassExecution",
"line_number": 70,
"usage_type": "argument"
},
{
"api_name": "robot.errors.PassExecution",
"line_number": 84,
"usage_type": "argument"
},
{
"api_name": "robot.model.TagPatterns",
"line_number": 188,
"usage_type": "call"
},
{... |
40180481888 | #! /usr/bin/env python
import sys
import os
import argparse
import pickle
_current_dir = os.path.abspath(os.path.dirname(__file__))
PROJECT_ROOT = os.path.normpath(os.path.join(_current_dir, ".."))
sys.path.append(PROJECT_ROOT)
from mylib.config import config
evademl_dir = config.get('evademl', 'project_path')
sys.pa... | surrealyz/pdfclassifier | attack/reverse_mimicry/all_check_cuckoo.py | all_check_cuckoo.py | py | 1,517 | python | en | code | 27 | github-code | 21 | [
{
"api_name": "os.path.abspath",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path.normpath",
"lin... |
43454862868 | import itertools
from typing import Optional, Tuple, Any
import matplotlib.pyplot as plt
import numpy as np
import sklearn.metrics as metrics
from sklearn.metrics import confusion_matrix
__all__ = ['Evaluation', 'plot_confusion_matrix']
def plot_confusion_matrix(
y_true: np.ndarray = None,
y_pred: n... | slatex/stexls | stexls/trefier/training/evaluation.py | evaluation.py | py | 8,480 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.ndarray",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "numpy.ndarray",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "typing.Optional",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
... |
30191153610 | """------------------
RACHIT RATHORE
2015HS120600P
------------------"""
import sys
import os
from PyQt5 import QtWidgets
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from ComputeProbabity import computeProab
from GenFunctions import *
global queryList
queryList = []
gl... | R-Rach/Probabilistic-Reasoning-AI | GUIDriver1.py | GUIDriver1.py | py | 51,218 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "PyQt5.QtWidgets.QLabel",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QPushButton",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "Py... |
2702511677 | #!/usr/bin/env python
#
# Author: Qiming Sun <osirpt.sun@gmail.com>
#
import unittest
import numpy as np
from pyscf.pbc import gto as pbcgto
from pyscf.pbc import dft as pbcdft
import pyscf.pbc.tools.pyscf_ase as pyscf_ase
import ase.lattice
from ase.lattice.cubic import Diamond
LATTICE_CONST = 3.5668
class KnowValu... | sunchong137/pyscf_2017 | pbc/dft/test/test_kuks.py | test_kuks.py | py | 1,177 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "unittest.TestCase",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "ase.lattice.cubic.Diamond",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pyscf.pbc.gto.Cell",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "p... |
26835133652 | '''
opening은 erosion -> dilation 순서로 진행
샤프하게 만든 다음 부드럽게 해서 노이즈를 좀 제거 -> 작은 점 같은 노이즈를 잘 잡음
closing은 dilation -> erosion 순서로 진행
조금 더 부드럽게 만든 다음 샤프하게 해서 노이즈를 제거 -> 윤곽을 좀 더 정확하게 잘 잡음
'''
import numpy as np
import cv2
import matplotlib.pyplot as plt
img = cv2.imread('../pocket ball.png', cv2.IMREAD_GRAYSCALE)
_, mask = c... | NoirCade/MS-AI-School | 46일차/2_1_opening.py | 2_1_opening.py | py | 1,535 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "cv2.imread",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.IMREAD_GRAYSCALE",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "cv2.threshold",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.THRESH_BINARY_... |
20134628785 | # python3
# 作者 :NemesisZoo
# 联系方式 :276793422
# 创建日期 :2020/9/22
# 文件名 :BaseLibrary.py
# 文件简介 :
# 文件说明 :
"""
"""
from Lib.Lib_head import *
# 符号文件路径,可以自动设置
import configparser
import win32event
import win32process
# 符号路径
symbol_path = ''
# 调试器路径
debug_path = ''
# 调试器程序名字
debugger_name ... | 276793422/ScriptDebugWinDBG | WinDBG/Lib/BaseLibrary.py | BaseLibrary.py | py | 6,905 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "win32process.CreateProcess",
"line_number": 93,
"usage_type": "call"
},
{
"api_name": "win32process.CREATE_NO_WINDOW",
"line_number": 94,
"usage_type": "attribute"
},
... |
30569841056 | from mongoengine import (
StringField,
DateTimeField,
BooleanField,
EmbeddedDocumentField,
IntField,
ListField,
)
from apiserver.database import Database, strict
from apiserver.database.fields import (
StrippedStringField,
SafeDictField,
SafeSortedListField,
SafeMapField,
)
from... | allegroai/clearml-server | apiserver/database/model/model.py | model.py | py | 3,604 | python | en | code | 334 | github-code | 21 | [
{
"api_name": "apiserver.database.model.AttributedDocument",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "apiserver.database.model.AttributedDocument._numeric_locale",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "apiserver.database.model.AttributedD... |
2239939100 | #!/usr/bin/env python
import pika
connection = pika.BlockingConnection(pika.ConnectionParameters(host='localhost')) #cria a conexao
channel = connection.channel()#abre o canal
channel.queue_declare(queue='eae')#declara o nome da queue
channel.basic_publish(exchange='',
routing_key='eae',
... | laviniameds/Exercicios_Distribuidos | MOM/send.py | send.py | py | 451 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "pika.BlockingConnection",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pika.ConnectionParameters",
"line_number": 4,
"usage_type": "call"
}
] |
34320610098 | import torch
import argparse
import numpy as np
from tqdm import tqdm
from torch.utils.data import DataLoader
from KoGPT.KoWellness.wellness_data import WellnessDialogDataset
from KoGPT.KoDialogGPT2 import KoDialogGPT2
from transformers import PreTrainedTokenizerFast
device = torch.device("cuda") if torch.cuda.is_a... | Slime0519/Training_LM | KoGPT/KoWellness/train.py | train.py | py | 3,284 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "torch.device",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.device",
... |
72731650292 | from pylab import *
from matplotlib.pyplot import plot, draw, show
import csv
import random
import math
######################################
# Class to represent a neuron
######################################
class Neuron:
# Variables
input = None
bias = None
output = None
# Constructor
def... | aurodeepg/NeuralNet | train.py | train.py | py | 8,233 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "csv.writer",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "random.uniform",
"line_number": ... |
43849273355 | #%%
import nltk
import json
import pandas as pd
import re
nltk.download('stopwords')
from ukraine_remove import dataremoved
# %%
cleaned_tweets = []
words = []
for tweet in dataremoved['tweet']:
clean = re.sub(r"(http[s]?\://\S+)|([\[\(].*[\)\]])|([#@]\S+)|\n", "", tweet)
clean = re.sub(r"\d", '', clean)
c... | embarbos/natural-language-processing-twitter-data | nlp.py | nlp.py | py | 1,762 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "nltk.download",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "ukraine_remove.dataremoved",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "re.sub",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_num... |
36990825237 | import requests,json
import streamlit as st
# from config import RAKUTEN_CLIENT_ME,YAHOO_CLIENT_ME
from time import sleep
import pandas as pd
#楽天市場
MAX_PAGE = 1
RAKUTEN_CLIENT_ME = {
'APPLICATION_ID':st.secrets["APPLICATION_ID"],
'APPLICATION_SECRET':st.secrets["APPLICATION_SECRET"],
'AFF_ID':st.secrets["A... | YugenSato/Streamlit_EC_App | app.py | app.py | py | 8,850 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "streamlit.secrets",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "streamlit.secrets",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "streamlit.secrets",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "... |
71579720692 | import hashlib
import configparser
import random
config = configparser.RawConfigParser()
config.read('agreement.txt')
prime = config.getint('agreement','prime')
p_root = config.getint('agreement','primitiveroot')
spub = config.getint('pubkey','sender')
rpub = config.getint('pubkey','recipient')
prime = prime
root =... | husnulhidayat/diffie-hellman-key-exchange | dh.py | dh.py | py | 978 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "configparser.RawConfigParser",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "hashlib.sha256",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "hashlib.sha256",
"line_number": 34,
"usage_type": "call"
}
] |
2184942228 | import abc
import json
import numpy as np
class AutoClaveRealtime:
def __init__(self, id, dev_id, data_set):
self.__clave_id = id
self.__device_id = dev_id
self.__data_set = data_set
pass
def get_dev_id(self):
return self.__device_id
def get_clave_id(self):
... | Travis-MA/Iot-CMP | model/RealTimeDataSet/AutoClaveRealTime.py | AutoClaveRealTime.py | py | 3,833 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "json.dumps",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "numpy.convolve",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "numpy.convolve",
"line_numb... |
14501389587 | #!/usr/bin/python3
__author__ = 'Alan Au'
__date__ = '2019-04-08'
# Chess knight valid-moves solver
from collections import deque;
x_max = 8;
y_max = 8;
class coord:
def __init__(self, x_coord, y_coord):
self.x = x_coord
self.y = y_coord
def visit(board, xy): # returns dict
... | AlanAu/sandbox | chess_knight_solver.py | chess_knight_solver.py | py | 2,563 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.deque",
"line_number": 74,
"usage_type": "call"
}
] |
4522708074 | # -*- coding: utf-8 -*-
"""
Program: hard_circle
Created: Apr 2020
@author: Ryan Clement (RRCC)
scisoft@outlook.com
"""
### IMPORTS
import random
import math as m
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib.ticker import AutoMinorLo... | QuantumWarlock/2D-Particle-Simulations | scripts/hard_circle.py | hard_circle.py | py | 10,155 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "matplotlib.cm.get_cmap",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "matplotlib.cm",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "math.hypot",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line... |
74492713333 | from telegram import Update
from telegram.ext import ApplicationBuilder, CommandHandler, ContextTypes
import datetime
from spy import *
import emoji
async def hi_command(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
log(update, context)
await update.message.reply_text(emoji.emojize(f'Привет, {u... | Makropulas/GB_Introduction_With_Python | DZ_Seminar9_26.01.2023/bot_commands.py | bot_commands.py | py | 1,343 | python | ru | code | 0 | github-code | 21 | [
{
"api_name": "telegram.Update",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "telegram.ext.ContextTypes.DEFAULT_TYPE",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "telegram.ext.ContextTypes",
"line_number": 8,
"usage_type": "name"
},
{
... |
19763417033 | import copy
from dataclasses import dataclass
from poke_env.player import Player
from poke_env.player.battle_order import BattleOrder, ForfeitBattleOrder
from poke_env.environment import AbstractBattle, Gen8Pokemon, Pokemon, Battle
from typing import List, Optional, Union, Awaitable, Dict
from abc import ABC, abstract... | Tripparsugo/pkm_ai | src/battle/evaluators.py | evaluators.py | py | 9,065 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "poke_env.player.battle_order.BattleOrder",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 18,
"usage_type": "name"
},
{
"ap... |
28911760023 | import os
import openai
from dotenv import load_dotenv
from slack_bolt import App
from slack_bolt.adapter.socket_mode import SocketModeHandler
load_dotenv(verbose=True)
# トークン設定
app = App(token=os.environ.get("SLACK_BOT_TOKEN"))
openai.api_key = os.environ.get("OPENAI_API_KEY")
def respond_gpt(user, content):
p... | yukihirano0425/python_langchain_chatbot | app/app.py | app.py | py | 2,860 | python | ja | code | 0 | github-code | 21 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "slack_bolt.App",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.environ",
"lin... |
9138597510 | import struct
import time
import evdev
import redis
import serial
from realtimefmri import config, utils
class CollectTTL():
"""Detect and record pulses from the scanner. Can record to a local log
file or transmit to a network destination.
"""
def __init__(self, source='keyboard', verbose=True):
... | gallantlab/realtimefmri | realtimefmri/collect_ttl.py | collect_ttl.py | py | 2,697 | python | en | code | 17 | github-code | 21 | [
{
"api_name": "realtimefmri.utils.get_logger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "realtimefmri.utils",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "redis.StrictRedis",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "re... |
21943922787 | # -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
import numpy as np
from sklearn import datasets
from sklearn.cross_validation import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import LogisticRegression
iris = dataset... | GaryLv/GaryLv.github.io | codes/Logistic Regression/LRsk.py | LRsk.py | py | 2,181 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sklearn.datasets.load_iris",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "numpy.unique",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sklearn.cros... |
7500029663 | from dataset import *
from scripts.train import get_dataset, get_model
import torch
from torch.utils.data import DataLoader
import pandas as pd
import tqdm
import time
import numpy as np
import pymongo
from model.gmf import GeneralizedMatrixFactorizationModel
from scripts.redindex import reindex
dbUrl = 'mongodb://loca... | LazyLZ/cadenza-movie | server/feedTopN.py | feedTopN.py | py | 5,572 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.device",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "model.gmf",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "model.gmf.GeneralizedMatri... |
11283939764 | #! -*- coding:utf-8 -*-
# 句子对分类任务,LCQMC数据集
# val_acc: 0.887071, test_acc: 0.870320
import numpy as np
import pandas as pd
from bert4keras.backend import keras, set_gelu, K
from bert4keras.tokenizers import Tokenizer
from bert4keras.models import build_transformer_model
from bert4keras.optimizers import Adam
... | wangle1218/deep_text_matching | bert_model/bert_similarly.py | bert_similarly.py | py | 4,466 | python | en | code | 278 | github-code | 21 | [
{
"api_name": "bert4keras.backend.set_gelu",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "bert4keras.tokenizers.Tokenizer",
"line_number": 44,
"usage_type": "call"
},
{
"api_n... |
9696697282 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 2 14:29:55 2017
reference:
https://pcjericks.github.io/py-gdalogr-cookbook/geometry.html
http://gis.stackexchange.com/a/52708/8104
@author: xiaomuliu
"""
from osgeo import ogr
from math import ceil
def create_poly_from_coords(outLayer, ... | xiaomuliu/SpatioTemporalPredictiveModeling | Grid/CreateShpfile.py | CreateShpfile.py | py | 6,300 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "osgeo.ogr.Geometry",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "osgeo.ogr",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "osgeo.ogr.wkbLinearRing",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "osgeo.ogr.G... |
24935657401 | # -*- coding: utf-8 -*-
class Solution(object):
def buddyStrings(self, A, B):
"""
:type A: str
:type B: str
:rtype: bool
"""
list_A = list(A)
for i in range(len(A) - 1):
for k in range(i + 1, len(A)):
list_A[i], list_A[k] = list... | beninghton/notGivenUpToG | String/859. Buddy Strings.py | 859. Buddy Strings.py | py | 4,761 | python | ru | code | 0 | github-code | 21 | [
{
"api_name": "collections.Counter",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "{'Counter': 'collections.Counter'}",
"line_number": 106,
"usage_type": "call"
}
] |
15400624223 | import sys
import json
import subprocess
import os
import itertools
sys.path.append(os.path.join(os.path.dirname(
os.path.abspath(__file__)), "..", "..", "..", "lib", "src", "python"))
from iterate_confs import distribute_jobs
#conf_type = "su2_suzuki"
#conf_type = "gluodynamics"
conf_type = "QCD/140MeV"
#conf_ty... | ilyakudrov/observables_cluster | scripts/python/polyakov_loop/do1_polyakov_loop.py | do1_polyakov_loop.py | py | 4,126 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.path.append",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": ... |
28848649844 | from time import sleep
from finote_api.models import Movie
from django.core.management.base import BaseCommand
import re
import requests
from myapi.settings import TMDB_APIKEY
class Command(BaseCommand):
help = 'If english overview in movie, update japanese overview and title.'
def add_arguments(self, parser... | kentaiwami/FiNote | server/src/finote_api/management/commands/update_movie.py | update_movie.py | py | 4,396 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "finote_api.models.Movie.objects.all",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "finote_api.models.Movie.objects",
"line_number": 28,
"usage_ty... |
11671611805 | # Здесь мы собираем всё, собранное в a3_prt_pdfs.py в части листов формата А4 в один огроооомный pdf
# -*- coding: utf-8 -*-.
from z_CONSTS import *
from z_helpers import *
from pathlib import Path
from PyPDF2 import PdfFileReader
import os
to_print = [
('104', 'н', 12),
('201', 'н', 18),
('202', 'п', 18),... | ShashkovS/math-circle-179 | Py_VMSH_5-6_2019/a3_zall_auds_pdf.py | a3_zall_auds_pdf.py | py | 3,193 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pathlib.Path",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "PyPDF2.PdfFileReader",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_nu... |
34098816908 | from pandas import DataFrame, read_csv
from bs4 import BeautifulSoup
import urllib.request
import json
price = []
year_df = []
add = []
ptnum = read_csv('ptnum.csv')
ptnums = list(ptnum['num'])
years = ['2013','2014','2015','2016','2017']
for year in years:
for num in ptnums:
url = 'http://apis.data.go.kr/1... | jjjjooonno/kmong | 크몽/land_price/c.py | c.py | py | 1,021 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.read_csv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "urllib.request.request.urlopen",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_nam... |
70041241974 | import statistics
class Calc(object):
def __init__(self):
self.fields = {
'abs': abs,
'min': min,
'max': max,
'mode': statistics.mode,
'mean': statistics.mean,
'print': print,
'len': len,
'round': round,
... | kForth/ClooneyWebServer | util/calc.py | calc.py | py | 917 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "statistics.mode",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "statistics.mean",
"line_number": 11,
"usage_type": "attribute"
}
] |
35878472576 | import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
import numpy as np
from iconfuv.misc import lastfile
import netCDF4
from dateutil import parser
path_dir = '/home/kamo/resources/icon-fuv/ncfiles/'
orbit = 0
pixnum = -100
date = '2020-11-05'
def loncorrect(lon):
lon = np.array(lon)
if l... | UIUC-SINE/icon-fuv | python3/scripts/tomo_visualize.py | tomo_visualize.py | py | 2,957 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.array",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "iconfuv.misc.lastfile",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "netCDF4.Dataset",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.unique",
... |
74256329974 | import streamlit as st
import pandas as pd
from Pred_func import *
import folium
from streamlit_folium import st_folium
from streamlit_folium import folium_static
fest_click = None
st.set_page_config(layout="wide")
# Barra lateral
st.sidebar.markdown(
"""
<h2 style='font-size: 40px; color: #8EF984;'>FestifyMe... | gusavato/FestifyMe | src/main.py | main.py | py | 8,183 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "streamlit.set_page_config",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "streamlit.sidebar.markdown",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "streamlit.sidebar",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_na... |
29019311429 | import asyncio
import collections
from collections import namedtuple
from enum import Enum
import aiohttp
from aiohttp import web
from flags import save_flag, show, main, BASE_URL
DEFAULT_CONCUR_REQ = 5
MAX_CONCUR_REQ = 1000
Result = namedtuple('Result', 'status data')
HTTPStatus = Enum('Status', 'ok not_found erro... | ZeronoFreya/Tumblr | demo/b.py | b.py | py | 3,805 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.namedtuple",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "enum.Enum",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "aiohttp.request",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "aiohttp.web.HttpNotF... |
10947910264 | # Copyright (c) Facebook, Inc. and its affiliates.
import numpy as np
import math
import shutil
import os
import pathlib
import re
import sys
sys.stdout.flush()
from PIL import Image
def lens_distortion_calibration(args):
import cv2
# alpha = 1 # 0 crops a very tight image to eliminate as mu... | facebookresearch/nonrigid_nerf | preprocess.py | preprocess.py | py | 15,626 | python | en | code | 347 | github-code | 21 | [
{
"api_name": "sys.stdout.flush",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
4660463054 | import os
import redis
import sys
class BaseConfig(object):
# Get Env vars
PREFIX = os.environ.get('PREFIX')
if type(PREFIX) == type(None):
PREFIX = ""
NAMESPACE = os.environ.get('NAMESPACE')
if type(NAMESPACE) == type(None):
NAMESPACE = ""
SITE_ENV = os.environ.get('SITE_EN... | f5devcentral/sentence-demo-app | docker/generator/config.py | config.py | py | 1,932 | python | en | code | 7 | github-code | 21 | [
{
"api_name": "os.environ.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_nu... |
9258574118 | # -*- coding: utf-8 -*-
import logging
from telethon import TelegramClient,sync, utils, errors
from telethon.tl.types import PeerUser, PeerChat, ChatFull
from telethon import functions, types
from telethon.utils import get_display_name
import pandas as pd
import time
import asyncio
import socks
from contextlib import... | danilshik/telegram_parser | telegram_new.py | telegram_new.py | py | 29,202 | python | ru | code | 4 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "asyncio.Queue... |
73642006133 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision
from torch.distributions import Normal
from torch.autograd import Variable
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
from base import BaseModel
from model.rollout_module import Rollout
device = torch.de... | Hhhhhhao/I2T2I | model/captiongan_modules.py | captiongan_modules.py | py | 17,994 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torch.device",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "base.BaseModel",... |
33165766370 | from pyexpat import features
import copy
import math
import numpy as np
import pytorch_lightning as pl
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchmetrics
from transformers import CLIPModel
class CLIPClassifier(pl.LightningModule):
def __init__(self, args, fine_grained_labels, ... | gokulkarthik/hateclipper | explaining/engine.py | engine.py | py | 11,980 | python | en | code | 29 | github-code | 21 | [
{
"api_name": "pytorch_lightning.LightningModule",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "torchmetrics.Accuracy",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "torchmetrics.AUROC",
"line_number": 30,
"usage_type": "call"
},
{
"a... |
72043498934 | import cv2
import numpy as np
from sklearn import svm
from sklearn.model_selection import train_test_split
import joblib
import tkinter as tk
from tkinter import messagebox
from tkinter import filedialog
global clf
global model_name
global model_name_save
# Load and pre-process image data
def load_data():
# Load ... | DeepRoy2002/Quality-control-filter | tk.snoop.py | tk.snoop.py | py | 4,508 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "cv2.imread",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_num... |
34058426730 | from netmiko.cisco_base_connection import CiscoSSHConnection
class ArrisCERBase(CiscoSSHConnection):
"""
Arris CER Support.
Implements methods for interacting with Arris CER platforms.
"""
def config_mode(
self,
config_command: str = "configure",
pattern: str = "",
... | ktbyers/netmiko | netmiko/arris/arris_cer.py | arris_cer.py | py | 948 | python | en | code | 3,278 | github-code | 21 | [
{
"api_name": "netmiko.cisco_base_connection.CiscoSSHConnection",
"line_number": 4,
"usage_type": "name"
}
] |
12143120383 | import requests
from flask.views import MethodView
from api.globals import endpoints, exceptions
from api.utils import is_authorized
from common.config import constants
class DiscordRolesResource(MethodView):
@is_authorized(user=True)
def get(self, guild_id, role_id):
if role_id is None:
... | SpartanPlume/Tosurnament | backend/api/v1/discord/guilds/roles/__init__.py | __init__.py | py | 926 | python | en | code | 10 | github-code | 21 | [
{
"api_name": "flask.views.MethodView",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "api.globals.exceptions.NotFound",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "api.globals.exceptions",
"line_number": 16,
"usage_type": "name"
},
{
"api... |
8386451994 | from fastapi import FastAPI, HTTPException
from fastapi.middleware.cors import CORSMiddleware
app = FastAPI()
origins = ['https://localhost:3000']
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
@app.get("/")
def... | ZychDev/Project_IN | backend/main.py | main.py | py | 686 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "fastapi.middleware.cors.CORSMiddleware",
"line_number": 10,
"usage_type": "argument"
}
] |
70346087414 | import datetime
from sqlalchemy.orm import relationship
from src.database import db
class Notification(db.Model):
__tablename__ = 'notification'
NotificationId = db.Column(db.Integer, primary_key=True)
AccountId = db.Column(db.Integer, db.ForeignKey('account.AccountId'))
Title = db.Column(db.String(5... | theminkantoso/museum.server | src/models/notificationDb.py | notificationDb.py | py | 1,913 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "src.database.db.Model",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "src.database.db",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "src.database.db.Column",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "src.da... |
74370886452 | import requests
from bs4 import BeautifulSoup
import re
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36 Edg/98.0.1108.62'}
def baidu(company):
url = 'https://www.baidu.com/s?rtt=4&tn=news&word=' + company
... | xjy486/spider | 爬取多家数据.py | 爬取多家数据.py | py | 1,722 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "re.S",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "re.findall",
"line_number": 18,... |
37345679186 | import torch
class Waypoints:
NPOS = 3 # x, y, theta
def __init__(self, params, logger, dtype, map, world_rep, value_fn):
self.params = params
self.logger = logger
self.dtype = dtype
self.map = map
self.world_rep = world_rep
self.value_fn = value_fn
... | romesco/correctiveFB_utils | ros_util/librhc/cost/waypoints.py | waypoints.py | py | 3,604 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torch.arange",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "torch.sort",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "torch.min",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "torch.max",
"line_number": 77,
... |
72904819254 | # ---------------------------------------------------------- #
# ----------------- OzDES_calibSpec_calc.py ---------------- #
# ------- https://github.com/jhoormann/OzDES_calibSpec ----- #
# ---------------------------------------------------------- #
# This is a code to perform spectrophotometric calibration. #
... | jhoormann/OzDES_calibSpec | OzDES_calibSpec_calc.py | OzDES_calibSpec_calc.py | py | 65,792 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "astropy.io.fits.open",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "astropy.io.fits",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "astropy.io.fits.open",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "astropy.io.... |
71534336054 | import pandas as pd
import xgboost as xgb
from sklearn.metrics import f1_score
import wandb
wandb.login()
# Sweep Configuration
sweep_config = {
'method': 'bayes',
'metric': {'name': 'validation_f1',
'goal': 'maximize'},
'parameters': {'max_bin': {'values': [2, 4, 8, 16, 32]},
... | berkegocmen/wesad | src/xgb_sweep.py | xgb_sweep.py | py | 2,729 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "wandb.login",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "wandb.sweep",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "wandb.init",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "wandb.config",
"line_number": 3... |
73233696054 | import json
from django.http import HttpResponse
from django_swagger_utils.drf_server.utils.decorator.interface_decorator \
import validate_decorator
from .validator_class import ValidatorClass
from content_management_portal.interactors.create_solution_approach_interactor import\
CreateSolutionApproachInteracto... | bammidichandini/content_management_portal | content_management_portal/views/create_coding_question_solution_approach/api_wrapper.py | api_wrapper.py | py | 1,456 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "content_management_portal.storages.solution_approach_storage_implementation.SolutionApproachStorageImplementation",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "content_management_portal.presenters.presenter_implementation.PresenterImplementation",
"line_number": ... |
13454086424 | # 爬取新能源网--> 关键词:电动汽车充电
# 直接打印出数据
# 2019-10-17
import time
import requests
from bs4 import BeautifulSoup
from requests.exceptions import ConnectionError
from requests.exceptions import HTTPError
list1 = []
list2 = []
base_url1 = 'http://www.china-nengyuan.com/news/news_list.php?news_sort_id=6&keyword='
base_url2 = 'ht... | Liangkang19/PyCharmFile | SpiderTest/XNY/charge.py | charge.py | py | 3,629 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "requests.exceptions.ConnectionError",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "requests.exceptions.HTTPError",
"line_number": 47,
"usage_type": "name"
},
{
"ap... |
9917043254 | from pathlib import Path
from PIL import Image
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision
from torchvision import datasets, transforms
from videotransforms import (
GroupScale, GroupCenterCrop, GroupNormalize, Stack
)
from models.pytorch_i3d import InceptionI3d
from datas... | microsoft/computervision-recipes | contrib/action_recognition/i3d/inference.py | inference.py | py | 2,580 | python | en | code | 9,169 | github-code | 21 | [
{
"api_name": "PIL.Image.open",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.Compose",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "torchvision.t... |
42040955918 | import copy
from collections import OrderedDict, Counter
from io import StringIO
from pathlib import Path
import sys
from typing import Optional
from requests import Session
import hashlib
import json
import re
from ruamel.yaml import YAML, RoundTripRepresenter, SafeRepresenter
from src.config import Config, Empty, me... | lykoss/lykos | gendoc.py | gendoc.py | py | 11,249 | python | en | code | 123 | github-code | 21 | [
{
"api_name": "json.JSONEncoder",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "src.cats.Category",
"line_number": 22,
"usage_type": "argument"
},
{
"api_name": "src.config.Config",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "collect... |
7233329613 | import streamlit as st
import pandas as pd
import numpy as np
import torch
import torch.nn as nn
import pickle
# from graduatedproject import BinaryClassification
from sklearn.preprocessing import StandardScaler
class BinaryClassification(nn.Module):
def __init__(self):
super(BinaryClassificatio... | yousefAk4/theboys | wepheart.py | wepheart.py | py | 4,069 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torch.nn.Module",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
33850215357 | import webapp2
from google.appengine.api import urlfetch, users
import json
import jinja2
import os
import random
from fatsecret import Fatsecret
from lifestyle_model import User, Meal
from lifestyle_model import User, Meal #api
from google.appengine.ext import ndb
consumer_key = "2de49a3300b94286944e4cbae4986364"
... | trisaleung/lifestyleapp | main.py | main.py | py | 9,454 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "jinja2.Environment",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "jinja2.FileSystemLoader",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
25539325855 | import numpy as np
import cv2
class cameraSet:
def capFrame(self,id):
ret, frame = self.camArray[id].read()
frame = cv2.resize(frame, (480, 270))
self.frameArray[id] = frame
def getFrame(self, id):
return self.frameArray[id]
def decCam(self, id):
return cv2.VideoC... | TASRobotics/RaidZero-FRC-2020 | jetson/camera.py | camera.py | py | 1,312 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "cv2.resize",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line_number"... |
4431342303 | from faker import Faker
from item.models import Item, Buyer
from conf_test_db import override_get_db
async def item_info() -> Item:
fake = Faker()
database = next(override_get_db())
item_count = database.query(Item).filter().count()
if Item_count <= 0:
item_obj = Item(name=fake.name())
... | MaxJokar/fastapi-project-crash-course-with-Tests | item/tests/shared/info.py | info.py | py | 510 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "faker.Faker",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "conf_test_db.override_get_db",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "item.models.Item",
"line_number": 9,
"usage_type": "argument"
},
{
"api_name": "item.model... |
24824377478 | # coding: utf-8
"""
Automatically populate chemical & material groups.
This module runs the whole collection of operations available in commongroups:
- Read compound group definitions either from the web (Google Sheets) or
from a JSON file.
- Compile and perform database queries based on group definitions.
- O... | akokai/commongroups-archived | commongroups/run.py | run.py | py | 2,260 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "commongroups.env.CommonEnv",
"line_number": 63,
"usage_type": "call"
}
] |
13799947967 | import numpy as np
import matplotlib.pyplot as plt
import os
import csv
def show_pro_loss(loss_path):
with open(loss_path) as f_loss:
contents=f_loss.readlines()
new_contents=[]
for line in contents:
list_line=np.asarray([float(x) for x in line.split(' ')[:-1]])
new_contents.appen... | Weia/cal_accuracy | find_separate_point.py | find_separate_point.py | py | 7,017 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.asarray",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_n... |
19439409049 | # ==== Importing all the necessary libraries
from tkinter import *
from tkinter import filedialog
from pydub import AudioSegment
from pydub.utils import make_chunks
import os
import moviepy.editor as mp
import speech_recognition as sr
# ==== creating main class
class VideoAudioConverter:
# ==== creating gui window... | dedzec/VideoConvert | app.py | app.py | py | 2,758 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "tkinter.filedialog.askopenfilename",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "tkinter.filedialog",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "os.path.basename",
"line_number": 26,
"usage_type": "call"
},
{
"api_name":... |
28273315330 | import requests
class BaseAPI:
def __init__(self, service, extra_headers=None):
self.service = service
self.extra_headers = extra_headers
def headers(self, token, content_type=None):
headers = {'X-Auth-Token': token}
if self.extra_headers:
headers.update(self.ex... | ChameleonCloud/hammers | hammers/osrest/base.py | base.py | py | 1,837 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "requests.put",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "requests.delete",
"line_n... |
73034500533 | from synapse.api.errors import SynapseError
from synapse.types import UserID, RoomID
from twisted.internet import defer
import ujson as json
class Filtering(object):
def __init__(self, hs):
super(Filtering, self).__init__()
self.store = hs.get_datastore()
@defer.inlineCallbacks
def get... | LiuFang816/SALSTM_py_data | python/matrix-org_synapse/synapse-master/synapse/api/filtering.py | filtering.py | py | 11,475 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "twisted.internet.defer.returnValue",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "twisted.internet.defer",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "twisted.internet.defer.inlineCallbacks",
"line_number": 15,
"usage_type": "attr... |
23502974335 | import time
import sys, argparse
import os
from aicsimageio import AICSImage
import skimage
from stardist.models import StarDist2D
from skimage.color import label2rgb
def main(argv):
parser = argparse.ArgumentParser(description="Count cells in DAB image")
parser.add_argument("Input File Path", help... | BioimageAnalysisCoreWEHI/HDAB_counts_HPC | IHC_DAB_Count.py | IHC_DAB_Count.py | py | 4,928 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.split",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "os.path.isdir",
... |
20493361896 | from django.shortcuts import render
# Create your views here.
from django.views import View
from goods.models import Goods_Sku, Goods_Spu, Category, Advertisement
from shopCart.helpler import get_cart_count
def index(request):#商城主页
if request.method=="GET":
data=Goods_Sku.objects.filter(is_delete=False)... | kyokusan/- | apps/goods/views.py | views.py | py | 1,538 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "goods.models.Goods_Sku.objects.filter",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "goods.models.Goods_Sku.objects",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "goods.models.Goods_Sku",
"line_number": 12,
"usage_type": "name... |
1855672684 | import cv2
# img = cv2.imread('lena.png')
cap = cv2.VideoCapture(0)
classnames = []
with open('projects/coco.names','rt') as f:
classnames = f.read().rstrip('\n').split('\n')
configPath = 'projects/ssd_mobilenet_v3_large_coco_2020_01_14.pbtxt'
weightPath = 'projects/frozen_inference_graph.pb'
net = cv2.dnn_Dete... | tanmoysrt/Opencv-Projects | object_detection.py | object_detection.py | py | 1,140 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.dnn_DetectionModel",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.rectangle",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "cv2.putText",
... |
71870017334 | import logging
import re
from pathlib import Path
logger = logging.getLogger("KICONV")
SYMBOL_RE = re.compile(r'^\s*\(symbol \"(?P<SYMBOL_NAME>.+)\" \(pin')
TEMPLATE_LIB_HEADER = b"""\
(kicad_symbol_lib (version 20211014) (generator kicad_symbol_editor)
"""
TEMPLATE_LIB_FOOTER = b")\n"
class SchematicExist(Exce... | tywtyw2002/easyEda2Kicad | helper/schematic/schematic_manager.py | schematic_manager.py | py | 5,990 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 30,
"usage_type": "call"
}
] |
71256511733 | import pandas as pd
import numpy as np
import os
import seaborn as sns
from matplotlib import pyplot as plt
from models import timeModel
from selfUtils import maths
from pandas.plotting import register_matplotlib_converters
register_matplotlib_converters()
def _get_format_plot_data(df=None, hist=None, text=None, equa... | cmkwong/MetaTrader5_command | views/plotView.py | plotView.py | py | 8,648 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.plotting.register_matplotlib_converters",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "models.timeModel.get_time_string",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "models.timeModel",
"line_number": 38,
"usage_type": "name... |
869741867 | from datetime import datetime, timedelta
from django.utils import timezone
from accounts.services import get_profile_from_user
from journal.models import Lessons, Homeworks, Marks
from journal.services import get_lesson_info
def get_student_homepage_lessons(study_group_id):
if datetime.now().hour >= datetime.st... | Qvineox/School148 | home/services.py | services.py | py | 5,499 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "datetime.datetime.now",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "da... |
2157536329 | from flask import Flask, request, jsonify
import json
app = Flask(__name__)
class Machine(object):
def __init__(self, name, address, timeout):
self.name = name
self.address = address
self.timeout = timeout
def get_name(self):
return self.name
machines = []
def object_decoder(obj):
return Machine(obj['name... | AcollaMolla/PLC4X-API | rest-api.py | rest-api.py | py | 1,494 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "flask.request.json",
"line_numbe... |
3485011063 | from sqlalchemy import delete
from core import user_table, engine
def delete_cliente():
nome_cliente = input('usuario a ser excluido: ')
conn=engine.connect()
dell= delete(user_table).where(user_table.c.nome==nome_cliente)
resultado = conn.execute(dell)
print(resultado.rowcount)
if __name__ == "__... | FabioGUB/Python.Fundamentals- | aula5/ORM/core_delete.py | core_delete.py | py | 349 | python | pt | code | 0 | github-code | 21 | [
{
"api_name": "core.engine.connect",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "core.engine",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.delete",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "core.user_table",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.