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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
13364931787 | import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib
import matplotlib.pyplot as plt
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
class1 = np.array([[4, 1], [2, 4],[2, 3],[3, 6],[4, 4]])
class2 = np.array([[9,10],[6, 8],[9, 5],[8, 7],[10, 8]])
m1 = np.mean(class1,ax... | mymultiverse/MachineLearning | Supervised/Classification/lda.py | lda.py | py | 2,508 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.array",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 13,... |
31861974349 | # coding: utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import unittest
import ray
from ray.rllib import _register_all
from ray.tune import Trainable
from ray.tune.ray_trial_executor import RayTrialExecutor
from ray.tune.suggest import BasicVariantG... | llan-ml/tesp | ray/tune/test/ray_trial_executor_test.py | ray_trial_executor_test.py | py | 3,841 | python | en | code | 30 | github-code | 18 | [
{
"api_name": "unittest.TestCase",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "ray.tune.ray_trial_executor.RayTrialExecutor",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "ray.init",
"line_number": 19,
"usage_type": "call"
},
{
"api_... |
6972423954 | import re
from http.cookiejar import LWPCookieJar
import requests
import requests.utils
def get_salesforce_keys(page):
patterns = {
'com.salesforce.visualforce.ViewState': r'"com.salesforce.visualforce.ViewState"\s+value="([^"]+)"',
'com.salesforce.visualforce.ViewStateVersion': r'"com.salesforce... | datagutten/apc-smartconnect-py | apc_smartconnect/APCSmartConnect.py | APCSmartConnect.py | py | 4,916 | python | en | code | 4 | github-code | 18 | [
{
"api_name": "re.search",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "http.cookiejar.LWPCookieJar",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "requests.Session",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "requests.utils... |
10867522435 | import hmac, hashlib
from cryptography.hazmat.primitives.kdf.hkdf import HKDF
from cryptography.hazmat.primitives.asymmetric.x25519 import (
X25519PrivateKey,
X25519PublicKey,
)
from cryptography.hazmat.primitives import hashes, padding
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, mod... | itsvs/seesaw | dblratchet/models.py | models.py | py | 5,031 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "cryptography.hazmat.primitives.kdf.hkdf.HKDF",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "cryptography.hazmat.primitives.hashes.SHA512",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "cryptography.hazmat.primitives.hashes",
"line_numbe... |
29072169896 | # BOJ No.1939
# 중량제한
import sys
from collections import deque
def bfs(target):
queue=deque([island1])
visited=[0 for _ in range(n+1)]
visited[island1]=1
while queue:
v=queue.popleft()
if v==island2:
return True
for b,c in graph[v]:
if not visited[b] and ... | Segye-kr/DataStructure-and-Algorithm | Binary_Search/BOJ_1939.py | BOJ_1939.py | py | 956 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "collections.deque",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.stdin.readline",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "sys.stdin.readline... |
14854621436 | """
Default settings for the ``mezzanine.blog`` app. Each of these can be
overridden in your project's settings module, just like regular
Django settings. The ``editable`` argument for each controls whether
the setting is editable via Django's admin.
Thought should be given to how a setting is actually used before
mak... | stephenmcd/mezzanine | mezzanine/blog/defaults.py | defaults.py | py | 2,363 | python | en | code | 4,663 | github-code | 18 | [
{
"api_name": "mezzanine.conf.register_setting",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "django.utils.translation.gettext_lazy",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "django.conf.settings",
"line_number": 25,
"usage_type": "argument"
... |
20013901549 | #!/usr/bin/python
# -*- encoding: utf-8 -*-
import traceback
import pika
class Client(object):
def __init__(self, channel, output_exchange, output_routing_key, method):
self._channel = channel
self._output_routing_key = output_routing_key
self._output_exchange = output_exchange
se... | dimorinny/rabbit-bind | rabbit_bind/rabbit_bind.py | rabbit_bind.py | py | 2,824 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pika.BlockingConnection",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pika.ConnectionParameters",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "traceback.print_exc",
"line_number": 57,
"usage_type": "call"
}
] |
33104326729 | import datetime
import json
import ics
import pytz
year = str(datetime.date.today().year)
def read_json():
with open("./yearlyCalendarOutput/Calendar" + year +".json") as file:
data = json.load(file)
generate_calendar(data)
def is_dst(dt,timeZone):
aware_dt = timeZone.localize(dt)
return aware... | EhabMohamedsaid/iCalendarPrayerTimes | json_parser.py | json_parser.py | py | 1,955 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "datetime.date.today",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
... |
73700942760 | import operator
from functools import reduce
from operator import eq
class FairnessUtils:
@classmethod
def calculate_cond_probability(cls, data, ofs, givens):
""" calculate conditional probability of 'ofs' given 'givens' """
givens_conditions = []
ofs_conditions = []
for of in... | jlaumonier/mlsurvey | mlsurvey/fairness_utils.py | fairness_utils.py | py | 1,013 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "operator.eq",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "operator.eq",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "operator.eq",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "functools.reduce",
"line_numb... |
39490141774 | import torch
import torch.nn as nn
def init(module, weight_init, bias_init, gain=1):
weight_init(module.weight.data, gain=gain)
bias_init(module.bias.data)
return module
class FCGenerator(nn.Module):
def __init__(self, init_var=0.1, num_p=2000):
super(FCGenerator, self).__init__()
in... | AdaCompNUS/Prompt | core/reconstruction/fc_gen.py | fc_gen.py | py | 749 | python | en | code | 4 | github-code | 18 | [
{
"api_name": "torch.nn.Module",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "torch.nn.init",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line... |
42474903898 | import pygame
import pygame_gui
from game_board import CoordinatePlane
from User import User
from gui import GUIManager
WINDOW_WIDTH = 1000
WINDOW_HEIGHT = 1000
# Initialize Pygame, create a screen surface, and other necessary variables
pygame.init()
screen = pygame.display.set_mode((WINDOW_WIDTH, WINDOW_HEIGHT))
cl... | coledtaylor/pygame-demo | main.py | main.py | py | 1,257 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pygame.init",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "pygame.time.C... |
25098536936 | from flask import json, Flask, render_template, url_for, request, session, redirect, make_response, flash, jsonify
from flask_socketio import SocketIO
from flaskext.mysql import MySQL
import bcrypt
from flask_pymongo import PyMongo
from pymongo import MongoClient
app = Flask(__name__, static_url_path='/static')
app... | tranquoctrung0606/Captone-1 | src/test1.py | test1.py | py | 1,099 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask_socketio.SocketIO",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flaskext.mysql.MySQL",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pymongo.Mong... |
14468595747 | from pprint import pprint
from math import sqrt
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
from pydataset import data
from statsmodels.formula.api import ols
def plot_residuals(x, y):
'''
Plots the residuals of a model that uses x to predict y. Note that we don't
need to m... | CodeupClassroom/bayes-methodologies-exercises | regression/evaluate.py | evaluate.py | py | 2,662 | python | en | code | 5 | github-code | 18 | [
{
"api_name": "seaborn.residplot",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "pydataset.data",
"line_numb... |
34857499087 | import csv
import os
import time
from datetime import datetime
from threading import Timer
import psutil
import Constants
class Logger:
# Returns A List Of Programs Using A Memory threshold
def get_active(self, threshold=None) -> list:
if threshold is None:
threshold = 1
active... | Maddest-Lad/Personal-Assistant | Time-Tracker/Logger.py | Logger.py | py | 2,322 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "Constants.ignore_list",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "psutil.process_iter",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path.exis... |
29127024443 | #!/usr/bin/python
import serial
import time
import requests
import json
import sys
job_limit = 16
max_job = job_limit - 1
token = sys.argv[1]
url = 'https://circleci.com/api/v1.1/recent-builds?circle-token=' + token + '&limit=' + str(job_limit) + '&offset=0'
request_frequency = 15
s = None
color_map = { ... | jhogsett/linkit | python/circleci4.py | circleci4.py | py | 3,484 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "time.sleep",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "serial.Serial",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_numbe... |
70599411239 | import sys
from parser.exceptions import BaseParseError
from parser.grammar.parser import NonTerminal, Terminal
from parser.grammar.parser import parse as parse_grammar
from parser.parser.models import Tree
from parser.parser_generator.exceptions import UnknownTokenException
from parser.parser_generator.models import P... | lk16/parser | parser/parser_generator/parser_generator.py | parser_generator.py | py | 11,291 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pathlib.Path",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "parser.grammar.parser.parse",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "typing.Optional",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "parser.parse... |
27129890359 | import datetime
import uuid
from typing import Generator, List
from unittest import mock
import pytest
from pymongo.collection import Collection
from sched_slack_bot.data.mongo.mongo_schedule_access import MongoScheduleAccess
from sched_slack_bot.model.schedule import Schedule
@pytest.fixture()
def mocked_collectio... | Germandrummer92/SchedSlackBot | test_sched_slack_bot/data/mongo/test_mongo_schedule_access.py | test_mongo_schedule_access.py | py | 3,619 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "unittest.mock.MagicMock",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "unittest.mock",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "pymongo.collection.Collection",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "p... |
38634754223 | from pathlib import Path, PurePath
from sys import version_info as py_ver
from pkg_resources import get_distribution as get_dist
from time import time
from json import load as json_load
from PIL import Image
from datetime import datetime
from httpx import get as get_url
import argparse
import hashlib
tg_u... | EyePatch10/tg-upload | tg-upload.py | tg-upload.py | py | 34,459 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.version_info",
"line_number": 82,
"usage_type": "name"
},
{
"api_name": "pkg_resources.get_distribution",
"line_number": 82,
"usage_type": "call"
},
{
"api_name"... |
39694154062 | import time
import torch
from torch import nn, optim
import sys
#sys.path.append("..")
import utils as d2l
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
import torch.nn.functional as F
def scale(x, y):#x:(B*C*T*H*W);y=(B*C)
x = x.permute(2, 3, 4, 0, 1)
y = y.squeeze()
... | jibandeshuai/pytorch-MRST | MRST-pytorch.py | MRST-pytorch.py | py | 3,870 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "torch.device",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Module",
... |
30349492254 | from django.urls import path
from . import views
urlpatterns = [
# здесь должен быть path(), который
# при обращении к странице /useful/
# вызовет функцию useful_function_list() из views.py
# # [примечание] при include запрошенный URL в присоединяемом файле
# указывается не полностью
path('', ... | SrGrey/Usefulsite | usefulsite/useful/urls.py | urls.py | py | 549 | python | ru | code | 0 | github-code | 18 | [
{
"api_name": "django.urls.path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 13,
"usage_type": "call"
}
] |
24965667173 | import itertools
import math
import torch
import torch.nn as nn
from networks.stylegan2_concat import ConvLayer, EqualLinear, PixelNorm
"""
Conv + Norm + Activation Block
"""
class ConvBlock(nn.Module):
def __init__(self, in_ch, out_ch, kernel=5, padding=1, stride=1, norm="batch", activation="lrelu"):
su... | Griffin98/InWildExpression | networks/encoder2.py | encoder2.py | py | 8,723 | python | en | code | 1 | 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.Conv2d",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
12634295604 | import selenium
from selenium import webdriver
from time import sleep
class YoutubeBot:
def __init__(self, driver_name):
if driver_name.lower() == "firefox":
# driver for firefox
self.driver = webdriver.Firefox()
sleep(0.5)
self.driver.get("https://www.you... | Opposite34/youtube-bot | youtube_bot.py | youtube_bot.py | py | 1,361 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "selenium.webdriver.Firefox",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "time.sleep",... |
9863159656 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Date :2020/10/25 20:14
# Author:Lydia
"""
使用cookie 登录企业微信,完成导入联系人,加上断言验证
"""
import shelve
from time import sleep
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
# cookie 实现浏览器复用
class Tes... | lydia008/hogwats15 | web/test_homework102202.py | test_homework102202.py | py | 5,149 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "selenium.webdriver.chrome.options.Options",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 22,
"usage_type": "name"
}
] |
28855810670 | import numpy as np
from scipy.optimize import minimize
from typing import Callable
import cma
from scipy.stats import t
import sys
import os
sys.path.insert(1, os.path.join(os.path.dirname(sys.path[0]), 'environments'))
sys.path.insert(1, os.path.join(os.path.dirname(sys.path[0]), 'optimizers'))
sys.path.insert(1, os.... | ananyagupta27/Seldonian-RL | optimizers/optimizer_library.py | optimizer_library.py | py | 3,015 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sys.path.insert",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": ... |
12763310521 | from tkinter import *
from tkinter import messagebox
import clipboard
from PIL import ImageTk, Image
import tkinter as tk
# pathway/code/bases/twodig/onedig/ciphersused/length of pathway
def retrieve_input():
global textBox, buttonCommit
inputValue = textBox.get("1.0", "end-1c")
global code
code = in... | Rishthegreat/Giraffe | Encryption and Decryption.py | Encryption and Decryption.py | py | 38,239 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "tkinter.Tk",
"line_number": 128,
"usage_type": "call"
},
{
"api_name": "tkinter.Tk",
"line_number": 162,
"usage_type": "call"
},
{
"api_name": "tkinter.Tk",
"line_number": 196,
"usage_type": "call"
},
{
"api_name": "tkinter.messagebox.showinfo",
... |
12327850631 | import collections
import functools
import xml.dom.minidom
import dbus
import qui.models.base
from typing import Any, Callable, Dict, Union
OBJECT_MANAGER_INTERFACE = 'org.freedesktop.DBus.ObjectManager'
PROPERTIES_INTERFACE = 'org.freedesktop.DBus.Properties'
PROPERTIES_CHANGED = 'PropertiesChanged'
_DictKey = Uni... | kalkin/qubes-desktop-linux-manager | qui/models/dbus.py | dbus.py | py | 6,651 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "typing.Union",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "dbus.String",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "qui.models.base.models",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "qui.models.... |
70109989161 | import sys
input = sys.stdin.readline
from collections import deque
T = int(input())
for _ in range(T):
p = input().rstrip()
n = int(input())
tmp = input().rstrip()[1:-1].split(",")
q = deque(tmp)
if not n:
q = deque()
cnt = 0
flag = False
for i in p:
if... | eunjng5474/Algorithm | 백준/Gold/5430. AC/AC.py | AC.py | py | 988 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "sys.stdin",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 12,
"usage_type": "call"
}
] |
9940002193 | # Author : Shivam Chauhan
# Date : March 6, 2019
# This scripts takes search matter as input and open up the best
# matched links(on the first page usually) in new tabs in the browser
# automatically.
from bs4 import BeautifulSoup
import requests
import webbrowser
content = input("Enter the content to be searched... | chashiv/AutomatedTasksWithPython | openingSearchResults.py | openingSearchResults.py | py | 870 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "webbrowser.open",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "webbrowser.open",
... |
71889392360 | #!/usr/bin/env python3
# coding: utf-8
import json
import nrn_validation as V
V.override_defaults_from_args()
# dendrite geometry: 200 µm long, diameter 1 µm to 0.4 µm.
geom = [(0, 1.0), (200, 0.4)]
model = V.VModel()
model.add_soma(12.6157)
model.add_dendrite("taper", geom)
model.add_iclamp(5, 80, 0.3, to="taper")... | arbor-sim/arbor | validation/ref/neuron/ball_and_taper.py | ball_and_taper.py | py | 426 | python | en | code | 97 | github-code | 18 | [
{
"api_name": "nrn_validation.override_defaults_from_args",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "nrn_validation.VModel",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "nrn_validation.run_nrn_sim",
"line_number": 17,
"usage_type": "call"
},... |
19452156920 | import json
from django.shortcuts import render
from django.http import JsonResponse
from common.utils import common_response, logger, page_calculate
from common.models import User, Grade
from knowledges.models import Knowledge
from knowledges.serializers.knowledge import knowledge_filter, knowledge_data
# 教程列表页面
def... | U-Recommend/lesson_sys | knowledges/views.py | views.py | py | 1,713 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "knowledges.models",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "knowledges.serializers.knowledge.knowledge_filter",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "knowledges.models",
"line_number": 15,
"usage_type": "name"
},
{
... |
24131508841 | from collections.abc import Mapping, Sequence
from pathlib import Path
from typing import Literal
import pytest
from freezegun import freeze_time
import cmk.utils.paths
from cmk.utils.hostaddress import HostName
from cmk.base.plugins.agent_based import logwatch_ec
from cmk.base.plugins.agent_based.agent_based_api.v1... | bbayersva/checkmk | tests/unit/cmk/base/plugins/agent_based/test_logwatch_ec.py | test_logwatch_ec.py | py | 27,317 | python | en | code | null | github-code | 18 | [
{
"api_name": "cmk.base.plugins.agent_based.utils.logwatch.Section",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "cmk.base.plugins.agent_based.utils.logwatch",
"line_number": 63,
"usage_type": "name"
},
{
"api_name": "pytest.MonkeyPatch",
"line_number": 160,
... |
22114565758 | #!/usr/bin/env python
from flask.ext.admin.contrib.sqla import ModelView
from flask.ext.admin import Admin
from models import (
Users,
Format,
Sameas,
Torrent,
Datasets,
Role,
Provider,
License,
db
)
from flask import session
from xmlrpclib import ServerProxy
from makeTorrent import ... | Kungbib/data.kb.se | flaskapp/lib/adminviews.py | adminviews.py | py | 5,841 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "flask.ext.admin.Admin",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "flask.ext.admin.contrib.sqla.ModelView",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "flask.session.get",
"line_number": 27,
"usage_type": "call"
},
{
"ap... |
15117227304 | from django.shortcuts import redirect, render
# Create your views here.
def add_to_cart(request):
return redirect('products')
from django.shortcuts import render , redirect
from django.contrib import messages
from products.models import Product
from orders.models import Order
from orders.models import OrderDetai... | medoosh79/coffee | SRC/orders/views.py | views.py | py | 4,591 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.shortcuts.redirect",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "orders.models.Order.objects.all",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "orders.models.Order.objects",
"line_number": 21,
"usage_type": "attribute"
},
... |
335900745 | from django.shortcuts import render, reverse
from django.http import HttpResponse, HttpResponseRedirect
from .models import MyModel
def myview(request):
myinstances = MyModel.objects.all()
context = {
'myinstances': myinstances
}
return render(request, 'myapp/mytemplate.html', context)
def myc... | PdxCodeGuild/class_olive | code/tim/Django/Quickstart/myproject/myapp/views.py | views.py | py | 710 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "models.MyModel.objects.all",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "models.MyModel.objects",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "models.MyModel",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "dj... |
73484857000 | """Training reserves serializers."""
# Django
from django.core.validators import RegexValidator
from django.utils import timezone
# Django REST Framework
from rest_framework import serializers
# Models
from users.models import User
from bookings.models import TrainingReserve
# Serializers
from users.serializers imp... | Julian-Bio0404/Gym-Admin | bookings/serializers/training_reserves.py | training_reserves.py | py | 2,478 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "users.serializers.UserModelSerializer",
"line_number": 21,
"us... |
28234673438 | from datetime import datetime, timedelta
from Modules.FlightConstants import FlightConstants
class FlightFinder():
# AIRLINE: Get airline(s) to fly from
def get_airline_codes(airlines, airline_choices):
if airlines: return airlines
elif airline_choices: return FlightConstants.airlines[airline_c... | DavidGracias/flightfinder | Modules/FlightFinder.py | FlightFinder.py | py | 3,627 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "Modules.FlightConstants.FlightConstants.airlines",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "Modules.FlightConstants.FlightConstants",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "Modules.FlightConstants.FlightConstants.airlines",
... |
31337709410 | #!/usr/bin/env python
from nornir import InitNornir
from nornir.core.filter import F
def main():
nr = InitNornir()
nr = nr.filter(F(groups__contains="sea") | F(groups__contains="sfo"))
print(nr.inventory.hosts)
if __name__ == "__main__":
main()
| avalonhawk/nornir_class | wk3/ex3/ex3b.py | ex3b.py | py | 264 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "nornir.InitNornir",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "nornir.core.filter.F",
"line_number": 8,
"usage_type": "call"
}
] |
22082560139 | import asyncio
import html
import json
import os
import re
from time import perf_counter
import aiohttp
import requests
import sqlalchemy as db
from dotenv import load_dotenv
load_dotenv()
print("RUNING")
url: str = os.getenv('DATABASE_URL')
engine = db.create_engine(url)
meta_data = db.MetaData(engine)
db.MetaDat... | VapoVapoStore/VapoVapoStoreWebSite | python/main.py | main.py | py | 6,662 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.create_engine",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Meta... |
1632868100 | from audioop import bias
from enum import auto
import sys
sys.path.append(".")
from agent.DeepScalper.model import Net
import numpy as np
import torch
from torch import nn
model_a = torch.load('/mnt/d/TradeMaster-1/result/AT/trained_model/best_model/best_model.pth').cpu()
model_a.eval()
torch.set_printoptions(threshol... | chunpengcoredelia/TradeMaster | agent/DeepScalper/print_weights_articture.py | print_weights_articture.py | py | 5,463 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sys.path.append",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "torch.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.set_printoptions",
"l... |
11993833333 | from typing import List
class Solution:
def contain_most_water(self, arr: List[int]):
max_area = 0
curr_area = 0
i = 0
j = len(arr) - 1
while i < j:
curr_area = min(arr[i], arr[j]) * (j - i)
if curr_area > max_area:
max_area = curr_are... | sreejithr2000/Leetcode-Problems | Python Leetcode Algorithms/1. Array and String/5. contains_most_water.py | 5. contains_most_water.py | py | 565 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "typing.List",
"line_number": 4,
"usage_type": "name"
}
] |
70232775081 | '''fonty.lib.telemetry'''
import sys
import json
import platform
import threading
from enum import Enum
from datetime import datetime
from typing import Tuple
import requests
from fonty.version import __version__
from fonty.lib.json_encoder import FontyJSONEncoder
from fonty.lib.constants import TELEMETRY_ENDPOINT, JS... | jamesssooi/fonty | fonty/lib/telemetry.py | telemetry.py | py | 4,550 | python | en | code | 15 | github-code | 18 | [
{
"api_name": "enum.Enum",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "datetime.datetime",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",... |
115810155 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import pandas as pd
import numpy as np
import librosa
from pathlib import Path
import soundfile as sf
from tqdm import tqdm
from pqdm.processes import pqdm
train = pd.read_csv('../input/train_metadata.csv')
train
def ogg2np(ebird, filename):
input_path = Path('../... | jfpuget/STFT_Transformer | data_final.py | data_final.py | py | 2,984 | python | en | code | 71 | github-code | 18 | [
{
"api_name": "pandas.read_csv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "soundfile.read",
"line_... |
3255293185 | import os
import numpy as np
import pandas as pd
print(os.getcwd())
bc_data = pd.read_csv('bc_data.csv', header=0) # 数据集中没有列名信息,所以header设置为0
bc_data.head()
print(bc_data.shape) # 查看形状
print(bc_data.columns) # 查看列名
print(bc_data.describe()) # 查看描述性统计信息
data = bc_data.drop(['id'], axis=1)
print(data.head())
x_data ... | a1864754/python | 大二一些代码/knn.py | knn.py | py | 1,024 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "os.getcwd",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.ravel",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_tes... |
5748850457 | from cdpcli.compat import json
import dateutil.parser
class ResponseParserFactory(object):
def create_parser(self):
return ResponseParser()
class ResponseParser(object):
DEFAULT_ENCODING = 'utf-8'
def parse(self, response, shape):
if response['status_code'] >= 301:
return s... | cloudera/cdpcli | cdpcli/parser.py | parser.py | py | 3,413 | python | en | code | 9 | github-code | 18 | [
{
"api_name": "cdpcli.compat.json.loads",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "cdpcli.compat.json",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "dateutil.parser.parser.parse",
"line_number": 92,
"usage_type": "call"
},
{
"api_name... |
72968244520 | import gym
import sys
import torch
import numpy as np
from PIL import Image
class DeepMindControl:
def __init__(self, name, seed, size=(64, 64), camera=None):
domain, task = name.split('-', 1)
if domain == 'cup': # Only domain with multiple words.
domain = 'ball_in_cup'
if isi... | adityabingi/Dreamer | env_wrapper.py | env_wrapper.py | py | 8,633 | python | en | code | 13 | github-code | 18 | [
{
"api_name": "dm_control.suite.load",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "dm_control.suite",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "gym.spaces.Box",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "gym.spaces",
... |
41030616075 | # Load packages
import numpy as np
import pandas as pd
import plotly.express as px
import matplotlib.pyplot as plt
from sklearn.ensemble import IsolationForest
from sklearn.model_selection import train_test_split
# Load data from the csv file
df = pd.read_csv("housing.csv", index_col=False)
df.head()
CONTAMINATION=... | bysarmad/detectoutliers | code.py | code.py | py | 1,304 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sklearn.ensemble.IsolationForest",
"line_number": 24,
"usage_type": "call"
},
... |
71312507241 | import math
import re
from functools import reduce
from operator import mul
import utils
def parse_img(img_part: str):
lines = img_part.splitlines()
return (utils.ints(lines[0])[0], lines[1:])
all_pics = utils.get_list_data_from_file('day20.txt', parser=parse_img, sep='\n\n')
MONSTER= [
' ... | ycombo/adventofcode2020 | day20.py | day20.py | py | 6,251 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "utils.ints",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "utils.get_list_data_from_file",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "functools.reduce",
"line_number": 111,
"usage_type": "call"
},
{
"api_name": "operator.m... |
2304265204 | from pytorch_transformers.modeling_bert import BertConfig
from pytorch_transformers import optimization
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter
from datasets import Datasets
from model import BertForEmotionClassification
from optim i... | Donghwa-KIM/audiotext-transformer | korbert_vat/train_classification.py | train_classification.py | py | 16,841 | python | en | code | 12 | github-code | 18 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "utils.get_logger",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "torch.tens... |
15826507676 | import pydantic
from box import ConfigBox
import os
from pathlib import Path
from mlengine.common.logger import logger
from mlengine.common.utils import create_directories
from mlengine.common.exceptions import MissingCriticalFileException
from mlengine.data_read.read import read_csv_file
class StudentDataTypesValid... | badutka/ml-app | src/mlengine/dataops/validate.py | validate.py | py | 3,354 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pydantic.BaseModel",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pydantic.StrictStr",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "pydantic.StrictStr",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name"... |
39524240288 | from django.db import models
from django.contrib import admin
try:
import json
except ImportError:
import simplejson as json
class Card(models.Model):
card_id = models.CharField(max_length=16)
def __unicode__(self):
return self.card_id
@classmethod
def load_json(cls, json_data):
... | toshi-kawanishi/felica-client-server | felicasite/simpleserver/models.py | models.py | py | 667 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "django.db.models.Model",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": ... |
30510827619 | # -*- coding: utf-8 -*-
from odoo import models, fields, api, _
from odoo.exceptions import AccessError, UserError, ValidationError
from odoo.tools.translate import html_translate
import logging
_logger = logging.getLogger(__name__)
class PurchaseOrder(models.Model):
_name = 'purchase.order'
_inherit = ['pu... | tu95ctv/sgvn | x_purchase_quotation/models/purchase.py | purchase.py | py | 10,139 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"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"... |
34000704673 | #!/usr/bin/env python3
# _*_ coding: utf-8 _*_
"""
collect_tweets_by_search.py
트위터 검색 API(https://dev.twitter.com/rest/public/search)를 이용하여 트윗을 수집한다
"""
from twython import Twython
import ujson
CONSUMER_KEY = "YOUR_CONSUMER_KEY"
CONSUMER_SECRET = "YOUR_CONSUMER_SECRET"
ACCESS_TOKEN = "YOUR_ACCESS_TOKEN"
ACCESS_TOKE... | Leesunghee/text_mining_pratice_with_python | text_mining_practice/collect_tweets_by_search.py | collect_tweets_by_search.py | py | 603 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "twython.Twython",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "ujson.dumps",
"line_number": 23,
"usage_type": "call"
}
] |
39132000553 | #!/usr/bin/env python3
# === IMPORTS ===
# Utils
import os
import json
# === FUNCTIONS ===
def obtain_json_data():
file_directory = os.path.dirname(os.path.abspath(__file__))
json_path = os.path.join(file_directory, "posts.json")
with open(json_path, "r") as json_file:
data = json.load(json_file)... | annamar26/bizbat-dashboard | back/blueprints/posts/posts_controller.py | posts_controller.py | py | 2,886 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.path.dirname",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line... |
72143132199 | import os
import aiohttp
from aiohttp import ClientResponseError, ServerTimeoutError, TooManyRedirects
from userge import Config, Message, userge
DOGBIN_URL = "https://del.dog/"
NEKOBIN_URL = "https://nekobin.com/"
@userge.on_cmd(
"paste",
about={
"header": "Pastes text or text_file to dogbin",
... | code-rgb/USERGE-X | userge/plugins/utils/paste.py | paste.py | py | 4,846 | python | en | code | 130 | github-code | 18 | [
{
"api_name": "userge.Message",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "os.path.splitext",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "userge.Config.DOWN_PATH"... |
6971277919 | # -*- coding: utf-8 -*-
from odoo import models, fields, api
from odoo.exceptions import AccessError, UserError, ValidationError
import logging
_logger = logging.getLogger(__name__)
class PurchaseOrder(models.Model):
_inherit = ['purchase.order']
# can_send_po = fields.Boolean(compute = '_can_send_po')
... | IsaiasRosario06/odoo | purchase/ipx_po_approval/models/purchase.py | purchase.py | py | 6,981 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "odoo.models.Model",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "odoo.models",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "odoo.fields.Integer... |
32662730953 | from __future__ import absolute_import
from uuid import uuid4
from sentry.models import (
Event,
Group,
GroupAssignee,
GroupHash,
GroupMeta,
GroupRedirect,
GroupStatus,
ScheduledDeletion,
UserReport,
)
from sentry.tasks.deletion import run_deletion
from sentry.testutils import Test... | pastpatryk/sentry | tests/sentry/deletions/test_group.py | test_group.py | py | 1,975 | python | en | code | null | github-code | 18 | [
{
"api_name": "sentry.testutils.TestCase",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sentry.testutils.helpers.datetime.iso_format",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "sentry.testutils.helpers.datetime.before_now",
"line_number": 32,
... |
21743864763 | # coding=utf-8
import json
import urllib
import urllib2
import os
class ShouHuiJianZhu(object):
def __init__(self):
pass
def gain_response(self, base_url, headers):
# url = 'http://image.so.com/j?q=%E6%89%8B%E7%BB%98%E5%BB%BA%E7%AD%91&src=srp' \
# '&correct=%E6%89%8B%E7%BB%98%E... | lingzige/tupian | 02_ajax.py | 02_ajax.py | py | 2,044 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "urllib.urlencode",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "urllib2.Request",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "urllib2.urlopen",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "json.loads",
"li... |
20998683649 | import torchvision.models as models
import torch
import torch.nn as nn
import torch.optim as optim
from torchvision import transforms
from transformers import DeiTForImageClassification
import database.dataset as dataset
import numpy as np
import time
from database.loss import MarginLoss, ProxyNCA_prob, NormSoftmax
fr... | stephdef08/tfe2 | database/models.py | models.py | py | 11,296 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "torch.nn.Module",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "torchvision.models.densenet121",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torchvis... |
22448782026 | import random
from sklearn.linear_model import LogisticRegression
from metal.utils import convert_labels
from metal.metrics import metric_score
class LogisticRegressionWrapper(object):
"""A wrapper around scikit-learn's LogisticRegression class
The wrapper is necessary both to convert labels from categorica... | HazyResearch/babble | babble/disc_model.py | disc_model.py | py | 1,359 | python | en | code | 144 | github-code | 18 | [
{
"api_name": "random.seed",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model.LogisticRegression",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "metal.utils.convert_labels",
"line_number": 20,
"usage_type": "call"
},
{
"ap... |
18672880061 | from django import template
from django.template.defaultfilters import stringfilter
register = template.Library()
@register.filter
@stringfilter
def formatar_preco(preco):
preco = preco[:-3]
preco = preco[:-2] + ',' + preco[-2:]
return preco
register.filter('formatar_preco', formatar_preco)
| WagnerEsser/meuspedidos | meuspedidos_app/templatetags/formatar_preco.py | formatar_preco.py | py | 309 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.template.Library",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "django.template.defaultfilters.stringfilter",
"line_number": 8,
"usage_type": "name"
}
] |
74594944358 | from django.contrib import admin
from .models import *
# Register your models here.
class CustomUserAdmin(admin.ModelAdmin):
list_display = ('phone_number', 'joined', 'email', 'is_superuser')
date_hierarchy = 'joined'
list_filter = ('joined', )
search_fields = ('email', 'phone_number')
fieldset... | root123-bot/Kiepe_Backend | Kiepe/register/admin.py | admin.py | py | 647 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.site.register",
"line_number": 24,
"usage_type": "call"
},... |
11254438487 | import lightning as pl
import torch
import transformers
from transformers import AdamW, T5ForConditionalGeneration, T5TokenizerFast as T5Tokenizer
from model import SummaryModel
tokenizer = T5Tokenizer.from_pretrained("t5-base")
checkpoint="base-checkpoint.ckpt"
model = SummaryModel()
model=model.load_from_checkpoin... | ogigo/lightning_text_summarization | src/inference.py | inference.py | py | 1,142 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "transformers.T5TokenizerFast.from_pretrained",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "transformers.T5TokenizerFast",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "model.SummaryModel",
"line_number": 11,
"usage_type": "call"
},... |
15964945911 | import sys
import random
import datetime
import numpy as np
import torch
import wandb
from rppg.loss import loss_fn
from rppg.models import get_model
from rppg.optim import optimizer
from rppg.config import get_config
from rppg.dataset_loader import (dataset_loader, dataset_split, data_loader)
from rppg.... | remotebiosensing/rppg | rppg/main.py | main.py | py | 2,699 | python | en | code | 185 | github-code | 18 | [
{
"api_name": "torch.manual_seed",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.cuda.manual_seed",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "torch.cuda.m... |
25412204309 | import os
import platform
import sys
try:
import termios
import tty
except ImportError:
import msvcrt
from .ansi_escapes import *
from .colorama import just_fix_windows_console
if platform.system() == "Windows":
just_fix_windows_console()
class Shell():
offset = 0
line = 0
def __init__(self, stdin = sys.stdi... | zheka2304/innercore-mod-toolchain | toolchain/toolchain/python/innercoremodtoolchain/shell.py | shell.py | py | 18,870 | python | en | code | 29 | github-code | 18 | [
{
"api_name": "platform.system",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "colorama.just_fix_windows_console",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "sys.... |
17980167402 | import math
import numpy as np
import scipy.optimize as optimize
import mlak.LinearAlgebra as la
import mlak.MathTools as mt
import mlak.ModelAnalyzer as ma
def apply_topology( topology, theta_ ):
theta = []
offset = 0
for i in range( 1, len( topology ) ):
rows = topology[i]
cols = topology[i - 1] + 1
s = ro... | codestation-org/mlak | mlak/NeuralNetwork.py | NeuralNetwork.py | py | 4,391 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "numpy.array",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.concatenate",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number"... |
11356047858 | import logging
from pyramid.view import view_config
from pyramid.httpexceptions import HTTPUnprocessableEntity, HTTPNotFound
from ziggurat_foundations.models.services.user import UserService
from appenlight.lib.utils import permission_tuple_to_dict
from appenlight.models.services.config import ConfigService
from appe... | AppEnlight/appenlight | backend/src/appenlight/views/groups.py | groups.py | py | 6,324 | python | en | code | 35 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "appenlight.models.group.Group.all",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "appenlight.models.group.Group",
"line_number": 31,
"usage_type": "name"
},
{
... |
17120658680 | """
Created on Thu Oct 24 11:44:50 2019
@author: Julia
"""
import pandas as pd
import numpy as np
from collections import defaultdict, Counter
import logging
from pyteomics import mass
try:
from pyteomics import cmass
except ImportError:
cmass = mass
import string
from . import utils, io
logger = logging.ge... | SimpleNumber/aa_stat | AA_stat/localization.py | localization.py | py | 17,166 | python | en | code | 5 | github-code | 18 | [
{
"api_name": "pyteomics.cmass",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "pyteomics.mass",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pyteomics.mass.std_a... |
317371853 | import pandas as pd
import numpy as np
import random
from pathlib import Path
from itertools import combinations
from collections import defaultdict
from functools import lru_cache
def calc_stats(part2pop, parts):
"""counts mean amount of wins for a real population"""
for part in parts:
populations =... | smetam/deepancestry | src/analyser.py | analyser.py | py | 6,308 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.read_csv",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.Series",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"lin... |
14668037822 | from django.conf.urls import patterns, include, url
from django.conf import settings
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'hackmum.views.home', name='home'),
# url(r'^hackmum/', include... | mehulved/hackmum | hackmum/urls.py | urls.py | py | 1,138 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "django.contrib.admin.autodiscover",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.conf.urls.patterns",
"line_number": 8,
"usage_type": "call"
},
{
"api... |
37059702559 | from django.core.exceptions import ImproperlyConfigured
from getpaid.utils import get_backend_settings
class PaymentProcessorBase(object):
"""
Base for all payment processors. It should at least be able to:
* redirect to a gateway based on Payment object
* manage all necessary logic to accept payment... | Coalas/django-getpaid | getpaid/backends/__init__.py | __init__.py | py | 2,300 | python | en | code | null | github-code | 18 | [
{
"api_name": "getpaid.utils.get_backend_settings",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "django.core.exceptions.ImproperlyConfigured",
"line_number": 58,
"usage_type": "call"
}
] |
930968927 | import Adafruit_DHT
import json
import sys
DHT_SENSOR = Adafruit_DHT.DHT22
DHT_PIN = 4
humidity, temperature = Adafruit_DHT.read_retry(DHT_SENSOR, DHT_PIN)
if humidity is not None and temperature is not None:
data = {}
data['TempC'] = round(temperature, 1)
data['Humidity'] = round(humidity, 1)
s... | ytechie/rv-iot | sensors/dht22/sensor.py | sensor.py | py | 428 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "Adafruit_DHT.DHT22",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "Adafruit_DHT.read_retry",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.stdout.write",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sys.st... |
72157247720 | from new_constraints import constraints
from mysolver_interface import call_my_solver
from lmisr_interface import call_solver
import numpy as np
import torch.nn.functional as F
import torch
from verify import aux_array_as_hex, parseaux
from tqdm import tqdm
np.set_printoptions(precision = 2, suppress = True)
# an in... | ikmartin/ising-clustering | oneshot/svm.py | svm.py | py | 4,344 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.set_printoptions",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "verify.parseaux",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "torch.tensor",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"... |
74074471400 | import sys
import numpy as np
import scipy.linalg as la
import scipy.sparse.linalg as las
def cg(A,k,x0,niter,tol):
A=np.array(A.split(',')).astype(int)
m=np.sqrt(A.shape[0]).astype(int)
A=A.reshape(-1,m)
k=np.array(k.split(',')).astype(int)
n=int(niter)
x=np.zeros((m,n))
x[:,0]=np.array(x0... | ericjvandervelden/machine_learning | cg_debugstatements.py | cg_debugstatements.py | py | 1,317 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.array",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 12,... |
2904409413 | #!/usr/bin/env python3
"""
This is a script preparing data for the post-editing task. It encodes the
sentences to be post-edited as a sequence of delete, keep and insert
operations from the target sentence.
Example:
source: Good afternoon , John ! !
target: Good evening , John !
result: <keep> <de... | ufal/neuralmonkey | scripts/postedit_prepare_data.py | postedit_prepare_data.py | py | 2,847 | python | en | code | 411 | github-code | 18 | [
{
"api_name": "re.split",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.inf",
"line_number": 53,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"li... |
25895686160 | from log import *
from telegram import ReplyKeyboardMarkup, ReplyKeyboardRemove
from telegram.ext import ConversationHandler
GET_NUM, RATIONAL_1, RATIONAL_2, COMPLEX_1, COMPLEX_2, RATIONAL_OPER, COMPLEX_OPER = range(
7)
async def start(update, context):
reply_keyboard = [['Рациональные', 'Комплексные', 'Выхо... | StaciBunx/python | Telegram_calc/operations.py | operations.py | py | 5,848 | python | ru | code | 0 | github-code | 18 | [
{
"api_name": "telegram.ReplyKeyboardMarkup",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "telegram.ReplyKeyboardRemove",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "telegram.ReplyKeyboardRemove",
"line_number": 25,
"usage_type": "call"
},
{... |
16550416430 | import nltk
def featureFunction(sent, i):
sentLen = len(sent)
(word, pos) = sent[i]
features = [
'word.lower=' + word.lower(),
'wordLast3=' + word[-3:],
'wordLast2=' + word[-2:],
'postag=' + pos,
]
if i == 0:
features.append('<START>')
else:
prev... | bikky9/Natural-Language-Processing | chunking/CRF/CRF2.py | CRF2.py | py | 1,725 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "nltk.download",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.conll2000.chunked_sents",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "nltk.corpus",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "nl... |
21366603023 | # Advent of Code - Day 9
# Part 2
import time
import pygame
def parseInput():
full_map = []
for line in open("input.txt"):
line_map = []
for string in line.strip():
for number in string:
line_map.append(int(number))
full_map.append(line_map)
return full_... | jhnmrtnssn/advent-of-code | 2021/day9/visualize.py | visualize.py | py | 2,960 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pygame.draw.rect",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "pygame.draw",
"line_number": 61,
"usage_type": "attribute"
},
{
"api_name": "pygame.time.delay",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "pygame.time",
... |
23462468103 | import xml.etree.ElementTree as ET
import io as io
from lxml import etree
class BaseResponse:
"""
Base class for which all Responses will inherit
"""
def __init__(self, response):
self.response = response
try:
self.root = ET.fromstring(response.text)
except ET.ParseE... | grantponting/pytest_soap_api_testing | endpoints/baseResponse.py | baseResponse.py | py | 1,849 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "xml.etree.ElementTree.fromstring",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "xml.etree.ElementTree.ParseError",
"line_number": 13,
"usage_type": "attribute"
... |
32839662914 | import cv2
import numpy as np
import matplotlib.pyplot as plt
image = cv2.imread('img/sample9.jpg', 0)
hist, bin_edges = np.histogram(image, bins=256)
plt.figure(figsize=(14, 5))
plt.subplot(121)
plt.imshow(image, cmap='gray')
plt.title('original image', fontsize=15)
plt.xticks([])
plt.yticks([])
plt.subplot(122), ... | stop0ho/2023-bundle-adjustment | segmentation_image_binarization.py | segmentation_image_binarization.py | py | 1,726 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "cv2.imread",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.histogram",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
3580680961 | import os
import sys
import subprocess
import sys
from contextlib import contextmanager
from io import StringIO
@contextmanager
def captured_output():
new_out, new_err = StringIO(), StringIO()
old_out, old_err = sys.stdout, sys.stderr
try:
sys.stdout, sys.stderr = new_out, new_err
yield sy... | ezbz/gitlabber | tests/io_test_util.py | io_test_util.py | py | 711 | python | en | code | 445 | github-code | 18 | [
{
"api_name": "io.StringIO",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sys.stderr",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sys.stdout",
"line_nu... |
10203985346 | import argparse
class Line:
def __init__(self, line):
self.text = line
self.changes = 0
self.new_text = ''
def __repr__(self):
return self.new_text
def change_line(self, configuration):
number_of_symbols = len(self.text)
for i in range(number_of_symbols):
... | aAa2009/Test-task-for-CQG | main.py | main.py | py | 1,652 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 41,
"usage_type": "call"
}
] |
71179129001 | import torch
from torch import nn
try:
from layer.MultiheadAttention import MultiheadAttention
from layer.PositionwiseFeedForward import PositionwiseFeedForward
except:
from MultiheadAttention import MultiheadAttention
from PositionwiseFeedForward import PositionwiseFeedForward
class TransformerDecode... | gigajet/transformer | layer/TransformerDecoderLayer.py | TransformerDecoderLayer.py | py | 2,180 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "torch.nn.Module",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "MultiheadAttention.MultiheadAttention",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "t... |
34246941889 | import cv2
import mediapipe as mp
import numpy as np
from flask import Flask, render_template, Response
mp_drawing = mp.solutions.drawing_utils
mp_pose = mp.solutions.pose
counterhands = 0
counterlegs = 0
stagelegs = None
stagehands = None
pose_det = None
app = Flask(__name__)
def calculate_angle(a, b, c):
a = ... | nishantsirohi23/gym_helper | app.py | app.py | py | 4,793 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "mediapipe.solutions",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "mediapipe.solutions",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "flask.Flask",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.arr... |
324118450 | """Test entry point"""
import aiohttp
import pyoctoprintapi
import argparse
import asyncio
import logging
from types import MappingProxyType
LOGGER = logging.getLogger(__name__)
async def main(host, user, port, use_ssl):
"""Main function."""
LOGGER.info("Starting octoprint")
async with aiohttp.ClientSe... | rfleming71/pyoctoprintapi | pyoctoprintapi/__main__.py | __main__.py | py | 1,673 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "aiohttp.ClientSession",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "aiohttp.CookieJar",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "types.Mappi... |
12096193290 | from django.conf.urls.defaults import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', 'django.views.generic.simple.redirect_to', {'url': 'charts/live'}),
url(r'^charts/', include('charts.urls'))... | martinmeinke/rlog | urls.py | urls.py | py | 371 | python | en | code | 6 | github-code | 18 | [
{
"api_name": "django.contrib.admin.autodiscover",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.conf.urls.defaults.patterns",
"line_number": 7,
"usage_type": "call"
},
{... |
17092698739 | import logging
import subprocess
import os
THIS_PATH = os.path.abspath(os.path.dirname(__file__))
LOG_FILE = os.path.join(THIS_PATH, "log_of_main.log")
CMD = "python " + os.path.join(THIS_PATH, "function2.py")
def function1():
proc = subprocess.Popen(CMD, shell=True, stdin=subprocess.PIPE, universal_newlines=Tru... | JeanBilheux/python_101 | sandbox/logging/main.py | main.py | py | 662 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "os.path.abspath",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_nu... |
44558228278 | import requests
from bs4 import BeautifulSoup
def get_bls_data():
"""Based on bls url, get data from soup"""
the_url = 'http://www.bls.gov/cps/cpsaat39.htm'
result = requests.get(the_url, auth=('user', 'pass'))
content= result.content
soup = BeautifulSoup(content, "html.parser")
soup.prettify()#Turns the so... | susancodes/talkpay | scrape_data.py | scrape_data.py | py | 1,696 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 13,
"usage_type": "call"
}
] |
14191708669 | from multiprocessing import connection
import mysql.connector
import feedparser
url = "https://threatpost.com/feed/"
url2 = "https://www.bleepingcomputer.com/feed/"
url3 = "https://hnrss.org/frontpage"
url4 = "https://latesthackingnews.com/feed/"
threatpost = feedparser.parse(url)
bleepingcomputer = feedparser.par... | qw3r1y/Rss_News | rss_news.py | rss_news.py | py | 1,495 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "feedparser.parse",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "feedparser.parse",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "feedparser.parse",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "feedparser.parse",... |
8985708632 | import json
from flask import Flask, render_template, redirect
import requests
from settings import settings
app = Flask(__name__)
key = settings.get("API_KEY")
pexels_key = settings.get("PEXELS_KEY")
q = settings.get("location", "NewYork")
lang = settings.get("language", "en")
system = settings.get("system", "metri... | Lutz-Pfannenschmidt/RpiWeatherDisplay | app.py | app.py | py | 1,998 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "settings.settings.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "settings.settings",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "settings.settings.ge... |
25096791123 | import os
import src.common.common as cmn
from src.snowflake.snowflake_client import snowflake_client as sf_client
from src.deployer.deployer import deployer
from src.deploy_logger.logger import deploy_logger
from src.wrangler.wrangler import wrangler
#from yaml_writer.yaml_writer import yaml_writer
#from yaml_r... | metaopslabs/snowflake_deployer | src/snowflake_deploy.py | snowflake_deploy.py | py | 44,338 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "src.validator.validator.validator",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "src.validator.validator.validator",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "src.validator.validator.validator",
"line_number": 89,
"usage_type": ... |
17987204442 | #!/usr/bin/python3
"""
This Python script fetches the last 10 commits of a repository ("rails") by
user ("rails") in GitHub using the GitHub API.
"""
from requests import get
from sys import argv
if __name__ == "__main__":
"""
using GitHub API to fetch commit history of a repository
"""
url = 'https:... | CodeStephens/alx-higher_level_programming | 0x11-python-network_1/100-github_commits.py | 100-github_commits.py | py | 704 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "sys.argv",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_number": 16,
"usage_type": "call"
}
] |
36411307729 | class Solution(object):
def sortColors(self, nums):
''' method 1 bubble sort
time: O(n^2)
space: O(1)
'''
for i in range(0, len(nums)):
for j in range(0, i):
if nums[i] < nums[j]:
nums[i], nums[j] = nums[j], nums[i]
ret... | cicihou/LearningProject | leetcode-py/leetcode75.py | leetcode75.py | py | 1,435 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "collections.Counter",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "{'Counter': 'collections.Counter'}",
"line_number": 45,
"usage_type": "call"
}
] |
23426048363 | #!/usr/bin/python3
"""
Python file similar to model_state.py named model_city.py
that contains the class definition of a City.
Script 14-model_city_fetch_by_state.py that prints all City
objects from the database hbtn_0e_14_usa:
"""
from sys import argv
from model_state import Base, State
from sqlalche... | Otisdev95/alx-higher_level_programming | 0x0F-python-object_relational_mapping/14-model_city_fetch_by_state.py | 14-model_city_fetch_by_state.py | py | 912 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sys.argv",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.create_engine",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.sessionmaker",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "model_s... |
37381066105 | import torch
import torch.nn as nn
import torch.nn.functional as F
import os
import sys
import gc
sys.path.append("..")
from utils import data_loader,utils
import argparse
import random
import pickle as pkl
from tqdm import tqdm
import datetime
from time import time
from algo import GraphHINGE_FFT,GraphHINGE_Conv,Graph... | dlutwy/GraphHINGE | test/run.py | run.py | py | 14,159 | python | en | code | null | github-code | 18 | [
{
"api_name": "sys.path.append",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "tqdm.tqdm",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "utils.utils.evaluate_acc",
... |
14330052770 | from flask import Flask, render_template, request
from search1 import score, retrieve, loadandbuildindex2, createDataInvertIndex, build_index, build_indexMy
from time import time
import os
app = Flask(__name__, template_folder='.')
# -- get df -- #
"""
try:
file_path = str()
for roots, dirs, files in os.walk... | Mikhail-Klochkov/HomeworkSearchSongs | server.py | server.py | py | 1,717 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "search1.loadandbuildindex2",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "flask.request.args.ge... |
27138140669 | #!/usr/bin/env python
# coding: utf-8
# In[3]:
import spacy
from spacy.lang.en.stop_words import STOP_WORDS
from string import punctuation
from heapq import nlargest
# In[4]:
from newspaper import Article #뉴스기사 text크롤링 해주는 라이브러리
# In[97]:
url = 'https://www.nytimes.com/2023/04/09/world/europe/europe-shells... | mmmjunjoy/continuation-of-knowledge | NLP/summary.py | summary.py | py | 2,129 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "newspaper.Article",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "spacy.load",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "spacy.lang.en.stop_words.STOP_WORDS",
"line_number": 66,
"usage_type": "argument"
},
{
"api_name": "... |
73642927080 | from django.conf.urls import url
from payment import views
urlpatterns = [
url(r'^$', views.Payment_Manager.Launch, name='payment'),
url(r'^potwierdzenie/$', views.Apply_Payment.Launch, name='payment.apply'),
url(r'^anulowanie/$', views.Cancel_Payment.Launch, name='payment.cancel'),
url(r'^dotpay/$', ... | arbuz-team/medifiller | payment/urls/pl.py | pl.py | py | 517 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "payment.views.Payment_Manager",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "payment.views",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "dj... |
13913003245 | import os
import discord
from discord.ext import commands
import json
import random
from discord.ext.commands import Bot
with open('C:\\Users\\alann\\Documents\\GitHub\dc\\setting.json','r',encoding='utf8') as jfile:
jdata = json.load(jfile)
intents = discord.Intents.all()
bot = commands.Bot(command_prefix='?',i... | negaialan/dc | lamy.py | lamy.py | py | 703 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "json.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "discord.Intents.all",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "discord.Intents",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.command... |
33938215972 | #%%
import os
import numpy as np
import pandas as pd
import seaborn as sns
import plotly.express as px
from IPython.display import display
from matplotlib import pyplot as plt
from umap import UMAP
from sklearn.decomposition import PCA
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import roc_... | MaayanLab/cohortsEnrichr | example/preinit.py | preinit.py | py | 5,768 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.read_csv",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.log2",
"li... |
12521113855 | import numpy as np
import matplotlib.pyplot as plt
from matplotlib.widgets import Slider, Button, RadioButtons
from calc import Computer
fig, ax = plt.subplots()
plt.subplots_adjust(left=0.25, bottom=0.4)
labels = ['Prec Hate', 'Rec Hate', 'F1 Hate', 'Prec Off', 'Rec Off', 'F1 Off', 'F1 Macro']
x = np.arange(len(labe... | PeterBul/ernie-hate | src/calculations and slider/slider.py | slider.py | py | 2,129 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.subplots_adjust",
"line_number": 7,
"usage_type": "call"
},
{
"api_n... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.