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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
24129528828 | import cv2
filepath = "vtest.avi"
# cap = cv2.VideoCapture(filepath)
# Webカメラを使うときはこちら
class Capture:
"""
Captureクラスは動画の動体検出をサポートするメソッドを提供します。
"""
def __init__(self,movie_path:str|None=None,device:int=0) -> None:
"""initialize capture mode. and configs."""
if not movie_path:
... | ik0326/aisolution | test/capture.py | capture.py | py | 2,167 | python | ja | code | 0 | github-code | 1 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
... |
16026511667 | import sys
import rdkit
from argparse import ArgumentParser
from rdkit import Chem, DataStructs
from rdkit.Chem import AllChem
import pandas as pd
pred_mols = pd.read_csv('',
header=None).values.reshape(-1)
ref_path = 'actives.txt'
with open(ref_path) as f:
next(f)
true_mols = [line.... | jkwang93/MCMG | eval/final_eval.py | final_eval.py | py | 1,343 | python | en | code | 59 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "rdkit.Chem.MolFromSmiles",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "rdkit.Chem",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "rdkit.Chem.AllChem... |
16676517988 | from django.shortcuts import render
from django.http import HttpResponse
from django.template import Template,Context
# Create your views here.
def suma(request,num1,num2):
res = num1+num2
contenido = """
<html>
<head>
<body>
<h2>El resultado es: %s </h2>
</body></head>
</html>
""" %res
return HttpRe... | Yahir5/examenunidad3 | ESYG/prueba3/uno/views.py | views.py | py | 660 | python | es | code | 0 | github-code | 1 | [
{
"api_name": "django.http.HttpResponse",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "django.template.Template",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "django.template.Context",
"line_number": 23,
"usage_type": "call"
},
{
"api_nam... |
13607688058 | import pandas as pd
import numpy as np
from scipy.integrate import solve_ivp
import matplotlib.pyplot as plt
from numpy.random import rand
from random import sample, shuffle
plt.close()
import torch
from torch import nn
from torch.utils.data import Dataset, DataLoader
from itertools import permutations
import matplotli... | erlebach/basic_UODE | circle_2pts.py | circle_2pts.py | py | 8,461 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "matplotlib.pyplot.close",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "numpy.arccos",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.random.ran... |
71109080994 | """
This module contains the implementation of the Classes: BaseEnvironment, BaseWrapper, BaseObservationWrapper, BaseActionWrapper,
BaseRewardWrapper, BaseGridWorld, BaseCarOnHill, BaseCartPole, BaseInvertedPendulum and LQG.
Then there are the Mujoco Environments Wrappers: BaseMujoco, BaseHalfCheetah, BaseAnt, BaseHo... | arlo-lib/ARLO | ARLO/environment/environment.py | environment.py | py | 49,674 | python | en | code | 10 | github-code | 1 | [
{
"api_name": "ARLO.abstract_unit.abstract_unit.AbstractUnit",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "abc.ABC",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 90,
"usage_type": "name"
},
{
"api_name... |
1585948759 | from typing import Optional
from decimal import Decimal
from validator_collection import validators
from highcharts_core import errors
from highcharts_core.metaclasses import HighchartsMeta
from highcharts_core.decorators import class_sensitive
from highcharts_core.options.sonification.track_configurations import (In... | highcharts-for-python/highcharts-core | highcharts_core/options/sonification/__init__.py | __init__.py | py | 13,339 | python | en | code | 40 | github-code | 1 | [
{
"api_name": "highcharts_core.metaclasses.HighchartsMeta",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 51,
"usage_type": "name"
},
{
"api_name": "decimal.Decimal",
"line_number": 51,
"usage_type": "name"
},
{
"api_na... |
38604647476 | import torch
from torch.utils.data import DataLoader
import torchaudio
import time
import warnings
warnings.filterwarnings('ignore')
yesno_data = torchaudio.datasets.YESNO('.', download=False)
def collate_fn(batch):
tensors = [b[0].t() for b in batch if b]
tensors = torch.nn.utils.rnn.pad_sequence(tensors, b... | sangje/sslsv | number_worker_test.py | number_worker_test.py | py | 1,994 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "torchaudio.datasets.YESNO",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torchaudio.datasets",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name"... |
22314540095 | # -*- coding: utf-8 -*-
"""
Created on Sun Jun 25 20:12:52 2017
@author: dell
"""
import collections
def topKFrequent(nums, k):
"""
:type nums: List[int]
:type k: int
:rtype: List[int]
"""
cnt=collections.Counter(nums)
sort_fre=sorted(cnt.items(),key=lambda d:d[1... | ding1995/Leetcode | 347.py | 347.py | py | 444 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.Counter",
"line_number": 14,
"usage_type": "call"
}
] |
6818157468 | import identifier_phase, biomarker, clinical_trial_code, patient_number, lines_of_therapy, study_evaluation
import utils.chunk_utils as cu
import utils.json_utils as ju
def get_overall_info(content):
overall_dict = {}
identifier_phase_dicts = identifier_phase.get_final_result(content)
overall_dict['Identi... | ye8303019/ChatGPT_demo | clinical_result/overall.py | overall.py | py | 1,832 | python | en | code | 27 | github-code | 1 | [
{
"api_name": "identifier_phase.get_final_result",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "clinical_trial_code.get_final_result",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "biomarker.get_final_result",
"line_number": 14,
"usage_type": "call... |
39551925504 | from pyrogram import filters,Client
import wikipedia
wikipedia.set_lang("it")
cprefix="/"
@Client.on_message(filters.command("wiki",cprefix))
async def my_handler(client, message):
send = await message.reply_text("Cercando...")
try:
await send.edit_text(str(wikipedia.summary(message.text.split(" ",1)[1... | pentecoste/bot-telegram-5l | caldatobot-telegram/comandi/wikipedia.py | wikipedia.py | py | 698 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "wikipedia.set_lang",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "wikipedia.summary",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pyrogram.Client.on_message",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pyrogra... |
72545619235 | #!/usr/bin/env python3
import numpy as np
import time
import cv2
import matplotlib.pyplot as plt
def corr(F, I):
"""
Input
F: A (k, ell, c)-shaped ndarray containing the k x ell filter (with c channels).
I: An (m, n, c)-shaped ndarray containing the m x n image (with c channels).
Returns... | pol-francesch/aa274_group31 | AA274A_HW3/Problem_3/linear_filter.py | linear_filter.py | py | 2,582 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.show",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "m... |
28575068555 | from . import bp
from flask.views import MethodView
from app import db
from app.schemas import JobQueryArgsSchema, JobSchema
from app.models import Job
@bp.route('/jobs')
class Jobs(MethodView):
@bp.arguments(JobQueryArgsSchema, location="query")
@bp.response(JobSchema(many=True))
@bp.paginate()
def g... | rabizao/starter_flask | backend/app/api/routes.py | routes.py | py | 800 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.views.MethodView",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "app.models.Job.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "app.models.Job",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "app.schemas.J... |
71757273633 | import config
import csv
import datetime
import main
import multiprocessing
import psycopg2
import time
sp = main.sp
cur = main.cur
lock = main.lock
def available_genres():
try:
print('Available genres for recommendation was requested!')
results = sp.recommendation_genre_seeds()['genres']
... | 0x01h/individual-symphony | tools/functions.py | functions.py | py | 18,474 | python | en | code | 6 | github-code | 1 | [
{
"api_name": "main.sp",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "main.cur",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "main.lock",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "csv.writer",
"line_numbe... |
41139310734 | import json
import time
import os
import datetime
from scraper.halooglasi import get_latest_with_retry
from scraper.db import check_if_exists, insert_property
from scraper.discord import send_to_discord
from scraper.logger import logger
def get_local_time():
"""
convert current time to CEST
"""
cest_... | avramdj/halo-oglasi-scraper | scraper/__main__.py | __main__.py | py | 1,400 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "datetime.datetime.now",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "datetime.timedelta",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.en... |
26553030524 | from flask_app.config.mysqlconnection import connectToMySQL
from flask import flash
from flask_app.controllers.users import User
class Sighting:
def __init__(self, data):
self.id = data['id']
self.location = data['location']
self.scenario = data['scenario']
self.date_of_sighting = d... | OhJackie21/Python-Practice | practice/sasquatch2/flask_app/models/sighting.py | sighting.py | py | 4,436 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask_app.config.mysqlconnection.connectToMySQL",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "flask_app.controllers.users.User",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "flask_app.config.mysqlconnection.connectToMySQL",
"line_numb... |
11995643688 | from rest_framework import generics
from rest_framework.response import Response
from .models import Ganado, Categoria, Raza, LitrosDeLeche
from .serializers import GanadoSerializer,CategoriaSerializer, RazaSerializer, LitrosDeLecheSerializer
from django.views.generic import View
class GanadoListCreateAPIView(generi... | edwinjojoa/proyecto_grado | backend/ganado/views.py | views.py | py | 2,860 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "rest_framework.generics.ListCreateAPIView",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.generics",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "models.Ganado.objects.all",
"line_number": 9,
"usage_type": "call"
... |
16921598410 | import util
from command import process_command
import session as discord_session
import filters
from discord import Embed
from logger import log
# for the memes
from random import choice
@util.client.event
async def on_message(message):
if message.author.bot:
# check to make sure it didn't send message
... | ComedicChimera/Null-Discord-Bot | bot.py | bot.py | py | 3,439 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "util.client",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "logger.log",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "util.client.send_message",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "util.client",
... |
73062305953 |
from mrjob.job import MRJob
from mrjob.protocol import JSONProtocol, RawValueProtocol, JSONValueProtocol
from mrjob.step import MRStep
import json
import numpy as np
def multivar_gauss_pdf(x, mu, cov):
'''
Caculates the multivariate normal density (pdf)
Parameters:
-----------
x - nu... | AmazaspShumik/MapReduce-Machine-Learning | Gaussian Mixture Model MapReduce/IterationGaussianMixtureMR.py | IterationGaussianMixtureMR.py | py | 8,086 | python | en | code | 22 | github-code | 1 | [
{
"api_name": "numpy.pi",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "numpy.linalg.det",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "numpy.dot",
"lin... |
39286301539 | import torch
import torch.nn as nn
import torch.nn.functional as F
from pycls.models.resnet_style.shake_shake_function import get_alpha_beta, shake_function
import pycls.utils.logging as lu
logger = lu.get_logger(__name__)
def initialize_weights(module):
if isinstance(module, nn.Conv2d):
nn.init.kaiming... | PrateekMunjal/TorchAL | pycls/models/resnet_style/resnet_shake_shake.py | resnet_shake_shake.py | py | 7,326 | python | en | code | 56 | github-code | 1 | [
{
"api_name": "pycls.utils.logging.get_logger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pycls.utils.logging",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": ... |
70243838433 | #tire_volume.py
from datetime import datetime
import math
print('This program calculte the tire volume')
print()
form_1 = 0
volume_1 = None
w=float(input('Please Enter the width of the tire in mm: '))
a =float(input('Please Enter the aspect ratio of the tire: '))
d =float(input('Enter the diameter of the whe... | CFrancoChavez/CFrancoChavez | tire_volume.py | tire_volume.py | py | 755 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "math.pi",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.now",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 21,
"usage_type": "name"
}
] |
15114313938 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 2 11:44:08 2019
@author: ashish
"""
import pandas as pd
import numpy as np
import seaborn as sn
import matplotlib.pyplot as plt
import time
dataset = pd.read_csv('new_appdata10.csv')
# Data Preprocessing
response = dataset["enrolled"]
dataset ... | singhashish4000/MachineLearning-Supervised-Logistic-Regression-DCTSBAB | directing_customers_to_subscribstions_through_app_behavior_analysis_Model.py | directing_customers_to_subscribstions_through_app_behavior_analysis_Model.py | py | 2,008 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.StandardScaler",
"line_number": 33,
"usage_type": "call"
... |
20254723614 | """
file: practica1
autor: davidpillco
"""
# Importa el codecs y json
import codecs
import json
# Lee el archivo
archivo = codecs.open("datos.txt","r")
# Lee en lineas
lineas_diccionario = archivo.readlines()
# Pasa los diccionario a lista
lineas_diccionario = [json.loads(l) for l in lineas_diccionario]
# Func... | ProgFuncionalReactivaoct19-feb20/practica04-davidpillco | practica1.py | practica1.py | py | 1,684 | python | es | code | 0 | github-code | 1 | [
{
"api_name": "codecs.open",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 13,
"usage_type": "call"
}
] |
16070565974 | #!/usr/bin/env python3.8
# -*- coding: utf-8 -*-
"""
https://projecteuler.net/problem=41
We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once.
For example, 2143 is a 4-digit pandigital and is also prime.
What is the largest n-digit pandigital prime that exists?
Answer... | vikasmunshi/euler | projecteuler/041_pandigital_prime.py | 041_pandigital_prime.py | py | 1,083 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "itertools.permutations",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "evaluate.Watchdog",
"line_number": 35,
"usage_type": "call"
}
] |
73454469792 | import os
import ctypes
dir_path = os.path.dirname(os.path.realpath(__file__))
lib = ctypes.cdll.LoadLibrary(dir_path + "/" + "larcv2_to_larcv3.so")
class larcv2_to_larcv3(object):
def __init__(self):
lib.larcv2_to_larcv3_new.argtypes = []
lib.larcv2_to_larcv3_new.restype = ctypes.c_void_p
... | DeepLearnPhysics/larcv2_to_larcv3 | larcv2_to_larcv3.py | larcv2_to_larcv3.py | py | 3,015 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.dirname",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "ctypes.cdll.LoadLibrary",
... |
6033788614 | import typing as t
"""
When inserting a string into a trie we first check if the root node has the
first letter of the string we want to insert.
--> When inserting a new word into the Trie:
We start from the root of the tree. Then we iterate over all chars in the str
to insert. For each char (iteration), I check the... | EvgeniiTitov/coding-practice | coding_practice/data_structures/tries/trie_implementation_1.py | trie_implementation_1.py | py | 3,871 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "typing.MutableMapping",
"line_number": 30,
"usage_type": "attribute"
}
] |
41976957988 | import argparse
import logging
import os
import shutil
import subprocess
import time
logging.basicConfig(level=logging.DEBUG)
parser = argparse.ArgumentParser(description="Famous Submitter")
parser.add_argument("-t", "--tag", type=str, help="Dataset tag.")
parser.add_argument("-i", "--input", type=str, help="Input fi... | SUEPPhysics/SUEPCoffea_dask | resubmit.py | resubmit.py | py | 5,108 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "logging.basicConfig",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.envir... |
35423265171 | # Author: Xinyi Wang
# Date: 2021/10/05
import scipy.io as io
import numpy as np
def getCsf(mat_file, video_num):
video_num = int(video_num)
X_mat = io.loadmat(mat_file)
X3 = np.asarray(X_mat['feats_mat'], dtype=np.float)
# print(X3)
# print(type(X3))
cnnsa_feats = X3[video_num]
io.savema... | xinyiW915/RVS-resize | src/func/get_cnnsafeats.py | get_cnnsafeats.py | py | 642 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "scipy.io.loadmat",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "scipy.io",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "numpy.asarray",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.float",
"line_numbe... |
2408166089 | import autograd.numpy as np
import numpy.testing as np_testing
import pytest
import pymanopt
from pymanopt.manifolds import Euclidean, Grassmann, Product, Sphere
class TestProductManifold:
@pytest.fixture(autouse=True)
def setup(self):
self.m = m = 100
self.n = n = 50
self.euclidean =... | pymanopt/pymanopt | tests/manifolds/test_product.py | test_product.py | py | 2,956 | python | en | code | 651 | github-code | 1 | [
{
"api_name": "pymanopt.manifolds.Euclidean",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pymanopt.manifolds.Sphere",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pymanopt.manifolds.Product",
"line_number": 16,
"usage_type": "call"
},
{
... |
74540295072 | import json
import os
from tornado import web
from .base import BaseApiHandler, check_xsrf, check_notebook_dir
from ...api import MissingEntry
class StatusHandler(BaseApiHandler):
@web.authenticated
@check_xsrf
def get(self):
self.write({"status": True})
class GradeCollectionHandler(BaseApiHan... | jupyter/nbgrader | nbgrader/server_extensions/formgrader/apihandlers.py | apihandlers.py | py | 11,194 | python | en | code | 1,232 | github-code | 1 | [
{
"api_name": "base.BaseApiHandler",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "tornado.web.authenticated",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "tornado.web",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "base.c... |
39151193505 | # Driving linear regression algo
# y = mx+b
# m = mean(x)mean(y)-mean(xy)/mean(x)square-((x)square)mean
# b = mean(y) - m(mean(x))
# ^ _
# y = 1-SE(y)/SE(y)
from statistics import mean
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import style
import random
style.use('fivethirtyeig... | Manukhurana97/Machine-Learning1 | 2 Linear Regression :drive(Best fit).py | 2 Linear Regression :drive(Best fit).py | py | 2,265 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "matplotlib.style.use",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "matplotlib.style",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "random.randrange",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.array",
... |
39695926581 | import datetime as dt
import pandas as pd
import os
import smtplib
import json
from dotenv import load_dotenv
def fetch_planner():
TIME_PERIOD = int(os.environ["TIME_PERIOD"])
ORG_PLANNER_PATH = os.environ["ORG_PLANNER_PATH"]
ORG_PLANNER_SHEET_NAME = os.environ["ORG_PLANNER_SHEET_NAME"]
ORG_PLANNER_HE... | adrian-bjorling/daily-digest | app.py | app.py | py | 3,019 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"lin... |
24181921860 | import nltk
from nltk.tokenize import word_tokenize, sent_tokenize
import heapq
nltk.download('stopwords')
from nltk.corpus import stopwords
def nltk_summarizer(raw_text):
stopWords = set(stopwords.words("english"))
word_frequency={}
for word in nltk.word_tokenize(raw_text):
if word not... | ShrutiNathavani/Text_Summarization | nltk_1.py | nltk_1.py | py | 1,189 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "nltk.download",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "nltk.wor... |
8651064290 | from django.shortcuts import render, redirect
from .models import Csvdata
import csv, io, os
from django.http import HttpResponse, Http404
from myproject.settings import STATIC_ROOT
# Home page
def home(request):
return render(request, 'myapp/home.html')
# Read sqlite3.db, load datas
def showdata(request):
cs... | milescm/VisualPTP | myapp/views.py | views.py | py | 4,249 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "django.shortcuts.render",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "models.Csvdata.objects.all",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "models.Csvdata.objects",
"line_number": 13,
"usage_type": "attribute"
},
{
"api... |
2067953896 | import cv2
from datetime import datetime
from app.ml.yolo_v3 import YoloV3
import kivy
kivy.require('1.0.6')
from kivy.core.window import Window
from kivymd.app import MDApp
from kivy.clock import Clock
from kivymd.uix.screen import MDScreen
from kivymd.uix.button.button import MDIconButton
from kivymd.uix.label.labe... | nellymin/WildlifeCameraTrap | app/main.py | main.py | py | 7,267 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "kivy.require",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "kivymd.app.MDApp",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "cv2.VideoWriter_fourcc",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "datetime.datetime... |
191886024 | #!/usr/bin/env python
"""Sample script of word embedding model.
This code implements skip-gram model and continuous-bow model.
Use ../ptb/download.py to download 'ptb.train.txt'.
"""
import argparse
import collections
import time
import numpy as np
import six.moves.cPickle as pickle
import chainer
from chainer impor... | jem0101/BigSwag-SQA2022-AUBURN | TestOrchestrator4ML-main/resources/Data/supervised/GITLAB_REPOS/jamieoglindsey0@chainer/examples/word2vec/train_word2vec.py | train_word2vec.py | py | 5,390 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "chainer.cuda.cupy",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "chainer.cuda",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "numpy.ran... |
33256158133 | from transformers import BertTokenizer,GPT2LMHeadModel, AutoModelForCausalLM
hf_model_path = 'IDEA-CCNL/Wenzhong2.0-GPT2-110M-BertTokenizer-chinese'
tokenizer = BertTokenizer.from_pretrained(hf_model_path)
# model = GPT2LMHeadModel.from_pretrained(hf_model_path)
model = AutoModelForCausalLM.from_pretrained(hf_model... | taishan1994/chinese_llm_pretrained | test_model.py | test_model.py | py | 1,212 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "transformers.BertTokenizer.from_pretrained",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "transformers.BertTokenizer",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "transformers.AutoModelForCausalLM.from_pretrained",
"line_number": 5,
... |
2396940716 | import os
from typing import Dict, List
from nltk.corpus import wordnet as wn
from tqdm import tqdm
import models
import parse
import preprocess
import utils
from sequence import TextSequence
def predict_babelnet(input_path: str, output_path: str, resources_path: str) -> None:
"""
DO NOT MODIFY THE SIGNATUR... | Riccorl/elmo-wsd | elmo-wsd/predict.py | predict.py | py | 10,774 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "parse.semcor_predict_map",
"line_number": 88,
"usage_type": "call"
},
{
"api_name": "preprocess.clean_predict",
"line_number": 89,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 82,
"usage_type": "name"
},
{
"api_name": "utils.r... |
15501808433 | import discord
import asyncio
from discord.ext.commands import Bot
from discord.ext import commands
import platform
import logging
import os
import pymongo
from urllib.parse import urlparse
from datetime import datetime
# constants
MESSAGE_START_CONFIRMED = 'Okay. Asking feedback from **{}** to **{}**.'
MESSAGE_WRONG_... | szilvesztererdos/feedbackbot | feedbackbot.py | feedbackbot.py | py | 18,976 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.basicConfig",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "discord.ext.c... |
27970434469 | # coding=utf-8
import os
import logging
from django.core.management.base import BaseCommand, CommandParser
from django.conf import settings
from django.apps import apps
from django.utils.translation.trans_real import translation
from prettytable import PrettyTable, ALL, FRAME, NONE
logger = logging.getLogger(__name__)... | xiaolin0199/bbt | apps/ws/management/commands/gendoc.py | gendoc.py | py | 14,000 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.utils.translation.trans_real.translation",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.LANGUAGE_CODE",
"line_number": 12,
"usage_type": "... |
27359979494 | from pymatgen.core import Element
from collections import OrderedDict
import numpy as np
from typing import Union, List
from pymatgen.core.composition import Composition
import pandas as pd
from numpy.typing import ArrayLike
class ElementOneHotRepresentation:
def __init__(self, one_hot: ArrayLike, element_dict: O... | nim-hrkn/ToyCompositionDescriptor | ToyCompositionDescriptor/composition_onehot.py | composition_onehot.py | py | 7,095 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.typing.ArrayLike",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "collections.OrderedDict",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "numpy.ndarray",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "pan... |
25272762590 | #!/usr/bin/env python
'''
This file works in python2
The code is largely modified from http://deeplearning.net/tutorial/mlp.html#mlp
First use read_caffe_param.py to read fc7 and fc8 layer's parameter into pkl file.
Then run this file to do a trojan trigger retraining on fc6 layer.
This file also requires files from ht... | chenyanjiao-zju/Defense-Resistant-Backdoor | backdoor/mnist/retrain/load_data.py | load_data.py | py | 5,876 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "scipy.misc.misc.imread",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "scipy.misc.misc",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "scipy.misc",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "numpy.zeros",
... |
28244631646 | import typing as t
import typer
import json
import git
import sys
import os
import pathlib
import subprocess
fuam_path: pathlib.Path = pathlib.Path(os.path.dirname(os.path.abspath(sys.argv[0])))
cli: typer.Typer = typer.Typer()
@cli.command()
def configure() -> None:
print("fuam configure 0.1\n")
... | OkiStuff/fuam | fuam.py | fuam.py | py | 3,120 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pathlib.Path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
... |
4197548801 | import matplotlib.pyplot as plt #import matplotlib yang digunakan sebagai visualisasi gambar
#matplotlib inline
import cv2 #mengimport atau memanggil cv2 dari opencv untuk pengolahan citra serta pembacaan gambar
from skimage import data #import data dari skimage sbagai acuan atau contoh
from skimage.io import imread#i... | farhanromd/Tugas-7 | Filter Batas.py | Filter Batas.py | py | 5,431 | python | id | code | 0 | github-code | 1 | [
{
"api_name": "cv2.imread",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.IMREAD_GRAYSCALE",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "cv2.imread",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.IMREAD_GRAYSCALE",
... |
24670068265 | from decimal import *
from django import template
from core.models import *
from pos.models import *
register = template.Library()
import datetime
@register.filter
def getBrand(value, salesLine):
product = Product.objects.filter(id=salesLine.item_id)
brand = Brand.objects.filter(id=product[0].brand_id)
ret... | hashirharis/DjangoERP | brutils/templatetags/reportTags.py | reportTags.py | py | 9,771 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "django.template.Library",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 5,
"usage_type": "name"
}
] |
7467875956 | import numpy as np
from sklearn.linear_model import LinearRegression, Ridge
from sklearn.preprocessing import PolynomialFeatures
import matplotlib.pyplot as plt
# read data
def readData(path):
data = []
with open(path, 'r') as f:
line = f.readline()
while line:
d = list(map(float, line.str... | Dm697/EE559-Supervised-Machine-Learning-Midterm | q1.py | q1.py | py | 5,538 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.array",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model.LinearRegression",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "sklearn... |
26593170611 | """Functions for deriving indices"""
import xarray as xr
import numpy as np
def effective_temp(T):
"""Compute effective temperature
Effective Temp = (1/2)*(yesterday's effective temp) + (1/2)*(today's actual temp)
To make sense of the expansion, today's ET is consist of a portion of the actual temperatur... | cal-adapt/climakitae | climakitae/tools/indices.py | indices.py | py | 7,473 | python | en | code | 11 | github-code | 1 | [
{
"api_name": "xarray.where",
"line_number": 101,
"usage_type": "call"
},
{
"api_name": "xarray.where",
"line_number": 102,
"usage_type": "call"
},
{
"api_name": "xarray.where",
"line_number": 103,
"usage_type": "call"
},
{
"api_name": "xarray.where",
"line_nu... |
10650487581 | import maya.cmds as cmds
import pymel.core as pm
class UI(object):
def __init__(self):
title = 'curvyEdges'
version = '1.01'
self.ceObj = spline(self)
if pm.window('curvyEdgesWin', exists=True):
pm.deleteUI('curvyEdgesWin')
with pm.window('curvy... | cmcpasserby/curvyEdges | scripts/curvyEdges.py | curvyEdges.py | py | 5,573 | python | en | code | 9 | github-code | 1 | [
{
"api_name": "pymel.core.window",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pymel.core",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "pymel.core.deleteUI",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pymel.core",
"li... |
9808834906 | import numpy as np
import matplotlib.pyplot as plt
import math
def count(arr):
tally = dict()
for ele in arr:
if ele not in tally.keys():
tally[ele] = 0
tally[ele] += 1
return tally
def save_plot(x, y, name):
plt.plot(x, y, 'o-')
plt.xlim((0, 100))
plt.savefig(nam... | yiyanw/Performance-Characterisation-of-Binarised-Neural-Networks-in-Traffic-Fingerprinting | TheromEncoder.py | TheromEncoder.py | py | 3,713 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.xlim",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "matpl... |
35663643651 |
import pandas as pd
import matplotlib.pyplot as plt
from datetime import datetime, timedelta
import sys
def moving_averages(stock_name, tdays, mdays):
data = pd.read_csv('log_data.csv')
data = data.set_index('Date')
data.index = pd.to_datetime(data.index, format = '%Y-%m-%d %H:%M:%S')
ldata = data['Lo... | Kiran9351/project | moving_averages.py | moving_averages.py | py | 1,715 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.... |
26768362338 |
# coding: utf-8
# In[ ]:
import matplotlib
matplotlib.use("TkAgg")
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg,NavigationToolbar2TkAgg
from matplotlib.figure import Figure
from matplotlib import pyplot as plt
import numpy as np
from tkinter import *
from tkinter import filedialog
from tkinter i... | zuhaalfaraj/DSP | Signals Display with Flask/Tkinterapp.py | Tkinterapp.py | py | 2,088 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "matplotlib.use",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "tkinter.ttk.Entry",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "tkinter.ttk",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "tkinter.ttk.Entry",
"... |
33519355882 | import base64
from .platform import JYTHON, PY2
def compress_text(text):
result = base64.b64encode(_compress(text.encode('UTF-8')))
return result if PY2 else result.decode('ASCII')
if not JYTHON:
import zlib
def _compress(text):
return zlib.compress(text, 9)
else:
# Custom compress ... | robotframework/RIDE | src/robotide/lib/robot/utils/compress.py | compress.py | py | 958 | python | en | code | 910 | github-code | 1 | [
{
"api_name": "base64.b64encode",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "platform.PY2",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "platform.JYTHON",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "zlib.compress",
"line... |
6407461716 | #
# Credit to:
# Troy Fawkes for his primer on using queues with Multithreading
# > https://www.troyfawkes.com/learn-python-multithreading-queues-basics/
#
# The Python3 queue documentation
# > https://docs.python.org/3/library/queue.html#queue.Empty
#
import threading
import socket
import datetime
from queue import Q... | RikJonAtk/multiThreadedDNS | dns_v3.py | dns_v3.py | py | 1,869 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "socket.gethostbyname",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "queue.Queue",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "queue.Queue",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
... |
27537503353 | import numpy as np
from torchtext import data
from torchtext import datasets
from gensim.models import KeyedVectors
def getVectors(args, data):
vectors = []
if args.mode != 'rand':
word2vec = KeyedVectors.load_word2vec_format('./GoogleNews-vectors-negative300.bin', binary=True)
for i in range(l... | UVa-NLP/HEDGE | cnn/load_data.py | load_data.py | py | 1,480 | python | en | code | 30 | github-code | 1 | [
{
"api_name": "gensim.models.KeyedVectors.load_word2vec_format",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "gensim.models.KeyedVectors",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torchtext.data.TEXT",
"line_number": 10,
"usage_type": "attribut... |
23669146088 | from django.shortcuts import render
from django.views.generic import TemplateView, ListView
import django_tables2
import books.models
import books.filters
import books.tables
class FilteredSingleTableView(django_tables2.SingleTableView):
filter_class = None
def get_table_data(self):
data = super(Filt... | spapas/django_table_filtering | books/views.py | views.py | py | 1,962 | python | en | code | 6 | github-code | 1 | [
{
"api_name": "django_tables2.SingleTableView",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "books.models.models",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "books.models",
"line_number": 24,
"usage_type": "name"
},
{
"api_name... |
5250226508 | __author__ = "Severi Jääskeläinen \n Samuel Kaiponen \n Heta Rekilä \n" \
"Sinikka Siironen \n Juhani Sundell"
__version__ = "2.0"
import platform
import subprocess
import shlex
import glob
from . import general_functions as gf
from .beam import Beam
from .detector import Detector
from .target import Ta... | ilardinho/ePotku_public | server/potku/modules/get_espe.py | get_espe.py | py | 6,789 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "beam.Beam",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "detector.Detector",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "target.Target",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_nu... |
28169435385 | from stix2 import MemoryStore, Filter
from itertools import chain
def get_related(thesrc, src_type, rel_type, target_type, reverse=False):
relationships = thesrc.query([
Filter('type', '=', 'relationship'),
Filter('relationship_type', '=', rel_type),
Filter('revoked', '=', False),
... | ilf0rz/MITRE-ATTACK-heatmap-gen | relationships.py | relationships.py | py | 5,814 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "stix2.Filter",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "stix2.Filter",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "stix2.Filter",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "stix2.Filter",
"line_number":... |
72355993314 | import pygame
import snake as s
import animal as a
import config as cfg
import random
import util as u
from game import Game
from pygame.locals import (
K_UP,
K_DOWN,
K_LEFT,
K_RIGHT,
)
class SnakeGame(Game):
def init(self):
self.snake = s.Snake((cfg.BLOCK_SIZE, cfg.BLOCK_SIZE))
se... | BinaryCat17/snake | play_snake.py | play_snake.py | py | 2,302 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "game.Game",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "snake.Snake",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "config.BLOCK_SIZE",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "pygame.USEREVENT",
"... |
41597137875 | import sys, os, logging
import random
import pysam
import pandas as pd
vcf_file = sys.argv[1]
pre_file = sys.argv[2]
luad = sys.argv[3]
out = sys.argv[4]
rand = sys.argv[5]
logging.basicConfig(filename = "{}/ExtractReads.{}.log".format(out,luad),
filemode = "a",
fo... | ShomronLab/SomaticSerum | SomaticExtract/src/ExtractSNVs.py | ExtractSNVs.py | py | 3,899 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.argv",
"line_number": 6,
"usage_type": "attribute"
},
{
"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": ... |
21174566509 | from tkinter import messagebox, Tk, Frame, TOP, X, NW, Canvas, Image, Button
from PIL import ImageTk, Image
from models.Users import checkLoggedUserRole, checkLoggedUserIsBlocked
from classes.Navbar import NavbarWidget
from views.Manage import ManageView
from views.Recipes.RecipesCategory import RecipesCategoryView
d... | pedromst2000/Tkinter-Recipes-manage-App | views/Home.py | Home.py | py | 6,757 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "tkinter.Tk",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "classes.Navbar.NavbarWidget",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "tkinter.Canvas",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open"... |
17702010446 | from django.urls import path
# -- Importar todas las vistas de mi_tienda
from . import views
# -- Aquí se definen las URLs de nuestra tienda
# -- Metemos de momento sólo la principal (índice)
urlpatterns = [
# -- Vista pricipal (índice)
path('', views.index, name='index'),
path('panaderia.html/', views.p... | martaquintana/2019-2020-LTAW-Practicas | P2/mi_tienda_web/mi_panaderia/urls.py | urls.py | py | 701 | python | es | code | 0 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.urls.path",... |
33093921448 | import solution
from collections import defaultdict
from sortedcontainers import SortedList
class Solution(solution.Solution):
def solve(self, test_input=None):
ops, vals = test_input
n, entries = vals[0]
# Your MovieRentingSystem object will be instantiated and called as such:
obj... | QuBenhao/LeetCode | problems/1912/solution.py | solution.py | py | 2,076 | python | en | code | 8 | github-code | 1 | [
{
"api_name": "solution.Solution",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "collections.defaultdict",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "sortedcontainers.SortedList",
"line_number": 34,
"usage_type": "argument"
},
{
"api... |
40926531737 | import argparse
import subprocess
import os
from qsub import q_sub
import shutil
def main():
# arguments
parser = argparse.ArgumentParser()
parser.add_argument('-block_info', help='CSV of homeoblock coords', required=True)
parser.add_argument('-key', help='CSV of chromosome names and corresponding re... | henryjuho/sal_enhancers | homeoblock_alignments/do_all_pairwise.py | do_all_pairwise.py | py | 2,708 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
... |
6585765676 | from UM.Job import Job
from UM.Logger import Logger
from .avr_isp import ispBase
from .avr_isp.stk500v2 import Stk500v2
from time import time, sleep
from serial import Serial, SerialException
# An async job that attempts to find the correct baud rate for a USB printer.
# It tries a pre-set list of baud rates. A... | Ultimaker/Cura | plugins/USBPrinting/AutoDetectBaudJob.py | AutoDetectBaudJob.py | py | 3,836 | python | en | code | 5,387 | github-code | 1 | [
{
"api_name": "UM.Job.Job",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "UM.Logger.Logger.debug",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "UM.Logger.Logger",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "UM.Logger.Logger.d... |
37978950788 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Written by H.Turbé, March 2020.
"""
import argparse
import os
import shutil
import sys
import time
from pyspark import SparkFiles
from pyspark.sql import SparkSession
CWD = os.getcwd()
FILEPATH = os.path.dirname(os.path.realpath(__file__))
ROOTPA... | hturbe/InterpretTime | src/operations/__exec_generate_data.py | __exec_generate_data.py | py | 2,775 | python | en | code | 23 | github-code | 1 | [
{
"api_name": "os.getcwd",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_n... |
70576316194 | import numpy as np
import easysim
import os
import torch
class YCB:
CLASSES = {
1: "002_master_chef_can",
2: "003_cracker_box",
3: "004_sugar_box",
4: "005_tomato_soup_can",
5: "006_mustard_bottle",
6: "007_tuna_fish_can",
7: "008_pudding_box",
8: "0... | NVlabs/handover-sim | handover/ycb.py | ycb.py | py | 5,389 | python | en | code | 66 | github-code | 1 | [
{
"api_name": "numpy.r_",
"line_number": 61,
"usage_type": "attribute"
},
{
"api_name": "numpy.round",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "easysim.Body",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "easysim.GeometryType",
"li... |
34552883298 | import gradio as gr
from spellchecker import SpellChecker
from itertools import permutations
def Anagram(words):
"""
A function that returns an anagram after filtering out the incorrect words.
It also returns the given word passed to the function whether anagaram is
generated or not.
"""
rand... | Jonaben1/Anagram | main.py | main.py | py | 1,427 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "spellchecker.SpellChecker",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "itertools.permutations",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "gradio.Interface",
"line_number": 47,
"usage_type": "call"
}
] |
71386683875 | import redis
import requests
from bs4 import BeautifulSoup
from celery import shared_task
from products.models import Product
from core.telegram_notification import telegram_notify
MARKETPLACE_URL = 'https://ozon.ru/seller/1/products'
redis_client = redis.StrictRedis(
host='redis',
port=6379,
db=0
)
d... | mxstrv/mxstrv-test-o-parser | ozon_parser/core/tasks.py | tasks.py | py | 5,591 | python | ru | code | 0 | github-code | 1 | [
{
"api_name": "redis.StrictRedis",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "requests.exceptions.ConnectionError",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "r... |
2316243589 | from __future__ import division, print_function, absolute_import
import numpy
from scipy.linalg.lapack import get_lapack_funcs
from scipy.linalg.misc import LinAlgError
__all__ = ['qrp', 'qlp', 'tri_inv']
# Duplicate from scipy.linalg.misc
def _datacopied(arr, original):
"""
Strict check for `arr` not shari... | Sabrina85/odemis | src/odemis/util/linalg.py | linalg.py | py | 3,299 | python | en | code | null | github-code | 1 | [
{
"api_name": "numpy.ndarray",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "numpy.asarray_chkfinite",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "scipy.linalg... |
19792334224 | import torch
import torch.nn as nn
import torch.nn.functional as F
from easydict import EasyDict as edict
import math
import torch.utils.model_zoo as model_zoo
__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
'resnet152']
model_urls = {
'resnet18': 'https://download.pytorch.org/mod... | GAIMJKP/summer_work | model_util.py | model_util.py | py | 12,858 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.nn.Conv2d",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "torch.nn.Module",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_nu... |
24217475763 | import faiss
import pandas as pd
import wandb
import time
import sys
wandb_name = sys.argv[1]
wandb.login(key='188ce11fc669c7ea709e957bece5360053daabe8')
wandb.init(id = id, project='faiss_clustering', entity='emilymuller1991')
n_clusters = 20
# prefix for hpc
# prefix = '/rds/general/user/emuller/home'
prefix = '/r... | emilymuller1991/thesis | chapter4clustering/faiss_clustering.py | faiss_clustering.py | py | 2,586 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.argv",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "wandb.login",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "wandb.init",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number"... |
24639727756 | import datetime
import time
from datetime import datetime
from typing import Optional
import holidays
import numpy as np
import pandas as pd
from gluonts.time_feature.holiday import (
BLACK_FRIDAY,
CHRISTMAS_DAY,
CHRISTMAS_EVE,
COLUMBUS_DAY,
CYBER_MONDAY,
EASTER_MONDAY,
EASTER_SUNDAY,
G... | aleksei-mashlakov/m6_competition | src/time_features.py | time_features.py | py | 5,570 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "gluonts.time_feature.holiday.squared_exponential_kernel",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "gluonts.time_feature.holiday.SpecialDateFeatureSet",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "gluonts.time_feature.holiday.NEW_YEARS... |
27070215388 | import json
import os
from flask import url_for
from flask_babel import _
from slugify import slugify
with open(
os.path.join(os.path.dirname(__file__), "countries.json"), encoding="utf8"
) as a:
COUNTRIES = sorted(json.load(a)["countries"], key=lambda k: k["name"])
COUNTRIES = [c for c in COUNTRIES if c[... | drkane/ngo-explorer | ngo_explorer/utils/countries.py | countries.py | py | 23,990 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "os.path.join",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number":... |
32596992467 | import heapq
from collections import defaultdict
class HuffmanNode:
def __init__(self, symbol, freq):
self.symbol = symbol
self.freq = freq
self.left = None
self.right = None
def __lt__(self, other):
return self.freq < other.freq
def build_huffman_tree(f... | s25672-pj/asdZad4 | zad4.py | zad4.py | py | 1,980 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "heapq.heappush",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "heapq.heappop",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "heapq.heappop",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "heapq.heappush",
"line... |
25846418713 | #!/usr/bin/python3
import discord
from discord.ext import commands
from spam_modules import meme
class MemeBot(commands.Cog):
def __init__(self,client):
self.client=client
@commands.command(name='help')
async def help(self,ctx):
h=discord.Embed(title='Help',description='Help for Disco Mem... | himanshudas75/Spam | spam_cogs/meteor.py | meteor.py | py | 863 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "discord.Embed",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "discor... |
40654443610 | import unittest
from datetime import datetime
from batteries.nubbin_battery import NubbinBattery
from batteries.spindler_battery import SpindlerBattery
class TestNubbin(unittest.TestCase):
def setUp(self) -> None:
self.current_date: datetime = datetime.today().date()
self.last_service_date: datet... | manucho254/forage-lyft-app | test/test_battries.py | test_battries.py | py | 1,956 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "unittest.TestCase",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.today",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datet... |
41977630402 | # %%
import os
import glob
import numpy as np
import torch
from PIL import Image, ImageDraw
from skimage import draw
from skimage.io import imread
from matplotlib import pyplot as plt
from scipy.ndimage.filters import gaussian_filter
from torch.utils.data import Dataset, DataLoader
from torchvision import tr... | NataliePolach/Bachelor-thessis | utils.py | utils.py | py | 3,034 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "transforms.append",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "transforms.Rescale",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "transforms.append",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "transforms.Nor... |
36176895571 | #----------------------------------------------------------------------
# A dataset wrapper for pluto simulations
#
# Author : Thomas Rometsch (thomas.rometsch@uni-tuebingen.de)
# Date : 2018-07-12
#----------------------------------------------------------------------
from cast.dataset import *
from . impor... | rometsch/cast | cast/pluto.py | pluto.py | py | 12,451 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "units.Dimension",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "units.Dimension",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "units.Dimension",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "units.Dimension",
... |
21578935466 | from fastapi.testclient import TestClient
import pytest
from app.main import app
from app.db import Base, engine
from app.cache import Cache
cache = Cache()
client = TestClient(app)
@pytest.fixture(autouse=True)
def cleanup_db():
Base.metadata.drop_all(bind=engine)
Base.metadata.create_all(bind=engine)
y... | csornyei/url-shortener | app/test_main.py | test_main.py | py | 4,650 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "app.cache.Cache",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "fastapi.testclient.TestClient",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "app.main.app",
"line_number": 9,
"usage_type": "argument"
},
{
"api_name": "app.db.Ba... |
22525694413 | import logging
import hydra
from omegaconf import DictConfig
logger = logging.getLogger(__name__)
class BiencoderDatasetsCfg(object):
def __init__(self, cfg: DictConfig):
datasets = cfg.datasets
self.train_datasets_names = cfg.train_datasets
logger.info("train_datasets: %s", self.train_d... | microsoft/LMOps | uprise/DPR/dpr/utils/conf_utils.py | conf_utils.py | py | 986 | python | en | code | 2,623 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "omegaconf.DictConfig",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "hydra.utils.instantiate",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "hydra.u... |
15818104013 | from models.calendar_model import CalendarItem
from dotenv import load_dotenv
import os
# id: int
# subject: str
# location: str
# starttime: str
# endtime: str
# categorycolor: str
# Load Secret Items
load_dotenv()
connection_string = os.getenv("ConnectionString")
# MongoDB Driver
import motor.motor_asyncio
client ... | DerenB/FARM-Stack-Dashboard | backend/db_functions/calendar_db_functions.py | calendar_db_functions.py | py | 1,586 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "motor.motor_asyncio.motor_asyncio.AsyncIOMotorClient",
"line_number": 18,
"usage_type": "call"
},
{
... |
11510356842 | # Released under the MIT License. See LICENSE for details.
#
"""Defines AppDelegate class for handling high level app functionality."""
from __future__ import annotations
from typing import TYPE_CHECKING
import babase
if TYPE_CHECKING:
from typing import Callable
import bascenev1
class AppDelegate:
"""... | efroemling/ballistica | src/assets/ba_data/python/baclassic/_appdelegate.py | _appdelegate.py | py | 1,336 | python | en | code | 468 | github-code | 1 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "bascenev1.GameActivity",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "bascenev1.Session",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name"... |
2325343679 | #!/usr/bin/env python
# HOUSE ROBBER
#
# - given list of values
# - return highest total value you can get by adding values - but none of the indexes can be touching
#
# NOTES
#
# - introduces RECURRANCE RELATIONSHIP which is a way to break up DYNAMIC PROGRAMMING problems
# - trick is to break the problem into subsets... | scorzo/python_algorithms | 13_1d_dyanmic_programming/03_house_robber.py | 03_house_robber.py | py | 1,424 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.List",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 40,
"usage_type": "call"
}
] |
19844910180 | #!/usr/bin/env python
# coding=utf-8
import rospy
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
import cv2
import numpy as np
from geometry_msgs.msg import Twist
rospy.init_node('line_follower')
cmd_vel_pub = rospy.Publisher('/cmd_vel', Twist, queue_size=1)
cv_bridge = CvBridge()
... | PARC-2023-Team-Mali/Line-followers-parc | parc_line_follower.py | parc_line_follower.py | py | 2,305 | python | fr | code | 0 | github-code | 1 | [
{
"api_name": "rospy.init_node",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "rospy.Publisher",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "geometry_msgs.msg.Twist",
"line_number": 13,
"usage_type": "argument"
},
{
"api_name": "cv_bridge... |
42581376596 | from tkinter import Tk, filedialog
import json
import os
Tk().withdraw() # prevents extra window
with filedialog.askopenfile(initialdir='~') as input_file:
base_name = os.path.basename(input_file.name)
if base_name.split('.')[-1] != 'ipynb':
raise ValueError("Expected file extension '.ipynb'")
in... | maxTarlov/interview-bot-source | utils/nb-remove-text.py | nb-remove-text.py | py | 811 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "tkinter.Tk",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "tkinter.filedialog.askopenfile",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "tkinter.filedialog",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "os.path.bas... |
36235255031 | # -*- coding: utf-8 -*-
"""
Created on Mon Nov 6 15:32:24 2017
@author: vidyag
"""
import tensorflow as tf
import numpy as np
import math
from scipy import misc
import glob
from autoencode import AutoEncoder
from layer_defs import variable_on_cpu, getConvInitializer
def fftshift(mat2D, dim0, dim1): #fftshift == i... | Mualpha7/Engineering_JupyterFiles | ENGR 090. Fourier ptychographic microscopy for biological samples/TensorFlowFunctions.py | TensorFlowFunctions.py | py | 58,048 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "tensorflow.cast",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "tensorflow.int32",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.cast",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "tensorflow.int3... |
11807018018 | from typing import List
import pandas as pd
from graphysio.dialogs import askUserValue
from graphysio.plotwidgets import PlotWidget
from graphysio.plotwidgets.curves import CurveItemWithPOI
from graphysio.structures import Parameter, PlotData
def get_perfusion_index(plotwidget: PlotWidget) -> List[CurveItemWithPOI]:... | jaj42/GraPhysio | graphysio/transformations/perfusion_index.py | perfusion_index.py | py | 1,512 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "graphysio.plotwidgets.PlotWidget",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "graphysio.structures.Parameter",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "graphysio.dialogs.askUserValue",
"line_number": 17,
"usage_type": "call"
... |
22710793236 | import pygame
import random
# creation de la class monstre
class Monster(pygame.sprite.Sprite):
def __init__(self, game):
super().__init__()
self.game = game
self.health = 100
self.max_health = 100
self.attack = 0.3
self.image = pygame.image.load('assets/bart.png')... | YvanMackowiak/SimpsonPython | monster.py | monster.py | py | 1,998 | python | fr | code | 0 | github-code | 1 | [
{
"api_name": "pygame.sprite",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "pygame.transfor... |
10338740792 | from PyQt5 import QtWidgets, QtCore, QtGui
from PyQt5.QtWidgets import QLabel
from menu_window import MenuWindow
class GUI(QtWidgets.QMainWindow):
"""
This is the base window where all the child widgets are placed.
All the child widgets act as seperate window.
This also holds all the variables shared... | jonirajala/ImgAnnotator | src/ui/gui.py | gui.py | py | 1,340 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 22,
"usage_type": "call"
},
{
"api_name":... |
11910453993 | from flask import jsonify, request
from app.models import Manufacturer, Token
from app import db
def deleteManufacturer(id):
'''delete manufacturer record'''
token = request.headers['TOKEN']
t=Token.query.filter_by(token=token).first()
is_expired=t.status
if id is n... | the1Prince/drug_repo | app/deletes/deleteManufacturer.py | deleteManufacturer.py | py | 964 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.request.headers",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "app.models.Token.query.filter_by",
"line_number": 12,
"usage_type": "call"
},
{
"api_name"... |
12021443393 | import discord
import asyncio
import sys
from datetime import datetime
import feedparser
import re
import time
import random
import os
client = discord.Client()
latestNum = 0
currentNum = 0
link = 'blank'
title = 'blank'
last = open("/last.txt", "r") #This file stores the last thread number so if the bot closes it ... | swmpdg/discord-mybb-thread-poster | bot.py | bot.py | py | 2,189 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "discord.Client",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "feedparser.parse",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
... |
71036138274 | import random
import tensorflow as tf
from dqn.agent import Agent
from dqn.environment import GymEnvironment
from config import get_config
flags = tf.app.flags
flags.DEFINE_string('env_name', 'Breakout-v0', 'The name of gym environment to use')
flags.DEFINE_boolean('display', False, 'Whether to do display the game ... | gutobortolozzo/reinforcement-learning-atari | main.py | main.py | py | 750 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "tensorflow.app",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.set_random_seed",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "random.seed",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "tensorflow.... |
27273086943 | import numpy as np
import scipy.stats as sts
import matplotlib.pyplot as plt
import functools as ft
#mu = 0
#std = 1
N = 10000
n_means = 2000
def Chi2_i(prediction_i, label_dist, population_variance=None, population_mean=None):
#Cowan p. 104
# The quantity (y_i - f(x_i, w)) / s_i is a measure of deviation b... | CLEANit/EGSnrc | egs_home/scatter-learn/misc/chi2_goodness_fit/chi2_demo.py | chi2_demo.py | py | 3,677 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.mean",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.var",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "numpy.random.uniform",
"line_numb... |
70888601635 | import csv
from io import StringIO
import json
import os
import requests
import sys
import unittest
from unittest.mock import patch
from etl.run import run_cmd_line
from etl.setup import ETLEnv
import pdb
REAL_GET = requests.get
def get_test_data_paths(format_, num_calls):
"Returns list of possible paths to t... | rhizomes-project/rhizomes-etl | etl/tests/test_tools.py | test_tools.py | py | 4,114 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "etl.setup.ETLEnv.instance",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "etl.setup.ETLEnv",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "os.path.... |
31915854876 | # -*- coding: utf-8 -*-
"""
TRABAJO 1.
Estudiante: JJavier Alonso Ramos
"""
# Importamos módulo para trabajar con datos matemáticos
import numpy as np
# Importamos módulo para gráficos 2D
import matplotlib.pyplot as plt
# Importamos el módulo para formater tablas
import pandas as pd
# Importamos el módu... | JJavier98/AA | PRACTICAS/P1/Template/Práctica1.py | Práctica1.py | py | 40,408 | python | es | code | 0 | github-code | 1 | [
{
"api_name": "numpy.random.seed",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "numpy.e",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "numpy.e",
"line_... |
24351569490 | import requests
from main import Position
url = 'http://127.0.0.1:8000/positions/'
def test_positions():
positions = [Position(cm=100, gp=20), Position(cm=100, gp=80)]
positions = [p.dict() for p in positions]
response = requests.post(url, json=positions)
assert response.json() == [{'cp': 50.0, 'cm'... | LuisIllig/savings-balancer | test_positions.py | test_positions.py | py | 466 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "main.Position",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 11,
"usage_type": "call"
}
] |
41209016704 | import threading, time
import multiprocessing
import socket
import json
import os
from kafka import KafkaConsumer, KafkaProducer, TopicPartition
from kafka.common import LeaderNotAvailableError
from kafka.errors import KafkaError
'''
KAFKA BASICS
describe a topic
/usr/local/kafka/bin/kafka-topics.sh -... | kartikra/dattasa | dattasa/kafka_system.py | kafka_system.py | py | 8,807 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "threading.Thread",
"line_number": 79,
"usage_type": "attribute"
},
{
"api_name": "threading.Thread.__init__",
"line_number": 81,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 81,
"usage_type": "attribute"
},
{
"api_name": ... |
72019823395 | from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_urllib_parse,
compat_urllib_request,
compat_urlparse,
)
from ..utils import (
ExtractorError,
int_or_none,
parse_duration,
)
class PluralsightIE(InfoE... | builder07/ytdl | youtube_dl/extractor/pluralsight.py | pluralsight.py | py | 7,598 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "common.InfoExtractor",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "compat.compat_urlparse.urljoin",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "compat.compat_urlparse",
"line_number": 61,
"usage_type": "name"
},
{
"api_na... |
28273046112 | RABBITMQ_HOST = 'localhost'
RABBITMQ_PORT = 5672
RABBITMQ_USER = 'guest'
RABBITMQ_PASS = 'guest'
import pika
from os import environ ###
#local RABBITMQ
hostname = environ.get('rabbit_host') or 'localhost'
port = environ.get('rabbit_port') or 5672
# connect to the broker and set up a communication cha... | peterwengg/Eevee-Trading | Backend/amqp_setup.py | amqp_setup.py | py | 4,384 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.environ.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "os.environ.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_numbe... |
35052674716 | import sqlite3
class Database:
def __init__(self, dbName):
self.dbName = dbName
self.con = sqlite3.connect('C://NFT_DATABASES/' + dbName +'.db')
def getNFT(self, id):
stmt = "SELECT * FROM NFT WHERE ID = " + str(id)
cursor = self.con.cursor()
cursor.execute(stmt)
... | Ahmad-Shehzad/NFT-Generator | NFT Image Creator/Database.py | Database.py | py | 1,735 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sqlite3.connect",
"line_number": 6,
"usage_type": "call"
}
] |
72259961953 | from django.db import models
from django.conf import settings
class CountCheckUtils:
@staticmethod
def seeding(index: int, single: bool = False, save: bool = True) -> models.QuerySet:
from apps.count_check.serializers import CountCheckBaseSr
if index == 0:
raise Exception('Indext m... | tbson/24ho | api/apps/count_check/utils.py | utils.py | py | 1,234 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "apps.count_check.serializers.CountCheckBaseSr",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "django.db.models.QuerySet",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 7,
"usage_type": "name"
}... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.