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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
23160211530 | #! /usr/bin/env python3
import re
from collections import deque
from typing import List
def initialize_stacks(initial_state: List[str]) -> List[deque]:
"""Initialize stacks.
Example stack initialization:
[D]
[N] [C]
[Z] [M] [P]
1 2 3
"""
# read position of boxes in each stac... | donovan-h-parks/advent-of-code | 2022/python/day-05/day-05.py | day-05.py | py | 3,798 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.List",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "collections.deque",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line... |
26219588881 | import torch.nn as nn
import torch
import math
import argparse
from tqdm import tqdm
# This enables the inbuilt cudnn auto-tuner to find the best algorithm to use for your hardware, e.g., wingrad conv op
torch.backends.cudnn.benchmark = True
NAME = 'dcgan'
batch_size = 1
latent_dim = 100
img_size = 256
channels = 3
#... | mikepapadim/collage-non-tvm-fork | python/collage/workloads/baselines/pytorch/dcgan.py | dcgan.py | py | 9,512 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "torch.backends",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.init.normal_",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.init.... |
33618000873 | from django.shortcuts import render
# Create your views here.
from rating.models import Rating
def add(request):
if request.method=="POST":
obj=Rating()
obj.rating=request.POST.get('rating')
obj.u_id="1"
obj.save()
return render(request,'rating/add_rating.html')
def view(request... | abhinavtp/gadget | shop/e_gadget/rating/views.py | views.py | py | 973 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "rating.models.Rating",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "rating.models.Rating.objects.all",
"line_number": 13,
"usage_type": "call"
},
{
"api_... |
26714123866 | import json
from os import path
import requests
import datetime
today = datetime.datetime.now()
ymd = (str(today)).split(' ')[0]
file_name = f'rates--{ymd}.json'
print((str(today)).split(' ')[0])
key = '664db39a8f01d144d3bda05cbcde2278'
endpoint = 'http://data.fixer.io/api/latest' + '?access_key=' + key
def files()... | denb11/HW_fixer_io | curenci/fixer_io.py | fixer_io.py | py | 3,437 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "datetime.datetime.now",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
27069940928 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2019/10/23 11:16
# @Author: yanmiexingkong
# @email : yanmiexingkong@gmail.com
# @File : main.py
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webd... | Annihilater/blast.ncbi.nlm.nih.gov | main.py | main.py | py | 3,127 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 48,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "selenium.webd... |
15416188509 | import cv2
import numpy as np
faceCascade = cv2.CascadeClassifier("Resources/haarcascade_frontalface_default.xml")
#read video from webcam
cap = cv2.VideoCapture(0) #0-> ID of the camera
cap.set(10,100) #10-> Brighness
# cap.set(3,640) #3-> width
# cap.set(4,480) #4-> height
#... | dwijmistry11/MyOpencvProject | 9_b_Webcam_FaceDetection.py | 9_b_Webcam_FaceDetection.py | py | 779 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "cv2.CascadeClassifier",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY"... |
44960818882 | import config
import MySQLdb
import hashlib
import urllib
import urllib2
import re
from xml.dom import minidom
def getText(nodelist):
rc = []
for node in nodelist:
if node.nodeType == node.TEXT_NODE:
rc.append(node.data)
return ''.join(rc)
def search_ticker(ticker, mode):
mysql = ... | kperson/TwitNode | pybatch/searchticker.py | searchticker.py | py | 2,435 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "MySQLdb.connect",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "config.rhost",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "config.ruser",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "config.rpassword"... |
74377598752 | #!python3
# Multiclipboard program - Automate the Boring Stuff C8
# Follow along tutorial.
# Implemented delete keyword
# mcb.pyw - Saves and loads pieces of text to the clipboard
# Command Line Arguments: py.exe mcb.pyw save <keyword> - Saves clipboard to keyword
# py.exe mcb.pyw <keyword> - Lo... | lupp1/pyscripts | Multiclipboard/mcb.py | mcb.py | py | 1,263 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "shelve.open",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "pyperclip.paste",
"line_n... |
23241366223 | # Register imports
from flask import Flask, request, jsonify
from models import db
from models import Client
from config import config
from flask_marshmallow import Marshmallow
from flask_cors import CORS, cross_origin
import os
#App startup configuration
def create_app(enviroment):
app = Flask(__name__)
app.c... | josewiss777/apirestClients | app.py | app.py | py | 3,480 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "models.db.init_app",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "models.db",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "models.db.create_all",
"... |
38284308726 | import discord
from discord.ext import commands
from src.summonerInfo import getSummonerIdentification
from src.champion import get_champion_info_embed
from src.ranked import init_tier, init_tier_embed, get_tiers_type, get_tier_info, get_max_tier, get_winratio
from src.summoner import get_summoner_info
from decouple ... | bakhoon/LoL-Summoner-Status | cogs/getSummonerInfo.py | getSummonerInfo.py | py | 4,527 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "decouple.config",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sr... |
3455412680 | import tensorflow as tf
from tensorflow import keras
import numpy as np
import cv2
from keras.models import load_model
facedetect = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
cap=cv2.VideoCapture(0)
cap.set(3,640)
cap.set(4,480)
font=cv2.FONT_HERSHEY_COMPLEX
model = load_model('keras_model.h5')
def ge... | ShadmanRana/Student_Attendance_System_Based_On_Face_Recogniton | project/facerecognition.py | facerecognition.py | py | 1,445 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "cv2.CascadeClassifier",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.FONT_HERSHEY_COMPLEX",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "ke... |
24677613630 | import re
from app.schemas.parse import RegexField, RegexFieldStatistical
from app.core.config import Settings, GetFileJson
from collections import OrderedDict, Counter
class RegexRules:
def __init__(self, content: str, setting: Settings = None):
self.content = content
if setting:
self... | yc88/attachment_parse | app/api/content_regex.py | content_regex.py | py | 6,941 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "app.core.config.Settings",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "app.core.config.Settings",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "app.core.config.GetFileJson",
"line_number": 14,
"usage_type": "call"
},
{
"api_... |
26990281858 | from flask_app.config.mysqlconnection import connectToMySQL
import re
from flask import flash
EMAIL_REGEX = re.compile(r'^[a-zA-z0-9.+_-]+@[a-zA-Z0-9]+\.[a-zA-z]+$')
class Email:
db = 'email_validation'
def __init__(self, data):
self.id = data['id']
self.email = data['email']
self.creat... | raspuna/python_course | python/flask_mysql/validation/email_validation/flask_app/models/email.py | email.py | py | 2,106 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "re.compile",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask_app.config.mysqlconnection.connectToMySQL",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "flask_app.config.mysqlconnection.connectToMySQL",
"line_number": 26,
"usage_typ... |
31066958205 | from __future__ import print_function
import argparse
import os
import random
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim as optim
import torch.utils.data
import torchvision.datasets as dset
import torchvision.transforms as transforms
import torchv... | gyes00205/NYCU_DLP_2022 | lab7/DCGAN.py | DCGAN.py | py | 3,649 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "torch.nn.Module",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"lin... |
15686226766 | import numpy as np
import matplotlib.pyplot as plt
import os
import utils as u
import result_gen_utils as ru
import pandas as pd
import seaborn as sns
import multiprocessing
from joblib import Parallel, delayed
import natsort
import time
from sklearn.metrics.pairwise import cosine_similarity
from sklearn import manifol... | agarwalShruti15/motion_signature | baseline/repo_tsne.py | repo_tsne.py | py | 6,156 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "os.path.exists",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.path.split",
"line_nu... |
19123288264 | import scrapy
class BestsellersSpider(scrapy.Spider):
name = 'bestsellers'
allowed_domains = ['www.glassesshop.com']
start_urls = ['http://www.glassesshop.com/bestsellers/']
def parse(self, response):
for glass in response.xpath("//div[@id='product-lists']/div"):
if glass.xpath(".... | paulitstep/web_scraping | 6_glasses_shop/glasses_shop/spiders/bestsellers.py | bestsellers.py | py | 959 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "scrapy.Spider",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "scrapy.Request",
"line_number": 23,
"usage_type": "call"
}
] |
7455835422 | import pytest
import json
from cdms_psql_server.server import app
@pytest.fixture
def test_client():
client = app.test_client()
def search_companies(term, limit=50, offset=0):
resp = client.post(
'/company-search',
data=json.dumps({
'term': term,
... | uktrade/cdms-psql-server | test/conftest.py | conftest.py | py | 562 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "cdms_psql_server.server.app.test_client",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cdms_psql_server.server.app",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "json.dumps",
"line_number": 13,
"usage_type": "call"
},
{
"api_... |
34104105219 | import sys
import requests
from google.cloud import storage
from os import listdir
storage_client = storage.Client()
def main(argv):
folder = argv[1]
bucket = storage_client.get_bucket('tfl-mp4-videos')
files = listdir('..' + folder)
print('Uploading videos from', folder)
for file in files:
... | ministrudels/JamCam-Detector | docker_containers/upload_video/app.py | app.py | py | 883 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "google.cloud.storage.Client",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "google.cloud.storage",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "os.listdir",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.ge... |
22193051528 | from telebot.types import Message
from loader import bot
from config_data.config import DEFAULT_COMMANDS
@bot.message_handler(commands=["start"])
def bot_start(message: Message) -> None:
text = f"Привет, {message.from_user.full_name}! Я бот для поиска подходящих билетов. " \
f"Выберите команду:\n"
... | AgGashv/Telegram-bot | handlers/default_handlers/start.py | start.py | py | 484 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "telebot.types.Message",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "config_data.config.DEFAULT_COMMANDS",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "loader.bot.reply_to",
"line_number": 13,
"usage_type": "call"
},
{
"api_... |
33490174588 | #!/usr/bin/env python
import logging
import sys
import os
import gzip
from argparse import ArgumentParser
from threading import Thread
from math import isnan
from glob import glob
import traceback
from time import time
import torch.cuda
from typing import Dict, Set, Optional
import numpy
import pandas
import csv
from... | DeepRank/DeepRank-Mut | scripts/preprocess_bioprodict.py | preprocess_bioprodict.py | py | 14,090 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "os.path.dirname",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "sys.path.insert",
"l... |
73614895713 | from typing import Optional
from sqlalchemy.orm import Session, selectinload
from . import models, schemas
class ResourceNotFound(Exception):
...
def get_resources(db: Session) -> list[models.Resource]:
return (
db.query(models.Resource).options(selectinload(models.Resource.snapshots)).all()
)... | janheindejong/urlstalker | api/urlstalker/crud.py | crud.py | py | 931 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sqlalchemy.orm.Session",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.orm.selectinload",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.Session",
"line_number": 18,
"usage_type": "name"
},
{
"api_nam... |
20824099866 | import time
import serial
from pdb import set_trace as st
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from scipy import fft
def velo_calc(x,delta_t):
v0 = 0
vel_list = []
for ind, each_x in enumerate(x):
v = v0+each_x*delta_t
vel_list.append(v)
v0 = v
return np.arr... | Paratra/sparkfun_adxl362 | arduino_version/receive_data.py | receive_data.py | py | 3,448 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.array",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "scipy.fft.fft",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "scipy.fft",
"line_number... |
1710560499 |
import sys
sys.path.insert(0, "/root/autodl-tmp/Code/RLHF")
sys.path.insert(0, "/mnt/sfevol775196/sunzeye273/Code/chatgpt")
# sys.path.insert(0, "/mnt/share-pa002-vol682688-prd/sunzeye273/Code/chatgpt")
sys.path.insert(0, "/mnt/pa002-28359-vol543625-private/Code/chatgpt")
import os
import argparse
import evaluate
impo... | xuqy1981/RLHF | src/train_sft.py | train_sft.py | py | 14,565 | python | en | code | null | github-code | 1 | [
{
"api_name": "sys.path.insert",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "sys.path.insert",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_numbe... |
25594134201 | import pytest
import os
import django
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'books_api.settings')
django.setup()
from books.models import Book
@pytest.fixture
def basic_book_data():
return {
"googleapis_id": "iY4yZEkphNgC",
"title": "basic_book",
"authors": "['basic author']",
... | bartoszbad/googleapis-books | tests/conftest.py | conftest.py | py | 2,319 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.environ.setdefault",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.setup",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
... |
15813485193 |
# coding: utf-8
# author of this script Enrique Aldana
# # Cleaning Energy Game database output (March, 21st, 2018)
#
# In order to use the output of the energy game for scientific purposes, it is needed to clean the database output. This script shows the process to clean the current database output.
# # 0.Import ... | xdanielsb/DataGamesProcessor | assets/firstProcessor.py | firstProcessor.py | py | 1,201 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "datetime.datetime.now",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pandas.r... |
28357143583 | from rest_framework import mixins, viewsets
from order.models import Order
from order.serializers import OrderSerializer
from order.utils import check_qualification, check_qty
class OrderViewSet(mixins.CreateModelMixin,
mixins.ListModelMixin,
mixins.DestroyModelMixin,
... | menghuil/excercise_project_1 | dashboard/order/views.py | views.py | py | 666 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "rest_framework.mixins.CreateModelMixin",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.mixins",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "rest_framework.mixins.ListModelMixin",
"line_number": 9,
"usage_type": "a... |
33603031027 | import pandas as pd
import matplotlib.pyplot as plt
import base64
from io import BytesIO
from time import strptime
from pandas.core import base
import plotly.express as px
class Myclass:
def __init__(self,path1,path2):
self.path1=path1
self.path2=path2
def matrix_multiplication(self):
... | AshishPhadtare1999/Assets-Portfolio-data-project | myproject/myapp/Port_Assets.py | Port_Assets.py | py | 4,808 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_excel",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.read_excel",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "time.strptime",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
... |
7585509733 | from .forms import UsersProfile_CreationForm, UsersProfile_ChangeForm
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from .models import UsersProfile_Model
@admin.register(UsersProfile_Model)
class UserProfile_Admin(UserAdmin):
# forms and model to use
model = UsersProfile_M... | withrvr/1Link | UsersProfile_App/admin.py | admin.py | py | 1,248 | python | en | code | 5 | github-code | 1 | [
{
"api_name": "django.contrib.auth.admin.UserAdmin",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "models.UsersProfile_Model",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "forms.UsersProfile_CreationForm",
"line_number": 12,
"usage_type": "name"
... |
4371333468 | from tqdm import tqdm
import torch
import torch.nn as nn
from torch.optim import Adam
from torch_geometric.data import DataLoader
from torch_geometric.nn import DataParallel
from core.trainer.trainer import Trainer
from core.model.vectornet import VectorNet, OriginalVectorNet
from core.optim_schedule import Scheduled... | 41623134/idea | core/trainer/vectornet_trainer.py | vectornet_trainer.py | py | 6,319 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "core.trainer.trainer.Trainer",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "core.model.vectornet.VectorNet",
"line_number": 77,
"usage_type": "name"
},
{
"api_name": "torch.optim.Adam",
"line_number": 101,
"usage_type": "call"
},
{
"api... |
5710224655 | # @Time : 2020/2/29 9:38
# @Author : Xylia_Yang
# @Description :
from functools import cmp_to_key
class Solution:
def PrintMinNumber(self, numbers):
"""
sort的key指向一个item到key的映射,这个映射内容可以是自定义的一个排序方式,默认返回
升序排列
"""
numbers.sort(key=cmp_to_key(self.compare))
res=''
... | XyliaYang/Leetcode_Record | python_version/Interview45.py | Interview45.py | py | 979 | python | zh | code | 1 | github-code | 1 | [
{
"api_name": "functools.cmp_to_key",
"line_number": 13,
"usage_type": "call"
}
] |
41951801108 | from torch import nn, optim, cat
import torch
import numpy as np
from torch.autograd import Variable
class CNN(nn.Module):
def __init__(self, weight):
# 继承父类的初始化函数
super(CNN, self).__init__()
# 定义卷积层,1 input image channel, 25 output channels, 3*3 square convolution kernel
... | cxyznj/DM2019_emojipredict | CNN.py | CNN.py | py | 3,952 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "torch.nn.Module",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_... |
19587087222 | import pathlib
from pydo import *
this_dir = pathlib.Path(__file__).parent
package = {
'requires': ['gstreamer'],
'sysroot_debs': ['libi2c-dev'],
'root_debs': [],
'target': this_dir / 'piroverd.tar.gz',
'install': ['{chroot} {stage} /bin/systemctl reenable piroverd.service'],
}
from ... imp... | ali1234/rpi-ramdisk | packages/piroverd/__init__.py | __init__.py | py | 1,831 | python | en | code | 79 | github-code | 1 | [
{
"api_name": "pathlib.Path",
"line_number": 5,
"usage_type": "call"
}
] |
22397222528 | from django.shortcuts import render
from django.shortcuts import redirect
from django.http import JsonResponse
from rest_framework import generics
import json
import matplotlib
import matplotlib.pyplot as plt
import networkx as nx
import nltk
import pandas as pd
import os
import json
import pickle
import re
import spa... | rheyannmagcalas/santa_all_web | main/wishlist/views.py | views.py | py | 9,877 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "spacy.load",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "re.sub",... |
74774358113 | import torch
import argparse
from kobert.pytorch_kobert import get_pytorch_kobert_model
from sklearn.model_selection import train_test_split
from dataset import *
from model import *
from loss import *
from transformers import AdamW
from adamp import AdamP
from transformers import ElectraModel, ElectraTokenizer
import... | ekzm8523/AI_Tech | Pstage_2/kobert/train.py | train.py | py | 8,677 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.max",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 41,
... |
8524034419 | import pygame as pg
def reveal_solution(screen, nbr_cases_x, nbr_cases_y, solution, images): # Fonction de révélation de toutes les cases
for k in range(nbr_cases_y):
for t in range(nbr_cases_x):
screen.blit(images[solution[k][t]], (22*t, 22*k))
def reveal_case(screen, nbr_cases_x, nbr_case... | RaphaelRoumat/mini-jeux | manipulation_case.py | manipulation_case.py | py | 3,874 | python | fr | code | 0 | github-code | 1 | [
{
"api_name": "pygame.time.Clock",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pygame.time",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "pygame.event.get",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pygame.event",
... |
43407965358 | from django.shortcuts import render
from django.views.generic import View
from .models import Notification
import time
from django.http import JsonResponse
from security.response import set_response_header
from authentication.auth import check_authentication
from user.method import get_user
from .serialize import noti... | tpvt99/new-social-network-backend | noti/views.py | views.py | py | 1,420 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "django.views.generic.View",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "authentication.auth.check_authentication",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "user.method",
"line_number": 17,
"usage_type": "name"
},
{
"ap... |
34000914126 | import datetime
class Shape:
def __init__(self, colour, material):
self.colour = colour
self.material = material
self.create_date = datetime.datetime.now().strftime("%x")
# this date will be the same for all Shapes, we do not need to pass this create parameter
| czamoral2021/CEBD-1100-CODE-WINTER-2021 | Entities/Shape.py | Shape.py | py | 301 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "datetime.datetime.now",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 8,
"usage_type": "attribute"
}
] |
14118223074 | from time import time
import inspect
import io
import contextlib
func_list = {}
class timer_func:
def __init__(self,func):
self.func = func
timer_func.count = 0
def __call__(self,*args,**kwargs):
timer_func.count += 1
self.arguments = args
start = time()
... | Ghadeer-Issa92/Assignment1 | Task3.py | Task3.py | py | 1,144 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "time.time",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "contextlib.redirect_stdout",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "io.StringIO",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "time.time",
"lin... |
21075647228 | from selenium import webdriver
from selenium.webdriver import ActionChains
from selenium.webdriver.common.actions.action_builder import ActionBuilder
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from time import sleep
import threading
from tkinter import *
from tkinter i... | IanDs0/Teste | Teste_Python/whatsapp/Envio_Mensagem_com_Arquivo/mensagemArquivo.py | mensagemArquivo.py | py | 2,406 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.path.append",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.ActionChains",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "seleniu... |
70880912995 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 多页抓取和二级页面抓取解析
import requests
from bs4 import BeautifulSoup
import json
def start_request(url):
r = requests.get(url)
return r.content
# 解析一级页面
def get_page(text):
soup = BeautifulSoup(text, 'html.parser')
movies = soup.find_all('div', class_ = 'info... | CHOPPERJJ/Python | LearningProject/Crawl/DoubanSpider_03.py | DoubanSpider_03.py | py | 1,832 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"li... |
39109996251 | import pygame
class Tear(pygame.sprite.Sprite):
def __init__(self,player,direction):
super().__init__()
self.velocity = 15
self.image = pygame.image.load('assets/tear.png')
self.image = pygame.transform.scale(self.image, (30, 30))
self.player = player
self.rect = se... | bastvdn/PyBoi | projectiles/tear.py | tear.py | py | 1,644 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pygame.sprite",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.load",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pygame.transform.... |
24927947803 | # coding: utf-8
from django.shortcuts import render, get_object_or_404, redirect, render_to_response
from .models import Category, Product, Rating, NewsBlock, ActionBlock, AboutUsBlock, DeliveryBlock, ContactsBlock
from cart.forms import CartAddProductForm
from django.db.models import Q, Avg, Sum, Max, Min, Count
from ... | saltal77/docsimvol | site/shop/views.py | views.py | py | 14,405 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "models.Product.objects.filter",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "models.Product.objects",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "models.Product",
"line_number": 17,
"usage_type": "name"
},
{
"api_name... |
11070186844 | # Librerias de python
from tkinter import *
from tkinter import messagebox as MessageBox
from io import open
from tkinter import filedialog
from tkinter.filedialog import asksaveasfile
import os
import re
# Analizadores lexicos
from Analizadores.AnalizadorLexicocss import *
from Analizadores.AnalizadorLexicoJS import ... | solaresjuan98/OLC1_Proyecto1_201800496 | interfaz.py | interfaz.py | py | 6,913 | python | es | code | 0 | github-code | 1 | [
{
"api_name": "tkinter.filedialog.askopenfilename",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "tkinter.filedialog",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "os.path.splitext",
"line_number": 31,
"usage_type": "call"
},
{
"api_name":... |
74978840354 | # coding:utf-8
#1画像からネジを検出し、画像の中心座標を求める
#2画像の中心座標から一定の幅を持つ四角形で画像をsaveする
#以下の3か所に調べたいネジを含むファイル名、出力ファイル名を記載する
#image = cv2.imread("imageCopy_M8-16_15b.png",0)
#image3 = cv2.imread("imageCopy_M8-16_15b.png",1)
#cv2.imwrite('imageCopy_M8-16_15b.png', image3[a:b,c:d])
import cv2
import matplotlib.pyplot as plt
import... | tmichiro/git_hub_code | getImageCenter_and_CaptureImage2.py | getImageCenter_and_CaptureImage2.py | py | 2,280 | python | ja | code | 0 | github-code | 1 | [
{
"api_name": "cv2.imread",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cv2.threshold",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "cv2.THRESH_BINARY",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "cv2.THRESH_OTSU",
... |
13762478550 | # 프로그래머스 LV1 - 완주하지 못한 선수(Counter 활용)
# https://programmers.co.kr/learn/courses/30/lessons/42576?language=python3
import collections
def solution(participant, completion):
answer = '' # 리턴할 값 answer
'''
participant와 completion 길이의 차는 1이다.
이를 활용하기 위해 Counter 클래스를 활용하면 된다.
participant와 completion 배열... | irishNoah/Algorithm-Study | Programmers(프로그래머스)/LV1/Python/해시/프로그래머스_LV1 _완주하지못한선수(Counter 활용).py | 프로그래머스_LV1 _완주하지못한선수(Counter 활용).py | py | 829 | python | ko | code | 4 | github-code | 1 | [
{
"api_name": "collections.Counter",
"line_number": 14,
"usage_type": "call"
}
] |
28567418275 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"Running jobs on all TaskCacheList"
from multiprocessing import Process, Pipe
from multiprocessing.connection import Connection
from typing import (
Dict, Callable, List, Optional, Set, Union, Any, Iterator, Tuple,
AsyncIterato... | depixusgenome/trackanalysis | src/peakcalling/model/_jobs.py | _jobs.py | py | 12,033 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "utils.logconfig.getLogger",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "typing.Dict",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "pandas.DataFrame",... |
16895217753 | import boto3
import botocore
# import jsonschema
import json
import traceback
import zipfile
import os
import hashlib
from botocore.exceptions import ClientError, ParamValidationError
from extutil import remove_none_attributes, account_context, ExtensionHandler, ext, \
current_epoch_time_usec_num, component_safe_... | cloudkommand/ses | config_set/lambda_function.py | lambda_function.py | py | 14,041 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "extutil.ExtensionHandler",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "extutil.account_context",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "extutil... |
9289479299 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import configparser
import os
from pymongo import MongoClient, DESCENDING, ASCENDING
path = os.path.dirname(os.path.abspath(__file__))
config = configparser.ConfigParser()
config.read(path + '''/../config/configuration.cfg''')
def connect_to_mongodb():
client = Mo... | dantunescost/antunedo | api/lib/mongoConnector.py | mongoConnector.py | py | 8,521 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.dirname",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "configparser.ConfigParser",... |
3196914614 |
import gdal
import os
import sys
import cv2
import numpy as np
from PIL import Image
from matplotlib import pyplot as plt
from functools import reduce
from MoreOne import Ui_Dialog
from PyQt5.QtWidgets import QDialog, QFileDialog,QApplication
from base_functions import drawMatchesKnn_cv2, save_matchedpoints_in_file
... | scrssys/agriculture_analyze | main.py | main.py | py | 4,073 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PyQt5.QtWidgets.QDialog",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "MoreOne.Ui_Dialog",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QFileDialog.getOpenFileName",
"line_number": 23,
"usage_type": "call"
},
{
... |
13501866067 | from django.shortcuts import redirect
from django.urls import path, re_path
from .models import *
from . import views
app_name = 'survey'
urlpatterns = [
path('', lambda request: redirect('survey:site_overview',
Checklist.objects.filter(is_active=True).last().id), name='index'),
re_path(r'^(?P<checkli... | sabekov-study/study-app | sabekov/survey/urls.py | urls.py | py | 1,445 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.re_path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.u... |
20042611909 | import json
from utils.file_io import FileIO
class IOjson(FileIO):
def import_file(
self, bucket: str, file_key_s3: str,
):
'''
import_json allows to import json file containing the addresses
with any vscode service on the datalab thanks to management of
environment var... | alannadevgen/french-address-matching | utils/json_io.py | json_io.py | py | 1,074 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "utils.file_io.FileIO",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "json.load",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 32,
"usage_type": "call"
}
] |
18038408493 | from django.shortcuts import get_object_or_404
from rest_framework import viewsets
from rest_framework.permissions import IsAuthenticated
from .permissions import IsAuthorOrReadOnly
from .serializer import CommentSerializer, PostSerializer, GroupSerializer
from posts.models import Post, Group
class PostViewSet(views... | bour89/api_yatube | yatube_api/api/views.py | views.py | py | 1,124 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "rest_framework.viewsets.ModelViewSet",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.viewsets",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "posts.models.Post.objects.all",
"line_number": 11,
"usage_type": "call"... |
42632416752 | import pennylane as qml
from pennylane import numpy as np
from arithmetic import compute_tensor
from utils import uniform_superposition, tensor_to_qubits
import matplotlib.pyplot as plt
QUBITS_PER_NUM = 1
PROBLEM_SIZE = 2
SOLUTION_RANK = 3
sizes = (SOLUTION_RANK, PROBLEM_SIZE, QUBITS_PER_NUM)
params_per_edge = SOLUTI... | yyargic/TRD_with_PennyLane | grover.py | grover.py | py | 1,826 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pennylane.numpy.array",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pennylane.numpy",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "utils.tensor_to_qubits",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pennylan... |
43694506844 | import numpy as np
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestRegressor, RandomForestClassifier
from sklearn import metrics
from sklearn.linear_model import LinearRegression
from sklearn.linear_model import Ridge
from sklearn.svm import ... | Jalbiti/DNAffinity | model.py | model.py | py | 5,002 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sklearn.ensemble.RandomForestRegressor",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model.LinearRegression",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model.Ridge",
"line_number": 13,
"usage_type"... |
36355678261 | from application.crud.public import download_shared_world, grab_shared_world
from fastapi import APIRouter, Path, Query
router = APIRouter()
@router.get("/worlds/{world_id}")
async def get_world_by_id(
world_id: str = Path(..., description="The unique identifier of the world.")
):
return grab_shared_world(w... | Valink-Solutions/ChunkVault-Lite | backend/application/routes/public.py | public.py | py | 621 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "fastapi.Path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "application.crud.public.grab_shared_world",
"line_number": 12,
"usage_type": "call"
},
{
"api_name"... |
72307566755 | import asyncio
import discord
from discord import client
from discord import message
from discord.abc import GuildChannel
from discord.ext import commands
from discord.utils import get
from discord_slash import SlashCommand
import logging
import json
from pathlib import Path
from datetime import datetime
from threading... | Finnmccarthy/pastebot-py | bot.py | bot.py | py | 4,472 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "datetime.datetime.now",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "discord.Intents.... |
7125422899 | from django.contrib import admin
from django.urls import path
from . import views
from .views import *
urlpatterns = [
path('',HomeView.as_view(),name='home'),
path('detail/<int:pk>',NewsDetailView.as_view(),name="news_detail"),
path('addnews/',AddNewsView.as_view(),name="add_news"),
path('detail/edit/... | tienduonggia/News-Website | TinTuc/urls.py | urls.py | py | 741 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
32583421410 | import sqlalchemy.exc
from database import get_db, run_transaction
from sqlalchemy.engine import Engine
from fastapi import APIRouter
from schemas import Ticket, Survey
from fastapi import Depends
ticket_router = APIRouter(
prefix="/tickets",
tags=['tickets']
)
@ticket_router.get("/get-tickets/{user_id}")
d... | CSchelbNE/CS5200-fengwLavrishinASchelbC | backend/ticket_operations.py | ticket_operations.py | py | 4,510 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.engine.Engine",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "fastapi.Depends",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "database.ge... |
72873057634 | from flask import jsonify, g
from app import db
from app.api import bp
from app.api.auth import basic_auth, token_auth
from app.models import WordSubject, Word, UserWord
from flask import request
from functools import cmp_to_key
def words_subject_compare(x, y):
# 已经完全背完了
if x['complete_ratio'] == 100:
... | HaoyueQiu/WordsInLife | back-end/app/api/words.py | words.py | py | 3,822 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "flask.request.args.get",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "flask.request.args",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "app.mode... |
6216213571 | import glob
import os
import numpy as np
import cv2
import argparse
parser = argparse.ArgumentParser(description='Preprocessing/Visualizing EGTEA Gaze+ gaze annotations')
parser.add_argument('--txtfile', default='./gaze_data', help='path to txt annotations')
parser.add_argument('--datapath', default='dataset', help... | faderani/egtea_gaze_preproc | main.py | main.py | py | 7,577 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
... |
19741485156 | # -*- coding: utf-8 -*-
"""
Spyder Editor
This is a cointegration script file.
"""
import numpy as np
import pandas as pd
import tushare as ta
from statsmodels.tsa.stattools import adfuller
start = '2020-01-01'
end = '2022-01-01'
SZ000725 = '000725'
SH600026 = '600026'
df_SZ000725 = ta.get_hist_data(SZ000725, start... | simple321vip/violin-trade | strategy/spreads_2.py | spreads_2.py | py | 1,626 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "tushare.get_hist_data",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "tushare.get_hist_data",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.co... |
38105063441 | import numpy as np
import matplotlib.pyplot as plt
#(a)
def multivariate_gaussian(X, mu, sigma2):
d = 1 if isinstance(X, float) or isinstance(X, int) else X.shape[0]
coef = 1 / np.power(np.linalg.det(sigma2), 0.5) / np.power(2*np.pi, d/2)
e = np.exp(-0.5*np.dot(np.dot((X - mu).T, np.linalg.pinv(sigma2)), ... | hongxin-y/EECS545-Homeworks | HW4/prob4.py | prob4.py | py | 2,363 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "numpy.power",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.det",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "numpy.pi",
"line_numb... |
20174214776 | #!/usr/bin/env python3
import datetime
import json
import logging
import pytz
import requests
import sys
from errors import SolarLogCommunicationError
from solarlog_reading import SolarLogReading
class SolarLogReader:
def __init__(self, ip, timezone, port=80):
self.logger = logging.getLogger(self.__clas... | logreposit/solarlog-reader-service | src/solarlog_reader.py | solarlog_reader.py | py | 3,553 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "logging.StreamHandler",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "sys.stdout... |
7837869318 | # 2023711994_전효림_데이터사이언스 컴퓨팅_중간고사 대체 과제
# 롤체지지 https://lolchess.gg/leaderboards?region=kr&mode=ranked
# 대상: 국가별 챌린저~그랜드마스터 순위, 플레이어id, 티어, 승률, 게임수, 이긴횟수, 순위 방어 횟수 등
import requests
from bs4 import BeautifulSoup
import pandas as pd
from selenium import webdriver
from datetime import datetime
import os
import... | jeonhyolim/Project | main_userchoice_webcrawler.py | main_userchoice_webcrawler.py | py | 7,231 | python | ko | code | 1 | github-code | 1 | [
{
"api_name": "pandas.DataFrame",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 105,
"usage_type": "call"
},
{
"api_name": "selenium.webdri... |
30523473116 | # A group of functions to do common data organization tasks
### Functions ###
# makeFilePath: Make a string for a file path indexed by today's date. If the path does not exist, create it
# saveData: Given an array of data and a list of variable names corresponding to columns in the array, save the data
# (an... | cphenicie/laserdaq_chris | dataShortcuts.py | dataShortcuts.py | py | 2,549 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "datetime.date.today",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.path",
"... |
70763205474 | from flask import Flask, jsonify, request, abort
import json
import os
app = Flask(__name__)
directory = "data"
with open(os.path.join(directory, 'productos.json'), 'r') as f:
productos = json.load(f)
with open(os.path.join(directory, 'carrito.json'), 'r') as f:
carritos_compra = json.load(f)
with ... | cano2030/Commerce-App | new.py | new.py | py | 9,747 | python | es | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 9,
... |
1835892975 | import vk
import json
import re
from django.conf import settings
from vk_data_grub.models import VkGroups, Events
token = settings.ACCESS_TOKEN
session = vk.Session(access_token={token})
api = vk.API(session, v='5.3', lang='ru', timeout=10)
api_5_103 = vk.API(session, v='5.53', lang='ru', timeout=10)
def _get_tour... | mike62polonskiy/vivaldi | src/utils/vk_events.py | vk_events.py | py | 4,106 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.conf.settings.ACCESS_TOKEN",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "vk.Session",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "... |
4981509036 | from __future__ import print_function
import torch.nn as nn
import torchvision.models as models
from torchvision.models.inception import inception_v3
from mylibs import ContentLoss, StyleLoss, TVLoss
from torchvision.models.feature_extraction import get_graph_node_names
from torchvision.models.feature_extraction import... | Xinyan1020/Image-Synthesis-CNN-MRF | model.py | model.py | py | 6,624 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.nn.Module",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "mylibs.TVLoss",
"line_number": 68,
"usage_type": "argument"
},
{
"api_name": "mylibs.ContentLoss",
... |
27794721154 | import os
from scipy.stats import pearsonr
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
cwd='staining of induced aggregates\\'
BIP=r'BIP/PFF/tif'
Congo=r'Congo/PFF/tif'
HSP=r'HSP60/PFF/tif'
pasyn=r'pasyn/PFF/tif'
#%% Loop through samples and find PCC scores
data={}
for sample in [BIP, Cong... | AlexanderSvan/PCC-colocalization-for-images | _analysisn_N_plotting.py | _analysisn_N_plotting.py | py | 2,095 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.listdir",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.imread",
"line... |
23395645622 | """visit_score
Revision ID: 5bab531b457a
Revises: e455d34da812
Create Date: 2022-05-22 20:03:01.685579
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '5bab531b457a'
down_revision = 'e455d34da812'
branch_labels = None
depends_on = None
def upgrade():
# ##... | Nikita-Filonov/visits_api | migrations/versions/5bab531b457a_visit_score.py | 5bab531b457a_visit_score.py | py | 661 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "alembic.op.add_column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Float",... |
157055733 | import cv2
# 导入人脸级联分类器引擎,'.xml'文件里包含训练出来的人脸特征,cv2.data.haarcascades即为存放所有级联分类器模型文件的目录
face = cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_frontalface_default.xml')
eye = cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_eye.xml')
smile=cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_s... | lijuncheng1993/FaceRecognition | 摄像头_人脸识别+人眼识别.py | 摄像头_人脸识别+人眼识别.py | py | 2,327 | python | zh | code | 0 | github-code | 1 | [
{
"api_name": "cv2.CascadeClassifier",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.data",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "cv2.CascadeClassifier",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.data",
... |
26666478666 | from __future__ import print_function
from mxnet import ndarray as nd
from mxnet import autograd
from mxnet import gluon
from utils import accuracy, evaluate_accuracy, sgd
import matplotlib.pyplot as plt
def transform(data, label):
return data.astype('float32') / 255, label.astype('float32')
mnist_train = gluon.d... | xcszbdnl/Toy | Gluon_Code/simple_mlp_2.py | simple_mlp_2.py | py | 2,491 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "mxnet.gluon.data.vision.FashionMNIST",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "mxnet.gluon.data",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "mxnet.gluon",
"line_number": 11,
"usage_type": "name"
},
{
"api_name":... |
44050740772 | from rest_framework import serializers
from .models import *
from django.contrib.auth import get_user_model, authenticate
class DynamicFieldsModelSerializer(serializers.ModelSerializer):
"""
A ModelSerializer that takes an additional `fields` argument that
controls which fields should be displayed.
""... | NTNU-IndEcol/db_project_indecol | backend/app_indecol/serializers.py | serializers.py | py | 3,755 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 25,
... |
39509436948 | from collections import deque
clock = deque([12, 3, 6, 9])
N = int(input())
N = (N//90)%4
for i in range(N):
clock.rotate(1)
while clock:
print(clock.popleft(), end=" ")
print(clock.pop(), end=" ") | choikeunyoung/algorithm | SWEA/D2/원형시계돌리기/원형시계돌리기.py | 원형시계돌리기.py | py | 214 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "collections.deque",
"line_number": 3,
"usage_type": "call"
}
] |
37212994808 | from tkinter import*
import sqlite3
from PIL import Image,ImageTk
from tkinter import messagebox
from course import CourseClass
from student import StudentClass
from exam import ExamClass
from st_exam import ScoreClass
from result import ResultClass
class RMS:
def __init__(self,root):
self.root=r... | asthavj/EQUINOX-The-Beginners | dashboard.py | dashboard.py | py | 4,743 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PIL.Image.open",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "PIL.Image.ANTIALIAS",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image",
"li... |
45018635051 | import cortexpy.__main__
from Bio import SeqIO
import os
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from benchmark.commands import CortexpyCommandBuilder, MccortexCommandBuilder
CHROM_GRAPH = 'fixtures/yeast/NC_001133.9.1kbp.ctx'
CHROM_GRAPH3 = 'fixtures/yeast/NC_001133.9.c3.1kbp.ctx'
CHROM_GRAPH_16... | winni2k/cortex_tools_benchmark | benchmark/test_unit/test_command/test_traverse/test_yeast_contig.py | test_yeast_contig.py | py | 1,713 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "benchmark.commands.CortexpyCommandBuilder",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "benchmark.commands",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cortexpy.__main__.__main__",
"line_number": 19,
"usage_type": "attribute"
... |
8718672060 | import os.path
from collections import defaultdict
import operator
from datetime import datetime
import matplotlib.pyplot as plt
import numpy as np
import math
import sys
sys.path.append('../')
from util import read_auxiliary_file, create_dir
ORG_TYPES = {
'mass_media': ['media', 'radio', 'newspaper', 'jyrnal', '... | irinfox/minor_langs_internet_analysis | domain_registration_stats.py | domain_registration_stats.py | py | 25,405 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.path.append",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "util.read_auxiliary_file",
"line_number": 93,
"usage_type": "call"
},
{
"api_name": "collections.de... |
813294676 | from torchvision import transforms
from PIL import Image
import numpy as np
import os
from .PreTrainingDataset import PreTrainingDataset
class TestPreTrainingDataset(PreTrainingDataset):
def __init__(self, dataset_root, train_size):
# super().__init__(dataset_root, train_size)
# self.joint_trans... | Robert-xiaoqiang/DS-Net | sodpackage/datasampler/TestPreTrainingDataset.py | TestPreTrainingDataset.py | py | 1,123 | python | en | code | 11 | github-code | 1 | [
{
"api_name": "PreTrainingDataset.PreTrainingDataset",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torchvis... |
12764354148 | #!/usr/bin/env python3
import sys, subprocess, gzip, os, shutil, zipfile
from os.path import join, relpath, abspath
inAppPath = sys.argv[1] # "air/myapp.air"
inTargetFile = sys.argv[2] # "localserver/app/testharness.tivoipkg"
tempDir = "tivo-package_temp"
if sys.platform == "win32":
# Windows-specific code
cmd_c... | muton/tivo_flash_packager | tivo-package.py | tivo-package.py | py | 3,276 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.argv",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "sys.platform",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "shutil.rmtree",
"line_... |
2020287014 | from flask import Flask
from firebase_admin import credentials, firestore, initialize_app
from dotenv import load_dotenv
import os
from mockfirestore import MockFirestore
from flask_cors import CORS
import json
load_dotenv()
initialize_app(credentials.Certificate(json.loads(os.environ.get('KEY'))))
db = firestore.clie... | DeeJMWilliams/nodwick-back-end | app/__init__.py | __init__.py | py | 904 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "firebase_admin.initialize_app",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "firebase_admin.credentials.Certificate",
"line_number": 10,
"usage_type": "call"
},
{... |
33805117197 | #%%
# imports
import time
from sklearn.datasets import load_sample_image
import faimg as fg
import numpy as np
import random
import matplotlib.pyplot as plt
#%%
# Tests for Image class:
china = load_sample_image("china.jpg")
imgProc = fg.ImageProcessor(china)
# %%
# Gini index
y = [1, 1, 1, 1, 2, 32, 3, 12, 312, 31... | SamuelJosse/FAIMG | faimgTest.py | faimgTest.py | py | 6,946 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sklearn.datasets.load_sample_image",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "faimg.ImageProcessor",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.bincount",
"line_number": 20,
"usage_type": "call"
},
{
"api_name":... |
38126542920 | import mediapipe as mp
import numpy as np
import cv2
from draw_landmarks import draw_landmarks_on_image
model_path = 'pose_landmarker_lite.task'
BaseOptions = mp.tasks.BaseOptions
PoseLandmarker = mp.tasks.vision.PoseLandmarker
PoseLandmarkerOptions = mp.tasks.vision.PoseLandmarkerOptions
PoseLandmarkerResult = mp.t... | napongps/Muay-Thai-pose-similarity | Detector_live_stream.py | Detector_live_stream.py | py | 2,056 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "mediapipe.tasks",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "mediapipe.tasks",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "mediapipe.tasks",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "mediapip... |
12422761713 | import time
import sys
INITIAL = {
'out1': 'G',
'out2': 'R',
'clock': 0,
'walk': False,
}
G1 = lambda s: (s['out1'] == 'G' and
s['out2'] == 'R' and
(
(s['clock'] < 30 and dict(s, clock=s['clock'] + 1, walk=False)) or
(s['clock'] =... | logston/raft | src/raft/light.py | light.py | py | 2,857 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "queue.Queue",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "sys.stdin.readline",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_numbe... |
20597475339 | #!/usr/bin/env python3
#
# Project homepage: https://github.com/mwoolweaver
# Licence: <http://unlicense.org/>
# Created by Michael Woolweaver <m.woolweaver@icloud.com>
# ================================================================================
from os import path
from sqlite3 import connect
from sqlite3 import... | mwoolweaver/listManager.py | lib/findGravity.py | findGravity.py | py | 2,737 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "lib.debug.args.dir",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "lib.debug.args",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "lib.debug.args.dir",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "lib.de... |
21929775849 | import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'proTwo.settings')
import django
django.setup()
import random
from appTwo.models import AccessRecord, Topic, Webpage
from faker import Faker
fakegen = Faker()
topics = ['Games', 'Books', 'News', 'Entertainment', 'Food', 'Health']
def add_topic():
t = Top... | RishiKumar158/my_django_stuff | proTwo/populate_access_records.py | populate_access_records.py | py | 884 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.environ.setdefault",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "django.setup",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "faker.Faker",
"li... |
75166301153 | import pickle
import time
from absl import app, flags
from utils.graphwave.graphwave import *
# flags
FLAGS = flags.FLAGS
flags.DEFINE_integer('emb_dim', 64, 'Embedding dimension.')
flags.DEFINE_integer('max_seq', 100, 'Max length of cascade sequence.')
flags.DEFINE_integer('num_s', 2, 'Number of s for sp... | Xovee/ccgl | src/gene_emb.py | gene_emb.py | py | 10,689 | python | en | code | 25 | github-code | 1 | [
{
"api_name": "absl.flags.FLAGS",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "absl.flags",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "absl.flags.DEFINE_integer",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "absl.flags",... |
14420237441 | import numpy as np
from matplotlib import pyplot as plt
import cv2
import glob
import math
from pathlib import Path
import argparse
def search_point(args):
# images_path = sorted(glob.glob(input_path+folder+"/*/l.jpg", recursive=True))
distance_table = []
with open(args.input_directory+'/'+args.folder+"/d... | WangQin0001/pointCloudProcessing | 3D-Model-Monocular-Vision-main/search_point_in_panorama.py | search_point_in_panorama.py | py | 5,355 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.array",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_nu... |
29275759751 | import execjs
def get_js():
f = open("./qd/index.js", 'r', encoding='UTF-8')
line = f.readline()
htmlstr = ''
while line:
htmlstr = htmlstr + line
line = f.readline()
return htmlstr
jsster = get_js()
ctx = execjs.compile(jsster)
print(ctx.call('enString','123456')) | jos-jos/recommendation | Intelligent recommendation system/indexjs.py | indexjs.py | py | 303 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "execjs.compile",
"line_number": 13,
"usage_type": "call"
}
] |
33490169208 | #!/usr/bin/env python
import sys
import os
import logging
import torch.optim as optim
# Assure that python can find the deeprank files:
deeprank_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, deeprank_root)
from deeprank.learn.NeuralNet import NeuralNet
from deeprank.learn.Dat... | DeepRank/DeepRank-Mut | scripts/learn.py | learn.py | py | 2,469 | python | en | code | 1 | github-code | 1 | [
{
"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.abspath",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.path.insert",
"l... |
39587452428 | import requests
import time
import json
from pprint import pprint
import spotipy
SPOTIFY_GET_CURRENT_TRACK_URL = 'https://api.spotify.com/v1/me/player/currently-playing'
ACCESS_TOKEN = 'BQBvhtfdCngkgmTBhWj4b7XHlJ3tu1I47EB8f-ofjTWVuWyWt_zAVHKzAFmkUrSFyF_0P2n09Wsh3UvnNfmuXmI8_233CqaKkdTmuTqI8OtWWnk3gPhrFMqgMDdonZcOkKT_... | kasthuridinesh/pythonprojects | spotify_api/spotify_api/spotify/main.py | main.py | py | 1,398 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pprint.pprint",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 51,
"usage_type": "call"
}
] |
39997879253 | #!/usr/bin/python3
"""
script that lists all State objects that contain the
letter a from the database hbtn_0e_6_usa
"""
from model_state import State, Base
from sqlalchemy import (create_engine)
from sqlalchemy.orm import sessionmaker
import sys
def state_a():
engine = create_engine('mysql+mysqldb://{}:{}@localh... | jerrynabango/alx-higher_level_programming | 0x0F-python-object_relational_mapping/9-model_state_filter_a.py | 9-model_state_filter_a.py | py | 682 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "model_state.Base.metadata.create_all",
"line_number": 16,
"usage_type": "call"
},
{
"api_n... |
35198335445 | from BaseRequest.BaseApi import BaseApi
from tools.get_time_schedule import get_schedule
class UpdateCampaign(BaseApi):
@staticmethod
async def post(session, form):
params = {
'title': form.title.data,
'budget': form.budget.data,
'promoteTime': get_schedule(form.pr... | szshysj/Digital_marketing_web | spider/BaseRequest/UpdateCampaign.py | UpdateCampaign.py | py | 880 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "BaseRequest.BaseApi.BaseApi",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "tools.get_time_schedule.get_schedule",
"line_number": 12,
"usage_type": "call"
}
] |
38038227705 | import cooler
import os.path as op
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import h5py
from toolz.curried import interleave, reduce, concat, concatv
from toolz.curried import unique
from toolz.curried import compose, compose_left, comp, complement
from toolz.curried import pipe, thread_fi... | zelhar/mg21 | hic/mymodule/hicCoolerModule.py | hicCoolerModule.py | py | 3,514 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.sum",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.log10",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot... |
6213442958 | from __future__ import absolute_import, unicode_literals, print_function
from ply import lex
from ..errors import ThriftParserError
__all__ = ['Lexer']
THRIFT_KEYWORDS = (
'namespace',
'include',
'void',
'bool',
'byte',
'i8',
'i16',
'i32',
'i64',
'double',
'string',
... | thriftrw/thriftrw-python | thriftrw/idl/lexer.py | lexer.py | py | 3,534 | python | en | code | 37 | github-code | 1 | [
{
"api_name": "errors.ThriftParserError",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "errors.ThriftParserError",
"line_number": 124,
"usage_type": "call"
},
{
"api_name": "ply.lex.lex",
"line_number": 146,
"usage_type": "call"
},
{
"api_name": "ply.l... |
30716286936 | from http import HTTPStatus
"""
Code in this module is based on https://auth0.com/docs/quickstart/backend/python#validate-access-tokens
and course material
"""
class AuthError(Exception):
"""
AuthError Exception
A standardized way to communicate auth failure modes
"""
def __init__(self, status_co... | ibuttimer/TeamPicker | src/team_picker/auth/exception/auth_error.py | auth_error.py | py | 632 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "http.HTTPStatus",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "http.HTTPStatus",
"line_number": 19,
"usage_type": "name"
}
] |
21143636979 | """
The assistant for brain of Sara.
Created on 19.01.2017
@author: Ruslan Dolovanyuk
"""
import logging
import os
import time
import configs
from extensions import birthday
from extensions import calendar
from extensions import events
from extensions import notes
from extensions import presser
from extensions im... | DollaR84/SARA | assist.py | assist.py | py | 4,193 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "configs.open_settings",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "extensions.birthday.if_exists",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": ... |
73033969953 | # -*- coding: utf-8 -*-
'''
Configuration of network interfaces
===================================
The network module is used to create and manage network settings,
interfaces can be set as either managed or ignored. By default
all interfaces are ignored unless specified.
.. note::
Prior to version 2014.1.0, on... | shineforever/ops | salt/salt/states/network.py | network.py | py | 13,736 | python | en | code | 9 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 190,
"usage_type": "call"
},
{
"api_name": "salt.utils.utils.is_windows",
"line_number": 198,
"usage_type": "call"
},
{
"api_name": "salt.utils.utils",
"line_number": 198,
"usage_type": "attribute"
},
{
"api_name":... |
9658391458 | import json
import mage
import tempfile
import time
import unittest
class TestAssessment(unittest.TestCase):
TEST_ASSET = "unittest.example.com"
@classmethod
def setUpClass(cls):
mage.connect()
def setUp(self):
self.a = mage.Assessment.create('EXTERNAL', name='UNITTEST')
self... | Stage2Sec/magepy | tests/assessment.py | assessment.py | py | 6,368 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "unittest.TestCase",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "mage.connect",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "mage.Assessment.create",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "mage.Assess... |
36976818187 | import pygame
import cv2
import os
import time
import opensimplex
import sys
strLocalPath = os.path.dirname(sys.modules[__name__].__file__)
if strLocalPath == "": strLocalPath = './'
sys.path.append(strLocalPath+"/../alex_pytools/")
import misctools
def bgr2rgb(col):
b = col[0]
col[0] = col[2]
col[2] = b
... | alexandre-mazel/electronoos | scripts/test_pygame.py | test_pygame.py | py | 7,088 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "os.path.dirname",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "sys.modules",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"lin... |
71103765473 | # coding: utf-8
import datetime as dt
today = dt.date.today()
day = today
while day.day != 13 or dt.datetime.isoweekday(day) != 5:
day += dt.timedelta(days=1)
print("Next friday the 13th will be ", day, " (", "in ", day - today, ")", sep="") | astro-kaba4ek/Python_5 | DZ1/4/friday_the_13th.py | friday_the_13th.py | py | 246 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "datetime.date.today",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.isoweekday",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "date... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.