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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
30570166546 | from typing import Tuple
from apiserver.apierrors import errors
from apiserver.tests.automated import TestService
class TestPipelines(TestService):
def test_delete_runs(self):
queue = self.api.queues.get_default().id
task_name = "pipelines test"
project, task = self._temp_project_and_task... | allegroai/clearml-server | apiserver/tests/automated/test_pipelines.py | test_pipelines.py | py | 2,774 | python | en | code | 334 | github-code | 21 | [
{
"api_name": "apiserver.tests.automated.TestService",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "apiserver.apierrors.errors.bad_request",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "apiserver.apierrors.errors",
"line_number": 23,
"usage_t... |
11381592149 | from typing import List, Any, cast, Union
from dialogs_framework import Dialog, send_message, get_client_response, dialog, run
@dialog(version="1.0")
def prompt(text) -> str:
run(send_message(text))
response: str = run(get_client_response())
return cast(str, response)
@dialog(version="1.0")
def chain(d... | khealth/dialogs | examples/dragons/primitives.py | primitives.py | py | 1,431 | python | en | code | 8 | github-code | 21 | [
{
"api_name": "dialogs_framework.run",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "dialogs_framework.send_message",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "dialogs_framework.run",
"line_number": 9,
"usage_type": "call"
},
{
"api_name"... |
20766230207 | import torch
from transformers import BertConfig, BertForSequenceClassification
from classification import ClassificationTrainArguments
from transformers import BertTokenizer
if __name__ == '__main__':
args = ClassificationTrainArguments(
pretrained_model_name="beomi/kcbert-base",
downstr... | sun0809/bert_classification | 04.07/kcbert/ratsnlp/ratsnlp/nlpbook/inference.py | inference.py | py | 2,377 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "classification.ClassificationTrainArguments",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 12,
"usage_type": "attribute"
},
{
... |
41969135515 | from collections import defaultdict
import re
import urllib
import urllib.parse
import pickle
from bs4 import BeautifulSoup
import urllib.request as urllib2
AutoTravelHttp = 'http://www.autotravel.ru'
class Autotravel:
def __init__(self):
try:
with open('attd.cache', 'rb') as f:
... | leremin/AtTrackDownloader | autotravel.py | autotravel.py | py | 2,953 | python | en | code | 6 | github-code | 21 | [
{
"api_name": "pickle.load",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "urllib.request.Request",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "urllib.request",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "urllib.request.urlo... |
4400764992 | import boto3
from botocore.exceptions import NoCredentialsError
from dotenv import load_dotenv
load_dotenv()
class AwsS3Image:
def __init__(self, accessKey, secretKey, bucketName, region):
self.accessKey = accessKey
self.secretKey = secretKey
self.bucketName = bucketName
self.regio... | adit-prawira/face_attendance_server | server/utils/aws_s3_image.py | aws_s3_image.py | py | 1,396 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "botocore.exceptions.NoCredentialsError",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": ... |
33472087344 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import logging
import json
from configparser import ConfigParser
from datetime import datetime, timedelta
from influxdb import InfluxDBClient
from sqlalchemy.orm import sessionmaker
from threading import Condition, Thread
from time import sleep, strftime
# Custom module... | maple52046/ness | external_modules/loaders/twse/fetcher.py | fetcher.py | py | 5,179 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "coloredlogs.install",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "logging.Formatter",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "logging.Strea... |
12343334481 | import smtplib
from email.message import EmailMessage
# with open('textfile.txt') as text:
# email = EmailMessage()
# email.set_content(text.read())
email = EmailMessage()
email['from'] = 'Spider'
email['to'] = 'aq.syed007@gmail.com'
email['subject'] = 'You won 1,000,000 dollars!'
email.set_content('I\'m a unhatch... | shahSpider/email-api | email_script.py | email_script.py | py | 561 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "email.message",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "email.message.EmailMessage",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "email.message",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "email.message",
... |
546955323 | import torch
import numpy as np
from os import makedirs
from PIL import Image
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent.parent))
from utils import prettify_name, pad_frames
# Apply edit to given latents, return strip of images
def create_strip(inst, mode, layer, latents, x_comp,... | harskish/ganspace | notebooks/notebook_utils.py | notebook_utils.py | py | 8,695 | python | en | code | 1,756 | github-code | 21 | [
{
"api_name": "sys.path.insert",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.clip",
"line_number... |
2292762633 | # -*- coding: utf-8 -*-
# @Time : 2019/2/27 22:40
# @Author : yunfan
import numpy as np
from torch.utils.data import DataLoader
from VaePose.data.RHDDataset import RHDDataset
from VaePose.utils.View import view_origin_img, view_hand_2d, view_mask
from VaePose.config.rhd import RHDConfig as cfg
from VaePose.data.Au... | yunfanLu/VAE-Pose | VaePose/UnitTest/RHDDataTest.py | RHDDataTest.py | py | 1,899 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "VaePose.data.RHDDataset.RHDDataset",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.utils.data.DataLoader",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.random.RandomState",
"line_number": 55,
"usage_type": "call"
},
... |
24070058610 | import util.util as UTIL
from flask import Blueprint, request, jsonify
ms_routes = Blueprint('ms_addin_routes', __name__, template_folder='templates')
@ms_routes.route('/objection_responses', methods=['GET'])
def get_get_objection_responses():
doc = [
{'key': 'obj_relevance', 'content': "This is relevant... | tjdaley/restutil | app/routes/ms_addin_routes.py | ms_addin_routes.py | py | 610 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Blueprint",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 17,
"usage_type": "call"
}
] |
2208471652 | import pygame
import time
import numpy as np
import quaternion
from pygame.draw import *
def coord3d_to_coordscreen(point):
"""
Make a projection of a point in 3d on a screen, located on z_screen
"""
return np.array([point[0]/point[2]*z_screen,point[1]/point[2]*z_screen])
def coordscreen_to_pixels(projection):
"... | SimeonStylites/My_programs | 3d_polygons.py | 3d_polygons.py | py | 11,937 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.array",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": ... |
9870420087 | #!/usr/bin/env python3
# Archive reason: No longer in use.
import datetime
import logging
import re
# The arrow library is used to handle datetimes
import arrow
# The request library is used to fetch content through HTTP
import requests
# Tablib is used to parse XLSX files
import tablib
# please try to write PEP8 ... | electricitymaps/electricitymaps-contrib | parsers/archived/XK.py | XK.py | py | 3,078 | python | en | code | 3,126 | github-code | 21 | [
{
"api_name": "datetime.datetime",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "logging.Logger",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "requests... |
21633841108 | import openai
import os
import json
import time, copy
#openai.api_key = "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"
def transcribe_audio(audio_path):
since = time.time()
openai.api_key = "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"
with open(audio_path, "rb") as audio_file:
t... | Daniel-sdn/openai | BKP-webhook/BKP_16-03_7h57/BKP_163_8h00/BKP-18-0311h22/workmessage.py | workmessage.py | py | 1,777 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "time.time",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "openai.api_key",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "openai.Audio.transcribe",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "openai.Audio",
... |
30441888514 | '''
Created on Jan 23, 2013
@author: sscepano
'''
import networkx as nx
G = nx.read_gml("/home/sscepano/D4D res/allstuff/simple dynamics/v1/cleaned_mod_v1.gml")
col = [str]*256
for i in range(256):
col[i] = 'w'
for node in G.nodes_iter(data=True):
#print node[1]['label']
col_gephi = node[1]['graphics'][... | sanja7s/SET37s | SET3/visualize/by_simple_subpref_dynamics/map_modular_classes.py | map_modular_classes.py | py | 2,832 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "networkx.read_gml",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "ma... |
30835021253 | from PyQt5 import QtCore
from PyQt5.QtCore import QRect
from PyQt5.QtWidgets import QWidget, QLabel
from ui import UndoButton, ResetButton
from ui.style import MAIN_BACKGROUND_COLOR, TEXT_COLORS
from field import Field
END_OVERLAY_STYLE = 'background-color: rgba(255, 255, 255, 0.7); ' \
'font-size... | HeartANDu/2048 | ui/main_window.py | main_window.py | py | 2,655 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "ui.style.MAIN_BACKGROUND_COLOR",
"line_number": 24,
"usage_type": "name"
},
{
"ap... |
20740172088 | import os
import glob
import tempfile
from typing import final
import numpy as np
from pathlib import Path
import shutil
import fnmatch
import re
label_file = 'MEGAsync Imports/Master file/Sliced Dialogue/Label files'
label_eqg_file = 'MEGAsync Imports/Master file/Sliced Dialogue/Label files/eqg'
label_fim_file = 'MEG... | pranavmalikk/TTS | testfile.py | testfile.py | py | 13,042 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.path.abspath",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "os.path.normpath",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
22894205720 | import matplotlib.pyplot as plt
from eleanor.source import Source
from eleanor.source import multi_sectors
from eleanor.targetdata import TargetData
from eleanor.visualize import Visualize
#star = Source(tic=157376929, sector='recent')
#star = multi_sectors(sectors=[1,2], tic=157376929)
star = Source(coords=('15:55:2... | megbedell/ELLIE | testing.py | testing.py | py | 1,619 | python | en | code | null | github-code | 21 | [
{
"api_name": "eleanor.source.Source",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "eleanor.targetdata.TargetData",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 13,
"usage_type": "call"
},
{
"api_na... |
39812390534 | import torch
##################################################################################
# The initial code was copyed from the pytorch implementation in 2019
# therefore part of this code is
# Copyright (c) 2016- Facebook, Inc and the developers of the lbfgs.py package
###################################... | chemalot/tOpt | tOpt/batch_lbfgs.py | batch_lbfgs.py | py | 32,456 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.set_printoptions",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.arange",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "torch.int64",
... |
15782332618 | from typing import List, Tuple, Sequence, Optional
values: List[int] = []
city: int = 350 # The city code, not a name
# This function returns a Tuple of two values, a str and an int
def get_details() -> Tuple[str, int]:
return "Python", 5
# The following is an example of Tuple unpacking
name: str
marks: int
nam... | kushaldas/pym | code/alltypes.py | alltypes.py | py | 825 | python | en | code | 668 | github-code | 21 | [
{
"api_name": "typing.List",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "typing.Sequence",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_nu... |
72058386293 |
from __future__ import division
import sklearn
import pandas as pd
import numpy as np
import collections
import os.path
from sklearn.cross_validation import train_test_split
from sklearn import svm
from sklearn.svm import SVC
from sklearn import linear_model
from sklearn import tree
from sklearn.cross_validation impo... | aravamudham/ncaa-2018-ML | MarchMadness2018.py | MarchMadness2018.py | py | 5,802 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.path.path.exists",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "numpy.load",
"line_... |
31360585211 | import torch
import torchvision
from utils import params
from utils.torch_wrapper import benchmark_wrapper2
from . import rnnt
from . import librespeech
device = torch.device(params.devname)
net = rnnt.Rnnt()
net.to(params.dtype_torch).to(device).train()
dataset = librespeech.Librespeech(f'{params.casio}/rnnt/libre... | VerticalResearchGroup/casio | rnnt/train.py | train.py | py | 992 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torch.device",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "utils.params.devname",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "utils.params",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "utils.params.dtyp... |
46871058134 | from puzzle import PuzzleContext
from collections import defaultdict
import networkx as nx
with PuzzleContext(year=2020, day=21) as ctx:
foods = []
for line in ctx.nonempty_lines:
ingredients, allergens = line.split(" (")
allergens = allergens[:-1].replace("contains ", "").split(", ")
... | vstrimaitis/aoc-2020 | 21/sol.py | sol.py | py | 1,570 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "puzzle.PuzzleContext",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "networkx.Graph",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "networkx.b... |
29434381123 | from blog.models import Submission
from django import forms
lang_choices = [
('C','C'),
('C++','C++'),
('Java','Java'),
('Python3','Python3'),
]
class SubmissionForm(forms.ModelForm):
language = forms.ChoiceField(choices=lang_choices,widget=forms.Select(attrs={'class':'form-control'}))
class M... | ashunimbz/my-blog | blog/forms.py | forms.py | py | 655 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.forms.ChoiceField",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "dja... |
36677574733 | import tensorflow as tf
import numpy as np
import config as cf
import functions as F
from tensorflow.python.framework import ops
class BasicConvNet(object):
def __init__(self, image_w=cf.w, image_h=cf.h, channels=cf.channels, num_classes=100):
self._width = image_w # define the width of the image.
... | meliketoy/cnn.tensorflow | Tensorflow/cifar100/network.py | network.py | py | 12,493 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "config.w",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "config.h",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "config.channels",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "config.batch_size",
... |
30623624914 | from datetime import datetime
from flask import request
from flask_restx import Namespace, Resource, reqparse
from src.api.v1.objects.Sensor_mgmt import SensorMgmt
from src.common import common_utils as utility
from src.api.v1.models.payload import sensor_mgmt as payloads
from src.api.v1.models.response import sensor_... | Himanshu-j/shoreline | shoreline/src/api/v1/services/sensor.py | sensor.py | py | 3,356 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask_restx.Namespace",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "src.api.v1.models.payload.sensor_mgmt.update_sensor_model",
"line_number": 18,
"usage_type": "cal... |
32405050514 | # %% [markdown]
# # Find all must support dependent profiles in StructureDefinitions
#
# - see FHIR-39723
# - for hard coded path search all SD (in YAML) for all reference with must support = true profiles
# - list of other profile that need to be supported
# - incorporate into narrative generator...
# - todo think ab... | Healthedata1/MyNotebooks | CapStatement/ms_references.py | ms_references.py | py | 9,105 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "pathlib.Path",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "yaml.load",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "yaml.FullLoader",
"line_numbe... |
8064835597 | import cv2
import math
import numpy as np
import matplotlib.pylab as plt
from glob import glob
def main():
blurred_image, image = read_image()
auto_edged_image = auto_canny_edge_detection(blurred_image)
image_with_lines = detect_lines(auto_edged_image)
show_images(image, image_with_lines)
def read_i... | hajo1038/KI_Projekt | Image_proc/edge_detection.py | edge_detection.py | py | 1,777 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "glob.glob",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_numb... |
4275618116 | from core import src
from interface import admin_interface
def add_user():
src.register()
def change_balance():
while True:
change_user = input("่พๅ
ฅ้่ฆไฟฎๆน้ขๅบฆ็็จๆทๅ: ").strip()
money = input('่ฏท่พๅ
ฅ้่ฆไฟฎๆน็็จๆท้ขๅบฆ: ').strip()
if not money.isdigit():
print('่ฏท่พๅ
ฅๆญฃ็กฎ็ๆฐๅญ!')
continu... | hoffmannchen/ATM | core/admin.py | admin.py | py | 1,197 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "core.src.register",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "core.src",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "interface.admin_interface.change_balance_interface",
"line_number": 16,
"usage_type": "call"
},
{
"api_n... |
17917065594 | #!/usr/bin/python3.6
# -*- coding: utf-8 -*-
import pygame as pg
import irismath as imath
import math
from numpy import random
class Entity():
def __init__(self, pos, size=(1, 1), color=(0, 0, 0), visible=False, solid=False, weight=0):
self.color = color
self.rect = pg.Rect((0, 0), size)
... | FTL-Space-Warp/IRIS | main.py | main.py | py | 11,768 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "pygame.Rect",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pygame.draw.rect",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pygame.draw",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "pygame.Rect",
"line... |
17312520373 | import datetime
import time
import threading
import dateutil.parser
from dataclasses import dataclass
from django.shortcuts import render
from rest_framework.generics import ListAPIView, RetrieveAPIView, UpdateAPIView
from rest_framework import viewsets, status
from rest_framework.permissions import IsAuthenticated
fr... | ManuelCL-jml/Polipay-Backup | apps/api_client/views.py | views.py | py | 54,572 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "rest_framework.viewsets.GenericViewSet",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.viewsets",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "MANAGEMENT.EndPoint.EndPointInfo.get_info",
"line_number": 47,
"usage... |
44944579661 | from typing import Type
class ContainerException(Exception):
def __init__(self, cls: Type, message):
self.cls = cls
super(ContainerException, self).__init__(message)
class ClassNotFoundException(ContainerException):
def __init__(self, cls: Type):
super(ClassNotFoundException, self)._... | omersaraf/IOCynergy | cynergy/errors/ContainerException.py | ContainerException.py | py | 1,124 | python | en | code | 11 | github-code | 21 | [
{
"api_name": "typing.Type",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "typing.Type",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.Type",
"line_number": 18,
"usage_type": "name"
}
] |
25956375386 | import os, pytest, types
import jsont.transforms.xml as xml
from xjs.validate import ExtValidator
from jsont.engine import StdEngine, DocEngine
from jsont.exceptions import *
from jsont import cli
@pytest.fixture(scope="module")
def engine(request):
return DocEngine()
xsiuri = "http://www.w3.org/2001/XMLSchema-i... | usnistgov/jsont | jsont/transforms/tests/test_xml.py | test_xml.py | py | 14,886 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "jsont.engine.DocEngine",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "jsont.transforms.xml.determine_prefix",
"line_number": 28,
"usage_type": "call"
},
{
"api_na... |
32852252081 | from datetime import datetime, timedelta
import json
from celery.task import periodic_task
from celery.utils.log import get_task_logger
from django.conf import settings
from corehq.apps.receiverwrapper.models import RepeatRecord
logging = get_task_logger(__name__)
CHECK_REPEATERS_INTERVAL = timedelta(minutes=5)
@per... | gmimano/commcaretest | corehq/apps/receiverwrapper/tasks.py | tasks.py | py | 3,086 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "celery.utils.log.get_task_logger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.utcnow",
"line_number": 14,
"usage_type": "call"
},
{
"api_n... |
70683750133 | import os
import sys
import json
import uuid
import logging
import uvicorn
import asyncio
import hashlib
import multiprocessing
from htag import Tag
from starlette.applications import Starlette
from starlette.responses import HTMLResponse,PlainTextResponse
from starlette.applications import Starlette
from starlette.rou... | manatlan/htagweb | htagweb/appserver.py | appserver.py | py | 11,869 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "types.ModuleType",
"line_number": 39,
"usage_type": "argument"
},
{
"api_name": "htag.Tag",
"line_number": 42,
"usage_type": "argument"
},
{
"api_name": "htag.Tag",
"l... |
5751521679 | import logging, time
import helper
import traceback
def time_log():
log = helper.logger_minute()
while True:
log.info("test message ")
print("log saved")
time.sleep(20)
def default_log():
log = helper.logger_default()
while True:
for i in range(20):
log.deb... | iorilan/py_tiny_apps_playground | log/run.py | run.py | py | 702 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "helper.logger_minute",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "helper.logger_default",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "time.sleep",
... |
14085566786 | import sqlite3
from app.helpers.helpers import getArgsBy,getCustomerInfoFromId,makeArgsDict
from app.helpers.getConfig import getConfPart
from app.db import dbConnection
from app import outputs
# Get arguments from config file to get from which attributes a
# booking can be removed, then get the arguments provided by ... | TomJamesGray/pyBook | app/bookings/removeBooking.py | removeBooking.py | py | 5,116 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "app.outputs.decideWhatToDo",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "app.outputs",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "app.helpers.helpers.getArgsBy",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "... |
70117115892 | from typing import List
from action import Action
from lesson import Lesson
from term import Term
from break1 import Break
from timetable1 import Timetable1
class Timetable2(Timetable1):
skipBreaks: bool = True
def __init__(self, breaks: List[Break]):
super().__init__()
self._breaks = breaks
... | czujsnn/skryptowe | 3/deanery_system_hermetized/timetable2.py | timetable2.py | py | 2,567 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "timetable1.Timetable1",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "break1.Break",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "term.getUniqueStartingH... |
30275942243 | import pytest
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.webdriver import WebDriver
driver = None
options = Options()
options.add_argument("start-maximized")
options.add_argument('--disable-gpu')
options.add_argument('--headless') ... | roshanc10/Pytest-Framework | tests/conftest.py | conftest.py | py | 2,039 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "selenium.webdriver.chrome.options.Options",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 16,
"usage_type": "name"
},
{
... |
74943525813 | from keras.models import load_model
import cv2
import numpy as np
import sys
filepath = sys.argv[1]
#filepath = 'test_one.jpg'
rev_class_map = {
0:"none",
1:"one",
2:"two",
3:"three",
4:"four",
5:"five",
6:"six"}
def mapper(val):
return rev_class_map[val]
# LOAD... | siddharthSharma102/HandCricket-OpenCV | test.py | test.py | py | 676 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "sys.argv",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "keras.models.load_model",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"l... |
27827014661 | import mv3d
from data import draw_top_image, draw_box3d_on_top
from net.utility.draw import imsave, draw_box3d_on_camera, draw_box3d_on_camera
from net.processing.boxes3d import boxes3d_decompose
from tracklets.Tracklet_saver import Tracklet_saver
import argparse
import os
import config
from config import cfg
import ti... | bostondiditeam/MV3D | src/tracking.py | tracking.py | py | 7,574 | python | en | code | 456 | github-code | 21 | [
{
"api_name": "mv3d.Predictor",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "config.cfg.TRACKING_TIMER",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "confi... |
2314686308 | from flask import Flask, render_template
from flask_debugtoolbar import DebugToolbarExtension
from flask.ext.sqlalchemy import SQLAlchemy
db = SQLAlchemy()
def create_app(config_overrides={}):
"""Create and return an Flask app instance"""
# create app; load config
app = Flask(__name__)
app.config.fro... | Hamms/flask-boilerplate | app/__init__.py | __init__.py | py | 975 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.ext.sqlalchemy.SQLAlchemy",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask_debugtoolbar.DebugToolbarExtension",
"line_number": 18,
"usage_type": "call"
},
{
... |
1716430305 | import os
import sys
import numpy as np
import torch
from torch import nn
from torch.nn.modules import Module
import torch.distributed as dist
N = 10 # input size, weight size
STEPS = 10
NPDTYPE = np.float32 if "FP32" not in sys.argv else np.float32
DTYPE = torch.float32 if "FP32" not in sys.argv else torch.float32
... | StellarrZ/Onboarding-SMDDP | E10-custom_PTDDT/main.py | main.py | py | 3,354 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "numpy.float32",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "torch.float32",
"l... |
9126468304 | import sys
reference_sizes_filename = sys.argv[1]
f = open(reference_sizes_filename, "r+")
lines = f.readlines()
reference_sizes = {}
for l in lines:
fields = [f.strip() for f in l.split('|')]
size = 0
name = ""
try:
size = int(fields[2])
name = fields[1]
except:
pass
... | mbenedettini/backups | check.py | check.py | py | 1,769 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.argv",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "psycopg2.connect",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 78,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": ... |
29393318358 |
# coding: utf-8
# In[1]:
from flask import Flask, render_template, redirect
from flask_pymongo import PyMongo
from splinter import Browser
from bs4 import BeautifulSoup as bs
import requests
import pandas as pd
import time
def scrape():
all_dict = {}
# In[2]:
url = 'https://mars.nasa.gov/news/?page=... | sheep0930/Homework10 | scrape_mars.py | scrape_mars.py | py | 4,171 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "splinter.Browser",
"line_number": 85,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"lin... |
9100095455 | import logging
import math
from enum import Enum
import numpy as np
from smac.configspace import Configuration
from smac.utils.constants import MAXINT
__author__ = "Marius Lindauer"
__copyright__ = "Copyright 2015, ML4AAD"
__license__ = "3-clause BSD"
__maintainer__ = "Marius Lindauer"
__email__ = "lindauer@cs.uni-f... | timothyyu/ml_monorepo | SMAC3/smac/tae/execute_ta_run.py | execute_ta_run.py | py | 9,760 | python | en | code | 59 | github-code | 21 | [
{
"api_name": "enum.Enum",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "smac.utils.constants.MAXINT",
"line_number": 84,
"usage_type": "argument"
},
{
"api_name": "logging.getLogger",
"line_number": 115,
"usage_type": "call"
},
{
"api_name": "smac.con... |
72907703734 | import argparse
import os
import tensorflow as tf
import sys
from models.base import BaseModelWrapper
from utils import utils, ops_utils
sys.path.insert(0, os.path.abspath('.'))
tf.logging.set_verbosity(tf.logging.INFO)
tf.logging.info('test')
def add_arguments(parser):
parser.register("type", "bool", lambda v:... | Kyoto-University-Speech-and-Audio/speech-to-dialog-act | src/infer.py | infer.py | py | 4,812 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "sys.path.insert",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
44363585393 | import random
import add
import sub
import mult
import div
import modpow
import primality as pm
from functools import reduce
def remove_redundant_zeroes(number):
length = len(number)
for i in range(length):
if number[i] != '0' or (number[i] == '0' and i == length - 1):
return number[i:]
... | alse0722/krypto | 2sem_n3/gamal/dss.py | dss.py | py | 3,599 | python | ru | code | 0 | github-code | 21 | [
{
"api_name": "random.randint",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "sub.subtraction",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "div.divide",
"line_... |
18197113338 | from z3 import *
import argparse
from random import randrange
import re
# python3 P5.py -n 4
# Check the following grid for size: 4
# ___ _R_ ___ ___
# ___ ___ ___ _Q_
# _R_ ___ ___ ___
# ___ ___ _R_ ___
# python3 P5.py -n 5
# Check the following gri... | mfaisal97/CS511_formal_methods | assignments/assignment12/P5.py | P5.py | py | 9,848 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "random.randrange",
"line_number": 192,
"usage_type": "call"
},
{
"api_name": "random.randrange",
"line_number": 201,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 231,
"usage_type": "call"
}
] |
16731407742 | import os
import sys
import random
import re
import numpy as np
import pandas as pd
from numba import jit, njit, prange
import Levenshtein as lev
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn import preprocessing
def make_tfidf_features(df, vectorizers=None, tfidf_args=None):
tfidf_args ... | btseytlin/Sigmod-Competition | sigmod_src/features.py | features.py | py | 5,780 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sklearn.feature_extraction.text.TfidfVectorizer",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_number": 45,
"usage_type": "call"
},
{
"ap... |
12630508126 | from sklearn.model_selection import train_test_split
from sklearn.naive_bayes import GaussianNB
from sklearn.svm import SVC
from sklearn.neighbors import KNeighborsClassifier
import numpy as np
from sklearn.metrics import accuracy_score
from sklearn.metrics import classification_report, confusion_matrix
from sklearn.tr... | CalebSpear/Projects | CS450-Machine_Learning/differentclassifiers.py | differentclassifiers.py | py | 1,582 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.random.normal",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "numpy.append",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.random.norma... |
32556927912 | """
Helper class for visualizing labels on images
"""
import json
import os
import sys
import matplotlib.pyplot as plt
from PIL import Image
class Label_Tester:
def __init__(self):
self.values = dict()
self.controlling_dict = {
"delete": False, "valid_key": False, "skip": False,
... | Emilio856/Bachelorarbeit | Bilder_Labeln/visualize_labels.py | visualize_labels.py | py | 9,578 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.path.join",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "os.path.isfile",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
8437814941 | import sys
import argparse
import alg_haffman
def create_parser():
""" ะกะพะทะดะฐัะผ ะฟะฐััะตั ะดะปั ัะฐะทะฑะพัะฐ ะฐัะณัะผะตะฝัะพะฒ ะบะพะผะฐะฝะดะฝะพะน ัััะพะบะธ"""
parser = argparse.ArgumentParser()
parser.add_argument("-e", "--encode", action="store_true", default=False)
parser.add_argument("-d", "--decode", action="store_t... | RasamVaziri/code-and-decode-with-Huffman-alg | my_script.py | my_script.py | py | 13,235 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "argparse.FileType",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "argparse.FileType",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "alg_haffma... |
22603989784 | #! /usr/bin/env python
import os
from pycbc import workflow as wf
# options
class Options:
pass
opts = Options
opts.workflow_name = "wfex"
opts.config_files = ["ex_wfex.ini"]
opts.config_delete = None
opts.config_overrides = None
opts.output_file = "wfex.dax"
opts.output_map = "output.map"
opts.transformation_cat... | gwastro/PyCBCInferenceWorkshopMay2019 | pycbc_inference_workflow/create_workflow.py | create_workflow.py | py | 1,039 | python | en | code | 13 | github-code | 21 | [
{
"api_name": "pycbc.workflow.makedir",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pycbc.workflow",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "pycbc.workflow.Workflow",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pycbc.w... |
40834133144 | import pandas as pd
from scipy.stats import boschloo_exact
from .CachedContingency import CachedContingency
def pickleable_boschloo(test_string: str) -> (float, float):
"""
Calculate Boschloo's test, ensure that pvalue is never nan
This function can be pickled
:param test_string: comma separated co... | MrTomRod/cached-contingency | cached_contingency/CachedBoschloo.py | CachedBoschloo.py | py | 2,002 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "scipy.stats.boschloo_exact",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pandas.Series",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "CachedContingency.CachedContingency",
"line_number": 45,
"usage_type": "name"
}
] |
21042337005 | from datetime import datetime, timedelta
from django.shortcuts import render
from .get_data_for_visualization import _get_normalization_data, _get_time_series_data
from .data_preprocess import data_preprocess
from .data_visualization import _visualize_price_data, _scatter_plot_graph, _visualize_normalization_data
imp... | KimChanw/GoldSilver_Price_Visualization_Project | PriceDashBoard/views.py | views.py | py | 2,974 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "matplotlib.use",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "datetime.timed... |
28785932582 | import argparse
import os
import logging
import logging.config
import yaml
import csv
import datetime
import numpy as np
import pandas as pd
import gym
import gym_CartPole_BT
from env_utils import simulation_rollout, simulation_rollouts
from control_baselines import LQR
from bayes_opt import BayesianOptimization
# Cr... | billtubbs/testing-rl | test_run_bo.py | test_run_bo.py | py | 5,739 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "yaml.safe_load",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "logging.config.dictConfig",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "logging.config",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "logging.... |
32885296210 | import pygame,math
import neat
import pickle
from helper import getSensorX, getSensorY
pygame.init()
screen = pygame.display.set_mode((1067,600))
pygame.display.set_caption("Car racing")
background_image = pygame.image.load("track.png").convert()
player_image = pygame.image.load("car.png").convert_alpha... | Tynker-Computer-Vision/TNK-M10-PRO-C79-TAS-BP | TA1/main.py | main.py | py | 4,470 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pygame.init",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.s... |
24093461610 | from bs4 import BeautifulSoup
import requests
from pprint import pprint
import base64
from github import Github
import pandas as pd
import numpy as np
import matplotlib as plt
def get_user_data(user_id):
profile_url = f'https://api.github.com/users/{user_id}'
user_data = requests.get(profile_url).json()
re... | aflah02/GitStats | main.py | main.py | py | 1,052 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "github.Github",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_numb... |
24164251567 | import tkinter
from tkinter import *
from tkinter import ttk
from tkinter import messagebox
import sqlite3
import workers
from subprocess import call
R_ID=[]
P_ID = []
P_NAME = []
P_PRICE = []
QTY = []
RETURNED = []
EXT_PRICE = []
DATE=[]
W_ID=[]
TOT=[]
stafflist=[]
DIS_P_ID=[]
DIS=[]
conn = sqlite3... | sph113/206CDE | Back-End/Editreceipt.py | Editreceipt.py | py | 7,402 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sqlite3.connect",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "tkinter.messagebox.sh... |
36020628312 | #from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer #python2.7
from http.server import BaseHTTPRequestHandler,HTTPServer
#import ssl
import os,time
import subprocess
from http.client import HTTPConnection
import hashlib
from socketserver import ThreadingMixIn
class Client():
def __init__(self):
... | berylyl/lmProxyServer | httpserver.py | httpserver.py | py | 2,885 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "http.server.BaseHTTPRequestHandler",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "http.client.HTTPConnection",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 63,
"usage_type": "call"
},
{
"api_name"... |
32348019736 | from typing import List
TEST_CASES = [
{
"input": {
"matrix": [[1,3,5,7],[10,11,16,20],[23,30,34,60]],
"target": 3
},
"result": True
},
{
"input": {
"matrix": [[1,3,5,7],[10,11,16,20],[23,30,34,60]],
"target": 13
},
... | jsparadacelis/exercising | binary-search/search_matrix/v4.py | v4.py | py | 1,701 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "typing.List",
"line_number": 22,
"usage_type": "name"
}
] |
39536520271 | import streamlit as st
import pandas as pd
import numpy as np
import os
import matplotlib.pyplot as plt
import seaborn as sns
from PIL import Image,ImageFilter,ImageEnhance
# Title and Subheader
st.title("Iris EDA App")
st.subheader("EDA Web App with Streamlit ")
# EDA
my_dataset = "iris.csv"
# To Improve speed an... | MaximeGasc/Tools-for-data-science | app.py | app.py | py | 4,111 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "streamlit.title",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "streamlit.subheader",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path.join",
... |
73882097334 | from cgi import test
import json
import subprocess as sp
import tempfile
import os
import shutil
from pathlib import Path
from .describe import get_server_lang
from .testparsers import parse_jest_report, parse_pytest_report
HOME = os.environ["HOME"]
def response(code, stdout, stderr):
return json.loads(stdout.de... | CodegroundProject/rce_service | run_lang/execute.py | execute.py | py | 6,069 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cgi.test",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "cgi.test",
"line_number": 31,... |
4123229619 | import sklearn.ensemble
from sklearn import metrics
from sklearn import svm
import pickle
from data_processing import process_from_files
from sklearn.linear_model import LogisticRegression
from sklearn.neural_network import MLPClassifier
from sklearn.ensemble import RandomForestClassifier
from sklearn.naive_bayes impor... | noemiko/myo_classify | learn_model.py | learn_model.py | py | 4,627 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "data_processing.process_from_files",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sklearn.ensemble.ensemble.AdaBoostClassifier",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sklearn.ensemble.ensemble",
"line_number": 16,
"usage_typ... |
3166426296 |
import numpy as np
from tensorflow.python.framework.ops import Tensor
from modules.func_utils import ft2, ift2, cart2pol
from matplotlib import pyplot as plt
import tensorflow as tf
PI = np.pi
def compute_strfunc(phz: tf.Tensor, mask, delta):
N = (phz.shape)[0]
phz = phz * mask
P = ft2(phz, delta)
... | NickMateus11/TurbulenceSimulator_Research_Co-op | src/modules/phase_screen_generation.py | phase_screen_generation.py | py | 3,164 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "numpy.pi",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.Tensor",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "modules.func_utils.ft2",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "modules.fu... |
9622302559 | import json, japanize_matplotlib
import matplotlib.pyplot as plt
import pandas as pd
savefile = "janken_history.json"
with open(savefile,encoding="utf-8") as f:
history = json.load(f)
print(history)
win,lose,draw =0,0,0
hand=[0,0,0]
for i in history:
if i["result"] == "ใใใ":
draw += 1
if i["result... | niikun/json | janken/analistic.py | analistic.py | py | 699 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "json.load",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplot",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplo... |
28654187053 | from django.shortcuts import render, redirect
from .models import League, Team, Player
from . import team_maker
def index(request):
context = {
#"leagues": League.objects.all(),
#"leagues": League.objects.filter(sport__contains="baseball"),
#"leagues": League.objects.filter(sport__contains="women"),
"leagues... | sanjosejulia/django | views.py | views.py | py | 1,881 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "models.League.objects.filter",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "models.League.objects",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "models.League",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": ... |
5929005104 | #!/bin/env python
import numpy as np
import unyt
import peano
import h5py
from metadata_wrapper.read_binary import BinaryFile
from metadata_wrapper.hdf5 import HDF5MetadataWrapper
from metadata_wrapper.swift_units import write_unit_attributes
class SnapshotFile(BinaryFile):
"""
Class for reading Millennium-1... | jchelly/DFED-MetadataWrapper | examples/wrap_millennium.py | wrap_millennium.py | py | 15,792 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "metadata_wrapper.read_binary.BinaryFile",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "metadata_wrapper.read_binary.BinaryFile.__init__",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "metadata_wrapper.read_binary.BinaryFile",
"line_numb... |
21395956517 | from django.conf import settings
from PyPDF2 import PdfFileWriter, PdfFileReader
import io
from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import letter
def create_cmr_file(delivery_number, po_list):
packet = io.BytesIO()
# Create a new PDF with Reportlab
can = canvas.Canvas(packet, pagesi... | Sielak/Django-AppPortal | apps/HighlightTracker/helpers.py | helpers.py | py | 1,503 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "io.BytesIO",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "reportlab.pdfgen.canvas.Canvas",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "reportlab.pdfgen.canvas",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "repo... |
42121225427 | import warnings
import numpy as np
from scipy.optimize import linprog
from relsad.network.systems import PowerSystem, Transmission
from relsad.Time import Time
from relsad.utils import INF
np.set_printoptions(suppress=True, linewidth=np.nan)
warnings.filterwarnings("ignore")
# flake8: noqa: C901
def shed_energy(
... | stinefm/relsad | relsad/energy/shedding.py | shedding.py | py | 11,661 | python | en | code | 10 | github-code | 21 | [
{
"api_name": "numpy.set_printoptions",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.nan",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "warnings.filterwarnings",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "relsad.... |
72915223414 | from multiprocessing import context
from time import sleep
import discord
from discord.ext import commands
from dotenv import load_dotenv
from discord import FFmpegPCMAudio
import os
import asyncio
load_dotenv()
bot = commands.Bot(command_prefix='$')
@bot.event
async def on_ready():
print('We have logged in as {... | leoceschin/jackinbot | app.py | app.py | py | 1,404 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands.Bot",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "disc... |
74166605174 | """Training script for the DeepLab-ResNet network on the PASCAL VOC dataset
for semantic image segmentation.
This script trains the model using augmented PASCAL VOC,
which contains approximately 10000 images for training and 1500 images for validation.
"""
import argparse
from datetime import datetime
import os
imp... | ethanygao/NDDR-CNN | train_multiple_tasks.py | train_multiple_tasks.py | py | 9,708 | python | en | code | 52 | github-code | 21 | [
{
"api_name": "tensorflow.contrib",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "util.input_arg... |
16467360036 | """
Greed is a dice game played with five six-sided dice.
Your mission, should you choose to accept it, is to score a throw according to these rules.
You will always be given an array with five six-sided dice values.
Three 1's => 1000 points
Three 6's => 600 points
Three 5's => 500 points
Three 4's => 400 point... | DmitryAgeev/codewars | python/5kyu/greed_is_good.py | greed_is_good.py | py | 1,814 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.Counter",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "timeit.timeit",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "timeit.timeit",... |
70348937333 | """Look at individual trial stimulus responses from example cells."""
from __future__ import print_function
from builtins import range
import itertools as it
import matplotlib as mpl
import numpy as np
from operator import itemgetter
import os
import pandas as pd
if 'DISPLAY' not in os.environ:
mpl.use('Agg')
imp... | asugden/pool | scripts/stimulus/trial_responses.py | trial_responses.py | py | 4,611 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.use",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flow.misc.default_parser",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "flow.misc",
... |
25715980750 | import numpy as np
import json
import collections
import time
import requests
import pickle
import pandas as pd
from sklearn.model_selection import cross_validate
import data_preprocessing as dp
from model_info import ModelInfo
from client_cass import CassandraClient
from typing import List, Dict, Union, Any, Tuple
fr... | LiLatee/Engineering_Thesis | build_and_update_model_server/model_SGDClassifier.py | model_SGDClassifier.py | py | 10,292 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "typing.Union",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "sklearn.linear_model.SGDClassif... |
43956491375 | from __future__ import print_function, unicode_literals
from jinja2 import FileSystemLoader, StrictUndefined
from jinja2.environment import Environment
env = Environment(undefined=StrictUndefined)
env.loader = FileSystemLoader('.')
device_vars = {
'snmp_location': 'San Francisco, CA',
'snmp_contact': 'Isaac N... | WaltRCodes/pynet_test | Lesson6/exercise4.py | exercise4.py | py | 458 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "jinja2.environment.Environment",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "jinja2.StrictUndefined",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "jinja2.FileSystemLoader",
"line_number": 6,
"usage_type": "call"
}
] |
40830657664 | import pygame as py
import os
import sys
import time
from pygame import mixer
py.init()
def get_highscore():
script_dir = os.path.dirname(os.path.abspath(__file__))
high_score_file = os.path.join(script_dir, "HISCORE.txt")
try:
with open(high_score_file, "r") as file:
high... | AnimeshRajpoot08/PYgame_Pass_the_Ball | PYgame/main.py | main.py | py | 5,909 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pygame.init",
"line_number": 7,
"usage_type": "call"
},
{
"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_num... |
31124680368 | from random import randint
def load_from_pickle(path='parameters.pkl'):
import dill
with open(path, 'rb') as f:
while True:
try:
yield dill.load(f)
except EOFError:
break
def sample(stream, k):
"""
:param stream:
:param k: the rese... | young-geng/ml_logger | ml_logger/helpers.py | helpers.py | py | 1,188 | python | en | code | null | github-code | 21 | [
{
"api_name": "dill.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line... |
41736813670 | #!/usr/bin/env python3
"""Check two versions of ruff against a corpus of open-source code.
Example usage:
scripts/check_ecosystem.py <path/to/ruff1> <path/to/ruff2>
"""
from __future__ import annotations
import argparse
import asyncio
import difflib
import heapq
import json
import logging
import re
import tempfi... | astral-sh/ruff | scripts/check_ecosystem.py | check_ecosystem.py | py | 18,323 | python | en | code | 20,375 | github-code | 21 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "typing.NamedTuple",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "typing.Self"... |
71836424054 | import pyglet
from engine.util import get_files_in_path
class MonsterSprite:
UP = 'up'
DOWN = 'down'
LEFT = 'left'
RIGHT = 'right'
IDLE = 'idle'
def __init__(self, id, path, x, y, speed, health, batch=None, group=None, action=IDLE):
self.id = id
self.path = path
self... | Kokonaut/fundamentals-lab-4 | engine/monster.py | monster.py | py | 6,033 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pyglet.resource.image",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "pyglet.resource",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "engine.util.get_files_in_path",
"line_number": 43,
"usage_type": "call"
},
{
"api_name... |
37300807474 | import os
import time
import shutil
import numpy as np
import tensorflow as tf
import torch.nn.functional as F
import torch.nn as nn
import torch
from functools import partial
#modelใฎchannelๆฐใชในใ
def get_inplanes():
return [64,128,256,512]
class Block(nn.Module):
"""
ResNet 10,18,34็จใฎBLOCK
... | Riku-ima/Pose-ViT | models/resnet.py | resnet.py | py | 8,582 | python | en | code | 0 | github-code | 21 | [
{
"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.Conv3d",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
21520503426 | '''
Created on Jun 11, 2020
@author: sjjamsa
'''
import pysss2
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors
import matplotlib.colorbar
from pysss2.libsss2 import _str_encoding
from matplotlib import cm
class cartesian_plotter(object):
'''
classdocs
'''
def __init__(s... | sjjamsa/pysss2 | pysss2/slicer.py | slicer.py | py | 7,701 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "numpy.empty",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.empty",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.reshape",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.reshape",
"line_numbe... |
39173450881 | from __future__ import annotations
from dataclasses import dataclass, field
from itertools import zip_longest
from typing import Any, cast, Collection, Dict, List, Optional, TypeVar, Union
from llvmlite import ir
from kotlang import ast, typesystem as ts
from kotlang.symbols import mangle
def codegen_module(
n... | jstasiak/kotlang | kotlang/codegen.py | codegen.py | py | 26,673 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "kotlang.ast.Module",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "kotlang.ast",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "llvmlite.ir.Module",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "llvmlite.... |
31264129876 |
''' https://www.acmicpc.net/problem/2961 ๋์์ด๊ฐ ๋ง๋ ๋ง์๋ ์์
'''
from itertools import combinations
N = int(input())
arr = [list(map(int, input().split(" "))) for _ in range(N)]
com = [combinations(arr, i) for i in range(1, N+1)]
answer = 1000000000
for line in com:
for each in line:
sour = 1
bit... | 2023cote/2022cote_eunseo | 0126_brute_force/18_2961.py | 18_2961.py | py | 489 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "itertools.combinations",
"line_number": 9,
"usage_type": "call"
}
] |
1404113232 | """
CTG Importtool POC
(c) 2021 ilionx
Versie: 0.1 (11-03-2021)
Auteur: R. Jonker, P. Groot
Script om ruwe CTG data uit MOSOS te importeren, verwerken en op te slaan in een Microsoft SQL Database.
Gebaseerd op de importfunctionaliteit uit de STVcalc applicatie van Hans Wolf (UMC Amsterdam)
"""
import os
im... | Dhanyakallat/CTG | main.py | main.py | py | 9,072 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pyodbc.connect",
"line_number": 87,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 105,
"usage_type": "call"
},
{
"api_name": "os.path.splitext",
"line_number": 107,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number"... |
47834242224 | # This file contains a functional generalized news website scraper
# You can scrape essentially every news site in existence without writing a line of python
# if you want to scrape an unadded news site, simply add a dictionary with the
# neccessary keys to the scraper_inputs list below
# then run this file with: pyth... | DhanujG/NLP-Machine-Learning-in-Environmental-News-Web-Scraper | generalized_scraper.py | generalized_scraper.py | py | 7,453 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 98,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 99,
"usage_type": "call"
},
{
"api_name": "sys.exc_info",
"line_number": 169,
"usage_type": "call"
}
] |
34727144590 | """
Project started on 19th of January 2023
"""
import math
import kivymd.uix.button
import pyttsx3
from kivy.clock import mainthread
from kivy.config import Config
engine = pyttsx3.init()
voices = engine.getProperty('voices')
MALE = 0
FEMALE = 1
engine.setProperty('voice', FEMALE)
Config.set('graphics', 'width',... | kushurox/CSProjsem1 | main.py | main.py | py | 9,267 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "pyttsx3.init",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "kivy.config.Config.set",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "kivy.config.Config",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "kivy.config.Co... |
31908124126 | import threading
import pcap
import os
import argparse
import pickle
# https://blog.csdn.net/weixin_39138707/article/details/74612637
# https://blog.csdn.net/u010069213/article/details/17999757
# https://blog.csdn.net/super_yc/article/details/72290931
# https://blog.csdn.net/weixin_34342992/article/details/88004374
"... | YaxinCui/SnifferPy | SnifferPy.py | SnifferPy.py | py | 14,012 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pcap.findalldevs",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "pickle.dump",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "os.path.exists",... |
13190923715 | from collections import deque
import sys
def bfs(n, graph, visited, start):
result = [0] * (n + 1)
q = deque([start])
while q:
node = q.popleft()
if visited[node]:
continue
visited[node] = True
for v in graph[node]:
q.append(v)
if result[... | Eui9179/algorithm-study | programmers/python/score_kit/dfsbfs/boj11725.py | boj11725.py | py | 719 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.deque",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 21,
"usage_type": "attribute"
}
] |
26712867766 | from datetime import timedelta
import os
import random
from faker import Faker
from flask_seeder import Seeder
from blog import cfg, bcrypt, db
from blog.models.ArticleModel import Article
from blog.models.AuthModel import User
from blog.models.LikeModel import Like
from blog.models.SubscribeModel import Strip... | HsoubAcademy/flask-blog | seeds/seedDb.py | seedDb.py | py | 3,580 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "faker.Faker",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask_seeder.Seeder",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "blog.cfg.ACCOUNT_COUNT",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "blog.cfg"... |
9943515546 | from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
##Link to deploy: https://cryptic-castle-13164.herokuapp.com/docs#/
SQLACLHEMY_DATABASE_URL = 'sqlite:///./card.db'
engine = create_engine(SQLACLHEMY_DATABASE_URL, connect_args={
... | CelsoBNF/fastapi-Zappts | card/database.py | database.py | py | 572 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.sessionmaker",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.ext.declarative.declarative_base",
"line_number": 16,
"usage_type": "call"... |
19774833217 | """
custom string formating, and how it works.
"""
from datetime import datetime
class Date(object):
_formats = {
"ymd": "{d.year}-{d.month}-{d.day}",
"mdy": "{d.month}/{d.day}/{d.year}",
"dmy": "{d.day}/{d.month}/{d.year}",
}
def __init__(self, day, month, year):
s... | felsen/fluent-python | format.py | format.py | py | 1,072 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 36,
"usage_type": "name"
}
] |
10374862425 | import sys
from collections import defaultdict, deque
input = sys.stdin.readline
n, m = map(int, input().split())
graph = defaultdict(list)
inDegree = [0 for _ in range(n+1)]
for _ in range(m):
arr = list(map(int, input().split()))
for i in range(2, len(arr)):
graph[arr[i-1]].append(arr[i])
... | yejin7211/Algorithm | ๋ฐฑ์ค/Gold/2623.โ
์์
ํ๋ก๊ทธ๋จ/์์
ํ๋ก๊ทธ๋จ.py | ์์
ํ๋ก๊ทธ๋จ.py | py | 702 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.stdin",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "collections.defaultdict",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 14,
"usage_type": "call"
}
] |
11536369363 | # This Program implements 10 armed bandit problem
# The Bandit() function takes in q, rewards, Exploration rate and no of iterations,
# and return array which contains max q value at each step.
## You can print either AVERAGE REWARD or PERCENTAGE OF BEST ACTION
import numpy as np
import matplotlib.pyplot as plt
###... | Mihir-D/Reinforcement_learning_codes | bandit.py | bandit.py | py | 3,272 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.zeros",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.argmax",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.random.normal",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line... |
19843317930 | """
This script will contain functions for plotting exploratory analysis things, and
maybe some final findings (who knows?).
"""
import matplotlib.pyplot as plt # this is a graphing tool in python (like matlab, but less clunky)
import seaborn as sns # this is a graphing tools that makes prettier graphs (also has mo... | hschumann/nba-fantasy-sports | graphing_tools.py | graphing_tools.py | py | 629 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "seaborn.distplot",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.title",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "matplotlib... |
15398192633 | from os import environ
from keras.layers import Dense, Flatten
from keras.models import Sequential
from keras.optimizers import adam_v2
from rl.agents.dqn import DQNAgent
from rl.memory import SequentialMemory
from rl.policy import BoltzmannQPolicy
from game import GameEnv
NB_STEPS = 300_0000
DEVICE = ... | hayayanai/py-hatetris | src/demo.py | demo.py | py | 1,417 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.environ",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "os.environ",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "game.GameEnv",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "keras.models.Sequential",
"lin... |
71526817654 | from django.urls import path
from . import views
urlpatterns = [
path('',views.log, name='log'),
path('signup/', views.sign, name='sign'),
path('home/', views.home, name='home'),
path('activate/<slug:uidb64>/<slug:token>', views.activate, name='activate'),
path('logout/', views.logout_user, name='... | senorfetty/movie | m/urls.py | urls.py | py | 330 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
74494972212 | import os
from PIL import Image
import numpy as np
import pathlib
import random
import shutil
"""
This script converts metaclass dataset into imagenet class dataset.
1. Fetch the mapping from metaclass to imagenet foldername list (to be used during reading the masks to be relabeled)
2. Fetch the mapping from imagenet... | chawins/adv-part-model | to_class_specific.py | to_class_specific.py | py | 4,549 | python | en | code | 20 | github-code | 21 | [
{
"api_name": "os.walk",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "os.mkdir",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "os.mkdir",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "os.mkdir",
"line_number": 75,
"usag... |
6081791895 | from __future__ import unicode_literals
import frappe
from frappe import _
import datetime
def execute(filters=None):
columns = get_columns()
data = get_data(filters)
return columns, data
def get_columns():
cols = [
{'fieldname': 'customer', 'label': _('Customer'), 'fieldtype': 'Link', 'opti... | libracore/bnovate | bnovate/bnovate/report/subscription_timeline/subscription_timeline.py | subscription_timeline.py | py | 2,881 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "frappe._",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "frappe._",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "frappe._",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "frappe._",
"line_number": 18,
"usa... |
74585257011 | """
This function predicts the y value in a simple linear regression model.
@param x: x position
@param m: slope of the model
@param c: y-intercept of the model
@return: the y value
"""
def predict_y(x, m = 1, c = 0):
return (x * m + c)
# run if called from command line
def main():
import argparse
parser ... | CUB-Computational-Tools/2020_project_sebkopf | scripts/calculator.py | calculator.py | py | 1,016 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 15,
"usage_type": "call"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.