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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
315658447 | """Send SMS via Twilio API."""
from conf import settings
from twilio.rest import TwilioRestClient
def send_sms_alert(body='News ML', destination_number=None, **kwargs):
"""Send alarms via Twilio SMS API.
:param body:
:param destination_number:
:param kwargs:
:return:
"""
try:
if ... | gogasca/news_ml | services/sms/send_sms.py | send_sms.py | py | 1,098 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "conf.settings.SMS_ALERTS",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "conf.settings",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "conf.settings.TWILIO_ACCOUNTID",
"line_number": 17,
"usage_type": "attribute"
},
{
"a... |
7560925966 | from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from cms.models.pluginmodel import CMSPlugin
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from models import *
bootstrap_module_name = _("Widgets")
layout_module_name = _("Layout elements")
ge... | RacingTadpole/cmsplugin-rt | cmsplugin_rt/resizeable_picture/cms_plugins.py | cms_plugins.py | py | 2,006 | python | en | code | 13 | github-code | 21 | [
{
"api_name": "django.utils.translation.ugettext_lazy",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.utils.translation.ugettext_lazy",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.utils.translation.ugettext_lazy",
"line_number": 11,
... |
30638021790 | """
Solution for 329. Longest Increasing Path in a Matrix
https://leetcode.com/problems/longest-increasing-path-in-a-matrix/
"""
from functools import lru_cache
from typing import List
class Solution:
"""
Runtime: 492 ms, faster than 75.58% of Python3 online submissions for Longest Increasing Path in a Matrix.... | KKosukeee/CodingQuestions | LeetCode/329_longest_increasing_path_in_a_matrix.py | 329_longest_increasing_path_in_a_matrix.py | py | 2,469 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "typing.List",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "functools.lru_cache",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 55,
"usage_type": "name"
}
] |
71757976374 | # -*- coding: utf-8 -*-
"""
Created on 2023-01-19 14:10:01
---------
@summary:
---------
@author: QiuQiuRen
"""
import feapder
from feapder import ArgumentParser
import re
import time
from items.my_batch_spider_integrated_wangyi_news_test_item import MyBatchSpiderIntegratedWangyiNewsTestItem
import datetime
from feapd... | CuiXiangTuT/MyFeapderSpiderCode | 基础知识点/爬虫集成/BatchSpider集成/MyBatchSpiderIntegrated/spiders/my_batch_spider_wangyi_news_parser_test.py | my_batch_spider_wangyi_news_parser_test.py | py | 4,976 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "feapder.BatchParser",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "feapder.dedup.Dedup",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "feapder.Request",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "re.compi... |
8379694714 | import pandas as pd
import numpy as np
import sklearn
from sklearn import linear_model
from sklearn.utils import shuffle
import matplotlib.pyplot as pyplot
import pickle
from matplotlib import style
#read data from file
data = pd.read_csv('student-mat.csv', sep=";")
#cleaning attributes, 33 is too much
data = data[["... | ZychDev/LinearRegresion_MachineLearning | main.py | main.py | py | 1,984 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.read_csv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train... |
15253040146 | import nltk
from nltk.corpus import stopwords
from nltk.stem import WordNetLemmatizer
import csv
def preprocessing(text):
# text = text.decode("utf8") # 此处不需要解码,若执行反而出错
# 取词
tokens = [word for sent in nltk.sent_tokenize(text) for word in
nltk.word_tokenize(sent)]
# 去除停用词
stop = stopwo... | Will-learning-nlp/ITLS_homework | NLTK练习代码/practice_7_数据清洗&采样.py | practice_7_数据清洗&采样.py | py | 4,967 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "nltk.sent_tokenize",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "nltk.word_tokenize",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "nltk... |
4968037571 | # CREDITS: https://huggingface.co/course/chapter1/3?fw=pt
from transformers import pipeline
classifier = pipeline("zero-shot-classification")
classifier(
"This is a course about the Transformers library",
candidate_labels=["education", "politics", "business"],
)
"""
{'sequence': 'This is a course... | Akshaykumarcp/explore-hugging-face | 0.1_pipelines/0.1.2_zero_shot_classification_pipeline.py | 0.1.2_zero_shot_classification_pipeline.py | py | 483 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "transformers.pipeline",
"line_number": 5,
"usage_type": "call"
}
] |
43681858695 | # -*- coding: UTF8 -*-
#版本控制文件生成 mwt 2020.04.03
import time
import datetime
import os
import tkinter as tk
from tkinter import filedialog
import json
#获取文件的修改时间
def get_FileModifyTime(filePath):
filePath = str(filePath)
t = os.path.getmtime(filePath)
return str(t)
root = tk.Tk()
root.withdraw()
folderpath = filedial... | LuckyJoey/EgretResourceManagementAndVersionControl | EgretResMgrVersionController/VersionTools/EgretVersionTool.py | EgretVersionTool.py | py | 1,798 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "os.path.getmtime",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "tkinter.Tk",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tkinter.filedialog.askdirect... |
19600303501 | import datetime
import itertools
import pathlib
import sys
sys.path.append("..")
current_dir = pathlib.Path(__file__).resolve().parent
sys.path.append(str(current_dir) + "/../..")
from unittest import TestCase
from libs.datacrud import Datacrud
from uhiimanbot.targetinformationacquisition import TargetInformationAcq... | Otazoman/uhiimanbot | tests/uhiimanbot/targetinformationacquisitiontest.py | targetinformationacquisitiontest.py | py | 6,280 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.path.append",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"line_n... |
17937520353 | """The connections module handles connecting to the server.
Classes:
ConnectionPool
"""
import typing as t
import trio
class ConnectionPool:
"""This class implements a default connection pool.
Attributes:
host (str): The address to connect to.
port (int): The port to connect to.
... | Harrison88/redtrio | src/redtrio/lowlevel/connections.py | connections.py | py | 2,900 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "typing.Callable",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "trio.open_tcp_stream",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "typing.Set",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "trio.a... |
23130925722 | """
Определение теплофизических свойств влажного воздуха:
1. Температура мокрого термометра;
2. Относительная влажность по температуре мокрого термометра;
3. Влагосодержание;
4. Энталтпия.
-------------------------------------------------
'Инженерные расчёты на Python'
https://zen.yandex.ru/id/5f33dcd5554adc5b33aaee83
... | medsv/medsv.github.io | dzen/0008/wetairprops.py | wetairprops.py | py | 6,982 | python | ru | code | 0 | github-code | 21 | [
{
"api_name": "saturationcurve.SaturationCurve",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "scipy.optimize.root_scalar",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "scipy.optimize",
"line_number": 54,
"usage_type": "name"
},
{
"api_nam... |
70433314614 | import matplotlib.pyplot as plt
import numpy as np
df = open('data.txt', 'r')
lines = df.readlines()
pitch = []
roll = []
for line in lines:
temp = line.split('|')
pitch.append( float(temp[0].split(':')[1]) )
roll.append ( float(temp[1].split(':')[1]) )
pitch_fft = np.fft.fft(pitch)
roll_fft = np.fft.... | zechenwang00/ECE-5160-Sp23 | Lab4/data_plotter.py | data_plotter.py | py | 949 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.fft.fft",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.fft",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "numpy.fft.fft",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.fft",
"line_numb... |
20727300432 | import io
from operator import mod
import sys
# 再帰用
# sys.setrecursionlimit(10**9)
_INPUT = """\
DEBABHOGE
"""
sys.stdin = io.StringIO(_INPUT)
# ---------------------------------
def kaibun(c):
lenc = len(c)
if lenc % 2 == 0:
# print(c[: (lenc // 2)], c[lenc // 2 :][::-1])
if c[: (lenc /... | makima333/Atcoder-ganbaru | contest/abc320/B.py | B.py | py | 935 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.stdin",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "io.StringIO",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "copy.copy",
"line_number": 40,
"usage_type": "call"
}
] |
37414677776 | ##
# Configuration management
#
from .form import AppSettingsForm, BackLightForm
from .settings_manager import Settings
from datetime import datetime
import subprocess
import os
from time import sleep
from io import BytesIO
from config import Config
from phototron.rpimodule import RpiModule
from flask import (Bluep... | ThomasBlein/ChronoRootControl | app/options/__init__.py | __init__.py | py | 2,230 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "flask.Blueprint",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "phototron.rpi... |
70385570294 | import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import time
import tqdm
import copy
import urllib
def import_github_script(URL=r'https://raw.githubusercontent.com/micklethepickle/modified-frozen-lake/main/frozen_lake.py',
file_name='frozen_lake.py'):
"""
... | luiz-resende/ReinforcementLearning | A02_MC_TD_Methods/utils/helper_fncs.py | helper_fncs.py | py | 36,017 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "os.path.isfile",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "urllib.request.urlopen",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "urllib.request",
... |
70046073654 | import re
import math
import pathlib
import collections
import urllib.request
from tqdm import tqdm
from pyigt import IGT
from pyigt.igt import NON_OVERT_ELEMENT, LGRConformance
from pyigt.lgrmorphemes import MORPHEME_SEPARATORS
from clldutils.lgr import ABBRS as lgrabbrs
from clldutils.jsonlib import load
from cldfbe... | cldf-datasets/imtvault-legacy | cldfbench_imtvault.py | cldfbench_imtvault.py | py | 11,201 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "clldutils.lgr.ABBRS.keys",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "clldutils.lgr.ABBRS",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "re.sub",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "re.escape",
"... |
73034897973 | # Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Daniel Strohmeier <daniel.strohmeier@tu-ilmenau.de>
#
# License: Simplified BSD
import os.path as op
import numpy as np
from numpy.testing import assert_array_almost_equal, assert_allclose
from nose.tools import assert_true, assert_equal
... | LiuFang816/SALSTM_py_data | python/mne-tools_mne-python/mne-python-master/mne/inverse_sparse/tests/test_mxne_inverse.py | test_mxne_inverse.py | py | 4,945 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "mne.datasets.testing.data_path",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "mne.datasets.testing",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.p... |
4323285001 | import yaml
from types import SimpleNamespace
# This is used to convert all the keys in the dict into string
convert_keys = lambda d: dict([(str(e[0]), e[1]) for e in d.items()])
class Config:
"""
Config file parser. It supports the defined
YAML files only.
"""
conf = None
def __init__(self,... | MayukhSobo/BoilerPlate | core/config.py | config.py | py | 1,382 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "yaml.safe_load",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "yaml.YAMLError",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "types.SimpleNamespace",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "types.Simple... |
69841311732 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Block(nn.Module):
def __init__(self, in_size, out_size):
super().__init__()
self.layer1 = nn.Linear(in_size, out_size)
self.relu = nn.ReLU()
def forward(self, batch):
out = self.layer1(batch)
out =... | CJ4n/DeepLearning | DeepNeuralNetwork/DeepNeuralNetworkClasses.py | DeepNeuralNetworkClasses.py | py | 3,034 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torch.nn.Module",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numbe... |
34567958463 | import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle
import matplotlib.animation as animation
waypoints=np.loadtxt('waypoints.txt')
pos_rbt=np.loadtxt('rbt_pos.txt')
pos_cldr=np.loadtxt('collider_pos.txt')
setup=np.loadtxt('setup.txt')
path=np.loadtxt('path.txt')
collisions=np.lo... | ccimrie/DeepDECS | case_studies/mobile_robot_collision_limitation/simulator/visualiser/visualise.py | visualise.py | py | 5,118 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.loadtxt",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_numb... |
16116826048 | # -*- coding: utf-8 -*-
"""
Created on Wed Aug 8 11:20:29 2018
@author: Sirius
train tiny imagenet on dataset representation
cs20 tutorial on tensorflow:
https://github.com/chiphuyen/stanford-tensorflow-tutorials/blob/master/examples/03_logreg.py
Note: 报handle错误的可能是主函数中sess.run([loss]) 中间没有添加 feed_dict={handle: tr... | Sirius083/tiny_imagenet | tiny_feedable/train_tiny_feedable.py | train_tiny_feedable.py | py | 12,768 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "datetime.datetime.now",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 58,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "os.path",
"l... |
18406545893 | import argparse
"""Zellers Congruence Birthday Algorithm
Find out what day of the week you were born on
Accepts birthday as a string in mm-dd-yyyy format
"""
def zeller(bday):
days = {
'0': 'Sunday',
'1': 'Monday',
'2': 'Tuesday',
'3': 'Wednesday',
'4': 'Thursday',... | AllAlgorithms/python | algorithms/math/zellers_birthday.py | zellers_birthday.py | py | 1,183 | python | en | code | 301 | github-code | 21 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 43,
"usage_type": "call"
}
] |
3174773451 | #!/usr/bin/env python
# coding: utf-8
# In[2]:
import cv2
import numpy as np
from keras.models import load_model
from statistics import mode
from utils.datasets import get_labels
from utils.inference import detect_faces
from utils.inference import draw_text
from utils.inference import draw_bounding_box
from utils.in... | anasm-17/smileandaction | Untitled-Copy1.py | Untitled-Copy1.py | py | 4,580 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "utils.datasets.get_labels",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "cv2.CascadeClassifier",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "keras.models.load_model",
"line_number": 47,
"usage_type": "call"
},
{
"api_name"... |
27014718133 | # Defines classes and methods for Oberver Pattern
# main(): Notifier script that accepts command line arguments
import argparse
import os, sys
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
path2root = os.path.join(os.path.dirname(__file__), "..")
sys.path.append(path2root)
from notion.notion_helpe... | moregain909/inea_produccion | notificaciones/notificador.py | notificador.py | py | 11,439 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.path.append",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
74878791411 | import flask
from flask import request, jsonify, render_template, redirect, url_for, flash
#from flask_cors import CORS, cross_origin
from sno import sno
import pyangbind.lib.pybindJSON as pybindJSON
from pyangbind.lib.serialise import pybindJSONEncoder, pybindJSONDecoder
from ConfigDB import ConfigDB
import ran... | vaibhgupta157/sno | python/RESTCall.py | RESTCall.py | py | 8,665 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "subprocess.Popen",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line_number": 80,
"usage_type": "attribute"
},
{
"api_name": "flask.request.metho... |
40923419711 | import streamlit as st
import pandas as pd
import pickle
st.write("""
# Heart disease Prediction App
This app predicts If a patient has a heart disease.
Data obtained from Kaggle:https://www.kaggle.com/datasets/rishidamarla/heart-disease-prediction
""")
st.sidebar.header('User Input Features')
# Coll... | IBM-EPBL/IBM-Project-4903-1658742306 | Final Deliverables/Project code/app.py | app.py | py | 2,268 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "streamlit.write",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "streamlit.sidebar.header",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "streamlit.sidebar",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "stream... |
24926140175 | from rest_framework import generics
from rest_framework.permissions import IsAuthenticated, AllowAny
from account.models import AccountsModel
from .serializers import AccountSerializers, RegistrationSerializers
class AccountView(generics.RetrieveAPIView):
queryset = AccountsModel.objects.all()
serializer_clas... | vomanc/Vomancus | project/account/api/views.py | views.py | py | 753 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "rest_framework.generics.RetrieveAPIView",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.generics",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "account.models.AccountsModel.objects.all",
"line_number": 8,
"usage_ty... |
18588309191 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import numpy as np
import pytest
from astropy.io import fits
from astropy.io.fits.hdu.compressed._tiled_compression import compress_image_data
from astropy.io.fits.tests.conftest import FitsTestCase
MAX_INT = np.iinfo(np.intc).max
MAX_LONG = np.iinfo(int... | astropy/astropy | astropy/io/fits/hdu/compressed/tests/test_compression_failures.py | test_compression_failures.py | py | 6,464 | python | en | code | 4,015 | github-code | 21 | [
{
"api_name": "numpy.iinfo",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.intc",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "numpy.iinfo",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.iinfo",
"line_numbe... |
10018343102 | from collections import OrderedDict
import math
# Dictionary of 20 standard amino acids encoding 3-letter to 1-letter codes
IUPAC_CODES = OrderedDict([
('Ala', 'A'),
('Cys', 'C'),
('Asp', 'D'),
('Glu', 'E'),
('Phe', 'F'),
('Gly', 'G'),
('His', 'H'),
('Ile', 'I'),
('Lys', 'K'),
(... | mit-ll/Insilico_Ab_Variant_Generator | scripts/parse_region.py | parse_region.py | py | 7,538 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "collections.OrderedDict",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "math.inf",
"line_number": 44,
"usage_type": "attribute"
}
] |
37125142407 | # Title: RADDet
# Authors: Ao Zhang, Erlik Nowruzi, Robert Laganiere
import torch
import torch.nn as nn
import numpy as np
import os
def denseLayer(input_tensor, input_channel,output_channel):
output =nn.Linear(input_channel,output_channel)
leakyrelu = nn.LeakyReLU(0.1)
return leakyrelu(output(input_t... | wadxxn/RADDET | RADDet-main/model/layers.py | layers.py | py | 2,466 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torch.nn.Linear",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "torch.nn.LeakyReLU",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numb... |
37414637426 | """
Organisation of the ChronoRootControl application
"""
import os
import fnmatch
import logging
from flask import Flask, render_template
from app.experimentlist import main_page
from app.experiment import experiment_page
from app.help import help_page
from app.api import api_exp
from app.options import config_page
fr... | ThomasBlein/ChronoRootControl | app/__init__.py | __init__.py | py | 2,423 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "app.experimentlist",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "flask.Flask",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "app.experimentlist.config.update",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "app.e... |
6501975100 | from __future__ import annotations
import logging
from typing import Union, Dict, Tuple, Optional, List, Any, TYPE_CHECKING
from pyobs.object import get_object
from pyobs.robotic.scripts import Script
from pyobs.robotic.task import Task
from pyobs.utils.logger import DuplicateFilter
from pyobs.utils.time import Time
... | pyobs/pyobs-core | pyobs/robotic/lco/task.py | task.py | py | 10,145 | python | en | code | 8 | github-code | 21 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pyobs.utils.... |
31000792411 | # %% imports
import os.path
import pandas as pd
import numpy as np
import glob
import csv
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
from langdetect import detect, DetectorFactory
DetectorFactory.seed = 0
analyzer = SentimentIntensityAnalyzer()
# %% params
IN_FOLDER = "data/Android/raw/revi... | gianlucascoccia/companionApps | notebook/parseReviews.py | parseReviews.py | py | 3,741 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "langdetect.DetectorFactory.seed",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "langdetect.DetectorFactory",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "vaderSentiment.vaderSentiment.SentimentIntensityAnalyzer",
"line_number": 11,... |
9115861545 | # flake8: noqa
import numpy as np
import pytest
from stochastic.base import Continuous
def test_check_times(end, n, zero, mocker):
continuous = Continuous(end)
mocker.patch('stochastic.base.Continuous.times')
assert continuous._n is None
continuous._check_times(n, zero)
assert continuous._n == n
... | timothyyu/ml_monorepo | stochastic/tests/base/test_base_continuous.py | test_base_continuous.py | py | 1,271 | python | en | code | 59 | github-code | 21 | [
{
"api_name": "stochastic.base.Continuous",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "stochastic.base.Continuous",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "n... |
7800787888 | from __future__ import print_function
import tornado.ioloop
import tornado.options
from rdflib.graph import Graph
import ztreamy
from ztreamy import logger
from ztreamy import client
class Processor(object):
def __init__(self, stream_urls):
self.client = client.Client(stream_urls,
... | jfisteus/ztreamy | ztreamy/casestudy/processor.py | processor.py | py | 2,232 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "ztreamy.client.Client",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "ztreamy.client",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "rdflib.graph.Graph",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "tornado.ioloo... |
4748805430 | import json
import os
from db import db
from db import User, Post, Comment
from flask import Flask, redirect, request, url_for, Request
from oauthlib.oauth2 import WebApplicationClient
import requests
from flask_login import (
LoginManager,
current_user,
login_required,
login_user,
logout_user,
... | ljgreenhill/BearMarket | Backend/app.py | app.py | py | 8,859 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.urandom",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number":... |
17998185232 | #!/usr/bin/python3
from __future__ import print_function
import sys
import json
import argparse
import os
import subprocess
import re
import itertools
from arabic_diacritics import diacritics
if sys.version_info <= (3,0):
print("This program only runs in python3", file=sys.stderr)
exit(1)
def is_subseq(x, y)... | lingz/arabic_tools | arabic_diacritizer/arabic-diacritizer.py | arabic-diacritizer.py | py | 6,203 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "sys.version_info",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "sys.stderr",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "sys.stderr",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname... |
70426093172 | from collections import defaultdict, deque
from typing import List
class Solution:
def findOrder(self, numCourses: int, prerequisites: List[List[int]]) -> List[int]:
graph = defaultdict(set)
indegree = defaultdict(int)
for p in prerequisites:
v, u = p
graph[u].add(... | Jeldo/PS | leetcode/solved/210.py | 210.py | py | 1,101 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "typing.List",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "collections.defaultdict",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "collections.... |
41260864077 | #!/usr/bin/python2
'''
simple example of how to use a mysql database using pythons
MySQLdb module.
Note that this module is not ported to python3 and so this example
is python2 specific.
catching errors is done with:
except MySQLdb.Error, e:
print('Error {0}: {1}'.format(*e))
sys.exit(1)
'''
from __future__ import... | nonZero/demos-python | src/examples/short/mysql/mysqldb_demo.py | mysqldb_demo.py | py | 683 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "MySQLdb.connect",
"line_number": 22,
"usage_type": "call"
}
] |
15224389047 | import requests
from json import dumps
from .NotifyBase import NotifyBase
from ..URLBase import PrivacyMode
from ..common import NotifyType
from ..common import NotifyImageSize
from ..utils import validate_regex
from ..utils import parse_bool
from ..AppriseLocale import gettext_lazy as _
class PagerDutySeverity:
... | caronc/apprise | apprise/plugins/NotifyPagerDuty.py | NotifyPagerDuty.py | py | 16,317 | python | en | code | 8,936 | github-code | 21 | [
{
"api_name": "common.NotifyType.INFO",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "common.NotifyType",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "common.NotifyType.SUCCESS",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_... |
1907127001 | import sys
import xml.etree.ElementTree as ET
fpath='c:/Projects/Weldobot/temp/workplan.wpln'
try:
tree = ET.parse(fpath)
except Exception as e:
print("Could not load file {0}, {1}".format(fpath, e ))
sys.exit(-1)
fileRoot = tree.getroot()
dataRoot = fileRoot[0]
cmds = dataRoot.findall ('command')
if cmds... | doronweiss/pythontesta | GeneralTests/XmlTest.py | XmlTest.py | py | 483 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "xml.etree.ElementTree.parse",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "sys.exit",
"line_number": 9,
"usage_type": "call"
}
] |
33928456601 | from typing import List, Union
from classes.dependencies import get_uow
from classes.functions import is_list, try_get_repository
from classes.interfaces import IRepository
from classes.validation import (
CabinetResponseModel,
FilterRequestModel,
OfficeResponseModel,
OrderResponseModel,
ProductCat... | Skeesh24/omiko-data | app/routers/select_router.py | select_router.py | py | 1,373 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "classes.validation.FilterRequestModel",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "fastapi.params.Depends",
"line_number": 47,
"usage_type": "call"
},
{
"ap... |
40758167636 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# 温刚
# 北京大学数学科学学院,jnwengang@pku.edu.cn
import torch
import utils
from torch.autograd import Variable
import random
T = 100
torch.set_default_tensor_type('torch.cuda.FloatTensor')
torch.backends.cudnn.deterministic = True
torch.backends.cudnn.benchmark = False
def init_w... | WanpingDong/CNNcode | elasticityExperiment/gd_vs_sgd.py | gd_vs_sgd.py | py | 3,618 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torch.set_default_tensor_type",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.backends",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torch.backends",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": ... |
38599111675 | import tensorflow as tf
from neural_compressor.utils import logger
from neural_compressor.adaptor import FRAMEWORKS
from neural_compressor.conf.dotdict import DotDict
from neural_compressor.training import WeightPruningConfig
from neural_compressor.training import prepare_compression
from neural_compressor.utils impor... | sinianyutian/neural-compressor | examples/tensorflow/image_recognition/keras_models/inception_v3/pruning/magnitude/main.py | main.py | py | 5,555 | python | en | code | null | github-code | 21 | [
{
"api_name": "tensorflow.compat",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.keras",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "horovod.tensorflow.init",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "... |
74989827891 | import cv2
import numpy as np
import time
import os
#from cvzone.HandTrackingModule import HandDetector
import HandTrackingModule as htm
folderPath = "header"
myList = os.listdir(folderPath)
#print(myList)
overlayLis = []
for imPath in myList:
image = cv2.imread(f'{folderPath}/{imPath}')
overla... | HoChuanYu/Virtual_Painter | virtual painter.py | virtual painter.py | py | 4,187 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.listdir",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "HandTrackingModule.handDetector... |
31789341616 | #%%
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
#reading ruspini.csv
ruspini = pd.read_csv("ruspini.csv")
ruspini_array = np.array(ruspini, dtype = float)
ruspini_array = impy.mean(ruspini_array)
#reading data_ruspini_missing.csv
ruspini_missing = pd.read_csv("data_ruspini_missing.csv")
... | mufiidatunnisaa/Ruspini2 | R5.py | R5.py | py | 1,269 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.read_csv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.nan",
"line_numbe... |
26150343125 | import pandas as pd
import os
import datetime as dt
def combineSpeeches(speech_load_file_path):
speechTypeList = os.listdir(speech_load_file_path)
cleanSpeechList = []
for i in speechTypeList:
if not i.startswith('.'):
cleanSpeechList.append(i)
df = pd.read_csv(speech_load_file_pa... | PabloRees/Masters | Scripts/Data_congregator.py | Data_congregator.py | py | 2,114 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.listdir",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_n... |
9115355825 | import collections
class _Node:
__slots__ = ["k", "v", "prev", "next"]
def __init__(self, k, v, prev, next):
self.k = k
self.v = v
self.prev = prev
self.next = next
class LRUCache(collections.MutableMapping):
def __insertInList(self, k, v):
if self.first is None... | timothyyu/ml_monorepo | statarb/src/python/lib/lru_cache.py | lru_cache.py | py | 4,228 | python | en | code | 59 | github-code | 21 | [
{
"api_name": "collections.MutableMapping",
"line_number": 11,
"usage_type": "attribute"
}
] |
5790249516 | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
# File : run-gpt35-promptv4.py
# Author : Jiayuan Mao
# Email : maojiayuan@gmail.com
# Date : 04/13/2023
#
# This file is part of Project Neuro-Codex.
# Distributed under terms of the MIT license.
import re
import os.path as osp
import random
import time
import open... | joyhsu0504/LEFT | prompts/run-gpt35-prompt.py | run-gpt35-prompt.py | py | 8,633 | python | en | code | 15 | github-code | 21 | [
{
"api_name": "openai.ChatCompletion.create",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "openai.ChatCompletion",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "openai.error",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_nam... |
21129998906 | #!/usr/bin/python
import gpxpy
import pyproj
from dateutil import tz
class Point:
def __init__(
self,
date,
timestamp,
lat,
lon,
alt
):
self.date = date
self.timestamp = timestamp
self.lat = float(lat)
self.lon = float(lon)
self.alt = float(alt)
self.az = None
def setAzimuth(self, az):... | evgeniyarbatov/stargazing-on-the-run | scripts/utils.py | utils.py | py | 1,755 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "gpxpy.parse",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "dateutil.tz.gettz",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "dateutil.tz",
"line_number": 65,
"usage_type": "name"
},
{
"api_name": "dateutil.tz.gettz",
"li... |
70358113332 | #! python3
import networkx as nx
from pprint import pprint
g = nx.DiGraph()
vertex_from = {}
vertex_to = {}
file = open('input','r')
for line in file:
first, second = line.strip().split(')')
vertex_from[first] = 1
vertex_to[second] = 1
g.add_edge(first, second)
sp = dict(nx.all_pairs_shortest_pa... | LubosKolouch/adventofcode_2019 | 06/t6.py | t6.py | py | 485 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "networkx.DiGraph",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "networkx.all_pairs_shortest_path_length",
"line_number": 21,
"usage_type": "call"
}
] |
12138453149 | # -*- coding: utf-8 -*-
"""
Created on Fri Jun 26 00:40:50 2020
@author: ASUS
"""
import numpy as np
import streamlit as st
import torch
from PIL import Image, ImageOps
from torchvision import transforms
def import_and_predict(image_data, model):
transformar = transforms.Compose([
transforms.Resize(256),
... | SergioCalo/image_classification_app | que-especie-e-app.py | que-especie-e-app.py | py | 2,820 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torchvision.transforms.Compose",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.Resize",
"line_number": 17,
"usage_type": "call"
},
{
... |
17312022723 | from typing import Union, Tuple
from rest_framework.serializers import ValidationError
import datetime
import firebase_admin
from firebase_admin import credentials, messaging, exceptions
cred = credentials.Certificate("MANAGEMENT/FireBase/keys/serviceAccountKey.json")
push_alerta = firebase_admin.initialize_app(cred... | ManuelCL-jml/Polipay-Backup | MANAGEMENT/notifications/movil/alert.py | alert.py | py | 1,148 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "firebase_admin.credentials.Certificate",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "firebase_admin.credentials",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "firebase_admin.initialize_app",
"line_number": 10,
"usage_type": "call"
... |
71374311733 | # !/usr/bin/env python3
import matplotlib.pyplot as plt
from elasticsearch import Elasticsearch
from matplotlib import rc
import json
deleted = []
live = []
names = []
r = []
# GET catalog/_segments?verbose=false&filter_path=indices.*.shards.0.segments
# es = Elasticsearch(hosts=[{'host': 'localhost', 'port': '9200'... | IvanMamontov/visualizing-lucene-segment-merges | segments.py | segments.py | py | 1,349 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "json.load",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "matplotlib.rc",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.bar",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
10274616708 | #-*- encoding: utf-8 -*-
"""
About : Code to run as a linux daemon service, interface with it via REST POST
"""
__author__ = "Eduard Florea"
__email__ = "viper6277@gmail.com"
__company__ = ""
__copyright__ = "Copyright (C) 2020 {a}".format(a=__author__)
__credits__ = ""
__license__ = "MIT"
__version__ = 0.03
__lastda... | BinaryCobrasTeam/http.server_service | slm_service.py | slm_service.py | py | 10,734 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "queue.Queue",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "http.server.BaseHTTPRequestHandler",
"line_number": 124,
"usage_type": "name"
},
{
"api_name": "json.loads",
"line_number": 217,
"usage_type": "call"
},
{
"api_name": "uuid.uuid... |
38967413114 | ###########
# IMPORTS #
###########
import pygame
import time
#############
# CONSTANTS #
#############
display_width = 800
display_height = 600
black = (0,0,0) #RGB concentrations
white = (255,255,255)
red = (200,0,0)
green = (0,200,0)
bright_red = (255,0,0)
bright_green = (0,255,0)
####################
# INITIALI... | syeaw0/battleship | src/GUI.py | GUI.py | py | 2,959 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pygame.init",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "pygame.displa... |
25124178065 | from ast import pattern
import fnmatch
import tkinter as tk
import os
from tracemalloc import start
from pygame import mixer
canvas = tk.Tk()
canvas.title("Terraria Music Player")
canvas.geometry("600x800")
canvas.config(bg="black")
canvas.resizable(False, False)
photo = tk.PhotoImage(file = "icons/pic.png")
canvas... | Simon0568/PythonProjects | musicPlayer/musicPlayer.py | musicPlayer.py | py | 1,322 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "tkinter.Tk",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "tkinter.PhotoImage",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pygame.mixer.init",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pygame.mixer",
"li... |
19437066149 | import tkinter as tk
from tkinter import filedialog
import os
import re
import requests
import Constants
import movieRatingRequest as ratingReq
from datetime import datetime
from pathlib import Path
import time
def getFolderPath():
folderPath = Path(input("WRITE Movies List Path \n"))
return folderPath
... | mosliem/MoviesListRanking | MoviesListRankingMain.py | MoviesListRankingMain.py | py | 2,722 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pathlib.Path",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.scandir",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 41,
"u... |
17670209677 | """Unit tests for Notional databases."""
import pytest
from notional import blocks, schema
def test_empty_database():
"""Create a default Database and verify properties."""
db = blocks.Database()
assert db.Title is None
@pytest.mark.vcr()
def test_create_database(notion, blank_db):
"""Create a d... | jheddings/notional | tests/test_database.py | test_database.py | py | 1,704 | python | en | code | 86 | github-code | 21 | [
{
"api_name": "notional.blocks.Database",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "notional.blocks",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "pytest.mark.vcr",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pytest.mark"... |
74342462452 | # Author : hellcat
# Time : 18-6-19
"""
import os
os.environ["CUDA_VISIBLE_DEVICES"]="-1"
import numpy as np
np.set_printoptions(threshold=np.inf)
import tensorflow as tf
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
sess = tf.Session(config=config)
"""
import os
import numpy as np
import pprin... | Hellcatzm/ClassifierForCifar10_TensorFlow | eval_CNN.py | eval_CNN.py | py | 3,723 | python | en | code | 13 | github-code | 21 | [
{
"api_name": "tensorflow.ConfigProto",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "tensorflow.placeholder",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "tensorflow.float32",
"line_number": 73,
"usage_type": "attribute"
},
{
"api_name": ... |
29055594147 | import os
from pytest import mark
from scipy.stats import stats
from mvalidators.data_schema import Constants
@mark.smoke
@mark.linear_regression
class LinearRegressionTests:
@mark.fit
def test_fit(self, test_df, test_model):
target = Constants().target
x, y = test_df.drop(target, axis=1), ... | ganprad/ml-tdd-example | tests/mwrapper/test_linear_regression_model.py | test_linear_regression_model.py | py | 2,796 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "mvalidators.data_schema.Constants",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.remo... |
2148239779 | import os
import shutil
import subprocess
import click
import numpy as np
import pandas as pd
from deepsense import neptune
from sklearn.model_selection import StratifiedKFold
from pipeline_config import SOLUTION_CONFIG, Y_COLUMNS, CV_LABELS, ID_LABEL
from pipelines import PIPELINES
from preprocessing import split_tr... | minerva-ml/open-solution-toxic-comments | main.py | main.py | py | 15,991 | python | en | code | 151 | github-code | 21 | [
{
"api_name": "utils.get_logger",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "deepsense.neptune.Context",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "deepsense.neptune",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "utils.re... |
18387005812 | """Controller for Odoo"""
import logging
from datetime import datetime
from odoo import http
from odoo.http import request
from werkzeug.exceptions import BadRequest, HTTPException
LOGGER = logging.getLogger(__name__)
class RecordNotFound(HTTPException):
code = 432
description = "<p>Record Not Found.</p>"
... | yousef-soliman/odoo-test-api | odoo-api/controllers/main.py | main.py | py | 4,664 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "werkzeug.exceptions.HTTPException",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "odoo.http.Controller",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_... |
70895773813 | """import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
# Dados de latitude, longitude e altitude
lat = [126.11766477698698, 126.11766477698698, 126.09978620117651, 126.10285035065877, 126.10285035065877, 126.09678639801436, 126.09678639801436, 126.1435053159169, 126.15960394202322, 126.11505024947... | MatheusLCouto/projeto-calc | teste orbita real/teste orb relal do sat v2.py | teste orb relal do sat v2.py | py | 7,274 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "datetime.datetime",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "pyorbital.orb... |
74991295411 | from mutagen.mp4 import MP4, MP4Cover
from quodlibet.util.path import get_temp_cover_file
from quodlibet.util.string import decode
from ._audio import AudioFile
from ._misc import AudioFileError, translate_errors
from ._image import EmbeddedImage
class MP4File(AudioFile):
format = "MPEG-4"
mimes = ["audio/m... | quodlibet/quodlibet | quodlibet/formats/mp4.py | mp4.py | py | 7,678 | python | en | code | 1,306 | github-code | 21 | [
{
"api_name": "_audio.AudioFile",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "_misc.translate_errors",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "mutagen.mp4.MP4",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "quodlibet.uti... |
16073135062 | """
@Author: Jake Schoonbrood
@Application: Engine Logger
@Version: V1.000 Beta
@PythonVersion: Python 3.9.6 64Bit
"""
import os
import sys
#import bcrypt
from PySide2 import QtCore, QtGui, QtWidgets
from pathlib import Path
from packages import home
from packages.backend import database
from packages.backend import ... | JSchoonbrood/Engine-Logger | main.py | main.py | py | 4,108 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.platform",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "sys.platform",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "PySide2.QtWidgets... |
25345013525 | #!/usr/bin/python
# Robovator
# An HTTPS interface to the MCE IMC-SCR elevator controller
import argparse
import BaseHTTPServer
import ssl
import serial
import sys
import time
import threading
from Queue import *
class RobovatorRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
def do_GET(self):
self.... | supersat/robovator | robovator.py | robovator.py | py | 7,224 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "BaseHTTPServer.BaseHTTPRequestHandler",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "serial.Serial",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "sys.stdout.write",
"line_number": 53,
"usage_type": "call"
},
{
"api_nam... |
74584442931 | import sys
from itertools import combinations
def buildWall():
global answer
dx = [-1, 1, 0, 0]
dy = [0, 0, -1, 1]
for coordinates in combinations(buildable, 3):
copy_map = [i[:] for i in map]
queue = [i[:] for i in infected]
cnt = 0
for x, y in coordinates:
... | dan-2ee/MyWeakness-Algorithm | Baekjoon/Graphs/연구소/14502.py | 14502.py | py | 1,194 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "itertools.combinations",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 31,
"usage_type": "attribute"
}
] |
22803464042 | #!/usr/bin/env python3
import io
import csv
import json
import subprocess
import functools
import logging
def call_calibre(*args):
return str(subprocess.check_output(["calibredb", *args]), encoding='utf-8')
def run_calibre(*args):
return subprocess.run(['calibredb', *args]);
def parse_calibre_csv(result):
... | ramblingenzyme/ebookfs | src/calibre.py | calibre.py | py | 1,453 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "subprocess.check_output",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "subprocess.run",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "io.StringIO",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"... |
5717455603 | import datetime
import re
import pytz
from app.config import config
from sendgrid import SendGridAPIClient
from sendgrid.helpers.mail import Mail
def send_email(email, html_content, subject):
"""Send Emails
Send email to the mail ids
:param emails: emails of the user
:type emails: list
:param n... | jansentim1/IQ-python-google-calendar | app/sendgrid_email.py | sendgrid_email.py | py | 5,828 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sendgrid.helpers.mail.Mail",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "sendgrid.SendGridAPIClient",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "app.config.config.SENDGRID_KEY",
"line_number": 28,
"usage_type": "attribute"
},
... |
12913439546 | import requests
from bs4 import BeautifulSoup
from flask import Flask, jsonify
import datetime
app = Flask(__name__)
@app.route('/powerball-article/', methods=['GET'])
def powerball_article():
# Scrape the Powerball website to get the latest winning number
url = "https://www.powerball.com/"
response = req... | AR-Studios-dev-SF/powerball-article-generator | app.py | app.py | py | 3,280 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_n... |
8848338537 | import click
from .Recorder import lookup
from .Recorder import detailed_info
def overall_report():
info = lookup()
click.echo(click.style('2019-nCoV病毒目前在中国的传播数据如下:', fg='blue'))
click.echo('确诊:' + click.style(info[0], fg='yellow'))
click.echo('疑似:' + click.style(info[1], fg='yellow'))
click.echo(... | EthanGeekFan/nCoV | Report/__main__.py | __main__.py | py | 1,715 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "Recorder.lookup",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "click.echo",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "click.style",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "click.echo",
"line_number": 9... |
30637459580 | """
Solution for 1091. Shortest Path in Binary Matrix
https://leetcode.com/problems/shortest-path-in-binary-matrix/
"""
from collections import deque
from typing import List
from heapq import heappush, heappop
class Solution:
"""
Runtime: 940 ms, faster than 23.14% of Python3 online submissions for Shortest Pa... | KKosukeee/CodingQuestions | LeetCode/1091_shortest_path_in_binary_matrix.py | 1091_shortest_path_in_binary_matrix.py | py | 6,783 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "typing.List",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "collections.deque",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "heapq.heappush",
"line_number": 141,
"usage_type": "call"
},
{
"api_name": "heapq.heappush",
"l... |
34588157582 | from py_ecc.bn128 import pairing, G2, G1
from .altbn128 import randsn, addmodn, hashsn, mulmodp, invmodn, multiply
"""
Bare-essentials implementation taken from the following papers:
- http://legacydirs.umiacs.umd.edu/~zhangyp/papers/accum.pdf
- https://pdfs.semanticscholar.org/3ffc/1bcb01802f85d764f1da2986389b2c4c8... | HarryR/solcrypto | pysolcrypto/accumulator.py | accumulator.py | py | 1,860 | python | en | code | 268 | github-code | 21 | [
{
"api_name": "altbn128.addmodn",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "altbn128.hashsn",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "altbn128.mulmodp",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "altbn128.multiply",... |
72690801014 | from django.shortcuts import render
from django.http import HttpResponse, HttpResponseRedirect, JsonResponse
from django.contrib import auth
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User, Group, Permission
from django.core.exceptions import ObjectDoesNotExist
from fc... | hangalice2156/FSAS_server | userapp/views.py | views.py | py | 12,852 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.http.JsonResponse",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.forms.UserCreationForm",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "fcm_django.models.FCMDevice.objects.create",
"line_number": 43,
"usag... |
17730035270 | import json
import os
from datetime import datetime
from aims.VictimRescueGoal import VictimRescueGoal
from aims.actions import PickUpVictim, InspectVictim, TreatVictim, ReplaceBattery, \
ManualEarthquake, InspectBuilding
from aims.door_actions import OpenDoorAimsAction
from aims.agents import RoomAgent,... | matrx-software/USAR-Testbed-for-Human-Agent-Teaming | aims/aims_experiment.py | aims_experiment.py | py | 17,617 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "json.load",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "matrxs.world_builder.WorldBuilder",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "aims.VictimRescueGoal.VictimRescueGoal",
"line_number": 46,
"usage_type": "call"
},
{
... |
4722604745 | import numpy as np
import scipy.misc
import tensorflow as tf
def preprocess(image):
image = tf.cast(image, tf.float32)
image = image/255
image = tf.image.resize(image, (224, 224))
image = image[None, ...]
return image
def deprocess(tensor):
J = np.array(tensor)
J = np.resize(J... | TariqBerrada/Adversarial-Attacks. | fgsm.py | fgsm.py | py | 1,946 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "tensorflow.cast",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "tensorflow.float32",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.image.resize",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "tensorfl... |
73041605493 | import os
import sys
from vispy.testing import (requires_application, SkipTest, run_tests_if_main,
assert_equal, assert_raises)
from vispy.app import Canvas, use_app
from vispy.gloo import get_gl_configuration, Program
from vispy.gloo.gl import check_error
@requires_application()
def test_... | LiuFang816/SALSTM_py_data | python/vispy_vispy/vispy-master/vispy/app/tests/test_context.py | test_context.py | py | 3,226 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "vispy.app.use_app",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "vispy.testing.assert_raises",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "vispy.app.Canvas",
"line_number": 27,
"usage_type": "argument"
},
{
"api_name": "os... |
23133139683 | import re
from pathlib import Path
from PIL import Image, UnidentifiedImageError
from typing import Any, List
from starlette.datastructures import UploadFile
from app.routers.exceptions.invalid_field import InvalidFieldsException
from app.routers.models.validation_field import ValidationField
class FieldVa... | VidroX/FitBuddy | backend/app/helpers/fields_validator.py | fields_validator.py | py | 5,340 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "typing.List",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "app.routers.models.validation_field.ValidationField",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 18,
"usage_type": "call"
},
{
"api_... |
72546818934 | import gym
import numpy as np
env = gym.make('LunarLander-v2')
for i_episode in range(100):
observation = env.reset()
total_reward = []
for t in range(100):
env.render()
#print(observation)
action = env.action_space.sample()
observation, reward, done, info = env.step(action)... | baribefe/deep_Qlearning | run_random.py | run_random.py | py | 487 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "gym.make",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 15,
"usage_type": "call"
}
] |
29653775000 | """
Django settings for Cobra project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
For checklist for production settings, see
See https://docs.djangoproject.com/en... | NobleSF/Cobra | settings/__init__.py | __init__.py | py | 4,163 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "os.path.dirname",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
8605584694 | import numpy as np
import torch
from functools import reduce
from numpy import unravel_index, ravel_multi_index
from pdb import set_trace as bp
def prev_seq(idx, k):
""" Previous element of the sequence in a specific direction. """
idx_bis = list(idx)
idx_bis[k] -= 1
idx_bis = tuple(idx_bis)
retu... | Nuelijarma/pytorch_mdrnn | mdrnn.py | mdrnn.py | py | 8,873 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.ravel_multi_index",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.zeros",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Parameter"... |
70924643573 | import pandas as pd
import pyarrow.parquet as pq
class ParquetLoader:
def __init__(self, file_path, columns=None, chunksize=None):
"""
Initialize the ParquetLoader object.
Parameters:
file_path (str): the path to the Parquet file.
columns (list): the list of column... | johnnysaldana/matchify | matchify/utils/data_loaders/parquet_loader.py | parquet_loader.py | py | 1,885 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pyarrow.parquet.ParquetFile",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pyarrow.parquet",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "pandas.concat",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "pandas.conc... |
20128549385 | from django.urls import path
from . import views
app_name = 'shop'
urlpatterns = [
path('', views.allProdCat, name='allProdCat'),
path('<slug:c_slug>/', views.allProdCat, name='products_by_category'),
path('product/<int:prod_id>/', views.product, name='productInfo'),
path('<slug:c_slug>/<slug:product_... | sreekanthbadri/perfectcushion | shop/urls.py | urls.py | py | 374 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
29976701261 | #!/usr/bin/env python
# coding: utf-8
import requests
import pandas as pd
import sqlalchemy as sa
from sqlalchemy import text
from hashlib import md5
# List of URLs and corresponding API keys
url_api_pairs = [
{'url': 'https://api.nextdns.io/profiles/1234/logs', 'api_key': '345gfsdfsdf'},
{'url': 'https://ap... | bloodyburger/datanix | nextdns-logs-postgres.py | nextdns-logs-postgres.py | py | 4,165 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.DataFrame",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pandas.json_normalize",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
... |
632443698 | # # def check_id(file_path,id):
# # f = open(file_path, "r")
# # temp = f.read().splitlines()
# # print(temp)
# # if id in temp:
# # return False
# # return True
# # print(check_id('id.txt','428950'))
# import os
# path_route = '/home/ha/Desktop/streamlit_insert_user/Image_out/'
# Name = 'hu... | Quanghuy99/streamlit_insert_user | test.py | test.py | py | 1,905 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "glob_var.minio_connect",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "datetime.date.today",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "datetime.dat... |
680099643 | import json
import pytest
import re
import requests
from urllib.parse import parse_qs
from .common import get_message, controlled_responses
from plugins.bamboo import BambooBot
with open('tests/test_bamboo_data.json') as data_file:
data = json.load(data_file)
server = {'host': 'http://host', 'username': 'user', ... | gpailler/AtlassianBot | tests/test_bamboo.py | test_bamboo.py | py | 6,229 | python | en | code | 21 | github-code | 21 | [
{
"api_name": "json.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "plugins.bamboo.BambooBot",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "re.search",
... |
13472184911 | import functions_from_Hvass as H
import numpy as np
import tensorflow as tf
from sklearn.datasets import load_digits
class tensor_PCA:
def __init__(self, data, target=None, dtype=tf.float32):
self.data = data
self.target = target
self.dtype = dtype
self.graph = None
self.X... | JunyoungJang/Python | ML.PCA/HW1.py | HW1.py | py | 2,684 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "tensorflow.float32",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.Graph",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "tensorflow.placeholder",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "tensor... |
74336879413 | from utils import io
from model.BaseEmbeddingModel import BaseEmbeddingModel, init_emb_table
from model.module import dot_product, bpr_loss, ssm_loss
import torch.nn.functional as F
import torch
import dgl
import os.path as osp
from abc import abstractclassmethod
class LightGCNConv(torch.nn.Module):
def __i... | xiransong/xGCN | model/LightGCN.py | LightGCN.py | py | 8,169 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "torch.nn",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "dgl.function.u_mul_e",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "dgl.function",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "dgl.function.sum... |
74330489332 | from django.shortcuts import render
from django.http import JsonResponse
import pandas as pd
from .models import PredResults
import requests
import json
def predict(request):
return render(request, 'predict.html')
def predict_chances(request):
if request.POST.get('action') == 'post':
... | AQI-BE-Project/AQI_Prediction | predict/views.py | views.py | py | 3,813 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.shortcuts.render",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pandas.read_pickl... |
35023012226 | import pytest
from ocflib.infra.hosts import hosts_by_filter
class TestHostsByFilter:
def _hostnames(self, results):
return [entry['cn'][0] for entry in results]
@pytest.mark.parametrize('filter_str,expected', [
('(cn=death)', ['death']),
('(cn=doesnotexist)', []),
('(herp=d... | chriskuehl/ocflib | tests/infra/hosts_test.py | hosts_test.py | py | 1,097 | python | en | code | null | github-code | 21 | [
{
"api_name": "ocflib.infra.hosts.hosts_by_filter",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_n... |
8931693561 | # -*- coding: UTF-8 -*-
import requests
from bs4 import BeautifulSoup, Tag
import os
import os.path as path
import queue
from PIL import Image
BASE_URL = r"https://saucenao.com/search.php"
BASE_URL = r"http://httpbin.org/post"
pictures = [] # 文件夹下面的图片
def scan_dir(location="."):
"""搜索文件夹下面的所有符合扩展名的图片,添加到list里"... | enihsyou/waifu2x-wallpaper | saucenao.py | saucenao.py | py | 1,572 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "os.path.isdir",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "os.scandir",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path.splitext",
"line_number"... |
7842318798 | from flask import current_app, flash, redirect, url_for, render_template
from app.libs.enums import PendingStatus
from app.models.base import db
from app.models.drift import Drift
from app.models.gift import Gift
from app.view_models.gift import MyGifts
from app.view_models.trade import MyTrades
from . import web
from ... | Marticles/bookcrossing | app/web/gift.py | gift.py | py | 1,767 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "flask_login.current_user.id",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "flask_login.current_user",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "app.models.gift.Gift.get_user_gifts",
"line_number": 15,
"usage_type": "call"
... |
2985120293 | import numpy as np
from utils import plot_images
import torch
from torch.utils.data import Dataset, DataLoader
from torchvision import datasets, transforms
import os
data_transforms = {
'train': transforms.Compose([
transforms.RandomResizedCrop(400),
transforms.Resize(224),
... | violaciao/Vision-Mask-and-Attend | recurrent-visual-attention/dataset2.py | dataset2.py | py | 5,523 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "torchvision.transforms.Compose",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.RandomResizedCrop",
"line_number": 13,
"usage_type": "call"
... |
19916109333 | # -*- coding: utf-8 -*-
"""
Created on Tue Apr 12 17:22:48 2022
@author: samar
"""
from __future__ import print_function
import os
import cv2
import numpy as np
import argparse
import random as rng
rng.seed(12345)
def thresh_callback(img):
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
thres... | SamarthSingh2001/LicencePI | Acquire_Licence_Images.py | Acquire_Licence_Images.py | py | 3,062 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "random.seed",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "cv2.Canny",
"lin... |
26797739958 | import cv2
import numpy as np
import scipy.misc
from matplotlib import pyplot as plt
import pandas as pd
import pickle
import umap
def frames_edges(vid_path, edge_threshold1=100, edge_threshold2=200):
"numpy array images of dimensions (n_f, n_H, n_W)"
"n_f = number of frames "
"n_H = number of pixels vert... | bouracha/MaskRCNN_rodent | edge_frames.py | edge_frames.py | py | 6,190 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "cv2.CAP_PROP_FRAME_COUNT",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "cv2.Canny"... |
40924638107 | # A permutation is an ordered arrangement of objects. For example, 3124 is one possible permutation of the digits 1, 2, 3 and 4.
# If all of the permutations are listed numerically or alphabetically, we call it lexicographic order. The lexicographic permutations of 0, 1 and 2 are:
# 012 021 102 120 201 210
... | TessaI159/euler | python/euler24_memhog.py | euler24_memhog.py | py | 915 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "inspect.getmodule",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "inspect.stack",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "itertools.permutations",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "decorator.time... |
43232940735 | import tensorflow as tf
import numpy as np
from tensorflow.keras.datasets import boston_housing
from tensorflow.keras import layers
import matplotlib.pyplot as plt
tf.config.set_visible_devices([], 'GPU')
(train_data, train_targets), (test_data, test_targets) = boston_housing.load_data()
print(f"Data type: {type(tes... | nathankrueger/tensorflow_examples | examples/regression_example.py | regression_example.py | py | 2,547 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "tensorflow.config.set_visible_devices",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "tensorflow.config",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.keras.datasets.boston_housing.load_data",
"line_number": 9,
"usage_... |
13588460072 | import os
import argparse
import numpy as np
import monai
from skimage import measure
from glob import glob
def value_range(x):
return x.min(),x.max()
def mask_to_bb(img:np.ndarray)->list:
img = np.round(img)
labelled_image = measure.label(img,connectivity=3)
uniq = np.unique(labelled_image)
uniq ... | CCIG-Champalimaud/adell-mri | utils/masks-to-bounding-boxes.py | masks-to-bounding-boxes.py | py | 2,050 | python | en | code | 5 | github-code | 21 | [
{
"api_name": "numpy.ndarray",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "numpy.round",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "skimage.measure.label",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "skimage.measure"... |
27539921715 | from enum import Enum
from vnpy.trader.constant import Exchange, Interval
class Exchange_(Enum):
BINANCE = "BINANCE"
HUOBI = "HUOBI"
OKEX = "OKEX"
COINBASE = "CONIBASE"
BITFINEX = "BITFINEX"
ExchangeExtend = Enum(
"Exchange",
[(e.name, e.value) for e in Exchange] + [(e.name, e.value) for... | cloudseasail/vnpy_cryptostrategy | vnpy_ccxt/constant.py | constant.py | py | 596 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "enum.Enum",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "vnpy.trader.constant.Exchange",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"lin... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.