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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3212382167 | import torch
import os
import numpy as np
from collections import defaultdict
from tqdm import tqdm
import imageio
from argparse import ArgumentParser
from models.rendering import render_rays
from models.nerf import *
from utils import load_ckpt
import metrics
from datasets import dataset_dict
from datasets.depth_ut... | AlphaPlusTT/nerf-w | eval.py | eval.py | py | 9,339 | python | en | code | 6 | github-code | 21 | [
{
"api_name": "torch.backends",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 88,
"usage_type": "call"
},
{
"api_name": "m... |
25040042937 | # -*- coding: utf-8 -*-
__author__ = 'romus'
import zope.interface
from statistic4text.utils.save_utils import MongoSaveUtils
from iRetrieval.errors.errors import ParamError
class ISaveRetrievalUtils(zope.interface.Interface):
""" Интерфейс """
def saveFilename(self, dictID, names, simpleDictName):
... | romus/iRetrieval | iRetrieval/utils/save_utils.py | save_utils.py | py | 1,799 | python | ru | code | 0 | github-code | 21 | [
{
"api_name": "zope.interface.interface",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "zope.interface",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "statistic4text.utils.save_utils.MongoSaveUtils",
"line_number": 26,
"usage_type": "name"
}... |
6699434632 | import os
import json
def fetchJSONData(file_name):
f = open(file_name)
data = json.load(f)
f.close()
return data
def jsonDataToFile(data, file_name):
f = open(file_name, 'w')
f.write('\n'.join(data))
f.close()
def readOutput(output_file_name):
f = open(output_file_name, 'r')
output = f.readlines()
f.clo... | akumar393/Masters-projects | Data Science Projects/DATA AGGREGATION, BIG DATA ANALYSIS AND VISUALIZATION using Hadoop/Lab 2 MapReduce/1_twitter_count.py | 1_twitter_count.py | py | 2,783 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "json.load",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "os.remove",
"line_number": 68,
... |
40313424380 | from modules.msgraph import get_access_token
import requests
base_url = "https://graph.microsoft.com/v1.0/"
def send_text_email(to: str, subject: str, content: str = "content"):
endpoint = base_url + "me/sendMail"
access_token = get_access_token()
headers = {"Authorization": "Bearer " + access_token}
... | beneran/send-outlook-email-python | modules/core.py | core.py | py | 738 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "modules.msgraph.get_access_token",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 22,
"usage_type": "call"
}
] |
2879196080 | """parse application config file"""
import os
import sys
from io import BytesIO
from typing import Self, List, Iterator
import argparse
class ApplicationSettings:
"""Applications settings data"""
@classmethod
def from_bytes(cls, buffer: BytesIO) -> Self:
"""create from bytes"""
applicatio... | Stateford/Display-Lock | scripts/parse_application_config.py | parse_application_config.py | py | 3,460 | python | en | code | 66 | github-code | 21 | [
{
"api_name": "io.BytesIO",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "sys.byteorder",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "sys.byteorder",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "sys.byteorder",
... |
13270254593 | from openai import AzureOpenAI
def get_client():
azure_endpoint = "https://openaiaus.openai.azure.com/"
azure_api_key = "<INSERT API KEY HERE>"
client = AzureOpenAI(
azure_endpoint=azure_endpoint, api_key=azure_api_key, api_version="2023-05-15"
)
return client
| michelle-qin/resumes-knowledge-navigator | backend/openai_helper.py | openai_helper.py | py | 292 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "openai.AzureOpenAI",
"line_number": 8,
"usage_type": "call"
}
] |
33584889805 | #!/usr/bin/env python
# encoding: utf-8
"""
Tools for reading CMD-interface tables outputs.
"""
from collections import deque
class BaseReader(object):
"""Baseclass for reading tables produced by the Padova CMD interface."""
def __init__(self, f):
super(BaseReader, self).__init__()
self._f = ... | jonathansick/padova | padova/basereader.py | basereader.py | py | 1,549 | python | en | code | 5 | github-code | 21 | [
{
"api_name": "collections.deque",
"line_number": 22,
"usage_type": "call"
}
] |
36502089898 | #JSON files
#java script object notation
import json
"""data='{ "var1":"sushmitha","var2":"18"}'
#parsed=json.loads(data)
data={
"channel_name":"codewithharry",
"cars": ['bmw','audi a8','ferrari'],
"fridge": ('roti',678,'dal')
}
#parsed=json.dumps(data)
print(parsed)"""
#sql lite3
#step-1:creating a connec... | sushmithakummara/S3-PFSD | prog_8.py | prog_8.py | py | 1,060 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sqlite3.connect",
"line_number": 18,
"usage_type": "call"
}
] |
36054167147 | import streamlit as st
import Formazione, Certificazioni, Esperienze, Skill, Bio
PAGES = {
'Biografia': Bio.pagina,
'Formazione': Formazione.pagina,
'Esperienze': Esperienze.pagina,
'Certificazioni': Certificazioni.pagina,
# 'Skill': Skill.pagina
}
LANGUAGES = {
"Italiano": "resources/flags/it... | micheleGolino/Portfolio | Biografia.py | Biografia.py | py | 1,702 | python | it | code | 0 | github-code | 21 | [
{
"api_name": "Bio.pagina",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "Formazione.pagina",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "Esperienze.pagina",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "Certificaz... |
1310514597 |
# Author: Matteo L. BEDINI
# Date: April 2016
import ModelFactory
import os
###########################################################################
## GRID EVALUATION FUNCTION ##
###########################################################################
def grid_eva... | gomboc1985/Pyrathon | PricingMethods.py | PricingMethods.py | py | 3,240 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "ModelFactory.ModelFactory",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "xlwings.Workbook",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "xlwings.Range",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "xlwings.Rang... |
28202541436 | import psycopg2
class UsersDB:
"""
База данных heroku PostgreSQL
"""
def __init__(self):
self.connection = psycopg2.connect(host="----",
database="----",
user="----",
... | teserk/telegram_patriotic_bot | dev/DB.py | DB.py | py | 4,679 | python | ru | code | 0 | github-code | 21 | [
{
"api_name": "psycopg2.connect",
"line_number": 10,
"usage_type": "call"
}
] |
7438240534 | from django.urls import path
from . import views
app_name="my_app"
urlpatterns = [
path('', views.dashboard, name="dashboard"),
path('workers/', views.worker_list, name="worker_list"),
path('expired/', views.worker_ended, name="worker_ended"),
path('workers/', views.worker_list, name="search"),
pa... | nabilhesham/WORKERS-MANAGEMENT-SYSTEM | my_app/urls.py | urls.py | py | 1,010 | 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",
... |
26798210881 | import numpy as np
from svgpathtools import svg2paths, Path
def points_from_path(path: Path, number: int, scale: float, dx: float, dy: float) -> list[tuple[float, float]]:
p = [path.point(i) for i in np.linspace(0, 1, number)]
return [(dx + scale * np.real(z), dy + scale * np.imag(z)) for z in p]
def print_st... | omaraflak/omaraflak.github.io | sketches/picture/svg.py | svg.py | py | 1,362 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "svgpathtools.Path",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "numpy.linspace",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.real",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.imag",
"line_numbe... |
28611200854 | import nltk, re, pprint, string
from model.model import *
from nltk import word_tokenize
from nltk.corpus import stopwords
class Spliter:
'''
Class Constructor
'''
def __init__(self):
self.course_index = {}
self.all_term = dict()
'''
Word Stemming Function
'''
def stem... | chnpat/ir-backend | model/Spliter.py | Spliter.py | py | 3,943 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "re.findall",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "nltk.word_tokenize",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "nltk.FreqDist",
"line_number... |
37396003792 | from con import *
from pessoa import Pessoa
from colorama import init, Fore, Back
import validar_CPF
from datetime import date
import os
import main
#classe reserva
class Reserva(Pessoa):
def __init__(self,nome, cpf, telefone):
self.nome = nome
self.cpf = cpf
self.telefone = telefone
... | AlanNegalho/Hotel | reserva.py | reserva.py | py | 7,247 | python | pt | code | 0 | github-code | 21 | [
{
"api_name": "pessoa.Pessoa",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "os.system",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "colorama.Fore.RED",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "colorama.Fore",
"l... |
74513498612 | # To add a new cell, type '# %%'
# To add a new markdown cell, type '# %% [markdown]'
# %%
import torch, sys
sys.path.insert(0, '../')
import importlib
import gc
from my_utils import align_utils as autils, utils
from my_utils.alignment_features import *
from tqdm import tqdm
import torch
def remove_bad_editions(editio... | ayyoobimani/GNN-POSTAG | app/gnn_prepare_data.py | gnn_prepare_data.py | py | 8,707 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "sys.path.insert",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "my_utils.utils.setup",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "my_utils.utils",
... |
16320682400 | from model.ActionType import ActionType
from model.VehicleType import VehicleType
from model.FacilityType import FacilityType
from model.Game import Game
from model.Move import Move
from model.Player import Player
from model.World import World
import numpy as np
from scipy.cluster.vq import vq, kmeans, whiten
... | mmvds/russianaicup2017 | MyStrategy.py | MyStrategy.py | py | 42,988 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "model.VehicleType.VehicleType.ARRV",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "model.VehicleType.VehicleType",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "model.VehicleType.VehicleType.IFV",
"line_number": 27,
"usage_type"... |
10954761867 | # Definition for a binary tree node.
from typing import List, Optional
class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
class Solution:
def inorderTraversal(self, root: Optional[TreeNode]) -> List[int]:
if root... | A7fa7fa/python-leetcode | 0094 - binary-tree-inorder-traversal/binary-tree-inorder-traversal-iterative.py | binary-tree-inorder-traversal-iterative.py | py | 801 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "typing.Optional",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 11,
"usage_type": "name"
}
] |
17935292858 | from collections import deque
import sys
input = sys.stdin.readline
T = int(input())
# 상하좌우
dx = [0, 0, 1, -1]
dy = [1, -1, 0, 0]
def bfs(graph, a, b):
queue = deque()
queue.append((a, b))
graph[a][b] = 0
while queue:
x, y = queue.popleft()
for i in range(4):
nx = x +... | GraceKim527/Pygorithm | BOJ/01000s/01000s/1012.py | 1012.py | py | 928 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.stdin",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 12,
"usage_type": "call"
}
] |
29424000581 | #!/usr/bin/env python
# scripts/examples/simple_tcp_server.py
from __future__ import print_function
import logging
from socketserver import TCPServer, ThreadingMixIn
from collections import defaultdict
from cachetools import cached, TTLCache
from datetime import datetime
import dateutil.parser
from threading import Loc... | SundialEnergy/sundial-modbus-server | server.py | server.py | py | 6,292 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pytz.UTC",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "sundial.configuration.Configuration",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.e... |
73273003892 | from django.shortcuts import render, redirect
from django.views.generic import TemplateView, ListView, CreateView
from .forms import ClothingForm
from .models import Clothing, CoordinateClothing
from .coordinate_clothings import fashion_tools, recommend, resize_with_padding
from PIL import Image, ImageOps
import cv2
i... | kkojae91/fAIshion_P | 2. Web/1.web/mysite/core/views.py | views.py | py | 3,325 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.views.generic.TemplateView",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "models.Clothing.objects.all",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "models.Clothing.objects",
"line_number": 18,
"usage_type": "attribute"
},... |
37597393245 | import numpy as np
from sklearn.neighbors import KNeighborsClassifier
train = np.loadtxt("datasets/train01.csv", delimiter=",", skiprows=1)
test = np.loadtxt("datasets/test01.csv", delimiter=",", skiprows=1)
y_train = train[:,0]
x_train = train[:,1:]
x_test = test[:,1:]
y_test = test[:,0]
clf = KNeighborsClassifier... | kronos-learning/kensyukai_ai | kneighbors_classifier.py | kneighbors_classifier.py | py | 433 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.loadtxt",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sklearn.neighbors.KNeighborsClassifier",
"line_number": 13,
"usage_type": "call"
}
] |
29384414541 | from django.shortcuts import render, redirect, HttpResponse
from django.contrib import messages
from .models import *
from .forms import *
def index(request):
return render(request, 'homepage.html')
def signuppage(request):
return render(request, 'signuppage.html')
def login(request):
loggedin_user = ... | mattcoleman05/MusicFiend | logreg/views.py | views.py | py | 3,513 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.shortcuts.render",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 24,
"usage_type": "call"
},
{
"api_name... |
9985038292 | # ch9_11.py
import openpyxl
from openpyxl.formula.translate import Translator
fn = "data9_6.xlsx"
wb = openpyxl.load_workbook(fn)
ws = wb.active
ws['E4'] = "=RANK(D4,$D$4:$D$9)"
for i in range(5,10):
index = 'E' + str(i)
ws[index] = Translator("=RANK(D4,$D$4:$D$9)",
origin="E4").trans... | June0608/Python | Program Examples/ch9/ch9_11.py | ch9_11.py | py | 375 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "openpyxl.load_workbook",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "openpyxl.formula.translate.Translator",
"line_number": 11,
"usage_type": "call"
}
] |
73030846773 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# required for documentation
# pylint: disable=line-too-long
# pylint's name standards are insane
# pylint: disable=invalid-name
# this file is imported from a different directory
# pylint: disable=import-error
"""
[lib/lib/find.py]
Defines the "find" command.
"""
import ... | LiuFang816/SALSTM_py_data | python/ergonomica_ergonomica/ergonomica-master/ergonomica/lib/lib/find.py | find.py | py | 1,263 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "os.path.isdir",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "lib.lang.error.ErgonomicaError",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "os.walk",
... |
37950748957 | from collections import defaultdict, deque
from itertools import product
import timeit
def validate(actual, target):
if isinstance(target, list):
if len(actual) != len(target):
return False
for a, t in zip(actual, target):
if not validate(a, t):
return False
... | allenkim0129/InterviewPrep | Two Sum IV - Input is a BST.py | Two Sum IV - Input is a BST.py | py | 3,927 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.deque",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "timeit.default_timer",
"line_number": 140,
"usage_type": "call"
},
{
"api_name": "timeit.defa... |
9000075884 | from pydub import AudioSegment
from pydub.silence import split_on_silence
import sys
import os
import time
def split(name):
# 载入
sound = AudioSegment.from_wav(name)
# sound = sound[:3*60*1000] # 如果文件较大,先取前3分钟测试,根据测试结果,调整参数
# 设置参数
silence_thresh = -70 # 小于-70dBFS以下的为静默
min_silence_len = 700 ... | adlsdztony/VedioGenerator | AudioSplitor.py | AudioSplitor.py | py | 6,303 | python | zh | code | 1 | github-code | 21 | [
{
"api_name": "pydub.AudioSegment.from_wav",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pydub.AudioSegment",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "os.path.exists",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "os.path... |
18048003856 | from django.forms import ModelForm, TextInput, Textarea, SlugField
from .models import PostModel
# Class Based Forms (CBF)
class PostForm(ModelForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields['author'].label = 'Автор статьи'
self.fields['title'].la... | AndreyZhulanov/shop | blog/forms.py | forms.py | py | 1,924 | python | ru | code | 0 | github-code | 21 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "models.PostModel",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "django.forms.TextInput",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "django.... |
39799118074 | import collections
def solution(maps):
my, mx = len(maps), len(maps[0])
dirs = [[1, 0], [-1, 0], [0, 1], [0, -1]]
queue = collections.deque([[0, 0]])
while queue:
y, x = queue.popleft()
for dy, dx in dirs:
ny, nx = y + dy, x + dx
if ny == my - 1 and nx == mx-1... | cheol-95/Algorithm | Python/141. 게임 맵 최단거리(python)/game_map.py | game_map.py | py | 620 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.deque",
"line_number": 7,
"usage_type": "call"
}
] |
25655800161 | from setuptools import setup, find_packages
long_description = (
'Implemention of the game classical old-school game Tetris.'
'The realization is based on the pygame framework.'
)
setup(
name='tetris_sources',
version='0.1.0',
author='Jakub Šuráň',
author_email='xsuran07@stud.fit.vutbr.cz',
... | xsuran07/Tetris | setup.py | setup.py | py | 548 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "setuptools.setup",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 18,
"usage_type": "call"
}
] |
3123641933 | import argparse
import datetime
import getpass
from itertools import chain
import json
import os
import subprocess
from tempfile import NamedTemporaryFile
import paramiko
import platform
import signal
from six import BytesIO, add_metaclass
import socket
import sys
import threading
import time
from twisted.internet impo... | Samsung/veles | veles/launcher.py | launcher.py | py | 34,909 | python | en | code | 903 | github-code | 21 | [
{
"api_name": "veles.external.pytrie.StringTrie",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "itertools.chain.from_iterable",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "itertools.chain",
"line_number": 42,
"usage_type": "name"
},
{
"ap... |
16731840832 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('club', '0004_auto_20151030_2152'),
]
operations = [
migrations.AddField(
model_name='member',
name='... | btseytlin/maiitwebsite | club/migrations/0005_auto_20151104_2114.py | 0005_auto_20151104_2114.py | py | 897 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AddField",
"line_number": 14,
"usage_type": "call"
},
{
... |
1911288434 | from __future__ import division
import torch
import numbers
import warnings
import math
from torch.nn.parameter import Parameter
from torch.nn import Module
from torch.nn import functional as F
from torch._C import _infer_size, _add_docstr
from torch.nn import _reduction as _Reduction
from torch.nn.modules import utils... | MikiMiller95/DivisiveNormalization | ImageNet_models_architectures/DivisiveNormalizations/SpatialDivisiveNormalization.py | SpatialDivisiveNormalization.py | py | 6,123 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "torch.nn.Module",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "torch.nn.parameter.Parameter",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "torch.Tensor",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "torch.nn.pa... |
36798659790 | """
Function for verifying the validity of the provided access_token.
"""
import datetime
import jwt
from ..config import JWT_SECRET
from ..models.auth import get_login
def verify_token(access_token):
"""
Verify that the provided access_token is valid.
:param access_token:
Str - The raw JWT string we... | IlyaChebanu/cpssd-musicloud | backend/src/utils/verify_token.py | verify_token.py | py | 919 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "jwt.decode",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "config.JWT_SECRET",
"line_number": 20,
"usage_type": "argument"
},
{
"api_name": "models.auth.get_login",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "datetime.timed... |
24672699135 | from fileinput import input
"""
[1,1,3,1,1]
[1,1,5,1,1]
[[1],[2,3,4]]
[[1],4]
[9]
[[8,7,6]]
[[4,4],4,4]
[[4,4],4,4,4]
[7,7,7,7]
[7,7,7]
[]
[3]
[[[]]]
[[]]
[1,[2,[3,[4,[5,6,7]]]],8,9]
[1,[2,[3,[4,[5,6,0]]]],8,9]
"""
lines = [eval(line.strip()) for line in input() if line.strip() != ""]
#
# ---------- PART 1 ----... | Arxcis/adventofcode2022 | day13/day13.py | day13.py | py | 2,670 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "fileinput.input",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "functools.cmp_to_key",
"line_number": 92,
"usage_type": "call"
},
{
"api_name": "functools.reduce",
"line_number": 102,
"usage_type": "call"
}
] |
29901943550 | from qtpy import QtWidgets, QtCore
import logging
from .AbstractWidget import AbstractWidget
logger = logging.getLogger(__name__)
class QuickSearch(AbstractWidget):
id_selected = QtCore.Signal(str)
index_selected = QtCore.Signal(int)
def __init__(self, parent=None):
self._go_to_id_button: QtWi... | ivkram/specvizitor | specvizitor/widgets/QuickSearch.py | QuickSearch.py | py | 2,449 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "AbstractWidget.AbstractWidget",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "qtpy.QtCore.Signal",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "qtp... |
22428157847 | """
Script to plot ICON simulations in preparation
to upload to zooniverse.
"""
import datetime as dt
import os
import glob
import tqdm
import numpy as np
import xarray as xr
import matplotlib.pyplot as plt
path_to_simulations_fmt = '/work/bb1156/ICON-1.25km/DATA/*/dei4_*2d_ll_DOM01_ML_*.nc'
lat0, lat1, lon0, lon1 = ... | observingClouds/C3ONTEXT | scripts/zooniverse_ICONsimulation.py | zooniverse_ICONsimulation.py | py | 2,539 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "os.path.basename",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "datetime.dat... |
31535758186 | import cv2
import numpy as np
import configparser
import os
cap = cv2.VideoCapture(0)
_, frame = cap.read()
height, width, _ = frame.shape
square_size_factor = 0.4
square_x1 = int((width - ((square_size_factor) * height)) / 2)
square_x2 = int((width + ((square_size_factor) * height)) / 2)
square_y1 = int(((1 - squar... | LUYUXUAN4111/RubicCube-Master | CubeMaster/Learning.py | Learning.py | py | 5,442 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.rectangle",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "cv2.namedWindow",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "cv2.moveWindow",
"l... |
27772345877 | from keras.applications.resnet50 import ResNet50
from keras.layers import Activation, Dropout, Flatten, Dense, GlobalAveragePooling2D, BatchNormalization
from keras.callbacks import ModelCheckpoint, EarlyStopping
from keras.models import Sequential
from FeatureLoad import load_dataset
from keras.layers import Input
fro... | SeverinAlexB/pilztrainer | aws_trainer.py | aws_trainer.py | py | 2,332 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "keras.applications.resnet50.ResNet50",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "keras.layers.Input",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "keras.preprocessing.image.ImageDataGenerator",
"line_number": 19,
"usage_type": "... |
9800289183 | from typing import Optional
from fastapi import FastAPI, status, HTTPException
from fastapi.responses import JSONResponse, FileResponse
from pydantic import BaseModel
app = FastAPI()
class Item(BaseModel):
id: str
value: str
class Message(BaseModel):
message: str
@app.get(
"/items/{item_id}",
... | tinylambda/keep | module_fastapi/fastapi_advanced/fastapi_additional_response.py | fastapi_additional_response.py | py | 2,079 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "fastapi.response... |
38520577217 | from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('musicc', '0005_registeredsystem_last_sync'),
]
opera... | theoutsider24/musicc | musicc/migrations/0006_auto_20190905_1358.py | 0006_auto_20190905_1358.py | py | 2,353 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.swappable_dependency",
"line_number": 10,
"usage_type": "call... |
72645436212 | from on_policy.baselines.ppo import ppo, ppo_variant
from on_policy.core.launch import launch
import gym
if __name__ == "__main__":
env = gym.make('InvertedPendulum-v2')
ppo_variant.update(dict(
hidden_size=64,
logging_dir='PPO/InvertedPendulum/',
policy_learning_rate=0.0003,
... | brandontrabucco/on_policy | experiments/inverted_pendulum_ppo.py | inverted_pendulum_ppo.py | py | 678 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "gym.make",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "on_policy.baselines.ppo.ppo_variant.update",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "on_policy.baselines.ppo.ppo_variant",
"line_number": 9,
"usage_type": "name"
},
{
... |
4099872436 | import pandas as pd, numpy as np, tensorflow as tf
from sklearn.model_selection import train_test_split
from sklearn.metrics import classification_report
from sklearn.model_selection import StratifiedKFold
data = pd.read_csv('data')
# stratified sampling
x_train, x_test, y_train, y_test = train_test_split(data.drop(co... | tanjiarui/comp258 | project/deep and cross network.py | deep and cross network.py | py | 2,326 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.Input",
"line_number": 12,
"usage_type": "call"
},
{
"api... |
6389320591 | import heapq
import itertools
from copy import deepcopy
import numpy as np
class TrajObj():
def __init__(self, ret, sz, uid):
"""
Create an object from trajectory return (ret) and length (sz)
"""
self.ret = ret
self.sz = sz
self.uid = uid
def __eq__(self, other):
return False
def _... | tgangwani/SelfImitationDiverse | imitation/priority_buffer.py | priority_buffer.py | py | 3,185 | python | en | code | 19 | github-code | 21 | [
{
"api_name": "itertools.count",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "heapq.heappop",
"line_num... |
40403168248 | import math
from copy import deepcopy
from random import random
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import pyplot as plt
import numpy as np
class vector3d():
def __init__(self, x, y, z):
self.deltaX = x
self.deltaY = y
self.deltaZ = z
self.direction = [0, 0, 0]... | sinplx2015/Smart-construction | demo8.py | demo8.py | py | 8,071 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "math.sqrt",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 140,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number":... |
18538606232 | from fastapi import APIRouter, HTTPException
from starlette.requests import Request
router = APIRouter(
prefix="/health",
tags=["health"]
)
@router.get("/")
async def health(request: Request):
for thread in request.app.threads:
if not thread.is_alive():
raise HTTPException(status_code... | SNStatComp/DeepGeoStat | src/experiments-api/internal/health.py | health.py | py | 357 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "starlette.requests.Request",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "fastapi.HTTPException",
"line_number": 14,
"usage_type": "call"
}
] |
25285325118 | from django.views.generic import TemplateView, ListView, View
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import ensure_csrf_cookie
from braces.views import JSONResponseMixin
from .models import Entry
class EntriesHomeView(TemplateView):
template_name = 'home.html'
... | Dearon/catalog | catalog/entries/views.py | views.py | py | 2,471 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.views.generic.TemplateView",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.utils.decorators.method_decorator",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.views.decorators.csrf.ensure_csrf_cookie",
"line_number": 12... |
70346700534 | import requests
import sys
ss = requests.session()
ss.proxies = {'http': 'socks5h://localhost:9050'}
cyphertext = sys.argv[1]
mrhost = sys.argv[2]
url1 = sys.argv[3]
hdr={
"Host":mrhost,
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0",
"Accept": "text/html,application/x... | Themiscodes/CTF-Challenge-2022 | Problem4/riddle2.py | riddle2.py | py | 2,530 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "requests.session",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number... |
43299079591 | # -*- coding: utf-8 -*-
"""
Created on Wed Mar 6 23:12:08 2019
@author: reblivi
"""
import numpy as np
import pandas as pd
from scipy import sparse
from sklearn.model_selection._split import check_cv
from sklearn.base import is_classifier
from sklearn.metrics import roc_auc_score
from sklearn.metrics.pairwise import... | victorrebli/PSOUFeatureSelection | evaluate.py | evaluate.py | py | 9,553 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 117,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"li... |
24183864271 | '''
Создать телефонный справочник с
возможностью импорта и экспорта данных в
формате .txt. Фамилия, имя, отчество, номер
телефона - данные, которые должны находиться
в файле.
1. Программа должна выводить данные
2. Программа должна сохранять данные в
текстовом файле
3. Пользователь может ввести одну из
характеристик для... | IrinaPonkratova/dz8 | 1.py | 1.py | py | 4,975 | python | ru | code | 0 | github-code | 21 | [
{
"api_name": "json.dumps",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 30,
"usage_type": "call"
}
] |
42375556942 | import os
from typing import List
import cv2
import json
import numpy as np
import pandas as pd
from apted import APTED, helpers
import xml.dom.minidom as minidom
import configure
import image.widget as widget
import util
from mathutil import insameclass
from reportprocess import Report
from configure import BOX_ENLA... | yushengcheng/EncrePrior-paper | image/structure_feature.py | structure_feature.py | py | 14,631 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "cv2.rectangle",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "configure.BOX_ENLARGE",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "numpy.count_nonzero",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "configure.DEF... |
32414769391 | #!/usr/bin/python
from contextlib import nullcontext
from flask import Flask, render_template
from flask import request,Response,redirect
from flask import render_template, url_for, session
from flask_session import Session
from flask_caching import Cache
from flask.json import jsonify
import json
import logging
impor... | mistokes-ppr/pprvc-test | app.py | app.py | py | 15,486 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "flask_caching.Cache",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.urandom",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_numb... |
7275847830 | import time
import snap7.exceptions
import struct
import math
import matplotlib.pyplot as plt
class WaterPressureSimulator:
def __init__(self):
self.amplitude = 3.45 # Amplituda sygnału sinusoidalnego
self.frequency = 0.1 # Częstotliwość sygnału sinusoidalnego
self.phase = 0.0 # Faza sy... | remceTkedaR/simulationSinusAnalogPLC_plot | main.py | main.py | py | 2,301 | python | pl | code | 0 | github-code | 21 | [
{
"api_name": "math.sin",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "math.pi",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.clf",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"... |
18750882028 | #!/usr/bin/env python3
# https://leetcode.com/problems/balanced-binary-tree/
import unittest
from typing import Optional
class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
class Solution:
def __balancedHeight(self, ro... | altermarkive/training | algorithms/code/leetcode/lc110_balanced_binary_tree/lc110_balanced_binary_tree.py | lc110_balanced_binary_tree.py | py | 2,076 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "typing.Optional",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "unittest.TestCase",
"line_number": 33,
"usage_type": "attribute"
}
] |
34652757853 | """
--------------------------------------------------------------------------
Test by selecting image
--------------------------------------------------------------------------
"""
import os
import tkinter.filedialog
import cv2
import numpy as np
from models.py_encoder_decoder import Encoder_Decoder
from m... | diliu1992/Saliency-based-DeepMatting | test_single_image.py | test_single_image.py | py | 3,049 | python | en | code | 5 | github-code | 21 | [
{
"api_name": "models.py_encoder_decoder.Encoder_Decoder",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "cv2.getStructuringElement",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "cv2.MORPH_ELLIPSE",
"line_number": 32,
"usage_type": "attribute"
},... |
71041761333 | from django.shortcuts import render, HttpResponseRedirect, reverse, get_object_or_404, redirect
from .models import Post, Comment
from .forms import PostCreateForm, CommentForm
from django.contrib.auth.decorators import login_required
from django.db.models import Q
from django.template.loader import render_to_string
fr... | AnujPanthri/Blog | blog/views.py | views.py | py | 2,607 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "models.Post.objects.filter",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "models.Post.objects",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "models.Post",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "djang... |
3707584351 | from typing import List
class Solution:
def calPoints(self, ops: List[str]) -> int:
st = []
for s in ops:
if s == "C":
st.pop()
elif s == "D":
st.append(st[-1] * 2)
elif s == "+":
st.append(st[-1] + st[-2])
... | dmp2016/LeetCode | Baseball Game.py | Baseball Game.py | py | 530 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
}
] |
3466915436 | from multiprocessing import Pool
import time
CON = 5000000
CO = 50
def cont_reg(m):
while m > 0:
m -= 1
if __name__ == '__main__':
pool = Pool(processes=2)
inicio = time.time()
R1 = pool.apply_async(cont_reg, [CO//2])
R2 = pool.apply_async(cont_reg, [CO//2])
pool.close()
pool.joi... | DiksonSantos/GeekUniversity_Python | 153_MultiProcessing.py | 153_MultiProcessing.py | py | 475 | python | pt | code | 0 | github-code | 21 | [
{
"api_name": "multiprocessing.Pool",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 19,
"usage_type": "call"
}
] |
33775290696 | """
Construct the blueprint for peregrine submissions, using the blueprint from
:py:mod:``peregrine``.
"""
import os
import json
import time
import fcntl
from cdiserrors import AuthZError
import datamodelutils.models as models
import flask
from peregrine.auth import get_read_access_projects
import peregrine.blueprin... | uc-cdis/peregrine | peregrine/resources/submission/__init__.py | __init__.py | py | 6,996 | python | en | code | 11 | github-code | 21 | [
{
"api_name": "datamodelutils.models.Project",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "datamodelutils.models",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "flask.current_app.db.session_scope",
"line_number": 33,
"usage_type": "call"
}... |
74713370931 | import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import confusion_matrix
from sklearn.model_selection import cross_val_score
dataset = pd.read_csv('breast_cancer.csv')
X = dataset.iloc[:, 1:-1].values
y ... | nmilenkovska/python_logistic_regression | breast_cancer/breast_cancer_prediction.py | breast_cancer_prediction.py | py | 942 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.read_csv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model.LogisticRegression",
"line_number": 14,
"usage_type": "call"... |
15196641601 | #!/usr/bin/env python2.7
import datetime
import random
import sys
import pickle
save_file = "/opt/irccat/irccat-data/noisebridgelevel.pickle"
random_min = 1000
random_max = 5000
halflife = 60 * 60 * 24 * 7
now = datetime.datetime.now()
try:
with open(save_file, "r") as f:
value, timestamp = pickle.load(... | londonhackspace/irccat-commands | noisebridgelevel.py | noisebridgelevel.py | py | 680 | python | en | code | 19 | github-code | 21 | [
{
"api_name": "datetime.datetime.now",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "pickle.load",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "random.randi... |
1650466032 | # baekjoon 1149
# RGB거리
import collections
N = int(input())
dp = collections.defaultdict(int)
cost = []
for _ in range(N):
p = list(map(int, input().split()))
cost.append(p)
for i in range(1, N): # value of (i)th row <- the minimum possible value of (i-1)th row + (i)th row
cost[i][0] = min(cost[i-1][1],... | haeju20/leetcode-algo-study | baekjoon/bj_1149.py | bj_1149.py | py | 569 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.defaultdict",
"line_number": 7,
"usage_type": "call"
}
] |
74865684853 | """
使用钢研院铁次化数据进行聚类分析
两维度 分别是 利用系数与燃料比, 聚类后 贴标签, 依旧标签分类,再观察子类常熟提取打分范围。
2020/4/11 15:00 修改
利用系数变倒数
画图使用标准化尺度
"""
import numpy as np
import pandas as pd
from sklearn.cluster import KMeans
from matplotlib import pyplot as plt
from sklearn.preprocessing import StandardScaler
from mpl_toolkits.mplot3d import Axes3D
... | Fivehours0/Proj-PerformanceGrade | mymo/myCluster/myClusterLabel.py | myClusterLabel.py | py | 3,229 | python | zh | code | 0 | github-code | 21 | [
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 18,
"usage_type": "attribute"
},
{
... |
31504645641 | from django.views.decorators.http import require_POST
from django.shortcuts import render, redirect
from django.http import HttpResponse, JsonResponse
from django.views.decorators.csrf import csrf_exempt
from django.contrib import auth
from .models import *
from django.contrib import messages
import pyupbit
import time... | sjh7711/project | app_main/views.py | views.py | py | 5,802 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.shortcuts.render",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.views.decorators.csrf.csrf_exempt",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.authenticate",
"line_number": 20,
"usage_type": "cal... |
4627203983 | from logging import getLogger
import numpy as np
from chainerrl import explorer
class AdditiveOU(explorer.Explorer):
"""Additive Ornstein-Uhlenbeck process.
Used in https://arxiv.org/abs/1509.02971 for exploration.
Args:
mu (float): Mean of the OU process
theta (float): Friction to pul... | chainer/chainerrl | chainerrl/explorers/additive_ou.py | additive_ou.py | py | 1,867 | python | en | code | 1,134 | github-code | 21 | [
{
"api_name": "chainerrl.explorer.Explorer",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "chainerrl.explorer",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "n... |
28709399222 | from PIL import Image
import requests
def get_dominant_color(image_path):
image = Image.open(image_path)
image = image.resize((20, 20))
pixels = image.getdata()
red, green, blue = 0, 0, 0
count = 0
for pixel in pixels:
red += pixel[0]
green += pixel[1]
blue += pixel[2]
... | eazyliving/ambientMacWLED | dcolor.py | dcolor.py | py | 891 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "PIL.Image.open",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "requests.put",
"line_number": 25,
"usage_type": "call"
}
] |
16928428554 | from termcolor import colored
import numpy as np
import random
import copy
playerAI = 2
playerHUMAN = 1
HUMAN = "X"
AI = "O"
def endGame():
ans = input("would you like to play again? y/Y = yes, n/N = no\n")
if ans.lower() == "y":
return "y"
elif ans.lower() == "n":
return "... | public-static-X/Connect4 | connect4.py | connect4.py | py | 11,002 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "termcolor.colored",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "termcolor.colored",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "termcolor.colored",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.array",
... |
18404878179 | import itertools; import math; import operator; import random; import string; from bisect import *; from collections import deque, defaultdict, Counter, OrderedDict; from functools import lru_cache, cache; from heapq import *; import unittest; from typing import List;
def get_sol(): return Solution()
class Solution:
... | afzalsiddique/problem-solving | Problem_Solving_Python/leetcode/lc1905.py | lc1905.py | py | 2,182 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "typing.List",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "unittest.TestCase",
"line_number": 33,
"usage_type": "attribute"
}
] |
33651529263 | import os
import math
import torch
import numpy as np
from tqdm import tqdm
import matplotlib.pyplot as plt
from src.mgr import manager
from src.utils.dirs import create_dirs
import torch.nn.functional as F
from lib import init_proto_model
from lib.protopnet.losses import cluster_sep_loss_fn, l1_loss_fn
from lib.protop... | archmaester/proto2proto | src/services/_evaluate/protopnet_evaluate.py | protopnet_evaluate.py | py | 14,596 | python | en | code | 18 | github-code | 21 | [
{
"api_name": "src.mgr.manager",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "os.cpu_count",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "ray.init",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "lib.init_proto_model",
"lin... |
33635026113 | import logging
import os
import pandas as pd
import telegram
from MT5Monitor_EMACross_DBv1.mt5monitor_dbv1.configuration.app_config import config
def get_file_name(path1, filename):
return os.path.join(path1, filename)
def archive_files():
cross_file_path = os.path.join(config['output_base_path'], config['... | nerusm/MT5Monitor_EMACross_DBv1 | mt5monitor_dbv1/notification/telegram_notificaton.py | telegram_notificaton.py | py | 5,689 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.path.join",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 1... |
26552320498 | import pytest
from httpx import AsyncClient
from cars.api.app import app
from cars.db.models import db
from cars.common.data_models import CreateCarRequest
from cars.api.settings import DB_URL
pytestmark = [pytest.mark.asyncio]
@pytest.fixture(autouse=True)
async def db_bind():
await db.set_bind(DB_URL)
awa... | MoonChel/cars | tests/test_app.py | test_app.py | py | 1,063 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pytest.mark",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "cars.db.models.db.set_bind",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cars.api.settings.DB_URL",
"line_number": 14,
"usage_type": "argument"
},
{
"api_name"... |
40225681962 | import cv2
import numpy as np
import matplotlib.pyplot as plt
# Read image from file in gray scale mode and convert to numpy array
img = cv2.normalize(cv2.imread("11.png", cv2.IMREAD_GRAYSCALE).astype("float"), None, 0.0, 1.0, cv2.NORM_MINMAX)
gx = np.array([[-1, -2, -1], [0, 0, 0], [1, 2, 1]])
Imggx = cv2.filter2D(... | Nourollah/Python_ImageProcessing | S02/S02_C21_P73_edge_size_extraction*.py | S02_C21_P73_edge_size_extraction*.py | py | 563 | python | en | code | 19 | github-code | 21 | [
{
"api_name": "cv2.normalize",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.IMREAD_GRAYSCALE",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "cv2.NORM_MINMAX",
... |
11090254388 | import os
import psutil
import time
from selenium import webdriver
from pyvirtualdisplay import Display
class Action():
def clear_appdata(self):
self.clear_appdata_command_list = ['taskkill /F /IM CUE.exe',
'RD /S /Q "%USERPROFILE%\AppData\Roaming\Corsair\CUE"'... | deedmitrij/PyFoC | Actions.py | Actions.py | py | 2,671 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.system",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 29,
... |
3881342128 | from matplotlib import pyplot as plt
import numpy as np
from neo import io
from neo.core import AnalogSignal
import quantities as pq
import igor.binarywave as igorbinary
# neo depends on igor
# pip install igor
# pip install neo
# Gwyddion can be used to view .ibw AFM files
# We want to be able to plot similar images
... | stevennoyce/AutexysPlatforms | Analysis/AFM_Loading/Igor_Reader.py | Igor_Reader.py | py | 3,331 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "neo.io.IgorIO",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "neo.io",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.subplot",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
33568123037 | from django.shortcuts import render, redirect
from .forms import modificarServicioForm
from .models import Servicios
# Create your views here.
from django.shortcuts import render, get_object_or_404
from .models import Servicios
# Create your views here.
def nuevo_servicio(request):
if request.POST:
nomb... | CodeSystem2022/Debugging-Demons-Tercer-Semestre-Integrador | barber_shop/Servicios/views.py | views.py | py | 1,724 | python | es | code | 1 | github-code | 21 | [
{
"api_name": "models.Servicios",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "models.Servicios.objects.all",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": ... |
35286366006 | from pydantic import validate_arguments
from .config import (
category_9_dragons_hp_fix,
dragon_rarity_power,
category_and_level_power,
damage_rune_power,
hp_rune_power,
rank_class_power,
hp_tower_power,
damage_tower_power
)
@validate_arguments
def calculate_status(
category: int,
... | 1Marcuth/py.dragon-city-utils | dcutils/tools/calculators/dragon/status/__init__.py | __init__.py | py | 3,620 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "config.category_and_level_power",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "config.rank_class_power",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "config.dragon_rarity_power",
"line_number": 51,
"usage_type": "name"
},
{
... |
39671361813 | # Least Recently Used Cache
from collections import OrderedDict
class LRU_Cache(object):
def __init__(self, capacity):
# Initialize class variables
self.capacity = capacity if capacity is not None else 0
self.cache = OrderedDict()
def get(self, key):
# Retrieve item from prov... | vrbarros/udacity-data-structures-algorithms-nanodegree | p_1/problem_1.py | problem_1.py | py | 1,936 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.OrderedDict",
"line_number": 10,
"usage_type": "call"
}
] |
69796693174 | import pyautogui as p
import pydirectinput as pp
import time
p.PAUSE = 0.5
pp.PAUSE = 0.5
# 選擇第一個卷軸
def clickReelButtom():
p.moveTo(1015,476)
p.click()
def clickStartRaiseReelButton():
clickImagePos('./img/select_raise_reel_button.png')
def clickCancelRaiseReelButton():
clickImagePos('./img/select_ca... | gfes980615/game_auto | maple/lib/level_up.py | level_up.py | py | 1,687 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pyautogui.PAUSE",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "pydirectinput.PAUSE",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pyautogui.moveTo",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pyautogui... |
38602194414 | from app import *
from time import sleep
import pywikibot
from pywikibot.exceptions import *
from requests.exceptions import *
def run_bot(template_param, access_token=None, site=None, max_edits=100000, remove=False):
cached_pages = list_cache_contents('bot_cache/')
edits_made = 0
for page_name in cached_p... | dissemin/oabot | src/bot.py | bot.py | py | 4,005 | python | en | code | 33 | github-code | 21 | [
{
"api_name": "time.sleep",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "app.logger.info",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "app.logger",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "app.logger.exception",
... |
72276282934 | import re
from datetime import datetime
from collections import defaultdict
from bs4 import BeautifulSoup
from pyquery import PyQuery
from ilms import exception
class ParseResult:
def __init__(self, body=None):
self.soup = BeautifulSoup(body, 'lxml') if body else None
self.result = []
se... | leVirve/iLms-nthu-API | ilms/parser.py | parser.py | py | 9,045 | python | en | code | 19 | github-code | 21 | [
{
"api_name": "bs4.BeautifulSoup",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pyquery.PyQuery",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "ilms.exception.Pe... |
72443210933 | from collections import OrderedDict
import torch
import torch.nn as nn
dtype = torch.float32
#complex valued block
class ComplexConv2d(nn.Module):
def __init__(self, input_channels, output_channels,
kernel_size=3, stride=1, padding=0, dilation=1, groups=1, bias=True):
super(ComplexConv2... | bianlab/CI-CDNet | models/basicblock.py | basicblock.py | py | 4,958 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "torch.float32",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Module",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"... |
29292642504 | """
Core interval join operations on arrays of interval coordinates.
"""
from __future__ import annotations
from typing import Any, Tuple, Union, Optional
import sys
if sys.version_info < (3, 8):
from typing_extensions import Literal
else:
from typing import Literal
import numpy as np
__all__ = [
"over... | nvictus/bioframe-lite | src/bioframe_lite/_ops.py | _ops.py | py | 18,808 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "sys.version_info",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "typing.Union",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "numpy.ndarray",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "typing.Optional"... |
40049392983 | # -*- coding: utf-8 -*-
import os
from datetime import datetime
import re
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse
try:
from python_plus.python_plus import _u
except ImportError:
from python_plus import _u
COPY = {
"zero": {
"author": "SHS-A... | zeroincombenze/tools | wok_code/scripts/license_mgnt.py | license_mgnt.py | py | 13,640 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "datetime.datetime.today",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 79,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
24241556871 | # -*- coding: utf-8 -*-
"""
Created on Wed Dec 16 15:36:10 2015
@author: Fatma - Geoffroy - Pierre
"""
import pygame
pygame.init()
FPS = 30 # frames per second, the general speed of the program
BOXSIZE = 40 # size of box height & width in pixels
GAPSIZE = 1 # size of gap between boxes in pixel... | GeoffroyG/TDLOG | Constantes.py | Constantes.py | py | 3,110 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pygame.init",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pygame.font.init",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "pygame.font",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "pygame.font.Font",
"... |
73595919414 | # !usr/bin/env python
# -*- coding:utf-8 -*-
from tensorflow.contrib import rnn
import numpy as np
from tensorflow.examples.tutorials.mnist import input_data
import tensorflow as tf
from sklearn.model_selection import train_test_split
# 首先导入数据,看一下数据的形式
positive_data=np.load("data/train_positive.npy")
negative_data=np... | Deermini/outlier_detection | deep_outlier.py | deep_outlier.py | py | 3,614 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "numpy.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.vstack",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test... |
73617639413 | import pygame
import menu
import party
import player
import keys_manager
"""
@Author : YANG Lei (S201970)
GARDIER Simon (S192580)
Game() : Classe gérant la logique du programme et tous ses composants
- Les objets player
- Les menus de départ/fin
- La partie en elle-même
... | sgardier/thewitcherscontest | Class/game.py | game.py | py | 2,756 | python | fr | code | 1 | github-code | 21 | [
{
"api_name": "pygame.K_ESCAPE",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "menu.Menu",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "menu.EndMenu",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "party.Party",
"line_n... |
24600330242 | #Imports===================================================
import sys, os, time, random, wave, argparse, pygame
import numpy as np
from collections import deque
from readchar import readchar
# show plot of algorith in action
gShowPlot = False
#Classes===================================================
''' Used to pl... | SeanFitzpatrick0/guitar_strings | strings.py | strings.py | py | 3,617 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pygame.mixer.pre_init",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pygame.mixer",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "pygame.mixer.init",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pygame.mixe... |
18285291622 | import argparse
import os
import pandas as pd
import sys
import shutil
import time
import torch
import torch.nn as nn
import torch.optim as optim
import torchvision
import yaml
import math
from addict import Dict
from sklearn.metrics import f1_score
from torch.utils.data import DataLoader
import torchvision.transforms... | ms903-github/adience-fair-classify | main.py | main.py | py | 20,726 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "libs.functions.AverageMeter",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "libs.functions.AverageMeter",
"line_number": 48,
"usage_type": "call"
},
{
"a... |
73384974132 | from django import forms
from .models import Prodi
from django.core import validators
class addProdi(forms.ModelForm):
kode_prodi = forms.CharField()
class Meta:
model = Prodi
fields = ('kode_prodi', 'nama_prodi')
def clean(self):
cleaned_data = super().clean()
kode_prodi... | ahmadagungtawakkal30/KPU | KPU/KPUapp/forms.py | forms.py | py | 461 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.forms.CharField",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.f... |
44363590773 | import add
import sub
import mult
import div
import modpow
import dss
import gost
import primality as pm
from functools import reduce
import random
import sympy
import os
import sys
working_symbs = '0123456789 !\"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~' \
'абвгдеёжзийклмнопрстуфхцчшщъыьэюя' \
... | alse0722/krypto | 2sem_n3/gamal/gamal.py | gamal.py | py | 12,743 | python | ru | code | 0 | github-code | 21 | [
{
"api_name": "sub.subtraction",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "div.divide",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "div.divide",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "add.add",
"line_number": 31... |
12593178905 | """project URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based... | martinezger/proyecto-modelo | project/urls.py | urls.py | py | 2,191 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "django.urls.path",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "SocialTravel.views.index",
"line_number": 26,
"usage_type": "argument"
},
{
"api_name": "django.urls.path",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "django... |
5019112683 | import cv2
import socket
import pickle
import struct
import threading
class StreamingServer:
"""
Class for the streaming server.
Attributes
----------
Private:
__host : str
host address of the listening server
__port : int
port on which the server is list... | PaulLockett/OSConferenceCall | serverlib/streaming.py | streaming.py | py | 10,819 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "threading.Lock",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "socket.socket",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 71,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_STREAM",... |
5510363267 | import requests
from bs4 import BeautifulSoup
url = "https://bp.eosgo.io/"
result = requests.get(url )
bs_obj = BeautifulSoup (result.content, "html.parser")
lf_items = bs_obj.findAll("div", {"class":"lf-item"})
hrefs = [div.find("a")['href'] for div in lf_items ]
print (hrefs)
# From now subpages
def get_bp_inf... | MinsuKim123/crawler | lesson6_bitcoinPartners.py | lesson6_bitcoinPartners.py | py | 2,098 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"li... |
21498090349 | import itertools
game = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]
def win(current_game):
def all_same(l):
if l.count(l[0]) == len(l) and l[0] != 0:
return True
else:
return False
for row in current_game:
print(row)
if all_same(row):
print(... | reynash/Python_Projects | TicTacToe.py | TicTacToe.py | py | 2,620 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "itertools.cycle",
"line_number": 62,
"usage_type": "call"
}
] |
1831078011 | import numpy as np
import scipy
import cPickle as pickle
from sklearn.cluster import KMeans
from sklearn.decomposition import PCA
import matplotlib.pyplot as plt
from time import time
from sklearn import metrics
from sklearn import preprocessing as pp
import csv
from operator import itemgetter
import json
... | dssg/411-on-311 | analysis/clustering/analyze_clusters.py | analyze_clusters.py | py | 2,607 | python | en | code | 44 | github-code | 21 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "operator.itemgetter",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "matplo... |
28119226750 | from flask import Flask, request, jsonify
app = Flask(__name__)
students = [
{'id': 1, 'name': 'Arpit', 'grade': 89},
{'id': 2, 'name': 'Balmukund', 'grade': 78},
{'id': 3, 'name': 'Chameli', 'grade': 69}
]
# Get a list of all students [GET REQUEST]
@app.route('/students', methods = ['GET'])
def get_stude... | PatelArpitt/ArpitPatel8915StudentApi | app.py | app.py | py | 2,011 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_numb... |
32181535635 | from typing import TYPE_CHECKING
from dask_sql.datacontainer import DataContainer
from dask_sql.physical.rel.base import BaseRelPlugin
from dask_sql.physical.utils.sort import apply_sort
if TYPE_CHECKING:
import dask_sql
from dask_sql._datafusion_lib import LogicalPlan
class DaskSortPlugin(BaseRelPlugin):
... | dask-contrib/dask-sql | dask_sql/physical/rel/logical/sort.py | sort.py | py | 1,316 | python | en | code | 336 | github-code | 21 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "dask_sql.physical.rel.base.BaseRelPlugin",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "dask_sql.physical.utils.sort.apply_sort",
"line_number": 33,
"usage_type": "... |
25005148340 | from keras import backend as K
import tensorflow as tf
## Evaluate Method
def k_recall(y_target, y_pred):
y_target_yn = K.round(K.clip(y_target, 0, 1))
y_pred_yn = K.round(K.clip(y_pred, 0, 1))
count_true_positive = K.sum(y_target_yn * y_pred_yn)
count_true_positive_false_negative = K.sum(y_target_yn)
... | ifuseok/AMCNN | Metric.py | Metric.py | py | 1,411 | python | en | code | 7 | github-code | 21 | [
{
"api_name": "keras.backend.round",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "keras.backend",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "keras.backend.clip",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "keras.backend.round... |
12581835093 | #!/usr/bin/env python2
import os
import numpy as np
from colorama import init, Fore
import trajectory_utils
import associate_timestamps as associ
init(autoreset=True)
def load_estimate_and_associate(fn_gt,
fn_es, fn_matches, data_gt=None,
max_diff=0.... | uzh-rpg/rpg_trajectory_evaluation | src/rpg_trajectory_evaluation/trajectory_loading.py | trajectory_loading.py | py | 2,997 | python | en | code | 922 | github-code | 21 | [
{
"api_name": "colorama.init",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
33887071045 | '''
Задание
У нас есть интернет магазин. Это стартап, потому до проверки ниши много действий делаются руками.
Поставщик прислал архив, в котором есть прайс и папка с картинками.
Прайс: id, name, brand, price
Картинки: имя файла начинается с id товара
Есть правило установки цены:
Для бренда Matchbox скидка от поставщи... | arthurka-company/intro_python_18_01 | lesson_10_4.py | lesson_10_4.py | py | 2,880 | python | ru | code | 0 | github-code | 21 | [
{
"api_name": "csv.DictReader",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_name": "shutil.copy",
"line_numb... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.