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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5577271544 | """
Mininet: A simple networking testbed for OpenFlow/SDN!
author: Bob Lantz (rlantz@cs.stanford.edu)
author: Brandon Heller (brandonh@stanford.edu)
Mininet creates scalable OpenFlow test networks by using
process-based virtualization and network namespaces.
Simulated hosts are created as processes in separate ... | mininet/mininet | mininet/net.py | net.py | py | 40,074 | python | en | code | 4,978 | github-code | 21 | [
{
"api_name": "mininet.node.OVSKernelSwitch",
"line_number": 118,
"usage_type": "name"
},
{
"api_name": "mininet.node.Host",
"line_number": 118,
"usage_type": "name"
},
{
"api_name": "mininet.node.DefaultController",
"line_number": 119,
"usage_type": "name"
},
{
"... |
73400989174 | import torch
import numpy as np
from typing import List, Tuple
from torch import nn
class Linear(nn.Module):
r"""Applies a linear transformation to the incoming data: :math:`y = xA^T + b`
Args:
in_features: size of each input sample
out_features: size of each output sample
Shape:
- ... | BabaSanfour/MLP-ResNet18-MLPMixer-CIFAR10 | MLP-ResNet18-MLPMixer-CIFAR10/mlp.py | mlp.py | py | 4,246 | python | en | code | 1 | github-code | 21 | [
{
"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.Parameter",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_n... |
9772267366 | from django.db.models.signals import post_save, post_delete
from django.dispatch import receiver
from .models import OrderLineItem
@receiver(post_save, sender=OrderLineItem)
def update_on_save(sender, instance, created, **kwargs):
# sender or the sinal | instance or the module and | bool sent by django=instance ... | joseenciso/Backpocket | checkout/signals.py | signals.py | py | 753 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.dispatch.receiver",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.db.models.signals.post_save",
"line_number": 7,
"usage_type": "argument"
},
{
"api_name": "models.OrderLineItem",
"line_number": 7,
"usage_type": "name"
},
{
... |
3838076344 | import click
from config import DEFAULT_OUTPUT_DIR
from utils import get_dataframe_from_file_list
@click.command('diff')
@click.option('-r', '--reports', nargs=2, type=str, help='Two file paths to simulation report files')
@click.option('-o', '--output-dir', default=DEFAULT_OUTPUT_DIR, type=click.Path(exists=True), ... | teschmitt/onetwo-reporting | commands/diff.py | diff.py | py | 788 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "utils.get_dataframe_from_file_list",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "click.echo",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "click.command",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "click.opti... |
37458831432 | import abc
import dataclasses
from pathlib import Path
from typing import Generator, List
from webapp.models.chapter import Chapter
from webapp.models.manga import Manga
from webapp.models.site import Site
from webapp.services.async_service import AsyncService
from .download_service import DownloadService
import h... | taiharry108/ac-server | webapp/services/abstract_manga_site_scraping_service.py | abstract_manga_site_scraping_service.py | py | 2,026 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "abc.ABCMeta",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "download_service.DownloadService",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "webapp.services.async_service.AsyncService",
"line_number": 20,
"usage_type": "name"
... |
4988282682 | import torch.nn as nn
import torch
import torchvision.models as models
class CNNModel(nn.Module):
def __init__(self):
super(CNNModel, self).__init__()
# #load alexnet
# alexn = models.alexnet(pretrained=True)
# alexn = torch.load()
# # remove last fully-connected layer
... | liuxindazz/JANN | models/lift_model.py | lift_model.py | py | 1,611 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "torch.nn.Module",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torchvision.models.__dict__",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "torchvis... |
1139341910 | from collections import defaultdict
class Vertex:
def __init__(self, val):
self.color = 0
self.value = val
def colorin(G):
for u in G.values():
for i in u:
i.color = 0
def DFS(G, u):
u.color = 1
for v in G[u.value]:
if v.color == 0:
if DFS(G, v)... | programophile/CSE-221-BRACU-Summer-23- | Lab 4/TASK 4/Task 4.py | Task 4.py | py | 891 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.defaultdict",
"line_number": 28,
"usage_type": "call"
}
] |
24265215423 | import cv2
import numpy as np
url = 'http://192.168.1.81:8080/video'
path = r'C:\Users\MASSON\Desktop\Palm\img'
cap = cv2.VideoCapture(url)
i=0
while(True):
ret, frame = cap.read()
if frame is not None:
cv2.imshow('frame',frame)
q = cv2.waitKey(1)
if q == ord("q"):
break
... | RalphMasson/CamAndroid | Cam.py | Cam.py | py | 437 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.imwrite",
"line_number... |
10602404050 |
from __future__ import annotations
import os
import re
import PIL
from mdutils.tools.Header import Header
from mdutils.tools.Image import Image
IMAGE_FOLDER = 'images'
OVERLAP_ERR = 5.0
class Line():
def __init__(self, line:dict) -> None:
self.rect_ = line['rect']
self.text_ = line['text'].strip('\n... | lxulxu/pdf-to-markdown | pdf2md/block.py | block.py | py | 3,595 | python | en | code | 13 | github-code | 21 | [
{
"api_name": "os.path.join",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 67,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
24679184733 |
# coding: utf-8
from nltk.corpus import stopwords
def removeStopWords(originSegs):
stopWords = set(stopwords.words('english'))
punctuationList = [',','\t',';','/','*','-','_','[',']','&','(',')','+','$','{', '%','}',':','#','"', '=','<','>']
#'.','!','?'分句
resultStr = ""
for seg in or... | FENG-Yinglan/D2P | split_stopwords.py | split_stopwords.py | py | 1,657 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "warnings.filterwarnings",
"line_number": 22,
"usage_type": "call"
},
{
"api_name"... |
27308837267 | from marshmallow import ValidationError
from main import app
from main.engines.category import *
from main.libs.authenticate import *
from main.schemas.category import *
@app.route("/categories", methods=["POST"])
@token_required
def create_category_controller(current_user):
"""
Create a category
"""
... | vuthuytrang93/backend_project | main/controllers/category.py | category.py | py | 2,587 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "marshmallow.ValidationError",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "main.app.route",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "main.app",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "marshmallow.Validat... |
23918955841 | import asyncore
import socket, time
from data_store import DkvDataStore
import dkv_config
from dkv_functions import dkv_debug
DATA_STORE = None
class DkvNetHandler(asyncore.dispatcher):
def create_buffers(self):
if not 'inbuffer' in self.__dict__:
self.inbuffer = ''
if not 'outbuffer' in self.__dict__:
self... | hpolloni/dikeva | server/server.py | server.py | py | 2,190 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "asyncore.dispatcher",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "dkv_functions.dkv_debug",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "dkv_functions.dkv_debug",
"line_number": 46,
"usage_type": "call"
},
{
"api_name"... |
29400656762 | from glob import glob
import xmltodict
import json
from tqdm import tqdm
import numpy as np
from src.eval import category_id, blank_annotations
gt_annotations = blank_annotations.copy()
gt_id = 0
for i, p in tqdm(enumerate(sorted(glob('../dataset/Mask Dataset/annotations/*.xml')))):
with open(p, 'r') as f:
... | YuliaYur/mask-detection | src/eval/save_annotation/save_kaggle_mask_annotation.py | save_kaggle_mask_annotation.py | py | 1,514 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "src.eval.blank_annotations.copy",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "src.eval.blank_annotations",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "tqdm.tqdm",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "... |
39682449911 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
from flask import Flask, request, jsonify, render_template
from keras.models import load_model
from flask.json import JSONEncoder
import keras
import numpy as np
from PIL import Image
from tensorflow.keras.applications.inception_v3 import preprocess_input
from tensorflo... | gmksf99/Tag-Me | TAG_ME/debug.py | debug.py | py | 2,435 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "keras.models.load_model",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "flask.render_temp... |
19475710601 | import argparse
import datetime
import logging
import time
import requests
import socket
import sys
from dateutil.parser import parse
from dateutil.tz import *
#logging.basicConfig(level=logging.DEBUG)
class ROTCTLD(object):
""" rotctld (hamlib) communication class """
# Note: This is a massive hack.
d... | darksidelemm/satnogs-unwinder | unwind.py | unwind.py | py | 11,542 | python | en | code | 13 | github-code | 21 | [
{
"api_name": "socket.socket",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_STREAM",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "time.time",... |
9898065304 | import DQN
import torch
from torch.utils.tensorboard import SummaryWriter
vic=[]
scores=[]
render=False
save=False
agent=DQN.Pw_Agent(gamma=0.93,epsilon=1.0)
tb = SummaryWriter(comment=agent.get_hyperparams())
print(agent.get_hyperparams())
print()
for i in range(400):
if i%50==0 :
render=False
else:
... | RpDp-git/LearningToSwim-DQN | learn.py | learn.py | py | 845 | python | en | code | 5 | github-code | 21 | [
{
"api_name": "DQN.Pw_Agent",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.utils.tensorboard.SummaryWriter",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torch.save",
"line_number": 19,
"usage_type": "call"
}
] |
72515492213 | """Get contour from ROI."""
import numpy as np
import caffe
import scipy
from skimage import transform
import pickle
proto = 'decon_deploy.prototxt'
model = 'model_logs/decon_iter_15000.caffemodel'
caffe.set_mode_gpu()
net = caffe.Net(proto, model, caffe.TEST)
kaggle_cdf = pickle.load(open('kaggle_cdf.pkl', 'rb'))
s... | denisyarats/kaggle_ds2 | ofir_seg/eval_contour.py | eval_contour.py | py | 962 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "caffe.set_mode_gpu",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "caffe.Net",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "caffe.TEST",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pickle.load",
"line_... |
37065911207 | import time
beginning_time = time.time()
import sys
import os
sys.path.insert(1, os.path.join(sys.path[0], '..'))
sys.path.insert(1, os.path.join(sys.path[0], '../gaggle'))
from pyGAD import pygad
from TorchGA import torchga
import torch
import pickle
import numpy as np
import argparse
import gym
from models import DQN... | LucasFenaux/gaggle-benchmarking | cartpole/pygad.py | pygad.py | py | 5,145 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "time.time",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path.insert",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number"... |
3747791698 | import numpy as np
import torch
from torch import nn
from torch import Tensor
from fastai.vision.learner import _load_pretrained_weights, _get_first_layer
class ResBlock3d(nn.Module):
"""
Based on
https://towardsdev.com/implement-resnet-with-pytorch-a9fb40a77448
https://github.com/pytorch/vis... | rbturnbull/cov3d | cov3d/models.py | models.py | py | 7,822 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "torch.nn.Module",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv3d",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numb... |
4213565289 | import argparse
import time
import os
from collections import defaultdict
from mmnrm.dataset import TrainCollectionV2, sentence_splitter_builderV2
from mmnrm.utils import set_random_seed, load_model_config, load_neural_model
from mmnrm.modelsv2 import shallow_interaction_model
import numpy as np
import tensorflow... | bioinformatics-ua/EACL2021-reproducibility | our-model-train-test.py | our-model-train-test.py | py | 3,743 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "mmnrm.callbacks.Callback",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "numpy.mean",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.std",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.median",
"lin... |
39694431165 | from django.shortcuts import render, redirect
from datetime import datetime
from .models import AccountBook
# Create your views here.
def index(request):
accountbooks = AccountBook.objects.all()
context = {
'accountbooks': accountbooks,
}
return render(request, 'accountbooks/index.html', c... | komanduk/django | django_ptj/accountbooks/views.py | views.py | py | 2,230 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "models.AccountBook.objects.all",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "models.AccountBook.objects",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "models.AccountBook",
"line_number": 7,
"usage_type": "name"
},
{
"ap... |
16373847473 | # -*- coding: utf-8 -*-
from jinja2 import Environment, PackageLoader, select_autoescape
class HtmlRender:
def __init__(self):
self.env = Environment(loader=PackageLoader('html_render', 'pages'), autoescape=select_autoescape(['html']))
page = self.env.get_template('resposta.html')
out = p... | KleyLima/html_render | source/html_render.py | html_render.py | py | 436 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "jinja2.Environment",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "jinja2.PackageLoader",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "jinja2.select_autoescape",
"line_number": 7,
"usage_type": "call"
}
] |
40387657704 | # -*- coding: utf-8 -*-
# ***********************************************************************
# ****************** CANADIAN ASTRONOMY DATA CENTRE *******************
# ************* CENTRE CANADIEN DE DONNÉES ASTRONOMIQUES **************
#
# (c) 2022. (c) 2022.
# Government of Canad... | opencadc/brite2caom2 | brite2caom2/tests/test_preview_augmentation.py | test_preview_augmentation.py | py | 5,957 | python | fr | code | 0 | github-code | 21 | [
{
"api_name": "glob.glob",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "test_main_app.TEST_DATA_DIR",
"line_number": 83,
"usage_type": "attribute"
},
{
"api_name": "os.path.basename",
"line_number": 89,
"usage_type": "call"
},
{
"api_name": "test_main... |
29366289153 | from django.template import loader
from apps.goods.models import GoodsChannel
from apps.contents.models import ContentCategory, Content
from django.conf import settings
import os
def get_categories():
"""
商品分类
:return:
"""
categories = {} # # 商品分类频道
# 按照组id排序,再按照sequence排序
channels = Good... | jackyyd/easy_buy | meiduo_mall_project/apps/contents/crons.py | crons.py | py | 3,052 | python | zh | code | 0 | github-code | 21 | [
{
"api_name": "apps.goods.models.GoodsChannel.objects.order_by",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "apps.goods.models.GoodsChannel.objects",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "apps.goods.models.GoodsChannel",
"line_number": 1... |
6116315181 | import re
import requests
import sqlite3
import pandas as pd
from utilities.getting_soup_from_web import BSoup
def fill_db(bus_line, one_way_or_return, bus_line_stopsDF):
'''FILL CONSORCIOGR.DB WITH ITINERARY FOR EACH BUS LINE'''
db_name = '..\datos\ConsorcioGR.db'
table_name = 'itinerary_{0}_{1}_CTMGR'.... | VictorGeaGarcia/consorcioTransportesGranada | scripts/3.Crawl_linea_a_linea_ITINERARIOS_CTMGR .py | 3.Crawl_linea_a_linea_ITINERARIOS_CTMGR .py | py | 2,645 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sqlite3.connect",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_numb... |
42634649763 | from rest_framework import generics, permissions
from rest_framework.pagination import PageNumberPagination
from rest_framework.response import Response
from rest_framework.views import APIView
from ...models import Artist
from ...serializers import ArtistSerializer
# __all__ = (
# 'ArtistListView',
# )
class A... | smallbee3/Melon-API | app/artist/apis/artist/list.py | list.py | py | 2,558 | python | ko | code | 0 | github-code | 21 | [
{
"api_name": "rest_framework.views.APIView",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "models.Artist.objects.all",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "models.Artist.objects",
"line_number": 39,
"usage_type": "attribute"
},
{
... |
36331336760 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import datetime
import os
import shutil
import signal
import time
import cv2
import numpy as np
import image_store
import mxnet as mx
from classifier import (get_registered_classifier, load_classifier,
load_classifiers)
from logger... | xytysingle/AnnotationTool | python-script/UseClassificationModel/class_images_classify.py | class_images_classify.py | py | 8,095 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.environ",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "os.chdir",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_... |
42725735857 | #!/usr/bin/env python3
import pika
import sys
import os
def sys_args():
msd = (sys.argv[1])
msg = (sys.argv[2])
frm = (sys.argv[3])
typ = (sys.argv[4])
return msd, msg, frm, typ
def main():
msd, msg, frm, typ = sys_args()
bdy = '{"msisdn":%s, "msg":"%s", "frm":%s, "msg_type":%s}' % (msd,... | msaiko239/MSM3500-LTE | agi/send.py | send.py | py | 641 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "sys.argv",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": ... |
18384130121 | from rich.progress import Progress, TextColumn, BarColumn, TimeRemainingColumn
from mrmustard import settings
# pylint: disable=disallowed-name
class ProgressBar:
"A spiffy loading bar to display the progress during an optimization."
def __init__(self, max_steps: int):
self.taskID = None
if m... | XanaduAI/MrMustard | mrmustard/training/progress_bar.py | progress_bar.py | py | 1,579 | python | en | code | 69 | github-code | 21 | [
{
"api_name": "rich.progress.Progress",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "rich.progress.TextColumn",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "rich.progress.BarColumn",
"line_number": 14,
"usage_type": "call"
},
{
"api_name"... |
29649928304 | # 이동평균선: 기술적 분석지표의 한 종류로 일정 기간 동안의 주가를 산술 평균한 값인 주가이동평균을 차례로 연결해 만든 선
import pandas as pd
import matplotlib.pyplot as plt
import pandas_datareader.data as web
gs = web.DataReader("078930.KS", "yahoo", "2014-01-01", "2016-03-06")
#print(gs.tail())
# 거래량이 없는 날짜 제외
new_gs = gs[gs['Volume'] != 0]
# 수정 종가에 대해 5일, 20일, 60... | minhyeonlee/algorithmic-trading | pandas_practice/MovingAverageLine.py | MovingAverageLine.py | py | 1,363 | python | ko | code | 0 | github-code | 21 | [
{
"api_name": "pandas_datareader.data.DataReader",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas_datareader.data",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 26,
"usage_type": "call"
},
{
"api... |
33899302303 | from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from ..models.detailed_shipping_time_type_availability_type import DetailedShippingTimeTypeAvailabilityType
from ..types import UNSET, Unset
T = TypeVar("T", bound="DetailedShippingTimeType")
@attr.s(auto_attribs=True)
class DetailedShippingTimeT... | milyord/sp-api | sp/product_pricing_v0/models/detailed_shipping_time_type.py | detailed_shipping_time_type.py | py | 3,893 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "typing.TypeVar",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "typing.Union",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "types.Unset",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "types.UNSET",
"line_number... |
25392640060 | import argparse
import json
from pathlib import Path
from pprint import pprint
import random
import sys
import torch
import yaml
from torch.utils.data import DataLoader
from base.trainers import DL_sample
from base.model import MyDataParallel
from lstm import GBVSSLSTMModel, GBVSSLSTMTrainer, GBVPPEvaluator, make_datas... | ryoma-k/GBVPP_Public | src/main.py | main.py | py | 4,676 | python | en | code | 8 | github-code | 21 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "yaml.load",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "yaml.SafeLoader",
... |
74365435254 | import pandas as pd
from typing import Dict, List
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.chrome.options import Options
from selenium.commo... | lorenzocesconetto/supermarket-scraper | scripts/dalben.py | dalben.py | py | 5,771 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "selenium.webdriver.chrome.options.Options",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 18,
"usage_type": "name"
},
{... |
2700903057 | #!/usr/bin/env python
#
# Author: Qiming Sun <osirpt.sun@gmail.com>
#
'''
Non-relativistic Unrestricted Kohn-Sham
'''
import time
import numpy
from pyscf.lib import logger
import pyscf.scf
from pyscf.dft import gen_grid
from pyscf.dft import numint
from pyscf.dft import rks
def get_veff(ks, mol=None, dm=None, dm_la... | sunchong137/pyscf_2017 | dft/uks.py | uks.py | py | 4,333 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "time.clock",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pyscf.lib.logger.timer",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pyscf.lib.logger",
"l... |
25164659965 | import torchvision.transforms as transforms
import torch.nn as nn
import torch
import torch.optim as optim
from torch.utils.data import DataLoader
import matplotlib.pyplot as plt
import numpy as np
import csv
import os
import argparse
import models
from data_prepare import medical_dataset
from utils import save_model... | ChengLiangYeh/dlcv_final | codes-twostage/run_predict.py | run_predict.py | py | 4,503 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torch.ones",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "torch.zeros",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "torch.no_grad",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "torch.nn.Sigmoid",
"line_num... |
24472861903 | import stripe
import os
from db import db
CURRENCY = "usd"
class ItemsInOrder(db.Model):
__tablename__ = "items_in_order"
id = db.Column(db.Integer, primary_key=True)
item_id = db.Column(db.Integer, db.ForeignKey("items.id"))
order_id = db.Column(db.Integer, db.ForeignKey("orders.id"))
quantity ... | MDRCS/advanced-flask-features | models/order.py | order.py | py | 2,126 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "db.db.Model",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "db.db",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "db.db.Column",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "db.db",
"line_number": 11,
... |
4232508177 | import logging, json, traceback, asyncio
from tornado import web
def assign_objects(isetools_obj):
global ise_obj
ise_obj = isetools_obj
class Test(web.RequestHandler):
async def get(self):
try:
ise_obj.test_ise_version()
self.write({'result': "OK"})
except:
... | danialre/ise_ipsk | isehandlers.py | isehandlers.py | py | 2,850 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "tornado.web.RequestHandler",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "tornado.web",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "tornado.web.RequestHandler",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_nam... |
15231563276 | #!/usr/bin/env python
# encoding: utf-8
'''
@author: Vothin
@software: 自动化测试
@file: start_appiumServer.py
@time: 2019/10/29 11:57
@desc:
'''
# ********************************************************
import subprocess, os
from time import ctime
from yzmbwf.base.globalpath import appium_log_path
fr... | vothin/code | yzmbwf/base/start_appiumServer.py | start_appiumServer.py | py | 2,426 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "psutil.pids",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "psutil.Process",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 4... |
73519895731 | # This is a sample Python script.
# Press ⇧F10 to execute it or replace it with your code.
# Press Double ⇧ to search everywhere for classes, files, tool windows, actions, and settings.
import logging
import fire
from cataloger_python_engine.lazy_coders.lazy_mongoose import LazyMongoose
from cataloger_python_engine.... | Squallium/cataloger-python-engine | main.py | main.py | py | 759 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "cataloger_python_engine.lazy_coders.lazy_mongoose.LazyMongoose",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cataloger_python_engine.utils.file_formats.FileFormats",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"... |
74678217331 | import numpy as np
import matplotlib.pyplot as plt
import time
class GaussSeidelMethod:
LENGTH = 1.0 # System length
LOGN = 7
N = 1 << LOGN
DX = LENGTH / N
EPS = 1e-5
MAX_ITERATION = 100000
def __init__(self):
self.phi = np.zeros(self.N + 1)
self.rho = np.zeros(self.N + 1... | tenajima/Poisson1D | multigrid.py | multigrid.py | py | 5,344 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.zeros",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.abs",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.zeros_like",
"line_number... |
13599362562 | import urllib
import requests
from appsignal.config import Config
class PushApiKeyValidator:
@staticmethod
def validate(config: Config) -> str:
endpoint = config.option("endpoint")
params = urllib.parse.urlencode(
{
"api_key": config.option("push_api_key"),
... | appsignal/appsignal-python | src/appsignal/push_api_key_validator.py | push_api_key_validator.py | py | 1,022 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "appsignal.config.Config",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "urllib.parse.urlencode",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "urllib.parse",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "requ... |
23047363569 | from django.test import TestCase
import datetime
from django.utils import timezone
from django.test import TestCase
from .models import Question
# Create your tests here.
class Player(object):
pass
class SparringRoom(object):
def enter(self, player):
if player.rope:
return {'mess... | chrisortman/mileage-tracker | polls/tests.py | tests.py | py | 1,304 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.test.TestCase",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "django.utils.timezone.now",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "django.utils.timezone",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "... |
14078064280 | from datetime import datetime
from socket import socket, AF_INET, SOCK_STREAM
from _thread import *
import os
host = 'localhost'
porta = 80
def servidor(socket_client):
while True:
data = socket_client.recv(2048)
if not data:
break
data_decodif = data.decode()
lista_req... | riqueCIN/network-project | proj_tcp/servidor.py | servidor.py | py | 5,971 | python | pt | code | 1 | github-code | 21 | [
{
"api_name": "os.path.isdir",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 71,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "os.path.getsize",
"line_num... |
38501443155 | from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.views import RedirectURLMixin
from sdc_core.sdc_extentions.views import SDCView
from sdc_core.sdc_extentions.response import send_redirect, send_error
from django.shortcuts import render
from django.contrib.auth.forms import Authentic... | StarmanMartin/SimpleDomControl | sdc_user/sdc_views.py | sdc_views.py | py | 2,140 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sdc_core.sdc_extentions.views.SDCView",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.views.RedirectURLMixin",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.forms.AuthenticationForm",
"line_number"... |
19038601738 | ########################################################################
# Name:
# Matplotlib_contour2D
#-----------------------------------------------------------------------
# Description:
# Single contour plot for the specific data at the given time.
###########################################################... | sharp1987/PlotTools | Matplotlib_contour2D.py | Matplotlib_contour2D.py | py | 3,254 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.array",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 57,
"usage_type": "attribute"
},
{
"api_name": "numpy.linspace",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figur... |
16144471179 | import requests
from bs4 import BeautifulSoup
import os
import sys
url = sys.argv[1] # 获取命令行参数
response = requests.get(url)
soup = BeautifulSoup(response.text, "html.parser")
image_urls = soup.find_all("img")
os.mkdir("images")
for image in image_urls:
src = image["src"]
image_response = req... | sofunc/pytool | imageSpider.py | imageSpider.py | py | 479 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.argv",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.mkdir",
"line_number... |
42586541630 | """
Dellea-Sadwin Senior Project: THE SCRAPER v.1
1. Download matches page while "logged in" as user of choice (BETA: ONLY SADWIN)
2. Parse matches for usernames, appending to list while checking for repeats
3. Repeat steps 1 & 2 as desired.
4. For each username, download profile (still "logged in"!)
5. Parse profiles ... | bethdellea/TheDatingLang | scraping/scraper.py | scraper.py | py | 4,501 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "requests.utils.dict_from_cookiejar",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "requests.utils",
"line_number": 51,
"usage_type": "attribute"
},
{
"api_name": "r... |
5236768745 | """
Django settings for web_django project on Heroku. For more info, see:
https://github.com/heroku/heroku-django-template
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/setti... | d33kayyy/web_django | web_django/settings.py | settings.py | py | 8,451 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.path.dirname",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"l... |
13645458489 | import os
import numpy as np
import subprocess
from glob import glob
from astropy.table import Table
from dlnpyutils import utils as dln
#index = Table.read('kurucz_index.fits')
#data = dln.unpickle('kurucz_data.pkl')
def read_kurucz_grid(teff,logg,metal,mtype='odfnew'):
""" Read a Kurucz model from the large gri... | dnidever/roland | python/roland/kuruczgrid.py | kuruczgrid.py | py | 6,911 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "numpy.zeros",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "numpy.float64",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "numpy.float64",
"line_... |
22546835269 | #!/usr/bin/env python3
import argparse
import datetime
import glob
import json
import os.path
import pathlib
import re
import sqlite3
import subprocess
import sys
import zipfile
# Paths to various files
approot = os.path.expanduser("~/Library/Group Containers/9K33E3U3T4.net.shinyfrog.bear")
dbpath = os.path.join(appro... | mivok/bear_backup | bear_backup.py | bear_backup.py | py | 7,248 | python | en | code | 38 | github-code | 21 | [
{
"api_name": "os.path.path.expanduser",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "os.path.path.join",... |
29562411840 | import cv2
import os
import torch
import pickle
import numpy as np
from loguru import logger
import albumentations as A
from torch.utils.data import Dataset
from torchvision.transforms import Normalize
from skimage.transform import resize
from ..core import constants, config
from ..core.constants import NUM_JOINTS_SMPL... | pixelite1201/BEDLAM | train/dataset/dataset_smpl.py | dataset_smpl.py | py | 11,737 | python | en | code | 164 | github-code | 21 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "core.config.DATASET_FOLDERS",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.Normalize",
"line_number": 26,
"usage_type": "call"
},
{
... |
16643643804 | import unittest
import shutil
import SimpleITK as sitk
import numpy as np
from typing import Union, Sequence
from mnts.scripts.dicom2nii import *
from mnts.scripts.normalization import *
from mnts.filters import MNTSFilterGraph
from mnts.filters.intensity import *
from mnts.filters.geom import *
from mnts.mnts_logger ... | alabamagan/mri_normalization_tools | unit_test/test_script.py | test_script.py | py | 4,966 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "mnts.filters.MNTSFilterGraph",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "mnts.filters.MNTSFilterGraph",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.Sequence",
"line_number": 26,
"usage_type": "name"
},
{
"api_nam... |
73031295413 | """This module is intended to be imported directly by blender.
It provides utility functions for adding meshes and saving them to communicate with the rest of pycortex
"""
import struct
import xdrlib
import tempfile
import bpy.ops
from bpy import context as C
from bpy import data as D
def _repack(linear, n=3):
""... | LiuFang816/SALSTM_py_data | python/gallantlab_pycortex/pycortex-master/cortex/blender/blendlib.py | blendlib.py | py | 6,166 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "bpy.ops.ops.object.select_all",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "bpy.ops.ops",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "bpy.ops",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "bpy.ops.ops.ob... |
23853570010 | import pytest
import numpy as np
import syft as sy
from syft import dependency_check
if dependency_check.tfe_available: # pragma: no cover
import tensorflow as tf
import tf_encrypted as tfe
@pytest.mark.skipif(not dependency_check.tfe_available, reason="tf_encrypted not installed")
def test_instantiate_tfe... | SanaAwan5/transfer_learning_on_mnist_spdz | test/keras/test_sequential.py | test_sequential.py | py | 3,640 | python | en | code | 6 | github-code | 21 | [
{
"api_name": "syft.dependency_check.tfe_available",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "syft.dependency_check",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "syft.KerasHook",
"line_number": 19,
"usage_type": "call"
},
{
"api_n... |
11657707106 | import config
import json
import os
import errno
from typing import Dict
def read_mastermac() -> str:
with open(config.MASTERMAC_FILE, 'rb') as file:
key = file.read()
return key
def write_mastermac(key: str) -> None:
with open(config.MASTERMAC_FILE, 'wb') as file:
file.write(key.encode(... | EduardoSaverin/password-manager | filesystem.py | filesystem.py | py | 1,755 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "config.MASTERMAC_FILE",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "config.MASTERMAC_FILE",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "config.SALT_FILE",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_na... |
74099056694 | import inspect
from collections import defaultdict
from r8music.music.models import ReleaseType
def query_and_collect(query, limits):
"""Collect reponses by querying a paginated resource.
`query` is a function which takes limit and offset parameters and returns
a list of responses. `limits` is the l... | Fedjmike/r8music | r8music/importation/utils.py | utils.py | py | 3,376 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "r8music.music.models.ReleaseType.ALBUM",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "r8music.music.models.ReleaseType",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "r8music.music.models.ReleaseType.SINGLE",
"line_number": 32,
... |
16988975155 | from pathlib import Path
import os
import shutil
print("Recipe Book 0.1")
exit_program = False
recipe_counter = 0
base = Path.home()
directory_path = Path(base, 'Desktop/Python/Day_6/Recipes')
print(f"Welcome! The recipes are located in {directory_path} ")
def exit_recipe_manager():
print("Farewell!")... | skitnoise/Cooking-book | Recipe_book.py | Recipe_book.py | py | 5,850 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pathlib.Path.home",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_numbe... |
18959357031 | import urllib
from rest_framework.response import Response
from rest_framework import viewsets, generics, status
from rest_framework.decorators import api_view, permission_classes
from django.http import JsonResponse
import requests
from django.contrib.auth.decorators import permission_required
from django.http import ... | benspelledabc/djangosite | imrunicorn/content_collection/views.py | views.py | py | 16,870 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "imrunicorn.functions.step_hit_count_by_page",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "content_collection.functions.get_all_buzz_words_or_phrases",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number":... |
73101246772 | from mxnet import nd
from mxnet.autograd import Function
import math
__all__ = ['GraphConvFn', 'EfficientGraphConvFn', 'SegmentSumFn',
'squeeze', 'unsqueeze', 'logsumexp', 'kl_divergence', 'get_activation', 'log_prob']
class GraphConvFn(Function):
def __init__(self, A):
self.A = A # type: nd.... | kevinid/molecule_generator | mx_mg/models/functions.py | functions.py | py | 5,218 | python | en | code | 131 | github-code | 21 | [
{
"api_name": "mxnet.autograd.Function",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "mxnet.nd.sparse.dot",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "mxnet.nd.sparse",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "mxnet... |
30614309270 | import sys
import ast
import ipaddress
def get_network(interface):
return ipaddress.ip_interface(interface).network
def build_network(d):
networks = {}
for host in d:
for interface in d[host]:
network = get_network(interface)
if network in networks:
netw... | lianemeth/codeeval | routing_problem.py | routing_problem.py | py | 646 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "ipaddress.ip_interface",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "ast.literal_eval",
"line_number": 21,
"usage_type": "call"
}
] |
5745372251 | from rest_framework import status
from rest_framework.response import Response
from rest_framework.views import APIView
from articles.models import Article
from articles.serializers import ArticleSerializer
# from rest_framework.decorators import api_view
# Create your views here.
class ArticleList(AP... | didjsrne/drf_morning_test | articles/views.py | views.py | py | 1,529 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "rest_framework.views.APIView",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "articles.models",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "articles.models.Article.objects.all",
"line_number": 16,
"usage_type": "call"
},
{
"... |
41784405145 | """Script to evaluate the model selection results, i.e. how well do models trained
on synthetic data match the models selected on real data?"""
from typing import Dict, List
import numpy as np
import pandas as pd
import plotnine as pn
from scipy.stats import spearmanr
from application.constants import RESULTS_DIR
fr... | HLasse/data-centric-synthetic-data | src/data_centric_synth/evaluation/model_selection.py | model_selection.py | py | 8,303 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "typing.List",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "data_centric_synth.experiments.models.IMPLEMENTED_DATA_CENTRIC_METHODS",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "data_centric_synth.experiments.models.get_default_synthetic_mo... |
10237806920 | import os
import hashlib
import uuid
import time
from copy import deepcopy
from functools import partial
from datetime import datetime, timedelta
from dateutil.relativedelta import relativedelta
from django.db import models
from django.db.models.query_utils import Q
from django.template import Context, Template
from d... | musasesay/membershiptemplet | tendenci/apps/memberships/models.py | models.py | py | 97,919 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "django.utils.translation.ugettext_lazy",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "django.utils.translation.ugettext_lazy",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "django.utils.translation.ugettext_lazy",
"line_number": 57,
... |
6493838021 | #Игровой центр
from tkinter import *
import string
import secrets
from tkinter import messagebox
import keyboard
import random
def abd():
root.destroy()
print('Вы успешно выйшли!')
def check():
l=login.get()
p=pasword.get()
if l and p:
global to
messagebox.showinfo... | Vjacheslav250/Project__Python-game | project.py | project.py | py | 22,863 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "tkinter.messagebox.showinfo",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "tkinter.messagebox",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "tkinter.messagebox.showerror",
"line_number": 34,
"usage_type": "call"
},
{
"api_n... |
33126344335 | from typing import Optional
import logging
from sqlalchemy.orm import Session
from weedly.db.models import Article, Channel, Feed, User
from weedly.db.session import db_session
from weedly.services.youtube import YoutubService
from weedly.errors import AlreadyExistsError, NotFoundError
class UserRepo:
def __in... | kbondar17/pocket-rss | rss-backend/weedly/repos/users.py | users.py | py | 6,951 | python | en | code | 6 | github-code | 21 | [
{
"api_name": "sqlalchemy.orm.Session",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "weedly.db.models.User",
"line_number": 18,
"usage_type": "argument"
},
{
"api_name": "weed... |
37391099925 | import os
import pandas as pd
from sqlalchemy import Table, Column, Integer, String, Index, MetaData, \
create_engine
from . import package_dir
__author__ = 'Stephen G. Gaffney'
def build_ref_db(ref_file=None):
"""Create refs table (ncbi_entrez) in sqlite file if doesn't exist."""
if ref_file is None:
... | sggaffney/gene_matcher | gene_matcher/initialize_db.py | initialize_db.py | py | 2,890 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.MetaData",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Table",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sqlalch... |
15054986292 | import cv2
import numpy as np
img = cv2.imread('./data/messi5.jpg', 1)
img2 = cv2.imread('./data/opencv-logo.png', 1)
img3 = np.ones([5,5,3], dtype=np.uint8)
print(img.shape) # rows, columns, channelsg
print(img.size) # numbers of pixel
print(img.dtype)
print(img3.dtype)
b, g, r = cv2.split(img)
img = cv2.merge((b... | MMirandaM/Tutorial-Opencv4 | 06_basic_operations_on_images.py | 06_basic_operations_on_images.py | py | 731 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "cv2.imread",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 6,
... |
17065968249 | import json
import logging
import torch
import glob
import os
import csv
try:
import submitit
_has_submitit = True
except ImportError:
_has_submitit = False
try:
import apex
from apex import amp
apex.amp.register_half_function(torch, "einsum")
_has_apex = True
except ImportError:
_has_ap... | facebookresearch/PAQ | paq/paq_utils.py | paq_utils.py | py | 5,820 | python | en | code | 195 | github-code | 21 | [
{
"api_name": "apex.amp.register_half_function",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "apex.amp",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "spacy.prefer_gpu",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "loggin... |
39196579595 |
from bs4 import BeautifulSoup
from splinter import Browser
import requests
import pymongo
import pandas as pd
import numpy as np
import time
import datetime
def init_browser():
executable_path = {'executable_path': 'chromedriver.exe'}
return Browser('chrome', **executable_path, headless=False)
def scrape()... | tlstapleton/March-Madness-2019 | happening_now.py | happening_now.py | py | 3,039 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "splinter.Browser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
... |
21442089929 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import RPi.GPIO as GPIO
import time
import sys
import record
import requests
import datetime
# LED_GPIO 変数に 25をセット
SW_GPIO = 25
# GPIO.BCMを設定することで、GPIO番号で制御出来るようになります。
GPIO.setmode(GPIO.BCM)
# GPIO.INを設定することで、入力モードになります。
# pull_up_down=GPIO.PUD_DOWNにすることで、内部プルダウンになります。
... | yamamotokuu/ES | SWpushREC.py | SWpushREC.py | py | 2,595 | python | ja | code | 0 | github-code | 21 | [
{
"api_name": "RPi.GPIO.setmode",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "RPi.GPIO",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "RPi.GPIO.BCM",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "RPi.GPIO.setup",
"lin... |
30185117251 | from datetime import date
from src.db.utils import connect, commit, fetch_one
TEST_OWNERSHIP = {
'username': 'lab-rat',
'barcode': 135792468012,
'purchase_price': 420.69,
'purchase_date': date.today()
}
TEST_TOOL = {
'barcode': 135792468012,
'category': 'hammer',
'shareable': True,
'n... | rafid-khan/Tool-Share | test/db/utils.py | utils.py | py | 2,094 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "datetime.date.today",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "src.db.utils.commit",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "src.db.utils.fetc... |
31790654421 | """
author : Lee Sang Min
github : https://github.com/sangm1n
e-mail : dltkd96als@naver.com
title : Puyo Puyo
description : BFS
"""
from collections import deque
def bfs(i, j, total):
q = deque()
q.append((i, j))
count = 1
visited = [[False] * 6 for _ in range(12)]
visited[i][j] = True
whi... | sangm1n/problem-solving | BOJ/11559.py | 11559.py | py | 1,681 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.deque",
"line_number": 14,
"usage_type": "call"
}
] |
197540464 | # coding: utf-8
# 读取奥比中广 astraS数据, 参考https://developer.orbbec.com.cn/technical_library.html?id=50
import os
import sys
PROJECT_ABSOLUTE_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(PROJECT_ABSOLUTE_PATH)
import cv2
import argparse
import numpy as np
from openni import openni2
fro... | zyan-repository/camera_joint_calibration | test/joint_calibration_show.py | joint_calibration_show.py | py | 10,981 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.path.dirname",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"line... |
73360985012 | from keras.layers import Input, Dropout, Dense, BatchNormalization, GRU, Embedding
from keras.models import Model
from keras.preprocessing.sequence import pad_sequences
from src.models.RnnModel.config import *
def get_keras_data(dataset, max_text_seq):
keras_data = {
DATA_COL: pad_sequences(dataset[DATA_C... | anshul-shaive/Text-Classifier | text_classifier/src/models/RnnModel/model.py | model.py | py | 1,251 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "keras.preprocessing.sequence.pad_sequences",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "keras.layers.Input",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "keras.layers.Embedding",
"line_number": 24,
"usage_type": "call"
},
{
... |
71123953334 | from pygenn.genn_model import create_var_ref
from .utils import optimizers, param_change_batch_reduce
DEFAULT_OPTIM = {
"optimizer": "adam",
"params": {
"low": -1000., "high": 1000.,
"lr": 1e-3,
"beta1": 0.9, "beta2": 0.999, "epsilon": 1e-7
}
}
class LayerBase:
def __init__(s... | FabianSchubert/microcircuit_network | mc/network_base/layer.py | layer.py | py | 2,792 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pygenn.genn_model.create_var_ref",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "utils.param_change_batch_reduce",
"line_number": 43,
"usage_type": "argument"
},
{
"api_name": "pygenn.genn_model.create_var_ref",
"line_number": 50,
"usage_type": ... |
42979956991 | #!/usr/bin/env python3
import os
import sys
import json
from pathlib import Path
from httplib2 import Http
from datetime import datetime
from collections import namedtuple
from collections import OrderedDict
from oauth2client import file
from googleapiclient.errors import HttpError
from googleapiclient.discovery import... | utkuufuk/budget-cli | budget/__main__.py | __main__.py | py | 13,961 | python | en | code | 33 | github-code | 21 | [
{
"api_name": "pathlib.Path.home",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "collections.OrderedDict",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "collections.na... |
18522654535 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('api', '0041_regression_regressionestimate_regressionplotitem'),
]
operations = [
migrations.AlterField(
model_na... | azz/clicker | api/migrations/0042_auto_20150831_0737.py | 0042_auto_20150831_0737.py | py | 503 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AlterField",
"line_number": 14,
"usage_type": "call"
},
{... |
21984522962 | from utils import utils
class AskComplexGraph():
filepath = "../outputs/v4/intents/"
name = 'Ask for complex graph'
def __init__(self, database, table):
self.database = database
self.table = table
@property
def intent(self):
intent = {
"id":"7c308982-f0d2-4129-b... | Snd18/GENBOT_public | GENBOT/code/intents/fixed/AskComplexGraph.py | AskComplexGraph.py | py | 9,569 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "utils.utils.writeToFile",
"line_number": 456,
"usage_type": "call"
},
{
"api_name": "utils.utils",
"line_number": 456,
"usage_type": "name"
},
{
"api_name": "utils.utils.writeToFile",
"line_number": 457,
"usage_type": "call"
},
{
"api_name": "utils.... |
74996966132 | """
Platform Auth: auth-user-roles
"""
from typing import List
from hopeit.app.api import event_api
from hopeit.app.context import EventContext
from app0.admin.app import AppRole
from app0.admin.db import db
from app0.admin.services.app_services import get_role_by_name
__steps__ = ['run']
__api__ = event_api(
r... | fhernand23/stateless-microservices-platform | app0-admin/app0-admin/src/app0/admin/api/auth_user_roles.py | auth_user_roles.py | py | 716 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "hopeit.app.api.event_api",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "app0.admin.app.AppRole",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "hopeit.ap... |
71814672694 | import sys
import io
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from bs4 import BeautifulSoup
import time
sys.stdout = io.TextIOWrapper(sys.stdout.detach(), encoding = 'utf-8')
sys.stderr = io.TextIOWrapper(sys.stderr.detach(), encoding = 'utf-8')
class NcafeMemberExr:
# ... | chcjswo/study-python | section3/3-7-2.py | 3-7-2.py | py | 2,154 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.stdout",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "io.TextIOWrapper",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.stdout.detach",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.stderr",
"lin... |
40402277855 | from gino.ext.starlette import Gino
from ssl import create_default_context
from fastapi.security import HTTPBearer
from core.factories import settings
if not settings.DEBUG:
ssl_object = create_default_context(cafile=settings.SSL_CERT_FILE)
db: Gino = Gino(
dsn=settings.DATABASE_URL,
echo=set... | Turall/FastApi-boilerplate-poetry | core/extensions.py | extensions.py | py | 551 | python | en | code | 5 | github-code | 21 | [
{
"api_name": "core.factories.settings.DEBUG",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "core.factories.settings",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "ssl.create_default_context",
"line_number": 8,
"usage_type": "call"
},
{
... |
15705589524 | import configargparse
import logging
from random import randint
from time import strftime
from boto3 import session
logs_format = "[%(asctime)s] [%(levelname)-8s] %(message)s"
logging.basicConfig(format=logs_format, level=logging.INFO)
log = logging.getLogger()
class StressClientManager:
instance_type = None
... | mendersoftware/mender-loadtest | tool/stress-clients-manager.py | stress-clients-manager.py | py | 17,487 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "logging.basicConfig",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "random.randin... |
13178444985 | import os
import pandas as pd
import torch
import torchvision.datasets as datasets
from torch.utils.data import Dataset
from torch.utils.data import DataLoader
import torchvision.transforms as transforms
import cv2 as cv
import matplotlib.pyplot as plt
# 通常使用Compose把你要做的transform全都包起来比如:
trans = transforms.Compose([
... | Rogerlv51/DeepLearning_Repo | Dataset_Dataloader.py | Dataset_Dataloader.py | py | 2,774 | python | zh | code | 1 | github-code | 21 | [
{
"api_name": "torchvision.transforms.Compose",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.PILToTensor",
"line_number": 13,
"usage_type": "call"
},
... |
14301858835 | from django.db.models import Q, Count
from backend.exceptions import ForbiddenError, NotFoundError
from comments.models import Comment
from feed.models import Post
def not_liked(user, inst):
if not inst.likes.aggregate(like=Count('user', filter=Q(user=user)))['like']:
return
raise Forbidde... | ScrollPage/Test-Chat | backend/like/api/service.py | service.py | py | 1,033 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.db.models.Count",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.db.models.Q",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "backend.exceptions.ForbiddenError",
"line_number": 10,
"usage_type": "call"
},
{
"api_nam... |
11084788218 | from snakemake.io import glob_wildcards
from snakemake.io import strip_wildcard_constraints
from snakemake.shell import shell
import os
import shutil
import re
from glob import glob
from snakebids import bids
#get subject and sessions
subject = snakemake.wildcards.subject
sessions, = glob_wildcards(f'{snakemake.input.... | khanlab/ppmi-bids-smk | bids_workflow/scripts/convert_nii_to_bids.py | convert_nii_to_bids.py | py | 5,805 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "snakemake.io.wildcards",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "snakemake.io",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "snakemake.io.glob_wildcards",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "... |
19636911712 | __author__ = 'lizzycruz'
from django_cron import CronJobBase, Schedule
from django.shortcuts import get_object_or_404
from YAASApp.models import Auction
from YAASApp.models import Bidders
from datetime import datetime
from forms import EditEmailForm
from django.core.mail import send_mail
class MyCronJob(CronJobBase... | Lizzy95/YAASWeb | YAASApp/cronjobs.py | cronjobs.py | py | 1,419 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django_cron.CronJobBase",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "django_cron.Schedule",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "YAASApp.models.Auction.objects.all",
"line_number": 21,
"usage_type": "call"
},
{
"a... |
36866149026 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from fairseq import options
from fairseq import utils
from fairseq.modules import (
MultiheadAttention, AdaptiveSoftmax, SinusoidalPositionalEmbedding
)
from . import (
FairseqEncoder, FairseqIncrementalDecoder, FairseqModel, reg... | kakaobrain/helo-word | fairseq/fairseq/models/copy_augmented_transformer_el.py | copy_augmented_transformer_el.py | py | 36,206 | python | en | code | 88 | github-code | 21 | [
{
"api_name": "fairseq.options.eval_bool",
"line_number": 55,
"usage_type": "attribute"
},
{
"api_name": "fairseq.options",
"line_number": 55,
"usage_type": "name"
},
{
"api_name": "fairseq.options.eval_bool",
"line_number": 58,
"usage_type": "attribute"
},
{
"api... |
21836839441 | # This files contains your custom actions which can be used to run
# custom Python code.
#
# See this guide on how to implement these action:
# https://rasa.com/docs/rasa/custom-actions
# This is a simple example for a custom action which utters "Hello World!"
from typing import Any, Text, Dict, List
from rasa_sdk ... | iqyoe/chatbot | actions/actions.py | actions.py | py | 3,170 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "rasa_sdk.Action",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "typing.Text",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "rasa_sdk.executor.CollectingDispatcher",
"line_number": 49,
"usage_type": "name"
},
{
"api_name": "ra... |
38460364256 | # coding: utf-8
from unittest2 import TestCase
from robottelo.bz_helpers import get_deselect_bug_ids, group_by_key
from robottelo.helpers import get_func_name
BZ_DATA = {
'1234': {
'bug_data': {
'resolution': 'WONTFIX',
'flags': {'sat-6.3.0': '+'}
}
},
'1235': {
... | sghai/robottelo | tests/robottelo/test_bz_helpers.py | test_bz_helpers.py | py | 2,452 | python | en | code | null | github-code | 21 | [
{
"api_name": "unittest2.TestCase",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "robottelo.bz_helpers.get_deselect_bug_ids",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "robottelo.bz_helpers.get_deselect_bug_ids",
"line_number": 47,
"usage_type":... |
33042039821 | from rest_framework import serializers
from ..models import Project
from people.serializers.collaborator_serializer import CollaboratorSerializer
from people.serializers.beneficiary_serializer import BeneficiarySerializer
class ProjectSerializer(serializers.ModelSerializer):
class Meta:
model = Project
... | hndoss/manos-bondadosas | backend/projects/serializers/project_serializer.py | project_serializer.py | py | 968 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "models.Project",
"line_number": 10,
"usage_type": "name"
},
... |
11774996662 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author: Donny You(youansheng@gmail.com)
# Select Cls Model for pose detection.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from models.cls.nets.mobilenet import MobileNet
from models.cls.nets.vgg import VG... | donnyyou/PyTorchCV | models/cls_model_manager.py | cls_model_manager.py | py | 1,084 | python | en | code | 45 | github-code | 21 | [
{
"api_name": "models.cls.nets.vgg.VGG",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "models.cls.nets.vgg.VGG",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "models.cls.nets.vgg.VGG",
"line_number": 19,
"usage_type": "name"
},
{
"api_name"... |
33801970117 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
plt.axes(aspect=1) # 横轴和纵轴比例为1:1
labels = ['A', 'B', 'C', 'D']
fracs = [15, 30, 45, 10]
explode = [0, 0.2, 0, 0] # 突出显示第二个部分
plt.pie(x=fracs, labels=labels, autopct='%.00f%%', explode=explode)
plt.show()
| Lovecanon/ProfessionalPython | Matplotlib/Lesson5Pie.py | Lesson5Pie.py | py | 320 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "matplotlib.pyplot.axes",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.pie",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotl... |
26428524005 | # 220804 12852 1로 만들기 2
# 3으로 나누어떨어져/ 2로 나누어쪌어져/1 빼기
# 3개 연산으로 1을 만들려고할때 가장 빠르게만드는 연산 순서 출력
# 백트래킹?bfs?
# n <= 1,000,000
import sys
from collections import deque
input = sys.stdin.readline
n = int(input())
answer = 0
visited = [0 for _ in range(n+1)]
queue = deque([1])
while queue:
now = queue.popleft()
if no... | seho27060/aug-algo-study | 0804/12852_seho.py | 12852_seho.py | py | 894 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "sys.stdin",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 14,
"usage_type": "call"
}
] |
13829147820 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import cv2
import tensorflow as tf
from PIL import Image
from sklearn.model_selection import train_test_split
from tensorflow.keras.utils import to_categorical
import os
def traffic_sign_dataset():
data =[]
labels = []
classes = 43
... | nmcvanson/CNN_Architectures-Tensorflow- | ResNet/data.py | data.py | py | 1,264 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.chdir",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
... |
1154158433 | #%% [markdown]
# # Stage : Create UPM dataflows
# Uses a config file to drive which UPM dataflows we should create
#%%
# Import all of the libraries we need to use...
import pandas as pd
import azureml.dataprep as dprep
import os as os
import re as re
import collections
from azureml.dataprep import col, ReplacementsVal... | Smartitect/dataprep | newstage_5_50_createUPMDataflow.py | newstage_5_50_createUPMDataflow.py | py | 3,377 | python | en | code | 5 | github-code | 21 | [
{
"api_name": "commonPackageHandling.openDataFlowPackage",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "azureml.dataprep.read_csv",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "azureml.dataprep",
"line_number": 33,
"usage_type": "name"
},
{
... |
43244313877 | import tensorflow as tf
import tensorflow_docs as tfdocs
import tensorflow_docs.plots
import tensorflow_docs.modeling
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
df=pd.read_csv('archived_result/electricity_gas_cplex_largefluc_classification2.csv',index_col=0).reset_index()
No_of_nodes=20
No... | Prof-Greatfellow/electricity-gas-ANN | 4.2_Scenario_Feasibility/bigfluc_feasibility.py | bigfluc_feasibility.py | py | 2,613 | python | en | code | 16 | github-code | 21 | [
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.models.Sequential",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name... |
1901044911 | import cv2
import numpy as np
import random
extracted=""
first_hint_img = cv2.imread("first_hint.bmp", cv2.IMREAD_COLOR)
second_hint_img = cv2.imread("second_hint.bmp", cv2.IMREAD_COLOR)
challange_img = cv2.imread("challenge.bmp", cv2.IMREAD_COLOR)
# Hint 1 - Solution
# Using two blank images
def decrypt(img):
#... | DoronYitz/checkpoint2021-ctf | Beat the map/beat_the_map.py | beat_the_map.py | py | 1,830 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "cv2.imread",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.IMREAD_COLOR",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "cv2.imread",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.IMREAD_COLOR",
"line... |
17377742113 | """Add media_link column and image_link for event table
Revision ID: 53242f49feb3
Revises: 1d019196b47c
Create Date: 2018-06-13 16:50:01.903764
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '53242f49feb3'
down_revision = '1d019196b47c'
branch_labels = None
de... | xzjia/lifeline-scraper | alembic/versions/53242f49feb3_add_media_link_column_and_image_link_.py | 53242f49feb3_add_media_link_column_and_image_link_.py | py | 578 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "alembic.op.add_column",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.TEXT",
... |
18121449103 | from datetime import timedelta, time, datetime
from django.core.mail import mail_admins
from django.core.management import BaseCommand
from django.utils import timezone
from django.utils.timezone import make_aware
from django.core.mail import send_mail
from todos.models import Todo
now = datetime.now()
today = timezon... | Dragllen/todoProj | app/todos/management/commands/check_deadline.py | check_deadline.py | py | 1,156 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "datetime.datetime.now",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.utils.timezone.now",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "djang... |
27440897610 | from __future__ import absolute_import, division, print_function
import os
import sys
import json
import argparse
import numpy as np
import multiprocessing
from scipy.signal import savgol_filter
from astropy import wcs
from astropy.table import Table, Column
from astropy.io import fits
from astropy.coordinates impor... | mauritiusdadd/python-specex | src/specex/specex.py | specex.py | py | 42,578 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 310,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 310,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.