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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
37073202625 | #!/usr/bin/env python
# coding: utf-8
# In[3]:
import numpy as np
import pandas as pd
from sklearn.linear_model import LogisticRegression
from sklearn.neural_network import MLPClassifier
from sklearn.neighbors import KNeighborsClassifier
from sklearn.svm import LinearSVC
from sklearn.svm import SVC
from sklearn.gau... | nourassaf/machine-learning | trainingdatatrial2 (1).py | trainingdatatrial2 (1).py | py | 6,360 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.read_csv",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.StandardScaler",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": ... |
72349908703 | from nltk.tokenize import TweetTokenizer
def text_analyzer(text):
"""Analyze the incoming text to separate the
users that were mentionned and the hashtags
from the current actual text"""
tokenizer = TweetTokenizer()
tokens = tokenizer.tokenize(text)
mentions = filter(lambda x: x.startswith('@')... | Zadigo/mytwitter | feed/utils.py | utils.py | py | 439 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "nltk.tokenize.TweetTokenizer",
"line_number": 7,
"usage_type": "call"
}
] |
6357550611 | import cv2
import utils_stereovision as stereovision
if __name__ == '__main__':
# Preparing the images
stereo_pair = cv2.imread('./scenes/photo.png')
imgL, imgR = stereovision.splitStereoImage(stereo_pair)
rectifiedL, rectifiedR = stereovision.rectifyImages(imgL, imgR)
"""
# Using demonstratio... | GuiFornes/stereo-vision | src/4_disparity.py | 4_disparity.py | py | 3,042 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "cv2.imread",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "utils_stereovision.splitStereoImage",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "utils_stereovision.rectifyImages",
"line_number": 8,
"usage_type": "call"
},
{
"api_... |
4879271772 | from aiohttp import web
import json
async def handle(request):
response_obj = {'status': 'success'}
return web.Response(text=json.dumps(response_obj))
async def new_user(request):
try:
user = request.query['name']
print("Creating new user with name: ", user)
response_obj = {'s... | acanacar/ExecutionAlgo | study/asyncio_tutorialedge/rest_api_aiohttp.py | rest_api_aiohttp.py | py | 725 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "aiohttp.web.Response",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "aiohttp.web",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "json.dumps",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "aiohttp.web.Response",
"... |
11349361992 | import requests
from matrix import MatrixAPI
from urllib.parse import urljoin
import json
USER_ID = 'sharky@shark.pm'
HOMESERVER = 'https://' + USER_ID[USER_ID.index('@')+1:]
from settings import ACCESS_TOKEN
print(HOMESERVER)
m = MatrixAPI(access_token=ACCESS_TOKEN, homeserver=HOMESERVER, user_id=USER_ID)
print(m.wh... | SharkyRawr/matrix-chat-export | export.py | export.py | py | 1,341 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "matrix.MatrixAPI",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "settings.ACCESS_TOKEN",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "urllib.parse.urljoin",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "json.dump... |
71182398625 | from lxml.html import parse
from urllib.request import Request, urlopen
import re
class HTMLParser:
site = 'http://ice-data.tinro.ru/'
#site = 'http://192.168.2.33/'
@staticmethod
def parse_page():
req = Request(HTMLParser.site, headers={'User-Agent': 'Mozilla/5.0'})
page = parse(urlop... | etharner/ice | ice/report/html_parser.py | html_parser.py | py | 1,103 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "urllib.request.Request",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "lxml.html.parse",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "urllib.request.urlopen",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "re.matc... |
74368805344 | import argparse
import csv
def parse_arguments():
info = 'Extracts the residues that were significant hotspots'
parser = argparse.ArgumentParser(description=info)
parser.add_argument('-i', '--input',
type=str, required=True,
help='Full output from hotspot sc... | KarchinLab/HotMAPS | scripts/get_hotspot_residues.py | get_hotspot_residues.py | py | 2,704 | python | en | code | 20 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 64,
"usage_type": "call"
}
] |
26822005368 | from django.shortcuts import render, redirect,get_object_or_404
# Create your views here.
from .models import *
from django.views.generic.detail import DetailView
from django.views.generic import CreateView
from django.db.models import Q
# from .models import product,collections,categ
# Create your views here.
def s... | appuachu/shoeshopping | shop/views.py | views.py | py | 1,805 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.shortcuts.get_object_or_404",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "django.views.generic.detail.DetailView",
"line_number": 28,
"usage_type": "nam... |
6718080396 | from pytube import YouTube
import tempfile
import asyncio
import whisper
import os
async def audio_transcriber(path):
model = whisper.load_model("base")
audio = whisper.load_audio(path)
mel = whisper.log_mel_spectrogram(whisper.pad_or_trim(audio)).to(model.device)
_, probs = model.detect_language(mel)... | marcosaurelioo/Youtube-Transcriptor | script.py | script.py | py | 939 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "whisper.load_model",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "whisper.load_audio",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "whisper.log_mel_spectrogram",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "whisp... |
26495054609 | x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
square = lambda x: x * x
print(square(2))
result = list(map(square, x))
print(result)
print(list(map(square, result)))
#########################################################
##Functional
x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
def productArray(myList):
re... | Gerrydh/Multi-Paradigm-Prog | task2.py | task2.py | py | 645 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "functools.reduce",
"line_number": 31,
"usage_type": "call"
}
] |
41324314537 | import matplotlib.pyplot as plt
import numpy as np
import os
import matplotlib.ticker as ticker
def load_2_d_array(directory, col_number_y):
px_axis = np.loadtxt(directory, skiprows=3, usecols=(0,))
counts = np.loadtxt(directory, skiprows=3, usecols=(col_number_y,))
return np.transpose(np.stack... | Similarities/HighHarmonicGaussianFit | avg_divergence.py | avg_divergence.py | py | 3,867 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.loadtxt",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.transpose",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.stack",
"line_nu... |
15070379760 | import sympy as sm
import numpy as np
print('='*15,'TUGAS BESAR ALOGAIRTMA DAN PEMROGRAMAN','='*15)
print('''
+--------------------------------+
| SYARIIF ABDURRAHMAN BATHIK |
| 1202194114 |
| SI-43-09 ... | foxxxesky/HillChipper | HillChipper.py | HillChipper.py | py | 3,572 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sympy.Matrix",
"line_number": 27,
"usage_type": "call"
}
] |
72831795742 | from flask import Flask
webapp = Flask(__name__)
#statistic
global T_max_miss
global T_min_miss
global expand
global shrink
control = "http://127.0.0.1:5000/controller"
from AutoScaler import main
| hotpotkiller11/ECE1779s2023 | AutoScaler/__init__.py | __init__.py | py | 201 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 3,
"usage_type": "call"
}
] |
32406609453 | import pygame
import math as m
from enum import Enum
class Direct(Enum):
LEFT = 1
RIGHT = 2
class Tank:
def __init__(self, screen, color, land, x=0, y=0, weapon_list=[]):
self.screen = screen
self.color = color
self.x = 0
self.y = 0
self.weapon_lis... | D0ct0rZl0/pt_tanks | Tank.py | Tank.py | py | 3,137 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "enum.Enum",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "math.cos",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "math.radians",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "math.sin",
"line_number": 44,
... |
27378741215 | import fitz, os, time
rut = input('Ubicación del archivo: ')
pdf = input('Nombre del pdf (sin la extensión *.pdf): ') # A mejorar: detectar la terminación *.pdf
ruta = os.path.join(rut, '')
nom_pdf = "{}{}.pdf".format(ruta, pdf)
ruta_imgs = os.path.join('{}{}'.format(ruta, nom_pdf), '')
if not os.path.exists(pdf):... | jairomelo/extractor_imgs | extractores/extractor_dir.py | extractor_dir.py | py | 1,068 | python | es | code | 0 | github-code | 7 | [
{
"api_name": "os.path.join",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,... |
71254442465 | #! /usr/bin/env python3
import dbm
import datetime
import time
import concurrent.futures
import requests
import send_email
try:
import tomllib
except ModuleNotFoundError:
import tomli as tomllib
def check_get(http_endpoint: str) -> bool:
try:
r = requests.get(http_endpoint, timeout=30)
excep... | Fraetor/status-monitor | monitor.py | monitor.py | py | 2,139 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "requests.codes",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "time.sleep",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
... |
4024723279 | from conans import ConanFile, CMake, tools
import os
class PocoConan(ConanFile):
name = "poco"
version = "1.10.1"
settings = "os", "compiler", "build_type", "arch"
options = {"shared": [True, False], "fPIC": [True, False]}
default_options = {"shared": True, "fPIC": True}
#requires = "openssl/... | cartel1/lib_fetcher | nla_recipes/poco/conanfile.py | conanfile.py | py | 1,992 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "conans.ConanFile",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "conans.tools.Git",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "conans.tools",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "conans.CMake",
"lin... |
33953948472 | import requests
import json
import time
# -------------------------
# Jinja2
# -------------------------
from jinja2 import Environment, FileSystemLoader
template_dir = 'Templates/'
env = Environment(loader=FileSystemLoader(template_dir))
xmen_template = env.get_template('XMen.j2')
# -------------------------
# Header... | automateyournetwork/cerebro | MindMaps/Cerebro.py | Cerebro.py | py | 2,990 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "jinja2.Environment",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "jinja2.FileSystemLoader",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "requests.request",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "requests.re... |
21121841473 | from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.plugins.lookup import LookupBase
from ansible.module_utils.six import string_types
from ansible.errors import AnsibleError
import os
class LookupModule(LookupBase):
def run(self, terms, variables=None, **kwargs)... | manala/ansible-role-proxmox | lookup_plugins/manala_proxmox_files.py | manala_proxmox_files.py | py | 2,482 | python | en | code | 6 | github-code | 7 | [
{
"api_name": "ansible.plugins.lookup.LookupBase",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "ansible.module_utils.six.string_types",
"line_number": 40,
"usage_type": "argument"
},
{
"api_name": "ansible.errors.AnsibleError",
"line_number": 48,
"usage_type"... |
6629046775 | import numpy as np
import torch
from .explorer import Explorer
from see_to_touch.utils import OrnsteinUhlenbeckActionNoise
class OUNoise(Explorer):
def __init__(
self,
num_expl_steps,
sigma=0.8
):
super().__init__(num_expl_steps=num_expl_steps)
self.sigma = sigma
... | irmakguzey/see-to-touch | see_to_touch/agents/exploration/ou_noise.py | ou_noise.py | py | 1,085 | python | en | code | 32 | github-code | 7 | [
{
"api_name": "explorer.Explorer",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "see_to_touch.utils.OrnsteinUhlenbeckActionNoise",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 16,
"usage_type": "call"
},
{
"api_... |
73713211103 | # Python script to run fIC analysis functions
# Import relevant libraries
import numpy as np
import matplotlib.pyplot as plt
import glob
import os
import sys
import pickle
from scipy.io import savemat
import pandas as pd
# Import fIC analysis functions
sys.path.insert(0,r'C:\Users\adam\OneDrive - University College L... | adamphippsUCL/VERDICT-Screening | VERDICT Fitting/In vivo/Run_fIC_analysis.py | Run_fIC_analysis.py | py | 5,788 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.path.insert",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "glob.glob",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "os.path.basename",
"line_... |
10643301558 | from django.shortcuts import render, redirect
# Create your views here.
from .models import Service
from django.template import loader
from .forms import ServiceForm
from datetime import datetime
from django.contrib.auth.models import User
from rest_framework import generics
from .serializers import Service... | arvindkushwah9/Embassy | services/views.py | views.py | py | 3,610 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "models.Service.objects.filter",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "models.Service.objects",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "models.Service",
"line_number": 18,
"usage_type": "name"
},
{
"api_name... |
3573925005 | import http
from datetime import datetime
from .utils import *
def init_upload_routes(app, socketio):
@app.route('/upload', methods=['POST'])
def upload():
file = request.files['file']
path = request.form['path']
# overwrite = request.form['overwrite']
# print(overwrite)
... | ZiqiXiao/ml-platform-v2 | python-flask/app/views/upload.py | upload.py | py | 1,839 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "http.HTTPStatus",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "http.HTTPStatus",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.timestamp",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": ... |
33454867335 | import matplotlib.pyplot as plt
import numpy as np
from scipy.optimize import curve_fit
from scipy.signal import find_peaks_cwt
from uncertainties import ufloat
import scipy.constants as c
import math
from lmfit import minimize, Parameter, Model
DA, ErrDA, IA, MA = np.loadtxt('data/Aluminium.txt', unpack=True)
DB, IB,... | phlipo95/AP-Praktikum | V704 - Absorbtion von gamma- und beta-Strahlung/plot.py | plot.py | py | 2,725 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.loadtxt",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_num... |
3293444088 | from django.http import HttpResponse
from upload.forms import UploadFileForm
from django.shortcuts import render
from upload.models import *
import openpyxl
def upload_file(request):
def get_last_used_row(sheet):
row = sheet.max_row
while row > 0:
cells = sheet[row]
if all(... | ChesterCode/testing | testing/upload/views.py | views.py | py | 3,338 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "upload.forms.UploadFileForm",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "openpyxl.load_workbook",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "django.http.HttpResponse",
"line_number": 69,
"usage_type": "call"
},
{
"api_n... |
929999383 | import cv2 as cv
import numpy as np
import mediapipe as mp
import math
from PIL import Image
from numpy.lib.function_base import average
LEFT_EYE = [362, 382, 381, 380, 374, 373, 390, 249, 263, 466, 388, 387, 386, 385, 384, 398]
RIGHT_EYE = [33, 7, 163, 144, 145, 153, 154, 155, 133, 173, 157, 158, 159, 160, 161, 246]
... | taheralmoussali/PDE_Reader | eye_process.py | eye_process.py | py | 7,841 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "math.sqrt",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "PIL.Image.fromarray",
"line_number": 118,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 118,
"usage_type": "name"
},
{
"api_name": "numpy.asarray",
"line_n... |
10142450400 | #PIC16
#Assignment10M
#Keith Atienza
#Li, Chak Yin (Anders) 704950093
import sys
import socket
from PyQt5.QtCore import Qt, QTimer
from PyQt5.QtWidgets import QApplication, QWidget, QLabel, QTextEdit, QVBoxLayout, QSizePolicy, QLineEdit, QMessageBox
# from PyQt5.QtGui import QPainter, QColor
class ChatWindo... | andersli53/Course-Work | python/Assignment10M.py | Assignment10M.py | py | 2,724 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QLabel",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QLineEdit",
"line_number": 28,
"usage_type": "call"
},
{
"api_name... |
6894151715 | import numpy as np
import tensorflow as tf
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import parameter_initialization as pi
import activation_func as af
NLAYER = 5
NUNIT = [100, 80, 60, 40, 10]
EPOCH = 10
LEARNING_RATE = 0.05
ACTIVATION_FUNC = {'Step': af.step, 'SimpleReturn': ... | TorigoNozomi/dnn | demo_variance_viewer_001.py | demo_variance_viewer_001.py | py | 1,305 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "matplotlib.use",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "activation_func.step",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "activation_func.simplereturn",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_nam... |
74918264542 | import datetime
from torch.optim import AdamW
from torch.optim.lr_scheduler import ReduceLROnPlateau
from src.__init__ import *
from src.utils.bbox import convert_bbox, untransform_bbox
from src.dataset.metric import Evaluate_COCO
from src.model.efficientdet import EfficientDet
from src.loss.focal_loss import Focal_Lo... | hotcouscous1/efficientdet-on-pytorch-lightning | src/lightning_model.py | lightning_model.py | py | 7,402 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "src.model.efficientdet.EfficientDet",
"line_number": 92,
"usage_type": "call"
},
{
"api_name": "torch.optim.load",
"line_number": 101,
"usage_type": "call"
},
{
"api_name": "torch.optim",
"line_number": 101,
"usage_type": "name"
},
{
"api_name": "to... |
34509220909 | import numpy as np
import math
from matplotlib import pyplot as plt
# B is self_localization
def destinationPoint(objeCordinates, destinationPoints, b,finishCounter,pastObje):
dist=np.array([])
index=np.array([])
p=0
k=0
for j in range(objeCordinates.shape[0]):
deltX= objeCordinates[j][0]-b... | aliaydin96/EngineeringDesign | Algorithm/MainCodes/Destination.py | Destination.py | py | 2,694 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "numpy.array",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.arctan2",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 1... |
70506037982 | '''
Convolutional autoencoder that imposes a gaussion prior
on latent variables.
'''
import numpy as np
import tensorflow as tf
import mnist
import matplotlib.pyplot as plt
import sklearn.decomposition
from mpl_toolkits.mplot3d import Axes3D
tfd = tf.contrib.distributions
DISPLAY = True
USE_LAST = False
lat_dim = 8
... | arjunsripathy/Auto-Encoders | Project Files/conv_vae.py | conv_vae.py | py | 3,405 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "tensorflow.contrib",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.placeholder",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "tensorflow.float32",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name":... |
74791106783 | import warnings
from dataclasses import dataclass
from typing import Callable, Dict, Literal, Optional, Sequence, Union
from spekk import Spec, trees
from spekk.util.slicing import IndicesT, slice_data, slice_spec
from vbeam.apodization.util import get_apodization_values
from vbeam.core import SignalForPointData
from... | magnusdk/vbeam | vbeam/data_importers/setup.py | setup.py | py | 4,814 | python | en | code | 19 | github-code | 7 | [
{
"api_name": "vbeam.core.SignalForPointData",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "spekk.Spec",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "vbeam.scan.S... |
73301838944 | import cv2
import numpy as np
import matplotlib.pyplot as plt
from My_src.detection_keypoint import DetectKeypoint
from My_src.classification_keypoint import KeypointClassification
# 创建检测关键点和分类关键点的实例
detection_keypoint = DetectKeypoint()
classification_keypoint = KeypointClassification(
'./My_models/My_... | swordcross/Yoga_9sposes | My_backup/app.py | app.py | py | 2,501 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "My_src.detection_keypoint.DetectKeypoint",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "My_src.classification_keypoint.KeypointClassification",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.rectangle",
"line_number": 28,
"usage_t... |
16970181646 | import pytest
import day_06.process
def test_example():
c = day_06.process.ChronalCoods()
c.coords = [
[1, 1],
[1, 6],
[8, 3],
[3, 4],
[5, 5],
[8, 9],
]
c.get_min_max()
c.calculate_nearest_coords()
assert c.retrieve_largest_finite_area() == 17
... | Fiddle-N/advent-of-code-2018 | day_06/test.py | test.py | py | 397 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "day_06.process.process.ChronalCoods",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "day_06.process.process",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "day_06.process",
"line_number": 6,
"usage_type": "name"
},
{
"api_n... |
34589947960 | """Define the default Vector class."""
from __future__ import division
from copy import deepcopy
import numbers
from six import iteritems, itervalues
from six.moves import zip
import numpy as np
from openmdao.vectors.vector import Vector, INT_DTYPE
from openmdao.vectors.default_transfer import DefaultTransfer
real... | ardalanghadimi/ATC | openmdao/vectors/default_vector.py | default_vector.py | py | 23,566 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numbers.Real",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "numpy.float32",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "numpy.float64",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "openmdao.vect... |
28829815984 | from flask import redirect, url_for, request, make_response
from app import db, model
from app.middlewares.auth.login import user_login_require
from app.middlewares.cart.cart import cart_check
@user_login_require
@cart_check
def order_create():
cart_id = getattr(request, 'cart_id', None)
user_id = getattr(r... | MahdiPeydai/Coffee-shop | app/controller/web/checkout/order/order.py | order.py | py | 1,842 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.request",
"line_number": 12,
"usage_type": "argument"
},
{
"api_name": "flask.request",
"line_number": 13,
"usage_type": "argument"
},
{
"api_name": "app.model.Address.query.filter_by",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": ... |
35814435861 | from flask import Flask, render_template, request
app = Flask(__name__)
@app.route("/")
def index():
# return "hello world"
name = request.args.get("name", "world")
return render_template("index.html", name=name)
# env FLASK_APP=application flask run
| CliffKnight/cup-of-wine | cs50/week7/hello/application.py | application.py | py | 267 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "flask.request.args.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.request.args",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "flask.request... |
34393171680 | import discord
from discord.ext import commands
import asyncio
import random
import os
import json
from dotenv import load_dotenv
import twitterapi
from clashroyaleapi import clashRoyale
from gifeditor import create_gif
bot = commands.Bot(command_prefix='.')
@bot.event
async def on_ready():
print("Bot is ready")... | 24Chromosones/mitchel-bot | main.py | main.py | py | 7,656 | python | en | code | 2 | github-code | 7 | [
{
"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": "asyncio.sleep",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "clashroya... |
73443597982 | #!/usr/bin/env python3
"""
Programme pour afficher la documentation python
Par austin brodeur
"""
import sys
import colorama
from colorama import Fore
import re
import math
colorama.init()
GLOBALS = {"__builtins__":{} ,**math.__dict__,"abs":abs,"min":min,"max":max,"sum":sum}
LOCALS = {}
def main() -> None:
"""
... | mugiebros/Somme | pyhelp.py | pyhelp.py | py | 1,588 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "colorama.init",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "math.__dict__",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "re.compile",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_numb... |
13837636210 | # builin imports
import asyncio
from concurrent.futures import ProcessPoolExecutor
import os
import logging
# Initialize logging
logging.basicConfig(level=logging.INFO,filename="telethon.log",filemode="a+",format= '[%(levelname)s] {%(pathname)s:%(lineno)d} %(asctime)s %(message)s')
logging.info("[!] Logging initi... | mosishon/ferenzi | main.py | main.py | py | 3,470 | python | en | code | 11 | github-code | 7 | [
{
"api_name": "logging.basicConfig",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "logging.info",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "colorama.init",
... |
21441521168 | import collections
import re
from typing import List
# 금지된 단어를 제외한 가장 흔하게 등장하는 단어를 출력하라. 대소문자 구분을 하지 않으며, 구두점 또한 무시한다.
paragraph = 'Bob hit a ball, the hit BALL flew far after it was hit'
banned = ['hit']
# => 'ball'
def mostCommonWord(self, paragraph: str, banned: List[str]) -> str:
words = [word for word in re... | luckyhyom/algolithms | python-algorith-interview/string-control/most-common-word-comprehension-counter.py | most-common-word-comprehension-counter.py | py | 904 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "re.sub",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 16,
"usage_type": "call"
}
] |
24913689780 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import re
import random
from os.path import join
from social_auth.models import UserSocialAuth
from facebook import GraphAPI
from myimgat.providers.base import ImageProvider, Album, Photo
def format_url(url):
return url.replace('http://', '').replace('https://', '')
cl... | timehome/djangodash2011 | myimgat/providers/fb.py | fb.py | py | 2,473 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "myimgat.providers.base.ImageProvider",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "social_auth.models.UserSocialAuth.objects.get",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "social_auth.models.UserSocialAuth.objects",
"line_number":... |
12872687419 | import matplotlib.pyplot as plt
import numpy as np
def getData():
N = 100 # class마다 점의 갯수
D = 2 # point의 dimension
K = 3 # class 갯수
X = np.zeros((N*K, D)) # data matrix (각 row가 data point)
y = np.zeros(N*K, dtype='uint8') # class label들
for j in range(K):
ix = range(N*j, N*(j+1))
... | Hulk89/NeuralNetworkTraining | data.py | data.py | py | 757 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.zeros",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_numb... |
37122176766 | from typing import TYPE_CHECKING
import opengsq
from opengsq.socket_async import SocketAsync
from discordgsm.protocols.protocol import Protocol
if TYPE_CHECKING:
from discordgsm.gamedig import GamedigResult
class Scum(Protocol):
pre_query_required = True
name = 'scum'
master_servers = None
asy... | DiscordGSM/GameServerMonitor | discordgsm/protocols/scum.py | scum.py | py | 1,377 | python | en | code | 83 | github-code | 7 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "discordgsm.protocols.protocol.Protocol",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "opengsq.Scum.query_master_servers",
"line_number": 18,
"usage_type": "call"
... |
13593607571 | import boto3
import json
import os
import base64
ses = boto3.client("ses")
from utility.utils import create_response
s3 = boto3.client('s3')
sns = boto3.client('sns')
def lambda_handler(event, context):
user = event['user']
invitedEmail = event['invitedEmail']
sender = "anastasijas557@gmail.com"
se... | kaca01/cloud-computing | back/sendFamilyVerification/send_family_verification.py | send_family_verification.py | py | 997 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "boto3.client",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "utility.utils.create_response",
... |
43435655038 | import numpy as np
import pandas as pd
import graphviz
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import confusion_matrix
from sklearn.externals import joblib
from sklearn.metrics ... | A-K-1/photo-recommender | test.py | test.py | py | 9,332 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sklearn.ensemble.RandomForestClassifier",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 233,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 239,
"usage_type": "call"
},
{
"api_nam... |
73264189343 | import asyncio
import os
import time
import requests
from config import START_IMG_URL
from pyrogram import filters
import random
from pyrogram import Client
from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton, ReplyKeyboardMarkup
from strings.filters import command
from AnonX import (Apple, ... | asaaqaa/wry | AnonX/plugins/developers.py | developers.py | py | 4,686 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pyrogram.Client",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "pyrogram.types.Message",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "pyrogram.types.InlineKeyboardMarkup",
"line_number": 31,
"usage_type": "call"
},
{
"api_na... |
17081310775 | from models.roulete import bet
from app import db
import random
import datetime
import json
import copy
class Roulete :
def __init__(self, id ):
self.id = id
self.state = 0
self.bets = []
self.BetsTable = "bet"+ str(self.id)
def open (self ) :
self.state = 1... | afgvn/rouletteAPI | models/roulete/roulete.py | roulete.py | py | 2,553 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "datetime.datetime.now",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.now",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "da... |
34954475087 | # coding=utf-8
import cv2
import numpy
import matplotlib.pyplot as plot
cap = cv2.VideoCapture(0)
while 1:
# get a frame
ret, frame = cap.read()
# show a frame
cv2.imshow("capture", frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
cv2.imwrite("now.jpg", frame)
break
cap.release()
cv2.d... | Mike-Strong/everedit | speech/test_cv.py | test_cv.py | py | 338 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.imwrite",
"line_number... |
4899032462 | #Herhangi bir url adresine göre çalışacak fonksiyonların yazıldığı dosyadır.
from django.shortcuts import render,HttpResponse,redirect,get_object_or_404,reverse
from .forms import ArticleForm
from django.contrib import messages
from .models import Article,Comment #article klasörünün içinde ki models dosyasında yer alan... | esraozkanli/django_blog_app | article/views.py | views.py | py | 6,137 | python | tr | code | 0 | github-code | 7 | [
{
"api_name": "models.Article.objects.filter",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "models.Article.objects",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "models.Article",
"line_number": 15,
"usage_type": "name"
},
{
"api_name... |
31737504237 | import json
with open('data.json', 'r',encoding='utf-8') as f:
data_str = f.read()
data = json.loads(data_str)
def get_participle(subject):
participle = None
if "We" in subject or "You" in subject or "They" in subject:
participle = "are"
elif "He" in subject or "She" in subject:
participle = "is"
... | JetHughes/computational-problem-solving | 05-look-whos-talking/generatetests.py | generatetests.py | py | 1,257 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "json.loads",
"line_number": 5,
"usage_type": "call"
}
] |
693255176 | import sqlite3
import ftplib
#connect to our local database
#based off of http://kaikaichen.com/?p=59
conn = sqlite3.connect('edgar_idx.db')
cur = conn.cursor()
ftp = ftplib.FTP('ftp.sec.gov')
ftp.login()
def query(name=None, startDate='1993-01-01', endDate='2017-01-01', type='8-K'):
print(name, startDate, endDat... | ezra-lieblich/CS316Final | dataScraping/retrieve.py | retrieve.py | py | 1,104 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sqlite3.connect",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "ftplib.FTP",
"line_number": 8,
"usage_type": "call"
}
] |
25305434331 | import os
import re
import shlex
import sys
from setuptools import setup
exec(open('./_version.py').read())
if sys.argv[-1] == "publish":
os.system(shlex.quote("cleanpy ."))
os.system(shlex.quote("python setup.py sdist"))
os.system(shlex.quote(f"twine upload dist/HSPsquared-{__version__}.tar.gz"))
sys... | respec/HSPsquared | setup.py | setup.py | py | 3,816 | python | en | code | 37 | github-code | 7 | [
{
"api_name": "sys.argv",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.system",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "shlex.quote",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 11,... |
7346338023 |
from collections import defaultdict
import random, math
import numpy as np
import pickle
from functools import partial
class QLearningAgent:
def __init__(self, alpha, epsilon, discount, get_legal_actions):
self.get_legal_actions = get_legal_actions
#self._qvalues = defaultdict(lambda: defaultdict(... | MegaYEye/traj_follow_q | QLearningAgent.py | QLearningAgent.py | py | 3,122 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "collections.defaultdict",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "functools.partial",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "random.random",
"line_number": 91,
"usage_type": "call"
},
{
"api_name": "random.choice... |
72021157982 | from flask import Blueprint, abort, render_template, request, flash, redirect, url_for
from bson.objectid import ObjectId
from flask_login import current_user, login_required
from __init__ import mongo
from routes.image import uploadImage
bakery = Blueprint('bakery', __name__, template_folder="templates")
def role_r... | jewarner57/doughversity | routes/bakery.py | bakery.py | py | 5,060 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Blueprint",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask_login.current_user.is_anonymous",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "flask_login.current_user",
"line_number": 19,
"usage_type": "name"
},
{
... |
23380962596 | # -*- coding: utf-8 -*-
import os
import mne
dir_root='/Users/nm.costa/Desktop/'
filename='1_pycorder_1min'
filepath=os.path.join(dir_root, 'e1_debug_experiment_2/raw_pycorder_data', filename+'.vhdr')
raw = mne.io.read_raw_brainvision(filepath, preload=True)
out_filepath=os.path.join(dir_root, 'e1_debug_experiment_2... | nmc-costa/neuroprime | neuroprime/src/utils/data_analysis/e2_pipe/eeg/io/bva2fif.py | bva2fif.py | py | 380 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "os.path.join",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "mne.io.read_raw_brainvision",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "mne.io",
"lin... |
42087341020 | import os
import random
import pandas as pd
from sklearn.naive_bayes import MultinomialNB as MB
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import HashingVectorizer
from sklearn.metrics import confusi... | aaron23pueschel/NaiveBayes | NB.py | NB.py | py | 4,897 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.scandir",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.scandir",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "sklearn.naive_bayes.MultinomialNB",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "sklearn.featu... |
11125831070 | from itertools import tee,zip_longest
from textblob import TextBlob
import nltk
import re
import math
def pairwise(iterable):
"""
Adjacent pairs with overlap
>>> list(pairwise(range(5)))
[(0, 1), (1, 2), (2, 3), (3, 4), (4, None)]
"""
a, b = tee(iterable) # tee returns n independent iterable ob... | bioRichard/new_words_identify | test.py | test.py | py | 1,885 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "itertools.tee",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "itertools.zip_longest",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "math.log",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "math.log",
"line_num... |
15046955242 | from operator import *
from functools import reduce
def do(i):
w={}
o={'NOT':invert,'AND':and_,'OR':or_,'LSHIFT':lshift,'RSHIFT':rshift}
f=sorted(i.split('\n')[:-1])[::-1]
g=lambda v:w[v] if v.isalpha() else int(v)
while f:
l=f.pop()
a,b=l.split(' -> ')
p,c=reduce(lambda x,y:... | grit96/advent-of-code | 7.py | 7.py | py | 641 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "functools.reduce",
"line_number": 11,
"usage_type": "call"
}
] |
24677935391 | import argparse
import json
import os
import time
import torch
#=====START: ADDED FOR DISTRIBUTED======
from distributed import init_distributed, apply_gradient_allreduce, reduce_tensor
from torch.utils.data.distributed import DistributedSampler
#=====END: ADDED FOR DISTRIBUTED======
from torch.utils.data import Da... | NVIDIA/nv-wavenet | pytorch/train.py | train.py | py | 6,443 | python | en | code | 728 | github-code | 7 | [
{
"api_name": "torch.nn",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.CrossEntropyLoss",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "os.path.isfile"... |
43414011296 | import sys
import res_rc
import base64
import subprocess
from PIL import Image
from io import BytesIO
from random import randint
from base64 import b64encode
from PyQt5.uic import loadUi
from Crypto.Cipher import AES
from PyQt5 import QtCore, QtWidgets
from Crypto.Util.Padding import pad
from Crypto.Util.Pa... | nxsxhb/securitext | root.py | root.py | py | 12,087 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCore.Qt",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtCore",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "PyQt5.Q... |
72845042142 | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | Ascend/ModelZoo-PyTorch | ACL_PyTorch/contrib/cv/super_resolution/Real-ESRGAN/Real-ESRGAN_postprocess.py | Real-ESRGAN_postprocess.py | py | 1,614 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "os.listdir",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.fromfile",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "numpy.transpose",
"l... |
39501271796 | from flask import Flask, request
from utils import get_requirements, get_users, get_astronauts, get_mean
app = Flask(__name__)
@app.route('/requirements/')
def requirements():
"""
Task #1
open requirements.txt file and return its contents
"""
result = get_requirements()
return result
@app.r... | aspyrin/flask_lesson | main.py | main.py | py | 1,359 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "utils.get_requirements",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.request.args.get",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "flask.reques... |
24672391304 | """ This module extracts syntactic features. """
import subprocess
import os
import re
import nltk.tree
from utils import file_utils
from utils.lexicosyntactic import yngve
def get_lu_complexity_features(lu_analyzer_path, transcript_filepath, transcript_filename, output_lu_parse_dir):
''' This function extracts... | SPOClab-ca/COVFEFE | utils/lexicosyntactic/syntactic_features.py | syntactic_features.py | py | 9,265 | python | en | code | 29 | github-code | 7 | [
{
"api_name": "subprocess.call",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line... |
16010265905 | from functools import reduce
numeros = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
quadrados = list(map(lambda x: x ** 2, numeros))
print("Quadrados dos números:", quadrados)
numeros_pares = list(filter(lambda x: x % 2 == 0, numeros))
print("Números pares:", numeros_pares)
soma = reduce(lambda x, y: x + y, numeros)
print("S... | AnthonyPCardoso/python | infinity/funcII.py | funcII.py | py | 356 | python | pt | code | 0 | github-code | 7 | [
{
"api_name": "functools.reduce",
"line_number": 14,
"usage_type": "call"
}
] |
11727016478 | import sys
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
class Window(Gtk.ApplicationWindow):
def __init__(self, app):
super().__init__(application=app)
from glglue.scene.sample import SampleScene
self.scene = SampleScene()
import glglue.gtk3
... | ousttrue/glglue | examples/gtk3_sample.py | gtk3_sample.py | py | 632 | python | en | code | 10 | github-code | 7 | [
{
"api_name": "gi.require_version",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "gi.repository.Gtk.ApplicationWindow",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "gi.repository.Gtk",
"line_number": 8,
"usage_type": "name"
},
{
"api_na... |
9965182086 | import logging
from typing import List
import torch
from torch.nn.utils.rnn import pad_sequence
from asr.text_encoder.text_encoder import TextEncoder
logger = logging.getLogger(__name__)
def collate_fn(dataset_items: List[dict]):
"""
Collate and pad fields in dataset items.
"""
audio = [item["audio... | khaykingleb/Automatic-Speech-Recognition | asr/collate_fn/collate.py | collate.py | py | 1,301 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "torch.LongTensor",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.nn.utils.rnn.pad_... |
34356563406 | #!/usr/bin/python
# encoding: utf8
import os
import sys
import urllib2
import socket
import time
import datetime as dt
import xml.etree.ElementTree as Et
import multiprocessing as mp
import idna
import urlparse
import logging
from argparse import ArgumentParser
cliparse = ArgumentParser()
cliparse.add_argument('-l', ... | gadzhet/check_zapret | check_zapret.py | check_zapret.py | py | 9,108 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
... |
77750838 | import cv2
import json
import multiprocessing as mp
import numpy as np
import os
import torch
import torchvision.transforms as transforms
from torch.utils.data import Dataset, DataLoader
'''
old_range = old_max - old_min
new_range = new_max - new_min
new_val = (((old_val - old_min) * new_range) / old_range) + new_mi... | filipgrigorov/dermatologist_ai | datasets.py | datasets.py | py | 3,957 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "json.load",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 38,
... |
6091837696 | import requests
from .exceptions import SearchGoogleNewsError
from .parse import ParseSearch
class Search:
def __init__(self, host_language='pt-BR', geolocation='BR'):
"""
The user can set host language and geolocation
for better search results.
"""
self.geolocatio... | fernandoarrj/googlenewspy | googlenewspy/search.py | search.py | py | 1,007 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "exceptions.SearchGoogleNewsError",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "parse.ParseSearch",
"line_number": 31,
"usage_type": "call"
}
] |
20937867000 | import random
import discord
from utils import http
from discord.ext import commands
class Animals (commands.Cog):
def __init__ (self, bot):
self.bot = bot
self.unsplash_token = self.bot.unsplash_token
@commands.command(name = 'cat', aliases = ['meow', 'randomcat'])
asyn... | unseen-ninja/discord-ninja | cogs/animals.py | animals.py | py | 9,761 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "utils.http.get",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "utils... |
32909860035 | import re
from typing import Any, cast
from ebooklib.epub import (
EpubBook,
EpubHtml,
EpubItem,
EpubNav,
EpubNcx,
Link,
write_epub,
)
from parsel import Selector
from shamela2epub import __version__
from shamela2epub.misc.constants import SHAMELA_DOMAIN
from shamela2epub.misc.patterns imp... | yshalsager/shamela2epub | shamela2epub/models/epub_book.py | epub_book.py | py | 6,924 | python | en | code | 12 | github-code | 7 | [
{
"api_name": "ebooklib.epub.EpubBook",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "ebooklib.epub.EpubHtml",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "ebooklib.epub.Link",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "eboo... |
71894502623 | # coding=utf-8
"""Project level settings."""
from .project import * # noqa
import os
if 'SENTRY_KEY' in os.environ:
SENTRY_KEY = os.environ['SENTRY_KEY']
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
sentry_sdk.init(
dsn=SENTRY_KEY,
integrations=[Djan... | kartoza/ford3 | django_project/core/settings/prod.py | prod.py | py | 1,175 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.environ",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "sentry_sdk.init",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sentry_sdk.integrations... |
29326502964 | from __future__ import print_function
import errno
import optparse
import sys
import saltlint
import saltlint.formatters as formatters
import six
from saltlint import RulesCollection
from saltlint.version import __version__
import yaml
import os
def load_config(config_file):
config_path = config_file if config_... | myii/salt-lint | lib/saltlint/__main__.py | __main__.py | py | 4,117 | python | en | code | null | github-code | 7 | [
{
"api_name": "os.path.exists",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "yaml.safe_load",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "yaml.YAMLERROR",
"line... |
2923582539 | import cv2
import os
import numpy as np
from skimage.util import random_noise
def data_augmentation(image_path, folder_path, number_of_variations=16):
# Carregar a imagem original
# Obter o nome do arquivo sem a extensão
filename = os.path.splitext(os.path.basename(image_path))[0]
# percorrer o num... | juniorklawa/pdi_ml | data_augmentation.py | data_augmentation.py | py | 4,851 | python | pt | code | 0 | github-code | 7 | [
{
"api_name": "os.path.splitext",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.basename",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line... |
8653968493 | from __future__ import unicode_literals
import io
import logging
import os
import tempfile
import textwrap
import time
import psutil
import requests
from six.moves import configparser
from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass
setUpModule, SlapOSInstanceTestCase = makeModuleSetUpAndTestCase... | SlapOS/slapos | software/grafana/test/test.py | test.py | py | 11,681 | python | en | code | 37 | github-code | 7 | [
{
"api_name": "slapos.testing.testcase.makeModuleSetUpAndTestCaseClass",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
... |
11692062711 | from django.test import Client, TestCase
from ..models import Disaster, Continent, Region, Type
class DisasterModelTest(TestCase):
fixtures = ['disaster.json']
# 1
def test_disaster(self):
disaster = Disaster.objects.get(disasterNo="2020-0055-WEF")
self.assertEqual(disaster.year, 2020)
... | azusaw/hotel_CS551Q | disaster/tests/test_models.py | test_models.py | py | 1,111 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "django.test.TestCase",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "models.Disaster.objects.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "models.Disaster.objects",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_... |
7759836699 | from PIL import Image
import cv2
import torch
from dataset.dataloader import ResNetDataset
import torch.optim as optim
import torch.nn as nn
import torchvision.models as models
import os
import time
import numpy as np
import argparse
from network.models import *
from network.metrics import *
# from torchsampler import ... | TannedCung/mask_on_cls | eval.py | eval.py | py | 13,743 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.nn.CrossEntropyLoss",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 50,
"usage_type": "name"
},
{
"api_name": "torch.devi... |
46545927187 | import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Output, Input
import plotly.express as px
import dash_bootstrap_components as dbc
import pandas as pd
from raceplotly.plots import barplot
def human_format(num):
num = float('{:.3g}'.format(num))
m... | grepto/dash-macrodata | app.py | app.py | py | 8,245 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.options",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "pandas.options",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "dash.Dash",
... |
165719370 | # import the necessary packages
import tensorflow.keras.backend as K
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.pyplot import figure
def make_pairs(images, labels):
# initialize two empty lists to hold the (image, image) pairs and
# labels to indicate if a pair is positive or negative
... | rajeevratan84/siamese_network_laser | utilities/utils.py | utils.py | py | 4,184 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "numpy.unique",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.random.choice",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line... |
655143345 | import enum
import typing
class ChannelMode(enum.IntEnum):
"""Channel mode."""
Servo = 0
"""The channel is a servo."""
ServoMultiplied = 1 # unused, as far as I can tell
"""This value is defined within the Maestro Control Centre, but unused.
It is not recommended to use this channel mod... | alexdutton/python-maestro-servo | maestro/enums.py | enums.py | py | 3,750 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "enum.IntEnum",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "enum.IntEnum",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "typing.Dict",
"line_number": 53,
"usage_type": "attribute"
},
{
"api_name": "enum.IntEnum",
... |
33199145327 | #!env python
import io
import urllib
import smtplib
import argparse
import numpy as np
import pandas as pd
import yahoo_fin.stock_info as yfsi
import matplotlib.pyplot as plt
parser = argparse.ArgumentParser(usage='Inquire the price for stock, need the stock ID argument')
parser.add_argument('--sid', '-s', type = str... | HongzhenZhou/BestAShares | agu.py | agu.py | py | 3,548 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.int64",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "yahoo_fin.stock_info.get_data",
"line_number": 38,
"usage_type": "call"
},
{
"api_name":... |
10819881228 | import arcpy
import arcgis
import datetime
import os
import numpy
arcpy.env.overwriteOutput = True
def main():
#TableImport()
#caseBaseTable()
violationsBaseTable()
#actionsBaseTable()
#Action()
#Inspection()
#Contact()
Duration()
#Compliance()
#stDev()
#E... | m1ssing/ArcGIS-Online-Updates | AGO_CodeEnforcement.py | AGO_CodeEnforcement.py | py | 20,444 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "arcpy.env",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "arcpy.management.CopyRows",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "arcpy.management",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "arcpy.c... |
30721359338 | import numpy as np
import matplotlib.pyplot as plt
import sympy as sy
from sympy.utilities.lambdify import lambdify
def f(x):
x = sy.symbols('x')
return sy.sin(x)/x
def g(x):
return sy.exp(x)
def taylor_expansion(f, a=1, n=3):
x = sy.symbols('x')
func = f(x)
result = func.subs(x, a)
for i... | daniabib/ode-course | HomeWorks/HW1/exercise03.py | exercise03.py | py | 692 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sympy.symbols",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sympy.sin",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sympy.exp",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sympy.symbols",
"line_number": 14... |
6102207738 | import spacy
import json
from csv import DictWriter
from spacy.matcher import Matcher
# Load English tokenizer, tagger, parser, NER and word vectors
nlp = spacy.load("en_core_web_sm")
def is_ambiguous(sent: str):
doc = nlp(sent.lower())
matches = matcher(doc)
return len(matches) > 0
# Load the dataset
... | aliereny/speclarify-be | main.py | main.py | py | 1,374 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "spacy.load",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "spacy.matcher.Matcher",
"line_numbe... |
17424611330 | # -*- coding: utf-8 -*-
"""
Created on Sat Nov 30 11:34:57 2019
Using user input, identifies headwords that match other headwords
as variants of a single headword.
Outputs dataframe containing solely entry ids and variant types indicating
relations.
@author: Mark
"""
import pandas as pd
import json
from os import p... | markjosims/FLExEntry | ReorderMatches.py | ReorderMatches.py | py | 8,611 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.read_csv",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "ast.literal_eval",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "PandasExcel.remove_b... |
22898086082 | import asyncio
from pyppeteer import launch
async def intercept_network_response(response):
# In this example, we only care about HTML responses!
if "text/html" in response.headers.get("content-type", ""):
# Print some info about the responses
print("URL:", response.url)
print("Method:",... | Patrickcoleman/Tests | Webscraper/scraper2.py | scraper2.py | py | 1,234 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pyppeteer.launch",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "asyncio.ensure_future",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "asyncio.get_event_loop",
"line_number": 25,
"usage_type": "call"
}
] |
25063684032 | import matplotlib.pyplot as plt
import numpy as np
import umap
import torch
from collections import OrderedDict
from torch import nn
def get_invariant_feats(model_feats,model_da, device, test_loader,use_ssl=1,only_ssl=1,no_da=0):
'no_da: no domain adaptation'
model_feats.eval()
model_da.eval()
test_... | nahad3/-active_learning_4_ts_instances- | utils_vis.py | utils_vis.py | py | 8,496 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "collections.OrderedDict",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "torch.no_grad",
... |
23837108650 | from selenium import webdriver
import unittest
import HtmlTestRunner
class GoogleSearch(unittest.TestCase):
@classmethod
def setUpClass(self):
self.driver = webdriver.Chrome(executable_path='../../ChromeDriver/chromedriver.exe')
self.driver.implicitly_wait(10)
self.driver.maximize_window()
def test_search_a... | phulikely/Auto_Draw_Frame | GoogleSearch.py | GoogleSearch.py | py | 1,057 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "unittest.TestCase",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "unit... |
28381422431 | from sklearn.cluster import KMeans
import matplotlib.pyplot as plt
import scipy.cluster.hierarchy as sch
from sklearn.cluster import AgglomerativeClustering
def k_means_clustering(X):
print ("Using the elbow method to perform K means clustering..")
wcss = []
for i in range(1,11):
kmeans = KMeans(n... | Wert1996/Data-Science-Competitions | machine_learning_template/Clustering_methods.py | Clustering_methods.py | py | 1,345 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "sklearn.cluster.KMeans",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sklearn.cluster.KMeans",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "scipy.cluster.hierarchy.dendrogram",
"line_number": 27,
"usage_type": "call"
},
{
"... |
40983518287 | import io
import zipfile
import pandas as pd
def extract_zip(content):
with zipfile.ZipFile(io.BytesIO(content)) as thezip:
for zipinfo in thezip.infolist():
with thezip.open(zipinfo) as thefile:
yield zipinfo.filename, thefile
def extract_features_from_bureau(bureau_df, bureau... | DSEI21000-S21/project-home-credit | experiments/eyob/data_extract_utils.py | data_extract_utils.py | py | 1,322 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "zipfile.ZipFile",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "io.BytesIO",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_n... |
32454806186 | import numpy as np
import pandas as pd
import os
import re
from sklearn import model_selection
def create_folds(data, num_splits):
# we create a new column called kfold and fill it with -1
data["kfold"] = -1
num_bins = int(np.floor(1 + np.log2(len(data))))
# bin targets
data.loc[:, "bins... | t0efL/Patent-Matching-Kaggle | prepare_data.py | prepare_data.py | py | 2,163 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "numpy.floor",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.log2",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.cut",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.StratifiedG... |
3697861434 | import torch
from torch import optim
import time
import numpy as np
from quantumdraw.sampler.metropolis import Metropolis
from quantumdraw.solver.neural_solver import NeuralSolver
from quantumdraw.solver.user_solver import UserSolver
from quantumdraw.wavefunction.neural_wave_function import NeuralWaveFunction
from qua... | NLESC-JCER/QuantumDraw | quantumdraw/server/scores.py | scores.py | py | 2,554 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "quantumdraw.wavefunction.user_wave_function.UserWaveFunction",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "quantumdraw.sampler.metropolis.Metropolis",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "quantumdraw.solver.user_solver.UserSolver"... |
18868202461 | from guacho_utils import *
import matplotlib as mpl
from mpl_toolkits.axes_grid1 import ImageGrid
from matplotlib.colors import LogNorm
from matplotlib import rc
import matplotlib.pyplot as plt
#import yt
plt.rc('font', family='serif')
plt.rc('font',**{'family':'serif','serif':['{Palatino}']})
rc('text', use... | Caritod/Guacho-v1.2 | py/plot_Figure2.py | plot_Figure2.py | py | 5,261 | python | en | code | null | github-code | 7 | [
{
"api_name": "matplotlib.pyplot.rc",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.rc",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.p... |
21771912260 | from pandas import read_csv, get_dummies, DataFrame
df = read_csv("dataset/train.csv")
val_df = read_csv("dataset/test.csv")
features = df.columns.drop(["Id","SalePrice"])
target = ["SalePrice"]
X, y = df[features], df[target]
X= X.fillna(X.mean())
X = get_dummies(X)
vX= val_df[features]
vX= vX.fillna(vX.mean())
vX ... | yannickkiki/datascience | houses-prices/yannick/main0.py | main0.py | py | 952 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "pandas.read_csv",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "pandas.get_dummies",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.get_dummies",... |
10270607526 | import logging
from logging.handlers import RotatingFileHandler
import datetime
#Logger
log = logging.getLogger('root')
log.setLevel(logging.DEBUG)
fileHandler = RotatingFileHandler('GlitchFilterLog.log', maxBytes=100000)
fileHandler.setLevel(logging.INFO)
log.addHandler(fileHandler)
log.info('******************** ... | stubbornGarrett/GlitchFilter | tools/logger.py | logger.py | py | 499 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "logging.handlers.RotatingFileHandler",
"line_number": 9,
"usage_type": "call"
},
{
"api_name":... |
11129774696 | import keras
import numpy as np
import tensorflow as tf
def get_dataset(batch_size: int, train_samples: int):
(x_train, y_train), (x_test, y_test) = keras.datasets.mnist.load_data()
x_train = np.reshape(x_train, (-1, 784))
x_test = np.reshape(x_test, (-1, 784))
# Reserve 10,000 samples for validation... | charbel-a-hC/iw.mlops_template | sample_main/dataset.py | dataset.py | py | 858 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "keras.datasets.mnist.load_data",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "keras.datasets",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "numpy.reshape",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.r... |
19221926850 | from typing import Any, List, Optional
from lib.parsers.data_parsers.data_parser import DataParser
from lib.parsers.id_parsers.id_parser import IdParser
from types_.category_id import CategoryId
from lib.db import update_supplier
class ParsingController:
def __init__(self, id_parsers: List[IdParser]=None, data_par... | ekinohito/mckinsey-parser | lib/parsing_controller.py | parsing_controller.py | py | 1,895 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "lib.parsers.id_parsers.id_parser.IdParser",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "lib.parsers.data_parsers.data_parser.DataParser",
"line_number": 8,
"usage_type": "na... |
41075387315 | import logging
from ibm_cloud_sdk_core import ApiException
from ..base_client import BaseClient
from ..consts import VPC_DEFAULT_PAGINATION_LIMIT
from ..exceptions import IBMInvalidRequestError
LOGGER = logging.getLogger(__name__)
class ImagesClient(BaseClient):
"""
Client for images related APIs
"""
... | talha927/cloud-ibm-test | ibm/common/clients/ibm_clients/images/images.py | images.py | py | 3,324 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "base_client.BaseClient",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "consts.VPC_DEFAULT_PAGINATION_LIMIT",
"line_number": 21,
"usage_type": "name"
},
{
"api_n... |
29959701973 | from typer.testing import CliRunner
from .fixture_cli import env_gitlab_token
from gitlabtree.main import app
runner = CliRunner()
def test_help() -> None:
result = runner.invoke(app, ["pipeline", "--help"])
assert result.exit_code == 0
assert "pipeline" in result.stdout
assert "last pipeline run" i... | INSRapperswil/gitlabtree | tests/test_cli_pipeline.py | test_cli_pipeline.py | py | 503 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "typer.testing.CliRunner",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "gitlabtree.main.app",
"line_number": 10,
"usage_type": "argument"
},
{
"api_name": "gitlabtree.main.app",
"line_number": 17,
"usage_type": "argument"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.