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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
10764256023 | import os
from sys import breakpointhook
import torch
import torch.nn.functional as F
import numpy as np
from numpy import ndarray
from torch.optim import optimizer
from buffer import ReplayBuffer
import math
from matplotlib import pyplot as plt
from IPython.display import clear_output
import logging
# Setup logger... | Tworck/dqn_lifectcle_model | dqn_agent.py | dqn_agent.py | py | 8,832 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.optim.optimizer",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "math.exp",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "torch.int64",
"l... |
29958495298 | import torch as t
import torch.distributions as dist
import torch.nn as nn
import torch.nn.functional as f
import torch.optim as opt
import torch.utils.data as dutils
from research_seed.bytorch.binary_neural_network import (
MomentumWithThresholdBinaryOptimizer,
BinaryLinear,
)
from matplotlib import pyplot a... | bsridatta/Rethinking-Binarized-Neural-Network-Optimization | tests/with_bytorch/bytorch_toy_experiment.py | bytorch_toy_experiment.py | py | 5,564 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "torch.distributions.Normal",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.distributions",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "torch.distributions.Normal",
"line_number": 17,
"usage_type": "call"
},
{
"api_nam... |
72398029481 | from tkinter import *
import sqlite3
import datetime
from tkinter import messagebox
import tkinter
tk = Tk()
namR = []
data = []
rowNum = 2 #we define the row to start creating the grids
db_data = []
select_data = []
m_id = []
checkbox = []
temp_data = []
temp_patients = []
original_data = []
new_data =... | bsodlover/medicament-manager | edit.py | edit.py | py | 4,324 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "datetime.datetime.now",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "sqlite3.connect",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "sqlite3.... |
28374521082 | import threading
import colorsys
import time
import datetime as dt
import logging
import noise
import psutil
from . import msirgb
LOGGER = logging.getLogger(__name__)
class Task(threading.Thread):
def __init__(self):
super().__init__()
self.setDaemon(False)
self.running = True
se... | alexanderkunz/msirgbd | msirgbd/tasks.py | tasks.py | py | 4,758 | python | en | code | 4 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "time.sleep",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.... |
31201552449 | import base64
import lib.bottle_pxsession as bottle_pxsession
import functools
import hashlib
import json
import os
import random
import smtplib
import sqlite3
import string
import threading
import math
import re
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from e... | tygzy/astatine | astatine.py | astatine.py | py | 16,770 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "threading.Lock",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "lib.bottle.Bottle",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
... |
36962020665 | import json
import os
import random
import flask
import flask_httpauth
import yaml
import wise_auth
import wise_inbox
import wise_microblog
import wise_queue
import wise_sub
class ServiceClientFactory:
def __init__(self):
conf_filename = os.path.join(os.path.abspath(os.path.dirname(__file__)),
"..", "... | daniel-neelappa/elba | microblog_bench/web/src/web.py | web.py | py | 4,580 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.path.join",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line... |
28852638991 | from setuptools import setup, find_packages
package_name = "artisan"
with open("requirements.txt", "r", encoding="utf-8") as f:
requires = f.readlines()
setup(
name="artisan",
version="0.0.1",
long_description_content_type="text/markdown",
packages=find_packages(),
python_requires=">=3.8",... | slavikengel/artisan | setup.py | setup.py | py | 428 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "setuptools.setup",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 15,
"usage_type": "call"
}
] |
1982447054 | # from __future__ import print_function, division
# from future.utils import iteritems
# from builtins import range, input
# import numpy as np
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split
import pandas as pd
df = pd.read_csv(
'https://archive.ics.uci.edu/m... | yasheymateen/DL_ML | dataset_processing.py | dataset_processing.py | py | 762 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.read_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model.LinearRegression",
"line_number": 29,
"usage_type": "call"
... |
26051079313 | """
Run `tox -s (session-name)` to run a suite.
Run `tox` to run all suites.
If you are contributing, please run all suites and fix all
errors and warning before submitting a pull request.
"""
import os
import nox
@nox.session
def test(session):
"""
Run all test files in the project.
"""
if os.envir... | hexcowboy/dinedash | noxfile.py | noxfile.py | py | 1,709 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "os.environ.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "nox.session",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "nox.session",
"li... |
40799477829 | from sys import stdout, stderr
from subprocess import check_call
from os import path, remove
from base64 import b64encode
def _base64_string(file):
return b64encode(open(file).read().encode()).decode()
def create_ca(prefix):
# Create CA (cert+key)
cfssl_cmd = f'cfssl gencert -initca -config=./ca-config... | cicdenv/cicdenv | terraform/kops/shared/ca-function/ca.py | ca.py | py | 759 | python | en | code | 8 | github-code | 18 | [
{
"api_name": "base64.b64encode",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "subprocess.check_call",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "sys.stderr",
"li... |
41497586720 | # -*- coding: utf-8 -*-
from django.urls import path, register_converter
from lgr_web.converters import StorageTypeConverter, FileNameConverter
from .views import DownloadReportFileView, DeleteReportFileView
register_converter(StorageTypeConverter, 'storage')
register_converter(FileNameConverter, 'filename')
urlpatt... | icann/lgr-django | src/lgr_session/urls.py | urls.py | py | 666 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.urls.register_converter",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "lgr_web.converters.StorageTypeConverter",
"line_number": 7,
"usage_type": "argument"
},
{
"api_name": "django.urls.register_converter",
"line_number": 8,
"usage_type":... |
3357566816 | # Calculates Avg. Score by Province from xxxxxx-4-发布成绩.xlsx
import pandas as pd
from openpyxl import Workbook
def avgscore(inputdf, header):
lstScore = inputdf[header]
lstProvince = inputdf["省份"]
lstRawData = []
for i in range(len(lstScore)):
lstRawData.append((lstProvince[i], lstScore[i]))
... | benzhang6/STEMA_ANALYSIS | ProvinceAvg.py | ProvinceAvg.py | py | 5,459 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.read_excel",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "pandas.read_excel",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "pandas.read_excel",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "openpyxl.Workbo... |
31008448105 | from django.shortcuts import render,redirect
from django.contrib.auth import authenticate
from django.contrib.auth.models import User
from django.contrib import messages
from .models import *
from datetime import date
# Create your views here.
def home(request):
return render(request,"index.html")
... | AbhijithGopalakrishnan/Project_Aid-for-farmers | views.py | views.py | py | 23,030 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.shortcuts.render",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 29,
"usage_type": "call"
},
{
"api_nam... |
24536469433 | #! /usr/bin/env python
from MyUtils import *
import cv2
import dlib
import base64
import numpy as np
import json
from camShift import camshiftTracker, meanshiftTracker
from demo_config import Config
# Tracking
class TrackerInitializer(object):
def __init__(self, prev_frame, prev_roi, frame):
self.prev_fra... | cmusatyalab/faceswap | server/vision.py | vision.py | py | 7,201 | python | en | code | 34 | github-code | 18 | [
{
"api_name": "dlib.correlation_tracker",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "dlib.rectangle",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "dlib.correlation_tracker",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "camS... |
34898470655 | import os
from os import path
import logging
from math import floor
import numpy as np
import wandb
import torch
from torch import nn
from sklearn.metrics import average_precision_score
from collections import OrderedDict
from splicing.models.losses import CategoricalCrossEntropy2d
from splicing.models.splice_ai impo... | boeselfr/DeepLearningProject | src/splicing/splicing/utils/general_utils.py | general_utils.py | py | 13,547 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.path.exists",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "splicing.models.losses.Catego... |
31895612795 | # Copyright (C) 2018 Elvis Yu-Jing Lin <elvisyjlin@gmail.com>
#
# This work is licensed under the MIT License. To view a copy of this license,
# visit https://opensource.org/licenses/MIT.
"""Main entry point for training AttGAN network."""
import argparse
import datetime
import json
import os
from os.path... | phaphuang/attr2face | train_with_attr2font.py | train_with_attr2font.py | py | 16,112 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "torch.device",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "argparse.Argumen... |
3438845235 | from sqlalchemy.orm import Session
import models
def commit_to_db(db: Session, db_model: models.Base) -> None:
"""Commiting to db function"""
db.add(db_model)
db.commit()
db.refresh(db_model)
def create_quiz(
db: Session,
quiz_data: dict,
) -> models.QuizQuestion:
"""Creating question i... | anza-afk/quiz_api_test | crud.py | crud.py | py | 941 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sqlalchemy.orm.Session",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "models.Base",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "sqlalchemy.orm.Session",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "models.Q... |
15817765244 | from flask import Flask, request, render_template
from sklearn.feature_extraction.text import TfidfVectorizer
import pandas as pd
from sklearn.svm import LinearSVC
from flask import Flask, request, render_template, url_for, redirect
from prometheus_client import start_http_server, Counter
import webbrowser
app... | NeloferArj/TextInfomationSystems_RacismTextDetector | UI/app.py | app.py | py | 3,267 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "prometheus_client.start_http_server",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sklear... |
71427166440 | # This Python 3 environment comes with many helpful analytics libraries installed
# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python
# For example, here's several helpful packages to load
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.... | aorursy/new-nb-3 | hiteshsom_siim-isic-melanoma-eda.py | hiteshsom_siim-isic-melanoma-eda.py | py | 10,317 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.read_csv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "matplotlib... |
40994949295 | from gensim.models import KeyedVectors
from gensim import models
from gensim.models import Word2Vec
import numpy as np
from gensim.models.poincare import PoincareModel
import nltk
import logging
from nltk.tokenize import word_tokenize
import pickle
nltk.download('punkt')
def normalize_embeddings(embeddings):
nor... | Nusha34/MasterThesis | experimenting_embedding_fusion/fusion_concepts.py | fusion_concepts.py | py | 2,673 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "nltk.download",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.norm",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "numpy.mean",
"l... |
15469773320 | """snack URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based v... | SubhasyaTippareddy/snack | snack/urls.py | urls.py | py | 2,982 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.urls.path",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "... |
71144664039 | import pyaudio
from IPython.display import Audio, display, clear_output
import wave
from scipy.io.wavfile import read
from sklearn.mixture import GMM
import warnings
warnings.filterwarnings("ignore")
import numpy as np
import os
import pickle,json
from sklearn import preprocessing
import python_speech_features as ... | IhabBendidi/Voice-authentification-API | trainGMM.py | trainGMM.py | py | 2,614 | python | en | code | 21 | github-code | 18 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "python_speech_features.mfcc",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "sklear... |
10557381573 | import ujson
from falcon import HTTPNotFound, HTTPBadRequest, before
from .falext import httpstatus
from .module import Fmod
def abort_if_user_dne(req, resp, resource, params):
if not resource._data_service.has_user(params['user_id']):
raise HTTPNotFound()
def abort_if_user_exists(req, resp, resource, par... | bulletcms/bullet-sabot-falcon | bulletsabot/bulletapi/users.py | users.py | py | 2,403 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "falcon.HTTPNotFound",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "falcon.HTTPBadRequest",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "falext.httpstatus",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "ujson.dump... |
35003652342 | from PyQt5.QtWidgets import (
QDialog,
QLabel,
QGridLayout,
QApplication,
QInputDialog,
QLineEdit,
QPushButton,
QMessageBox,
QFileDialog,
QProgressBar,
)
from PyQt5.QtCore import Qt, QThread
from PyQt5.QtGui import QMovie, QPainter, QPixmap, QImage
from PyQt5 import QtGui, QtCore... | ct-js/ct-js-installer | main.py | main.py | py | 23,777 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "sys.maxsize",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "platform.platform",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"... |
22617662844 | """ This file defines the iLQG-based trajectory optimization method. """
import logging
import numpy as np
from gps.algorithm.algorithm import Algorithm
LOGGER = logging.getLogger(__name__)
class AlgorithmTrajOpt(Algorithm):
""" Sample-based trajectory optimization. """
def __init__(self, hyperparams):
... | cbfinn/gps | python/gps/algorithm/algorithm_traj_opt.py | algorithm_traj_opt.py | py | 4,927 | python | en | code | 588 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "gps.algorithm.algorithm.Algorithm",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "gps.algorithm.algorithm.Algorithm.__init__",
"line_number": 15,
"usage_type": "call"
... |
32541535594 | from django.db.models import F
from pyfcm import FCMNotification
from pyfcm.errors import AuthenticationError, FCMServerError, InvalidDataError, InternalPackageError
import os
from account.models import Profile
from django.contrib.auth.models import User
def send_push_notifications(users, title, message, category):
... | memobijou/clinic-app | taskmanagement/utils.py | utils.py | py | 1,944 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.environ.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pyfcm.FCMNotification",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.environ.get",... |
13385932711 | from aiogram import Router, F
from aiogram.types import Message
user_kolvo_router = Router(name='user_kolvo')
@user_kolvo_router.message(F.text == '1')
async def choose_num(message: Message):
await message.answer(
text='На данный момент бот не может obaka'
) | LitvinT/parser-bot | handlers/users/kol_vo.py | kol_vo.py | py | 301 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "aiogram.Router",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "aiogram.types.Message",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "aiogram.F.text",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "aiogram.F",
... |
71889280680 | #!/usr/bin/env python3
import arbor
import argparse
import numpy as np
from numpy.random import RandomState
"""
A Brunel network consists of nexc excitatory LIF neurons and ninh inhibitory
LIF neurons. Each neuron in the network receives in_degree_prop * nexc
excitatory connections chosen randomly, in_degree_prop * n... | arbor-sim/arbor | python/example/brunel.py | brunel.py | py | 8,111 | python | en | code | 97 | github-code | 18 | [
{
"api_name": "numpy.arange",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.delete",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "arbor.recipe",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "arbor.recipe.__init__",
... |
10969395329 | from pyspark import SparkConf, SparkContext
def loadMoviesNames():
movieNames = {}
with open("data/ml-100k/u.item", encoding='ISO-8859-1') as f:
for line in f:
fields = line.split('|')
movieNames[int(fields[0])] = fields[1]
return movieNames
conf = SparkConf().setMaster... | akash-codes93/myspark | broadcastVariables.py | broadcastVariables.py | py | 830 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pyspark.SparkConf",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pyspark.SparkContext",
"line_number": 16,
"usage_type": "call"
}
] |
3405906191 | from __future__ import print_function
from datetime import datetime
import numpy as np
import torch
import gym
import os
import json
import argparse
from model import Model
import utils
from dataloader import process_img
import cv2
def run_episode(env, agent, save_states, rendering=True, max_timesteps=1000):
... | SohamTamba/DeepRL | 2 - Immitation Learning/Racing/test_agent.py | test_agent.py | py | 3,429 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "utils.get_device",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "torch.no_grad",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "dataloader.process_img",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "utils.get_devic... |
11672036782 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('hwlogs', '0007_auto_20150125_2205'),
]
operations = [
migrations.AddField(
model_name='logfiltervalues',
... | wolfmc3/itmemory | hwlogs/migrations/0008_auto_20150125_2215.py | 0008_auto_20150125_2215.py | py | 1,118 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AddField",
"line_number": 14,
"usage_type": "call"
},
{
... |
10034886564 | # Claire Williams and Luisa Escosteguy
import sys
import flask
import json
import psycopg2
from flask import request
from config import password
from config import database
from config import user
api = flask.Blueprint('api', __name__)
@api.route('/games/')
def get_games():
''' Returns a JSON list of games dict... | LuisaE/cs257 | webapp/api.py | api.py | py | 4,918 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.Blueprint",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.request.args.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "flask.request.args",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "flask.... |
14363389852 | #Program wykorzystuje wlasnoręcznie zrealizowany algorytm Kohonena do klasteryzacji danych dotyczących wybranej spółki giełdowej
#Wynikiem działania jest podanie jakosci klasteryzacji (poprzez wynik Daviesa-Bouldina) oraz wizualizacja na wykresach jego
#przełożenia na jakość regresji. Zrealizowano dwa warianty - z wyko... | Myxir294/Programowanie-Sieciowe | lab5 - regresja Kohonen/Kohonen_regression.py | Kohonen_regression.py | py | 8,708 | python | pl | code | 0 | github-code | 18 | [
{
"api_name": "numpy.exp",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.square",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.norm",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"line_num... |
6137792270 | import maya.cmds as cmds
global sphereCountField
global sphereRadiusField
global cubeW
global cubeH
global cubeD
global cubeCount
# Takes the user input to set Cube dimensions.
def cubeFunction(args):
w = cmds.floatField(cubeW, query=True, value=True)
h = cmds.floatField(cubeH, query=True, val... | BigMan101/assignment03 | shapeGenerator.py | shapeGenerator.py | py | 3,717 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "maya.cmds.floatField",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "maya.cmds",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "maya.cmds.floatField",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "maya.cmds",
"... |
947480310 | import pandas as pd
import streamlit as st
from line import Line
from map import Map
def do_stuff_on_page_load():
# To set the page layout to wide on page load
st.set_page_config(layout="wide")
@st.cache
def get_data(path: str) -> pd.DataFrame:
# Fetches the data from the given url and returns a datafra... | bhargavd90/streamlit_corona | main.py | main.py | py | 1,341 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "streamlit.set_page_config",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "streamlit... |
25806674153 | import os
import sys
import datetime
from math import *
import numpy as np
import numpy.ma as ma
import netCDF4
import bounders
#---------------------------------------------------
#Gross bound checks on .nc files, developed primarily from the sea ice (CICE6) output
#Robert Grumbine
#30 January 2020
#
#data file = a... | rgrumbine/ice_scoring | gross_checks/ufs_ice/ufs_ice.subset.py | ufs_ice.subset.py | py | 2,142 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "os.path.exists",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number... |
7557654806 | import mimetypes
import cs3.storage.provider.v1beta1.resources_pb2 as resource_types
from tornado import web
from datetime import datetime
from IPython.utils import tz
from cs3api4lab.utils.share_utils import ShareUtils
class ModelUtils:
date_fmt = '%Y-%m-%dT%H:%M:%SZ'
@staticmethod
def create_respond_mo... | sciencemesh/cs3api4lab | cs3api4lab/utils/model_utils.py | model_utils.py | py | 7,291 | python | en | code | 4 | github-code | 18 | [
{
"api_name": "datetime.datetime.now",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "IPython.utils.tz.UTC",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "IPy... |
30456758788 | from parser.base_parser import BaseParser
from parser import utility as util
from os import path
import os
import json
from parser.base_parser import write_parsed_records
class JSONParser(BaseParser):
def __init__(self, trans_info):
super().__init__(trans_info)
self.trans_info = trans_info
d... | AnilPalFreeCamp/etl | parser/json_parser.py | json_parser.py | py | 1,525 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "parser.base_parser.BaseParser",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "parser.utility.validate_path",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "parser.utility",
"line_number": 16,
"usage_type": "name"
},
{
"api_name... |
6851642951 | import pandas as pd
from ete3 import NCBITaxa
import sys
input_file = sys.argv[1]
output = open(sys.argv[2], "w")
#given a file with one taxID per row, output the complete taxonomy.
taxids = open(input_file).readlines()
lista=[]
for item in taxids:
ncbi =NCBITaxa()
lineage = ncbi.get_lineage(item)
nam... | marcelauliano/phython_scripts | get_taxonomy.py | get_taxonomy.py | py | 498 | python | en | code | 5 | github-code | 18 | [
{
"api_name": "sys.argv",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "ete3.NCBITaxa",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_... |
21223027039 | import re
import MeCab
from bs4 import BeautifulSoup
from urllib import request
main_url = "https://www.aozora.gr.jp/cards/000148/files/2371_13943.html"
stop_url = "http://svn.sourceforge.jp/svnroot/slothlib/CSharp/Version1/SlothLib/NLP/Filter/StopWord/word/Japanese.txt"
main_response = request.urlopen(main_url)
main... | OIT2003/natural-language-basic-kadai | kadai_002/kadai_002.py | kadai_002.py | py | 1,149 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "urllib.request",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "urllib.request.... |
11278107896 | from modules import *
import PySimpleGUI as psg
init_json()
theme = psg.theme('DarkPurple')
label = psg.Text('Type in a to-do')
input_box = psg.InputText(tooltip="Enter Todo", size=32, key='task_name')
icons = ['./media/edit.png', './media/plus.png', './media/minus.png']
list_box = psg.Listbox(values=get_task_list()... | codeboychik/todo-list-py | gui.py | gui.py | py | 2,547 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "PySimpleGUI.theme",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "PySimpleGUI.Text",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "PySimpleGUI.InputText",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "PySimpleGUI.Lis... |
72837511079 | # python3
from collections import namedtuple
Bracket = namedtuple("Bracket", ["char", "position"])
def are_matching(left, right):
return (left + right) in ["()", "[]", "{}"]
def find_mismatch(text):
opening_brackets_stack = []
for i, next in enumerate(text):
if next in "([{":
# Pro... | brandonmburroughs/data_structures_and_algorithms | 2_data_structures/week1_basic_data_structures/1_check_brackets_in_code/check_brackets.py | check_brackets.py | py | 1,213 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "collections.namedtuple",
"line_number": 5,
"usage_type": "call"
}
] |
35819878876 | import json
import boto3
from botocore.exceptions import ClientError
credentialDurationInSec = 3600
def createRoleAlias(props):
alias_role_name = str(props['IoTRoleAliasName'])
token_role_arn = str(props['TokenRoleARN'])
print('Role creation: requested', alias_role_name)
try:
client = boto3.... | aws-samples/aws-iot-greengrass-v2-using-aws-cdk | codes/lambda/custom_iot_role_alias/src/handler.py | handler.py | py | 1,719 | python | en | code | 16 | github-code | 18 | [
{
"api_name": "boto3.client",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 43,
"usage_type": "call"
}
] |
971657867 | import tweepy
import json
from random import randint
from time import sleep
class composeMessage:
def ph1(self, w1dic, w2dic):
w1_lst = w1dic[randint(0, len(w1dic) - 1)]
w2_lst = w2dic[randint(0, len(w2dic) - 1)]
try:
temp = w1_lst[2]
temp = w2_lst[1]
whi... | tigche/bbob | bbob.py | bbob.py | py | 2,060 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "random.randint",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_num... |
5338800229 | #!/usr/bin/env python
import inputs
inputs.EVENT_MAP = list(inputs.EVENT_MAP)
inputs.EVENT_MAP[1] = ('type_codes', list((value, key) for key, value in inputs.EVENT_TYPES))
inputs.EVENT_MAP = tuple(inputs.EVENT_MAP)
class XboxController:
""" Xbox 360/One Controller interface """
gamepad = None
# def __i... | joseafga/thanos-python | gamepad.py | gamepad.py | py | 3,673 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "inputs.EVENT_MAP",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "inputs.EVENT_MAP",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "inputs.EVENT_TYPES",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "inpu... |
31546961819 | """Download, (build), and install programs."""
import logging
import shutil
import socket
from typing import List, NoReturn
from provision import apt, logger
from provision.git import git_latest_tag
from provision.utils import chdir, mkdir_p, rmtree, run
LOG = logger.get_logger(__name__, logging.DEBUG)
def install(... | comfortablynick/provision | provision/install.py | install.py | py | 12,412 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "provision.logger.get_logger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "provision.logger",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "logging.DEBUG",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "shuti... |
21391047051 | from django.shortcuts import render, render_to_response
from django.template import RequestContext
from django.http import HttpResponseRedirect, HttpResponse
from .forms import *
from .models import *
from django.contrib.auth.forms import AuthenticationForm
from django.contrib.auth import login, authenticate, logout
fr... | cristian372/proyecto_triviador | triviador/apps/trivia/views.py | views.py | py | 2,947 | python | es | code | 0 | github-code | 18 | [
{
"api_name": "django.shortcuts.render_to_response",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.template.RequestContext",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.http.HttpResponseRedirect",
"line_number": 20,
"usage_type": "c... |
14031669811 | import nltk
from nltk.corpus import brown
govt_text = brown.words(categories='government')
fdist = dict(nltk.FreqDist([w.lower() for w in govt_text]))
models = 'wh'
for k in fdist.keys():
if k.startswith(models):
print(k, ':', fdist[k])
| prashanthprabhu24/DATASCIENCE | Projects/NLP/Basic 1-100/41-50/47.py | 47.py | py | 252 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "nltk.corpus.brown.words",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.brown",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "nltk.FreqDist",
"line_number": 5,
"usage_type": "call"
}
] |
10147116132 | import logging
import random
import urllib.request, json
import time
from threading import Thread
from utils import Command, Constants
class SqsClientInterface(Thread):
""" CLass for interfacing with the SQS Queues in a simple way, client oriented, abstracting from the lower leve
operation.
Parameters su... | davidrpere/application-technologies-p1 | client_interface.py | client_interface.py | py | 6,351 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "threading.Thread",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "utils.Constants.INBOX_QUEUE_NAME",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "utils.Constants",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": ... |
11252111642 | from unittest import mock
from django.conf import settings
from django.template import Context, Template
from sitedata.templatetags.sitedata import fqdn_format
from sitedata.utils import SiteData
def test_url_fqdn():
# Expect a FQDN to work for a given site in context
template = (
'{% load sitedata ... | xfxf/django-sitedata | tests/test_templatetags.py | test_templatetags.py | py | 4,113 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "unittest.mock.Mock",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "unittest.mock",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "sitedata.utils.SiteData",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "django.templ... |
3309480452 | '''
#Author: Abdul Azeez Omar
#Date: Feb 2018
#Purpose: A tool that will start with a given URL and extract all links from that webpage.
'''
from bs4 import BeautifulSoup
from urllib import request
import getopt, sys
from urllib.parse import urlparse
from symbol import except_clause
def getHelp():
prin... | 0xx7/Map-Website-URL | MapURL.py | MapURL.py | py | 4,093 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "sys.argv",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "urllib.parse.urlparse",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "getopt.getopt",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"lin... |
17071942782 | import distutils.spawn
import logging
import unittest
from typing import Optional
import os
import easyprocess
from flask import url_for as flask_url_for
from flask_testing import LiveServerTestCase
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.desi... | StartupsPoleEmploi/labonneboite | labonneboite/tests/selenium/base.py | base.py | py | 4,587 | python | en | code | 42 | github-code | 18 | [
{
"api_name": "flask_testing.LiveServerTestCase",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "labonneboite.conf.settings.API_ADRESSE_BASE_URL",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "labonneboite.conf.settings",
"line_number": 33,
"us... |
17368819343 | # hello_world.py
from ctypes import alignment
from tkinter import CENTER
from urllib import response
import PySimpleGUI as sg
import requests
import json
from HackChat import app as hcAPI
import threading
import configparser
import git
#sg.Window(title="Hello World", layout=[[]], margins=(100, 50)).read()
repourl = "h... | lubek-dc/Lubchat | app.py | app.py | py | 11,913 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "threading.Timer",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "HackChat.app.M... |
32864262888 | import cv2
import imutils
from imutils import perspective
#from imutils.video import count_frames
import numpy as np
from matplotlib import pyplot as plt
import glob
#WIDTH, HEIGHT = 100, 100
class utils(object):
def getSpotsCoordiantesFromImage(img, num_space) :
#coordinate_lists ... | offsouza/parking_lot_opencv | image_transforms.py | image_transforms.py | py | 2,080 | python | en | code | 15 | github-code | 18 | [
{
"api_name": "matplotlib.pyplot.imshow",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.xticks",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "m... |
16097716236 | import os
import sys
import tarfile
import time
import ieugwaspy
import pandas as pd
from datetime import datetime
__version__ = "0.3.0"
# Versions of ontologies and the resulting search database
EFO_VERSION = "3.57.0"
UBERON_VERSION = "2023-07-25"
SEARCH_DB_VERSION = "0.10.0"
DATASET_NAME = "opengwas"
OUTPUT_DATABA... | ccb-hms/openGWASSearchDB | src/build_opengwas_db.py | build_opengwas_db.py | py | 3,825 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.path.isfile",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "os.remove",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_nu... |
11562489215 | # This module defines functions that can be used to check whether OpenMP is
# available and if so what flags to use. To use this, import the
# add_openmp_flags_if_available function in a setup_package.py file where you
# are defining your extensions:
#
# from astropy_helpers.openmp_helpers import add_openmp_flags_i... | Johannes-Sahlmann/pystrometry | astropy_helpers/astropy_helpers/openmp_helpers.py | openmp_helpers.py | py | 3,141 | python | en | code | 14 | github-code | 18 | [
{
"api_name": "distutils.ccompiler.new_compiler",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "distutils.sysconfig.customize_compiler",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "tempfile.mkdtemp",
"line_number": 54,
"usage_type": "call"
},
... |
28445593572 | import uuid
from neuron import h
import warnings
from .guitools import make_callable
import logging
logging.basicConfig(level=logging.DEBUG, filename="mylog.txt")
make_browser_html = None
class Widget:
def to_html(self):
raise NotImplementedError()
def mappings(self):
return {}
class XValue... | mcdougallab/neurongui2 | neurongui2/gui.py | gui.py | py | 9,464 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "logging.basicConfig",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "neuron.h",
"line_number": 22,
"usage_type": "argument"
},
{
"api_name": "uuid.uuid4",
"l... |
26013037336 | import sys
import pynput
from pynput.keyboard import Key, Controller
from selenium import webdriver
import time
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.expected_conditions import element_to_be_clickable
from selenium.webdriver.common.by import By
from selenium.webdriver.... | ArtDemid/InfopulseUniversity | Lesson10_classwork/Lesson10_Selenium_classwork.py | Lesson10_Selenium_classwork.py | py | 2,072 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "pynput.keyboard.Controller",
"line_number": 13,
"usage_type": "call"
},
{
"api_name"... |
31295635125 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from pytorch_transformers import BertConfig, BertTokenizer, BertForSequenceClassification
class BertForTextClassification(nn.Module):
def __init__(self, pretrained_model_path, num_classes, hidden_size=768, num_hidden_layers=12, num_atte... | flyfatty/self-allennlp | guide/text_classification/model/bert.py | bert.py | py | 1,622 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "torch.nn.Module",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "pytorch_transformers.BertForSequenceClassification.from_pretrained",
"line_number": 15,
"usage_type": "call"
... |
38022545096 | # You won't directly use this class, but it will be used by the other classes.
# Unless you want to build the class yourself, you may use this
import torch.nn as nn
class CNNClassificationModel(nn.Module):
"""
Base PyTorch class of the classification model with Encoder, Head for CNN
"""
def forward(se... | taipingeric/fusionlab | fusionlab/classification/base.py | base.py | py | 3,353 | python | en | code | 12 | github-code | 18 | [
{
"api_name": "torch.nn.Module",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.nn.Module",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line... |
35302387506 | from memory_profiler import profile # may need to pip isntall memory_profiler
import collections
@profile # we can decorate ANY function to get a memory profile
def someFn():
# here is a double-ended queue
my_deq = collections.deque('98765432')
# we can alter members of the queue
my_deq.append(... | onionmccabbage/furtherAdvancedPythonSept22 | performance/using_profile.py | using_profile.py | py | 504 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "collections.deque",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "memory_profiler.profile",
"line_number": 4,
"usage_type": "name"
}
] |
35543979022 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 11 18:07:10 2018
@author: dzhong
"""
import pandas as pd
import numpy as np
import networkx as nx
import matplotlib.pyplot as plt
from networkx.drawing.nx_agraph import write_dot, graphviz_layout
#G = nx.DiGraph()
G = nx.MultiDiGraph()
G.add_nod... | dong0321/paco_ft | spanning_tree_with_seq.py | spanning_tree_with_seq.py | py | 1,819 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "networkx.MultiDiGraph",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "networkx.drawing.nx_agraph.write_dot",
"line_number": 50,
"usage_type": "call"
}
] |
15806217073 | from fastapi import FastAPI, File, UploadFile
from fastapi.middleware.cors import CORSMiddleware
from main import ImageProcessor
import numpy as np
import cv2
import random
# cors
origins = ["*"]
app = FastAPI(title="DKNSB Image Processing Task", description="This FastAPI backend is built to process the Images provide... | z404/DKNSB_Task | api.py | api.py | py | 2,211 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "fastapi.middleware.cors.CORSMiddleware",
"line_number": 12,
"usage_type": "argument"
},
{
"api_name": "fastapi.UploadFile",
"line_number": 21,
"usage_type": "name"
},
{
"api... |
32779385494 | import ast
import json
import os
import tempfile
import uuid
from time import gmtime, strftime
import boto3
from PIL import Image
from utility import logger
from handler.db_handler import get_face_group_data, save_face_group_data
from handler.es_handler import push_data_to_es
ES_HOST = "search-od-happy-face-5i3vty7c... | ani-saraf/happyface-edge-flask | handler/img_handler.py | img_handler.py | py | 7,031 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "boto3.client",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "boto3.resource",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_num... |
6970979329 | # -*- coding: utf-8 -*-
from odoo import api, fields, models, _
import logging
from odoo.exceptions import ValidationError
from odoo.tools.profiler import profile
_logger = logging.getLogger(__name__)
class AccountMove(models.Model):
_inherit = ['account.move']
@api.depends('type')
def _get_ncf_types_d... | IsaiasRosario06/odoo | accounting/ncf_generator/models/account_move.py | account_move.py | py | 4,765 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "odoo.models.Model",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "odoo.models",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "odoo.api.depends"... |
30022487788 | import time
import jwt
from typing import Dict
from decouple import config
import json
JWT_SECRET = config("secret")
JWT_ALGORITHM = config("algorithm")
def token_response(token: str):
return {
"access_token": token
}
def sign_JWT(user_email: str) -> Dict[str, str]:
pyload = {
"user_emai... | KillFork/fastapi-jwt | app/services/auth/jwt_handler.py | jwt_handler.py | py | 1,200 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "decouple.config",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "decouple.config",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "jwt.encode",
"line_number... |
12392171298 | # Path Operations for posts
from fastapi import Depends, Response, status, HTTPException, APIRouter
from .. import schemas, oauth2, models
from typing import List
from ..database_orm import get_db
from sqlalchemy.orm import Session
from sqlalchemy import func
#from .. import database
router = APIRouter(prefix="/posts... | SP2EZ/demo-fastapi-orm | app/routers/posts_orm.py | posts_orm.py | py | 5,903 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.Session",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "fastapi.Depends",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "database_orm... |
71426690920 | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
df_train = pd.read_csv("../input/liverpool-ion-switching/train.csv")
train_time = df_train["time"].values.reshape(-1,500000)
train_signal = df_train["signal"].values.reshape(-1,500000)
train_opench = df_train["open_channels"... | aorursy/new-nb-3 | friedchips_on-markov-chains-and-the-competition-data.py | friedchips_on-markov-chains-and-the-competition-data.py | py | 3,319 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.read_csv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "numpy.lin... |
26316614669 |
import modules.html_parser as html_parser, modules.vector_operator as vector_operator
import modules.similarity_matcher as similarity_matcher
hp= html_parser.html_parser()
vo = vector_operator.vector_operator()
sm = similarity_matcher.simi_matcher()
print("start to load filenames")
all_files, all_filenames = hp.loa... | walkerzjs/WholeTextSearchEngine_COMP9900_GroupProject | init.py | init.py | py | 1,031 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "modules.html_parser.html_parser",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "modules.html_parser",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "modules.vector_operator.vector_operator",
"line_number": 6,
"usage_type": "call"
},
... |
6718638592 | import math
import torch
import torch.nn.functional as F
import torch.nn as nn
import torch as th
from torch.optim import Adam, SGD
import numpy as np
from torch.nn import init
class Base_Exp_Model(nn.Module):
def __init__(self, input_size, output_size):
super().__init__()
self.input_size = inpu... | martj001/baselines3_exploration | stable_baselines3/exp_model.py | exp_model.py | py | 5,747 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "torch.nn.Module",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"lin... |
71856228201 | #-------------------------------------------------------------------------------
# bob: compiler.py
#
# Scheme compiler.
#
# Eli Bendersky (eliben@gmail.com)
# This code is in the public domain
#-------------------------------------------------------------------------------
from __future__ import print_function
from .u... | eliben/bobscheme | bob/compiler.py | compiler.py | py | 10,590 | python | en | code | 157 | github-code | 18 | [
{
"api_name": "utils.flatten",
"line_number": 104,
"usage_type": "call"
},
{
"api_name": "utils.list_find_or_append",
"line_number": 255,
"usage_type": "call"
},
{
"api_name": "utils.list_find_or_append",
"line_number": 257,
"usage_type": "call"
},
{
"api_name": "... |
34252354169 | import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from sklearn import linear_model
from sklearn.metrics import r2_score
# Load the data into a pandas dataframe
iris = sns.load_dataset('iris')
x = iris.sepal_length
y = iris.petal_length
lr = linear_model.LinearRegression()
degreeList = [1,2,3,4... | nishantp-home/Masters-DataSciences | statisticsAndMLforRegression/intro/polynomialRegressionPython.py | polynomialRegressionPython.py | py | 544 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "seaborn.load_dataset",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model.LinearRegression",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model",
"line_number": 12,
"usage_type": "name"
},
{
"ap... |
35835209183 | from flask import Flask, request
import sys
import optparse
import time
app = Flask(__name__)
start = int(round(time.time()))
@app.route("/")
def main():
return "Hello World!"
@app.route("/Calc")
def calculate():
hpw = float(request.args['hpw'])
cost = float(request.args['cost'])
tax = float(reques... | monfii/pytest | calculator/calculator.py | calculator.py | py | 772 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.request.args",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line... |
22437341455 | import requests
import pandas as pd
def callAPI(key, videoId, mode, nextToken=None):
return requests.get('https://www.googleapis.com/youtube/v3/commentThreads',
params={
'key': key,
'part': mode,
'videoId': videoId,
'maxResults': 1... | jose-amat/python-youtube-comments | functions/CommentThreads.py | CommentThreads.py | py | 2,173 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 58,
"usage_type": "call"
}
] |
17205557770 | import json
import boto3
import os
import uuid
def handler(event, context):
endpoint = "http://%s:4566" % os.environ["LOCALSTACK_HOSTNAME"]
stepfunction = boto3.client("stepfunctions", endpoint_url=endpoint)
body = json.loads(event["body"])
task_token = body["token"]
userid = body["userid"]
... | mickjmason/deployer | confirmation_processor.py | confirmation_processor.py | py | 1,870 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "boto3.client",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number... |
23981888343 | import logging
from concurrent.futures import ThreadPoolExecutor
from console_parser import add_argument_parser
from services import request_processor
from simple_server import SimpleHTTPServer
logging.basicConfig(
format='[%(asctime)s] %(levelname).1s %(message)s',
level=logging.INFO, datefmt='%Y.%m.... | jBuly4/OTUS_projects | month_2/05_automatization/otuserver/httpd.py | httpd.py | py | 1,401 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "logging.basicConfig",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "simple_server.SimpleHTTPServer",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "l... |
500426426 | import math
import pandas as pd
import numpy as np
from pandas import DataFrame
from sklearn.preprocessing import MinMaxScaler
import sys
from multiprocessing import Pool
import talib
# prints formatted price
def formatPrice(n):
return ("-$" if n < 0 else "$") + "{0:.2f}".format(abs(n))
# returns the vector contai... | rougewood/es-trades | functions.py | functions.py | py | 3,019 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "math.exp",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "numpy.nan",
"line_numb... |
73656872039 | from email.mime.application import MIMEApplication
import smtplib
import pandas as pd
from jinja2 import Environment, FileSystemLoader
import pdfkit
def send_email(to, subject, body, pdf_file):
sender = 'my_email'
password = 'my_password'
smtp_server = 'smtp.gmail.com'
smtp_port = 587
message ... | tejashreeb12/tejashreeb12 | sifreceipts.py | sifreceipts.py | py | 3,414 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "smtplib.SMTP",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "email.mime.application.MIMEApplication",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pdfkit.from_file",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "... |
37007747901 | import json # IMPORT json LIBRARY
class ClientMessageHandler: # Define ClientMessageHandler class
def __init__(self, ui, camera, read_queue): # Create constructor
self.ui = ui # Assign ui variable
self.camera = camera # Assign camera variable
self.read_queue = read_queue # Assign read_queue... | vminin2000/Spring2023ForamsBot | forabot_hardware/forams-bot/src/communication/ClientMessageHandler.py | ClientMessageHandler.py | py | 3,082 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "json.loads",
"line_number": 30,
"usage_type": "call"
}
] |
40102856601 | """
Author: Omid Nejati
Email: omid_nejaty@alumni.iust.ac.ir
MedViT: A Robust Vision Transformer for Generalized Medical Image Classification.
"""
from functools import partial
import math
import torch
import torch.utils.checkpoint as checkpoint
from einops import rearrange
from timm.models.layers import DropPath, tru... | Omid-Nejati/MedViT | MedViT.py | MedViT.py | py | 19,451 | python | en | code | 32 | github-code | 18 | [
{
"api_name": "torch.nn.Module",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
35021772182 | import h5py
import numpy as np
import os
import matplotlib.pyplot as plt
import time
from preprocessor import pca
from preprocessor import split_train_test
from preprocessor import ConfusionMatrixHelper
# KNN Classifier
class KNNClassifier:
def __init__(self, train_images, train_labels, test_images, test_lab... | dukeNashor/R2Us | SVM_Classifier_FashionMNIST/SVM_Classifier_FashionMNIST/KNN_Classifier.py | KNN_Classifier.py | py | 8,795 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.sum",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.argmax",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.bincount",
"line_numb... |
26673868188 | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.common.action_chains import ActionChains
import clipboard
import time
driver = webdriver.Chrome(ChromeDriverManager().install())
driver.get('https://web.whatsap... | AnthonyCavalcante/Estudos_python | chatbot/WhatsappBot/functions/interactions.py | interactions.py | py | 2,124 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "webdriver_manager.chrome.ChromeDriverManager",
"line_number": 7,
"usage_type": "call"
},
{... |
536701003 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Date : Feb-11-20 14:18
# @Author : Kelly Hwong (you@example.org)
# @Link : https://stackoverflow.com/questions/2828059/sorting-arrays-in-numpy-by-column
import os
import csv
import json
import numpy as np
import shutil
from tqdm import tqdm
def c... | AI-Huang/semi-conductor-image-classification-first | utils/csv_utils.py | csv_utils.py | py | 7,275 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "csv.reader",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 4... |
26938615294 | # TODO перебрать список зависимостей
import csv
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtPrintSupport import *
import sys, sqlite3, time
from MainWindow import *
import os
import pandas
class InsertDialog(QDialog):
def __init__(self, *args, **kwa... | feztix/Python__Edu__PyQt-DBMS | main.py | main.py | py | 14,579 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sqlite3.connect",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 143,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 155,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
... |
12980264401 | import json
import energima_logger
import logging
from SauterAPI_module_v3_2 import sautervision_login, sautervision_sensorlist
from CogniteAPI_module_sauter_v1 import cdp_startup
from monotonic import monotonic
import os
import threading
def energima_startup():
"""
setup for energima logger, starts runtime, ... | mortenhuse/SA1_data_ingest | prepare database.py | prepare database.py | py | 4,255 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "energima_logger.configure_logger",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "monotonic.monotonic",
"line_number": 26,
"usage_type": "call"
},
{
"api_name":... |
31789583760 | import csv
import re
from collections import defaultdict
from surprise import Dataset
from surprise import Reader
class MovieLens:
def __init__(self, ratings_path, movies_path, movie_content_path=None):
"""_summary_
Args:
ratings_path (Str): Path of file in csv format that contains r... | kartikra/recommender-lib | recommender_lib/dataprep/movielens.py | movielens.py | py | 6,231 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "surprise.Reader",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "surprise.Dataset.load_from_file",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "surprise.Dataset",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "coll... |
70680277160 | __all__ = ['get_intent_word']
import sys
import os
import re
import traceback
from collections import Counter
curPath = os.path.abspath(os.path.dirname(__file__))
rootPath = os.path.split(curPath)[0]
sys.path.append(os.path.split(rootPath)[0])
sys.path.append(rootPath)
from voiceAssistant.analysisAlgorithm.ahoCorasick ... | xiejunbiao/cloudbrain-assistant | voiceAssistant/intentGreet/get_intention_word.py | get_intention_word.py | py | 6,549 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.path.abspath",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path.split",
"line_n... |
34352658891 | """
@file: detect_edges.py
@brief: This script finds you the edges of the conveyor band in an image.
@author: Gökhan Koçmarlı (github.com/electricalgorithm)
@company: YongaTek (yongatek.com)
"""
import cv2
import numpy
import math
import argparse
def apply_gaussian_filter(image: numpy.ndarray, window_size=51, gaussia... | electricalgorithm/ConveyorBandEdgeDetection | detect_edges.py | detect_edges.py | py | 4,940 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.ndarray",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "cv2.GaussianBlur",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.ndarray",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "cv2.cvtColor",... |
26778011630 | from django.conf.urls import url
from . import views
print(dir(views))
urlpatterns = [
url(r'^$', views.HoldingView.as_view(), name='holdings'),
url(r'^createportfolio$', views.UserCreatePortfolio.as_view(), name='create_portfolio'),
url(r'^list_portfolio$', views.ListViewPortfolio.as_view(), name='list_portfolio'... | caveatemptors-2015/special-garbanzo | project/portfolioX/urls.py | urls.py | py | 803 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.co... |
34692591336 | import urllib.request, urllib.error # 制定URL,获取网页数据
from bs4 import BeautifulSoup
context = ''
def askURL(url):
head = { # 模拟服务器头部信息,向豆瓣服务器发送消息
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36"
}
# 用户代理表示... | imagic79/Automatic-emailing-program | weather.py | weather.py | py | 2,376 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "urllib.request.request.Request",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "urllib.request",
"line_number": 13,
"usage_type": "name"
},
{
"api_nam... |
14210576419 | import pytest, time, requests, re, os
import pandas as pd
from unittest.mock import call
from pandas.util.testing import assert_frame_equal, assert_series_equal
from crypto_analytics.data_source import DataSource
from crypto_analytics.types import Interval
from crypto_analytics.types.symbol import Symbol, SymbolPair, ... | kobejean/crypto_analytics | tests/unit_tests/data_source/test_data_source_base.py | test_data_source_base.py | py | 3,622 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.DataFrame",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "pytest.fixture",
"line... |
72212373480 | #Boa:Frame:Frame
import wx
import account
from line import *
import datetime as dt
yOffset = yLineSize + 1
yBottomButtons = 150
xTotalSize = 1300
yFrameSize = 1000
xWindowSize = 1280
yWindowSize = yFrameSize - 254
# xTotalSize = 1200
# yFrameSize = 664
# xWindowSize = 1180
# yWindowSize = 450
def create(parent):
... | florent-lamiraux/banking | frame.py | frame.py | py | 12,378 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "wx.NewId",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "wx.NewId",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "wx.Frame",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "wx.ITEM_NORMAL",
"line_number": 4... |
12507658471 | import pandas as pd
import numpy as np
# Importing dataset
dataset = pd.read_csv("train.csv")
# Feature Types
categorical_features = [feature for feature in dataset.columns if dataset[feature].dtype == "object"]
numerical_features = [feature for feature in dataset.columns if feature not in categorical_feature... | neeresh/kaggle | Space ship Titanic/Feature Engineering.py | Feature Engineering.py | py | 6,589 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.read_csv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "feature_engine.imputation.RandomSampleImputer",
"line_number": 49,
"usage_type": ... |
32027089331 | # -*- coding: utf-8 -*-
"""Test serialization."""
import importlib
import os
import tempfile
import unittest
from acsets import ACSet, Attr, AttrType, Hom, Ob, mira, petris
PYDANTIC_1 = importlib.metadata.version("pydantic").startswith("1.")
class TestSerialization(unittest.TestCase):
"""A test case for testi... | AlgebraicJulia/py-acsets | tests/test_petri.py | test_petri.py | py | 2,499 | python | en | code | 10 | github-code | 18 | [
{
"api_name": "importlib.metadata.version",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "importlib.metadata",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "unittest.TestCase",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_nam... |
2252326511 | __author__ = "X."
__email__ = "xzhang@westwoodrobotics.io"
__copyright__ = "Copyright 2021 Westwood Robotics"
__date__ = "Apr. 07, 2021"
__version__ = "0.0.1"
__status__ = "Prototype"
import pdb
import struct
import time
import sys
from itertools import chain
import numpy as np
import serial
from bruce_sense.TIMIN... | Westwood-Robotics/BRUCE_SENSE | archive/BRUCE_SENSE/bruce_sense/Packet.py | Packet.py | py | 12,518 | python | en | code | 5 | github-code | 18 | [
{
"api_name": "serial.Serial",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "serial.EIGHTBITS",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "serial.PARITY_NONE",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "serial.ST... |
10141553134 | import nltk
from nltk.chat.util import Chat, reflections
# Define the chat pairs for greetings
pairs = [
['hi|hello|hey', ['Hello!', 'Hi there!', 'Hey!']],
['how are you', ['I\'m just a chatbot, but I\'m here to help! How can I assist you today?']],
['what is your name', ['I am a chatbot created by ... | Sandychandran/SYNC-INTERNS | CHATBOT.PY | CHATBOT.PY | py | 994 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "nltk.chat.util.Chat",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "nltk.chat.util.reflections",
"line_number": 17,
"usage_type": "argument"
}
] |
13875292133 | import pandas
import networkx as nx
import json
import matplotlib.pyplot as plt
#read JSON file
jsondata = open('hnsw.json', 'r')
data = jsondata.read()
#parse
obj = json.loads(data)
#Create an empty undirected graph
#use nx.Digraph() for directed graph
G = nx.Graph()
for i in obj:
#add node if it does not exis... | KRAPSM514/UGHENT-HNSW | src/HNSW.py | HNSW.py | py | 936 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "json.loads",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "networkx.Graph",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "networkx.set_node_attributes",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "networkx.set_n... |
34882384279 | '''
Created on 2018年11月23日
@author: Administrator
'''
#coding=utf-8
import requests
from urllib import parse
import urllib.request #获取网址模块
from bs4 import BeautifulSoup
from selenium import webdriver
import os
class Zymk:
#知音漫客列表url
url =''
#漫画存储位置
outPath=''
#下载数量 0表示全部
... | GJguojin/zymk | src/com/gj/zymk/zymk.py | zymk.py | py | 3,582 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "urllib.request",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "selenium... |
28299104320 | # -*- coding: utf-8 -*-
# (c) 2009-2010 Ruslan Popov <ruslan.popov@gmail.com>
from django.conf.urls.defaults import *
#автоматическое подключение необходимых приложений
from django.contrib import admin
admin.autodiscover()
handler404 = 'views.handler404'
handler500 = 'views.handler500'
# карта сайта
from django.con... | RaD/moiluchru | urls.py | urls.py | py | 2,725 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.contrib.admin.autodiscover",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "shop.models.Item.objects.all",
"line_number": 18,
"usage_type": "call"
},
{
... |
72660215719 | import torch
def kpixel_attack(X, X_pgd, k=3000):
"""
K -pixel attack on the image X perturbed by PGD
Parameters
----------
X : torch.Tensor
Image to attack
X_pgd : torch.Tensor
Perturbed image by PGD
k : int
Number of pixels to retain from PGD perturbation
Re... | lorenzobasile/AdViT | utils/adversarial/attack.py | attack.py | py | 3,013 | python | en | code | 6 | github-code | 18 | [
{
"api_name": "torch.norm",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "torch.topk",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "torch.gt",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "torch.transpose",
"line_number": 3... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.