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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
41152323649 | from cmath import sqrt
import tkinter as tk
from tkinter import RAISED, Entry, Label, StringVar, ttk, Checkbutton, Button, messagebox
import matplotlib.pyplot as plt
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
import numpy as np
import pandas as pd
def sePuedeConvertir(texto):
if texto == '':
... | Moisesmp75/TkinterForms | Trabajo1/MCUA.py | MCUA.py | py | 27,614 | python | es | code | 0 | github-code | 6 | [
{
"api_name": "tkinter.ttk.Frame",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "tkinter.ttk",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "tkinter.StringVar",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "tkinter.StringVar",
... |
34402812372 | import sqlite3
db = sqlite3.connect("app.db")
cursor = db.cursor()
row = cursor.execute("SELECT * FROM app_data")
class Team:
def __init__(self, name):
self.score = 1000
self.team_name = name
self.members = []
def add_member(self, player):
self.members.append(player)
... | PranjalGupta2199/Fantasy-Cricket-Game | event_handling.py | event_handling.py | py | 3,142 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "sqlite3.connect",
"line_number": 2,
"usage_type": "call"
}
] |
25988099519 | import os
from winreg import OpenKey, HKEY_LOCAL_MACHINE, KEY_ALL_ACCESS, REG_SZ, SetValueEx, CloseKey
'''
Usage: python3 usb_eject.py
OS: Window7 and later
Eject the usb storage when the usb device plugin your PC!
'''
from time import sleep
import http.client
import subprocess
def monitorUSBStorage():
label = ['... | 1Lorde/usb_detect | client/utils.py | utils.py | py | 2,588 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "subprocess.Popen",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "yaml.load",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "yaml.SafeLoader",
"line_num... |
7751416747 | import json
import logging
from dateutil import parser
from grimoire.elk.enrich import Enrich
from .utils import get_time_diff_days
class KitsuneEnrich(Enrich):
def __init__(self, jenkins, db_sortinghat=None, db_projects_map = None):
super().__init__(db_sortinghat, db_projects_map)
self.elasti... | timhayduk/glusterDashboard | GrimoireELK/grimoire/elk/kitsune.py | kitsune.py | py | 7,766 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "grimoire.elk.enrich.Enrich",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "dateutil.parser.parse",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "dateutil.parser",
"line_number": 80,
"usage_type": "name"
},
{
"api_name": "date... |
40795460137 | '''
команда запуска
exec(open('mysite/test.py', encoding='utf8').read())
'''
from django import template
# from django.conf import settings
# settings.configure(settings)
# t = template.Template('My name is {{ name }}.')
t = template.Template("Меня зовут {{name|length}}")
c = template.Context({'name': 'Адриан 6 те... | znorthstream/djcode | mysite/test.py | test.py | py | 444 | python | ru | code | 0 | github-code | 6 | [
{
"api_name": "django.template.Template",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "django.template.Context",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "djan... |
16809835664 | import json
from flask import Flask, render_template, make_response
import datetime
from time import time
import sqlite3
app = Flask(__name__)
def get_data() -> tuple:
conn = sqlite3.connect("src/db/rguard_db.db")
cursor = conn.cursor()
for row in cursor.execute("SELECT * FROM DHT_DATA ORDER BY timestamp... | rehrler/rguard | src/server/start_server.py | start_server.py | py | 1,079 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.st... |
12193020941 | from six import binary_type, text_type
from unittest import TestCase
from zc_events.utils import model_to_dict
class ExampleModel(object):
def __init__(self):
self.control_attr = 'test'
class ModelToDictTests(TestCase):
def dictify(self):
attr_dict = {x: x for x in ['test_attr', 'control_at... | ZeroCater/zc_events | tests/test_utils.py | test_utils.py | py | 3,413 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "unittest.TestCase",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "zc_events.utils.model_to_dict",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "zc_events.utils.model_to_dict",
"line_number": 29,
"usage_type": "call"
},
{
"api... |
34557804678 | import re
import matplotlib.pyplot as plt
pattern = "^[\D]*(\d{1,3})[\D]*(\d\.[\d]*)[\D]*(\d\.[\d]*).*"
# with open("data/cnn_result_batch32_size128_00005.txt", mode='r') as f:
with open("data/cnn_result.txt", mode='r') as f:
lines = f.readlines()
epoch = []
train_loss = []
accuracy = []
for line i... | k1412/pycharm_test | data_ analysis.py | data_ analysis.py | py | 937 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "re.match",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot... |
1991970660 | import concurrent.futures
import requests
from collections import deque
import get_raw_proxy as gr
def put_in_queue(raw_proxy_list):
q = deque()
for proxy in raw_proxy_list:
q.append(proxy)
return q
def check_proxies(proxy):
try:
response = session.get("https://api.ipify.org", proxie... | qbizzzz/valid_proxy_generator | get_valid_proxy.py | get_valid_proxy.py | py | 1,784 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.deque",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "requests.exceptions",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "requests.exceptions",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "ge... |
39400851157 | import os
from typing import Dict, Any, List, Union, Callable
import pickle
import argparse
import logging
import json
import boto3
import pandas as pd
import numpy as np
import cupy as cp
import cudf
from sklearn.pipeline import Pipeline
from sklearn.model_selection import StratifiedKFold
from sklearn.utils.class_wei... | YangWu1227/python-for-machine-learning | tree_based/projects/otto_product_sagemaker/src/baseline_entry.py | baseline_entry.py | py | 7,442 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.Dict",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "xgboost.callback.EarlyStopping",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "xgboost.callbac... |
42420653225 | # -*- python -*-
# This module provides the following project specific sphinx directives
#
# sourcefile
from docutils import nodes
from docutils.parsers.rst import Directive
from sphinx import addnodes, roles
from sphinx.util.nodes import make_refnode, set_source_info
_SOURCEFILES = 'cacert_sourcefiles'
__version__ ... | CAcertOrg/cacert-codedocs | source/sphinxext/cacert.py | cacert.py | py | 6,722 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "docutils.nodes.Structural",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "docutils.nodes",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "docutils.nodes.Element",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_nam... |
36810050332 |
import requests
def get_weather(url):
result = requests.get(url) #string
if result.status_code == 200: #check chto ststus servera ok
return result.json() #json - perevodim str v dict (json - metod modulya requests)
else:
print("Что-то пошло не так")
def get_names(url):
resul... | koiiNyan/LearnPython | lesson4/req.py | req.py | py | 630 | python | ru | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 18,
"usage_type": "call"
}
] |
40539579200 | from flask_wtf import Form
from wtforms.fields import StringField, TextAreaField, SubmitField, SelectField
from wtforms.validators import DataRequired
from wtforms_alchemy import model_form_factory
ModelForm = model_form_factory(Form)
class TestForm(Form):
url = StringField('URL', [
DataRequired('Please ... | vigov5/anyrss | app/forms.py | forms.py | py | 1,006 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "wtforms_alchemy.model_form_factory",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask_wtf.Form",
"line_number": 6,
"usage_type": "argument"
},
{
"api_name": "flask_wtf.Form",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "wtf... |
72067004989 | import logging
module_logger = logging.getLogger("pyfetra")
from pyfetra.tools import Factory
class NonLinearSolver(object):
def __init__(self):
self._boss = None
self._niter_max = None
self._ratio = None
self._linsolve = None
def initialize(self, boss, opt):
sel... | basileMarchand/pyfetra | pyfetra/problem/nonlinearSolver.py | nonlinearSolver.py | py | 1,996 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "pyfetra.tools.Factory.Register",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "pyfetra.tools.Factory",
"line_number": 56,
"usage_type": "name"
}
] |
14358645794 | # -*- coding: utf-8 -*-
"""
Created on Sun May 19 13:18:51 2019
@author: marco
"""
import matplotlib.pyplot as plt
import numpy as np
from core import get_txt_data
ch1_2 = []
ch1_3 = []
ch1_4 = []
ch2_1 = []
ch2_3 = []
ch2_4 = []
ch3_1 = []
ch3_2 = []
ch3_4 = []
ch4_1 = []
ch4_2 = []
ch4_3 = []
for i in range(984... | MarcoYu0508/GrangerCausality_pytorch | plot casuality.py | plot casuality.py | py | 2,691 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "core.get_txt_data",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "matplotlib.... |
5358938753 | from django import forms
from .models import *
from django.core.validators import MinLengthValidator
class NewClassForm(forms.ModelForm):
class Meta:
model = Classes
fields = [
'name',
'info',
]
class JoinClassForm(forms.Form):
code = forms.CharField(
max_length = 7,
validators= [MinLengthValidator(... | NijoNinan/Classroom-Manager | TheSchool/classes/forms.py | forms.py | py | 578 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.forms.Form",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "django.... |
22977685661 | from setuptools import setup, find_packages
with open('requirements.txt') as f:
required = f.read().splitlines()
print (required)
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name="first_pip_module",
version="0.3",
author="Sanjay Singh Shekhawat",
author_email="s... | sanster23/makefiles | first_pip_module/setup.py | setup.py | py | 803 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "setuptools.setup",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 24,
"usage_type": "call"
}
] |
71779965948 | """Retrieve camera data from Trafikverket API."""
from __future__ import annotations
from datetime import datetime
import aiohttp
from lxml import etree
from .exceptions import MultipleCamerasFound, NoCameraFound
from .trafikverket import (
FieldFilter,
FilterOperation,
NodeHelper,
OrFilter,
Traf... | gjohansson-ST/pytrafikverket | pytrafikverket/trafikverket_camera.py | trafikverket_camera.py | py | 4,942 | python | en | code | 21 | github-code | 6 | [
{
"api_name": "datetime.datetime",
"line_number": 48,
"usage_type": "name"
},
{
"api_name": "datetime.datetime",
"line_number": 49,
"usage_type": "name"
},
{
"api_name": "lxml.etree._ElementTree",
"line_number": 71,
"usage_type": "attribute"
},
{
"api_name": "lxml... |
40224835819 | import sys
from PyQt6.QtWidgets import (QWidget, QLabel, QCheckBox, QPushButton,
QApplication, QVBoxLayout, QButtonGroup)
from PyQt6.QtCore import Qt
from PyQt6.QtGui import QFont
class MainWindows(QWidget):
def __init__(self):
super(MainWindows, self).__init__()
self.i... | grant-Gan/programing_learn | pyqt6_learn/ch4-Learning _about_layout_management/vertical_box.py | vertical_box.py | py | 1,066 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "PyQt6.QtWidgets.QWidget",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "PyQt6.QtWidgets.QCheckBox",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "PyQt6.QtWidgets.QCheckBox",
"line_number": 21,
"usage_type": "call"
},
{
"api_na... |
14792647816 | import pickle
from dataclasses import dataclass
@dataclass
class Person:
first_name: str
last_name: str
id: int
def greet(self):
print(f"Witam, jestem {self.first_name} {self.last_name}, Id to {self.id}")
if __name__ == '__main__':
p1 = Person("JAcek", "Kowalski", 1)
print(p1) # Pe... | rajkonkret/or-19-06 | kl13.py | kl13.py | py | 613 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "dataclasses.dataclass",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "pickle.dump",
"line_number": 28,
"usage_type": "call"
}
] |
13659011758 | from django.urls import path
from . import views
app_name = 'front'
urlpatterns = [
path('', views.index, name='index'),
path('stulogout/', views.stulogout, name='stulogout'), # 学生退出登录
path('tealogout/', views.tealogout, name='tealogout'), # 学生退出登录
path('studentLogin/', views.studentLogin, name='stu... | 00zy/OnlineExamSystem | front/urls.py | urls.py | py | 705 | python | en | code | 0 | github-code | 6 | [
{
"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",
... |
23822523093 | # ---
# jupyter:
# jupytext:
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.4.2
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# %% [markdown]
# # S... | YueFelixYang/statsthinking21-python | notebooks/06-Sampling.py | 06-Sampling.py | py | 7,964 | python | en | code | null | github-code | 6 | [
{
"api_name": "nhanes.load.load_NHANES_data",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "matplotlib.... |
41280601570 | import numpy as np
import scipy.stats
import nxsdk
ms_per_time_step = 10
time_steps_per_ms = 1 / ms_per_time_step
time_steps_per_second = 1000 * time_steps_per_ms
time_steps_per_minute = 60 * time_steps_per_second
def decay(tau):
return int(4095 / tau)
# preallocate empty array and assign slice by chrisaycock... | mathisrichter/dft_loihi | dft_loihi/dft/util.py | util.py | py | 3,479 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.empty_like",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"li... |
15039121707 | import time
from selenium.webdriver.common.by import By
from core.automation_utils import wait_for_element_to_be_visible
class ProductsBuying:
def __init__(self, driver):
self.driver = driver
nameOfUser = (By.ID, "nameofuser")
laptop = (By.XPATH, "//a[text()='Laptops']")
products = (By.XPAT... | rainaazad/pythonbasicpracticeproblem | pageobjects/Products.py | Products.py | py | 1,202 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.common.by.By.ID",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.common.by.By",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.common.by.By.XPATH",
"line_number": 13,
"usage... |
26442375959 | import os
import cv2
import matplotlib.pyplot as plt
import json
import numpy as np
hues = {'bg': 0,'aw': 0,'lvr': 0,'git': 328,'fat': 58,'gspr': 80,'ct':19,'blood': 0,'cd': 60,'hook': 130,'gbldr': 357,'hv': 217,'llmt': 40}
saturation = {'bg': 100,'aw': 33.3,'lvr': 55.3,'git': 69.7,'fat': 59.7,'gspr':100,'ct'... | pushpjain3/endoscopy_image_segmentation | create_masks.py | create_masks.py | py | 1,683 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "numpy.zeros",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.int32",
"line_numb... |
21521007582 | import aiohttp
import asyncio
async def download(session, i):
payload = {
'username': f'并发测试用户_{i:05}',
'email': f'binfa_{i:05}@binfa.com',
'password': '123',
'individual': 'individual'
}
await session.post('729222.iterator-traits.com/auth/register', json=payload)
async d... | AerysNan/ChallengeHub | utils/bulk_user_create.py | bulk_user_create.py | py | 723 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "aiohttp.ClientSession",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "asyncio.gather",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "asyncio.get_event_loop",
"line_number": 26,
"usage_type": "call"
}
] |
158488246 | """
comment-crud
comment-list
comment-detail
"""
from django.urls import path
from bumblebee.feeds.api.views.feed_views import (
FeedBuzzListView,
FeedFollowSuggestionsListView,
)
urlpatterns = [
# retrieve
path(
"post",
FeedBuzzListView.as_view(),
name="feed-post-list",
)... | sthasam2/bumblebee-backend | bumblebee/feeds/urls.py | urls.py | py | 458 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "bumblebee.feeds.api.views.feed_views.FeedBuzzListView.as_view",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "bumblebee.feeds.api.views.feed_views.FeedBuzzListView",
"line_... |
23202916560 | # author:ToddCombs
# appium例子1——打开手机计算器输入2019
# 在手机上打开需要获取包名和活动名的app
# 在cmd中运行‘adb shell’命令,进入shell命令行
# 在shell命令行运行dumpsys window windows | grep -E ‘mCurrentFocus’命令获取appPackage和appActivity
import time
from appium import webdriver
desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['platfo... | ToddCombs/Phenomenon | appium_one.py | appium_one.py | py | 1,155 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "appium.webdriver.Remote",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "appium.webdriver",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 20,
"usage_type": "call"
}
] |
71997540348 | from django.urls import path
from .views import main_views as views
from .views import auth_views as auth
from .views import api_views as api_view
urlpatterns = (
path('home',views.home,name='home-member'),
path('myclients', views.manage_directs, name='manage_direct'),
path('transaction/direct',views.dir... | chaitphani/New-DivMart | membership/urls.py | urls.py | py | 1,042 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "views.main_views.home",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "views.main_views",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.urls... |
35875724515 | import os, argparse, random
parser = argparse.ArgumentParser()
parser.add_argument('-i', help='path with images')
parser.add_argument('-o', help='path with images')
args = parser.parse_args()
i_path = args.i
o_path = args.o
images = os.listdir(i_path)
test_size = int(len(images) * 0.3)
test_index = random.sample(ra... | Prograf-UFF/HoVW | HoVW/classification/split-train-test.py | split-train-test.py | py | 1,942 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "random.sample",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
... |
32552329049 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
import math
import enum
import random
import Map
colors = ['white', 'black', 'red', 'blue', 'orange', 'green','brown','yellow']
bounds = [0,1,2,3,4,5,6,7,8] #entre 0 et 1 exclu: white,...
cmap = mpl.colors.ListedColormap(colors)
norm = mpl.c... | TheMagnat/IAR_Self-Improving-Reactive-Agents | src/environment.py | environment.py | py | 17,323 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.colors.ListedColormap",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.colors",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.colors.BoundaryNorm",
"line_number": 14,
"usage_type": "call"
},
{... |
40561171945 | import os
import time
import torch
import argparse
from tqdm import tqdm
import torch.optim as optim
import torch.nn.functional as F
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter
from utils import (
load_files,
save_pickle,
fix_seed,
print_model,
CosineAnn... | YuJungHeo/kbvqa-public | main.py | main.py | py | 13,430 | python | en | code | 31 | github-code | 6 | [
{
"api_name": "model.eval",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "torch.topk",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 66,... |
35656954886 | import pygame
import random
class Object:
def __init__(self, x_pos, y_pos, width, height, velocity):
self.height = height
self.width = width
self.y_pos = y_pos
self.x_pos = x_pos
self.velocity = velocity
self.type = "object"
def collide(self, object):
... | Francis-Cataldo/asteriods-game | object.py | object.py | py | 1,029 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.draw.rect",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "pygame.draw",
"line_number": 36,
"usage_type": "attribute"
}
] |
6246423666 | """
주의!!!
2~3시간 이상 걸릴 수 있음!
"""
import keras
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten
from keras.layers import Conv2D, MaxPool2D
from keras.optimizers import RMSprop
from keras.datasets import mnist
import matplotlib.pyplot as plt
import logging
logging.basicConfig(filenam... | cheesecat47/ML_DL_Jan2020 | Jan23/mnist_cnn.py | mnist_cnn.py | py | 1,591 | python | ko | code | 0 | github-code | 6 | [
{
"api_name": "logging.basicConfig",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "keras.datase... |
10775278029 | """
I thought it was a fiddly one. Alana had a much nicer solution that recognised
there were only 9 possible inputs/outcomes and enumerating them all.
"""
import json
from requests_cache import CachedSession
data = (
CachedSession()
.get('https://adventofcode.com/2022/day/2/input', cookies=json.load(open('coo... | knjmooney/Advent-Of-Code | 2022/02-rock-paper-scissors.py | 02-rock-paper-scissors.py | py | 1,518 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests_cache.CachedSession",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 10,
"usage_type": "call"
}
] |
7237685970 | import socket
from _thread import *
import threading
import json
import time
from os import listdir
from os.path import isfile, join
import account as acc
import log_handling as logh
import error_detection_recovery as er
global_port = 12356
halt_process = False
deamon_processes = []
warning_phase = False
running_pr... | pritamksahoo/III-IV-YEAR-Assignments | DS/Assign3/server.py | server.py | py | 13,593 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "time.localtime",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "account.logout",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "account.block",
"line_nu... |
71430386748 | from bs4 import BeautifulSoup
import re
__author__ = 'fcanas'
class IzProperties(dict):
"""
Responsible for parsing and containing any properties used by IzPack's installation spec files.
"""
def __init__(self, path):
"""
Initialize paths to properties and begin parsing.
"""
... | izv/IzVerifier | IzVerifier/izspecs/izproperties.py | izproperties.py | py | 2,650 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "bs4.BeautifulSoup",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 62,
"usage_type": "call"
}
] |
2283768409 | import tensorflow as tf
import numpy as np
from tensorflow.keras import layers
from tensorflow.keras import Input
from tensorflow.keras.models import Model
import argparse
import os
import logging
from src.utils.callback import save_callback
from src.utils.model import loadData
from src.utils.common import read_yaml, c... | sanjeev49/aiClassification | src/stage_03_training.py | stage_03_training.py | py | 4,233 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tensorflow.data.experimental.enable_debug_mode",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "tensorflow.data",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "logging.basicConfig",
"line_number": 16,
"usage_type": "call"
},
... |
31281207252 | # -*- coding: utf-8 -*-
"""
Created on Mon May 6 16:00:00 2019
@author: Shengjie Liu, liushengjie0756@gmail.com
"""
import matplotlib.pyplot as plt
import numpy as np
def save_cmap(img, cmap, fname):
sizes = np.shape(img)
height = float(sizes[0])
width = float(sizes[1])
fig... | sjliu68/save-map-without-axis-and-blank | save_cmap.py | save_cmap.py | py | 571 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.shape",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyp... |
22270769802 | import sys, time
import serial
from copy import deepcopy
from Modules.GPSFuncs import distCoordsComponentsSigned
import numpy as np
from PyQt6.QtWidgets import (QApplication, QMainWindow, QTableWidgetItem, QMessageBox, QWidget, QColorDialog)
from PyQt6.QtGui import QClipboard
from PyQt6.QtCore import Qt, QSettings, QDi... | David-ArsB/Advanced-Avionics | Ground Station/gcs.py | gcs.py | py | 35,353 | python | en | code | null | github-code | 6 | [
{
"api_name": "PyQt6.QtCore.QObject",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "PyQt6.QtCore.pyqtSignal",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "PyQt6.QtCore.pyqtSignal",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "... |
35492017534 | import torch
from PIL import Image, ImageDraw, ImageFont
import os
import io
import json
model = torch.hub.load('ultralytics/yolov5', 'custom', path='weights/exp50/weights/best.pt')
for i in os.listdir("images_wh/"):
# print(i)
image_path = os.path.join("images_wh", i)
image = Image.open(image_path)
re... | fakhrilak/image_recognize | YOLOV5/move.py | move.py | py | 676 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.hub.load",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.hub",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number... |
11120988687 | import typing as tp
import logging
from librarius.domain.messages import events, AbstractEvent
from librarius.service.handlers import AbstractEventHandler
logger = logging.getLogger(__name__)
class PublicationAddedHandler(AbstractEventHandler[events.PublicationAdded]):
def __call__(self, event: "events.Publicati... | adriangabura/vega | librarius/service/handlers/event_handlers.py | event_handlers.py | py | 1,106 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "librarius.service.handlers.AbstractEventHandler",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "librarius.domain.messages.events.PublicationAdded",
"line_number": 9,
"us... |
13987509297 | from PIL import ImageGrab
# Define the coordinates and size of the region to capture
left = 0
top = 800
width = 200
height = 200
# Capture the region and save it to a file
def screenShot(image_name):
image = ImageGrab.grab(bbox=(left, top, left+width, top+height))
image.save("photo/"+ image_name +".png") | hongdangcseiu/Telebottest | ScreenCapture.py | ScreenCapture.py | py | 316 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "PIL.ImageGrab.grab",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "PIL.ImageGrab",
"line_number": 12,
"usage_type": "name"
}
] |
9278387182 | from scipy.special import kn
import numpy as np
from odeintw import odeintw
import timeit
from numpy import linalg
import cmath
def fast_isPerturbative(y):
"""
Check perturbativity of Yukawas
"""
#limit of perturbativity for y
limit = np.power(4*np.pi,0.5)
#check if any element of column 1, 2 o... | earlyuniverse/ulysses | ulysses/ulsbase.py | ulsbase.py | py | 30,298 | python | en | code | 13 | github-code | 6 | [
{
"api_name": "numpy.power",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "scipy.special.kn",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "scipy.special.kn",
"li... |
2683217274 | from rest_framework import viewsets
from rest_framework.generics import get_object_or_404
from rest_framework import permissions
from rest_framework.permissions import IsAuthenticated
from .serializers import CommentSerializer, GroupSerializer, PostSerializer
from posts.models import Group, Post
class IsOwnerOrReadO... | magicbuka/api_yatube | yatube_api/api/views.py | views.py | py | 1,432 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rest_framework.permissions.BasePermission",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.permissions",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "rest_framework.permissions.SAFE_METHODS",
"line_number": 12,
"u... |
8280593597 | '''
This problem was recently asked by LinkedIn:
Given a binary tree, find the most frequent subtree sum.
Example:
3
/ \
1 -3
The above tree has 3 subtrees. The root node with 3, and the 2 leaf nodes, which gives us a total of 3 subtree sums. The root node has a sum of 1 (3 + 1 + -3), the left leaf node has... | gadodia/Algorithms | algorithms/Graph/frequentSubtreeSum.py | frequentSubtreeSum.py | py | 1,489 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.defaultdict",
"line_number": 29,
"usage_type": "call"
}
] |
39294157690 | import fileinput
import re
import sys
from fractions import Fraction as frac
#Remove the string to integer conversion limit
sys.set_int_max_str_digits(0)
#Open a file and store it in a string
full = ""
for line in fileinput.input("E:\Portfolio\Programs\Extra - TE1/test.txt", encoding="utf-8"):
full = f... | StephenFisher1988/ThoughtExperiment | Extra - TE1/ThoughtExperiment1.py | ThoughtExperiment1.py | py | 718 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.set_int_max_str_digits",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "fileinput.input",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "fractions.Fraction",... |
2044667762 | import asyncio
from pyppeteer import launch
# https://medium.com/analytics-vidhya/web-scrapping-using-pyppeteer-and-jupyter-notebook-69b07a6f914c
URL = 'https://play.google.com/store/apps/details?id=com.gamedevjr.crystalguardian'
async def main():
browser = await launch(headless=True)
page = await browser.n... | nicolebegnoche/CS390Z | Activities/00_Libraries_and_Tools/Pyppeteer/tutorial.py | tutorial.py | py | 2,032 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pyppeteer.launch",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "asyncio.get_event_loop",
"line_number": 49,
"usage_type": "call"
}
] |
21378633883 | import wx, time
from taskcoachlib import patterns
import dateandtime
class Clock(object):
__metaclass__ = patterns.Singleton
def __init__(self, *args, **kwargs):
now = kwargs.pop('now', time.time)
super(Clock, self).__init__(*args, **kwargs)
self._timer = wx.PyTimer(self.startTheC... | HieronymusCH/TaskCoach | branches/Feature_SyncML/taskcoach/taskcoachlib/domain/date/clock.py | clock.py | py | 2,010 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "taskcoachlib.patterns.Singleton",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "taskcoachlib.patterns",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "time.time",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name"... |
44010978466 | import os
import tempfile
import unittest
from detectron2.config import downgrade_config, get_cfg, upgrade_config
_V0_CFG = """
MODEL:
RPN_HEAD:
NAME: "TEST"
VERSION: 0
"""
_V1_CFG = """
MODEL:
WEIGHT: "/path/to/weight"
"""
class TestConfigVersioning(unittest.TestCase):
def test_upgrade_downgrade_consi... | ying09/TextFuseNet | tests/test_config.py | test_config.py | py | 1,297 | python | en | code | 445 | github-code | 6 | [
{
"api_name": "unittest.TestCase",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "detectron2.config.get_cfg",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "detectron2.config.downgrade_config",
"line_number": 26,
"usage_type": "call"
},
{
... |
73574098107 | import streamlit as st
import pandas as pd
import pickle
from sklearn.feature_extraction.text import TfidfVectorizer
import nltk
from nltk.corpus import stopwords
from nltk import word_tokenize
from nltk.stem import PorterStemmer
from nltk.stem import WordNetLemmatizer
from nltk.corpus import wordnet
import re
nltk.do... | YI75/Fake-News_Identifier_CTP | fake_real.py | fake_real.py | py | 2,009 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "nltk.download",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "nltk.download",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "nltk.download",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords",
... |
6773039535 | import argparse
import os
import random
import time
import json
import pandas as pd
from compiled_jss.CPEnv import CompiledJssEnvCP
from stable_baselines3.common.vec_env import VecEnvWrapper
from torch.distributions import Categorical
import wandb
import torch
import numpy as np
import ray
from MyVecEnv import W... | ingambe/End2End-Job-Shop-Scheduling-CP | fast_solve.py | fast_solve.py | py | 5,223 | python | en | code | 16 | github-code | 6 | [
{
"api_name": "stable_baselines3.common.vec_env.VecEnvWrapper",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "compiled_jss.CPEnv.CompiledJssEnvCP",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 51,
"usage_type": "attribu... |
7002224781 | from ...common.constants import SUBJECTS_BY_KEYWORD
from ..utils.db_utils import conn
from ..utils import unique_everseen, redis_lru, departments, course_utils as course
from ...common.constants import CURRENT_TERM
import psycopg2
def _uniqify_numbers(result):
result['numbers'] = list(unique_everseen(result['numbe... | minupalaniappan/gradfire | daviscoursesearch/flaskapp/service/index.py | index.py | py | 1,063 | python | en | code | 12 | github-code | 6 | [
{
"api_name": "utils.unique_everseen",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "utils.db_utils.conn.cursor",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "utils.db_utils.conn",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "p... |
70454808507 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# In[2]:
# calculates the loss given an input, an output, and the theta values
# returns a scalar loss
def loss_function(xVal, yVal, theta):
hVal = np.dot(xVal, theta)
hVal = np.resh... | AustenBrooks/ECGR_4105 | HW_0_Lin_Reg/ECGR 4105 HW 0.py | ECGR 4105 HW 0.py | py | 4,569 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.dot",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.reshape",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 35... |
22137657732 | import streamlit as st
from docx import Document
import base64
from openai import OpenAI
from prompts import PROBLEM_STATEMENT_PROMPT, NEED_FOR_INNOVATION_PROMPT, INNOVATION_NAME_PROMPT, INNOVATION_DESCRIPTION_PROMPT, GLOBAL_TEMPERATURE
# Set the page config
st.set_page_config(
page_title="Generador de Ideas de In... | eduardo-meik/InnovationIdeaGenerator | app.py | app.py | py | 4,852 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "streamlit.set_page_config",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "streamlit.markdown",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "streamlit.secrets",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "st... |
42891954724 | from __future__ import print_function
import numpy as np
import pandas as pd
import pytest
from urbansim.utils.sampling import sample_rows, get_probs
def test_get_probs():
df = pd.DataFrame({
'a': np.zeros(4),
'b': [0.25, 0.25, 0.25, 0.25],
'c': np.ones(4)
})
assert get_probs(df... | UDST/urbansim | urbansim/utils/tests/test_sampling.py | test_sampling.py | py | 3,466 | python | en | code | 451 | github-code | 6 | [
{
"api_name": "pandas.DataFrame",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "urbansim.utils.sampling.get_p... |
16907732828 | import matplotlib.pyplot as plt
import numpy as np
def plotData(x, y):
plt.plot(x,y,'x') # z最后参数是模式选择
plt.show()
listx = [1,2,3]
listy = [1,2,3]
# plotData(listx, listy)
data = np.loadtxt('ex1data1_bak.txt', delimiter=',')
# print(data)
# print(type(data))
# print(data.shape) # 显示行列数量
X = data[:,0:1] # 第一列
... | 2332256766/python_test | 02_day_GradientDescent/01plotData.py | 01plotData.py | py | 478 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.show",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotl... |
70635040509 | from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
from selenium.webdri... | CvsBurak/trendyol | test/conftest.py | conftest.py | py | 2,676 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.ChromeOptions",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 30,
"usage_type": "call"
},
{
"api... |
3126002095 | from schema import Scope, Role, Schema
from result import *
class ProximityException(Exception):
def __init__(self, item_name):
self.item_name = item_name
class OwnershipException(Exception):
def __init__(self, item_name, article='the'):
self.article = article
self.item_name = item... | ccastiglione/adventure | command.py | command.py | py | 8,302 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "schema.Schema",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "schema.set_role",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "schema.Scope.INVENTORY",
"line_number": 91,
"usage_type": "attribute"
},
{
"api_name": "schema.Scop... |
25098667158 | from argparse import ArgumentParser
import os
import events as e
import settings as s
from environment import GenericWorld
from fallbacks import tqdm
from agents import Agent
from items import Coin
import numpy as np
import random
from collections import namedtuple
WorldArgs = namedtuple("WorldArgs",
... | jfreyberg/IFML | train.py | train.py | py | 10,504 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.namedtuple",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "environment.GenericWorld",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "numpy.random.rand",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "num... |
31659604057 | from watchdog_gevent.observers import GeventObserver
from watchdog.events import FileSystemEventHandler
from flask import Flask
from flask_socketio import SocketIO
import os
import time
path = "/flag/king.txt"
is_running = True
time_left = 60*60
def get_team_name():
with open(path, "r") as f:
return f.rea... | Ingeniums/securityPlatform | server/src/run.py | run.py | py | 1,604 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "time.sleep",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "watchdog.events.FileSystemEventHandler",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "flask.Flask",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "os.envi... |
26318498883 | #!/usr/bin/python3
import tesrct_client as client
import socket
import cv2
import numpy
import os
def recvall(sock, count):
buf = b''
while count:
newbuf = sock.recv(count)
if not newbuf:
return None
buf += newbuf
count -= len(newbuf)
return buf
TCP_PORT = 5000
... | stnamjef/txt_recognition | tersct_container/tesrct_main.py | tesrct_main.py | py | 900 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "socket.socket",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_STREAM",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "numpy.froms... |
11004371878 | import collections
from typing import List
class Solution:
def calcEquation(self, equations: List[List[str]], values: List[float], queries: List[List[str]]) -> List[float]:
ans = []
visited = set()
table = collections.defaultdict(dict)
for (x, y), value in zip(equations, values):
... | xixihaha1995/CS61B_SP19_SP20 | temp/toy/python/399. Evaluate Division.py | 399. Evaluate Division.py | py | 1,122 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "collections.defaultdict",
"line_number": 9,
"usage_type": "call"
}
] |
13330764576 | import pytest
import Pyro4
from models import profile_deserializer
@pytest.fixture
def server(pytestconfig):
""" Configura uma instância do ArchiveServer para realizar os testes """
host_adress = pytestconfig.getoption("host")
uri = f"PYRO:ArchiveServer@{host_adress}:1234"
return Pyro4.Proxy(uri)
... | marceloFA/sd-p1 | test_benchmark.py | test_benchmark.py | py | 2,255 | python | pt | code | 0 | github-code | 6 | [
{
"api_name": "Pyro4.Proxy",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "models.profile_deserializer",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "models.pro... |
32886583067 | import os
import numpy as np
import pandas as pd
import ccxt
import time
def initialize(cash=None):
"""Initialize the dashboard, data storage, and account balances."""
print("Intializing Account and DataFrame")
# Initialize Account
account = {"balance": cash, "shares": 0}
# Initialize dataframe
... | rolopez21/Rice_Course1 | 15-Algorithmic-Trading/2/Activities/04-Evr_Going_Live/Solved/jarvis.py | jarvis.py | py | 2,885 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "os.getenv",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "ccxt.kraken",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number":... |
16992266192 | import pygame
import random
from character import Character
from platforms import Platforms
import os
class Game:
COLOR_RED = (255, 0, 0)
COLOR_GREEN = (172, 246, 200)
COLOR_BLACK = (0, 0, 0)
def __init__(self) -> None:
self.width = 600
self.height = 720
self.window = None
... | Vassarya/JumpyUwU | src/game.py | game.py | py | 5,464 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.time.Clock",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pygame.time",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_n... |
18449232060 | # pylint: skip-file
import requests as rq
from bs4 import BeautifulSoup
import re
from ReviewHandler import ReviewHandler
from DbHandler import DbHandler
class MemberPageHandler:
host_uri = 'https://www.tripadvisor.com.sg'
main_page_url = 'https://www.tripadvisor.com.sg/Attraction_Review-g294212-d319086-Review... | rafael977/ForbiddenCity | MemberPageHandler.py | MemberPageHandler.py | py | 4,831 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"... |
10874582070 | import sys
import pygame
from math import sqrt
pygame.init()
# pantalla
ANCHO,ALTO=650,650
superficie=pygame.display.set_mode((ANCHO,ALTO))
pygame.display.set_caption('Fractal Sierpinski')
# colores
azul,negro=(0,0,255),(0,0,0)
class Punto():
def __init__(self, x, y):
self.x = int(x)
self.y = int(y)
def __str... | Edgar-Ruiz-Tovar/Curso-Python | fractal_sierpinski.py | fractal_sierpinski.py | py | 1,483 | python | es | code | 0 | github-code | 6 | [
{
"api_name": "pygame.init",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.s... |
1359228924 | import argparse
import tensorflow as tf
def main(args):
if not args.task:
print("No Task name was provided wiht --task/-t\nLoading available tasks...")
import seqio
import codeT5.tasks # pylint:disable=unused-import
print("Available Mixtures")
print(seqio.MixtureRegistry.... | nashid/code-t5 | print_dataset.py | print_dataset.py | py | 3,171 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "seqio.MixtureRegistry.names",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "seqio.MixtureRegistry",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "seqio.TaskRegistry.names",
"line_number": 15,
"usage_type": "call"
},
{
"a... |
17516493348 | '''Command-line tool functionality for `cellmincer train`.'''
import yaml
import logging
import os
import sys
from datetime import datetime
from cellmincer.cli.base_cli import AbstractCLI
from cellmincer.train.main import Train
class CLI(AbstractCLI):
'''CLI implements AbstractCLI from the cellmincer.cli packag... | broadinstitute/CellMincer | cellmincer/train/cli.py | cli.py | py | 2,844 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "cellmincer.cli.base_cli.AbstractCLI",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "os.path.expanduser",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "o... |
39477177145 | # -*- coding: utf-8 -*-
import scrapy
class ClubaqSpider(scrapy.Spider):
name = 'clubaq'
allowed_domains = ['club.xywy.com']
start_urls = ['http://club.xywy.com/']
def parse(self, response):
search_url = 'http://club.xywy.com/kswd_list.htm'
yield scrapy.Request(url=search_url,callbac... | zhang8929/zhangyuguang | zyg/spider/Clubaq/Clubaq/spiders/clubaq.py | clubaq.py | py | 1,974 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "scrapy.Spider",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "scrapy.Request",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "scrapy.Request",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "scrapy.Request",
... |
7782249527 | import sys
import pygame
from pygame.sprite import Group
from pygame.sprite import Sprite
class Rain(Sprite):
def __init__(self, screen):
super().__init__()
self.screen = screen
self.image = pygame.image.load('../Src/ic_rain_drop.png')
self.screen_rect = self.screen.get_rect()
... | fghnntp/pythonPracticeProject | AlianInvadation/test/rain_drop.py | rain_drop.py | py | 1,691 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.sprite.Sprite",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "pygame.image.load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pygame.init",... |
10230337825 | """
Functions to handle registration of evals. To add a new eval to the registry,
add an entry in one of the YAML files in the `../registry` dir.
By convention, every eval name should start with {base_eval}.{split}.
"""
import copy
import difflib
import functools
import logging
import os
import re
from functools import... | openai/evals | evals/registry.py | registry.py | py | 10,986 | python | en | code | 12,495 | github-code | 6 | [
{
"api_name": "openai.OpenAI",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
... |
540250291 | """
Utility functions used by assembly_strategies.
"""
from itertools import chain, groupby, zip_longest
from re import escape, search, sub
from typing import Iterable, Mapping, Optional, Sequence
from document.config import settings
from document.domain.bible_books import BOOK_NAMES, BOOK_NUMBERS
from document.domai... | WycliffeAssociates/DOC | backend/document/domain/assembly_strategies/assembly_strategy_utils.py | assembly_strategy_utils.py | py | 15,957 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "document.config.settings.logger",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "document.config.settings",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "document.domain.model.BookContent",
"line_number": 31,
"usage_type": "name"
},... |
36295746434 | from setuptools import (
find_packages,
setup,
)
DEV_REQUIRES = [
"black",
"pylint",
"pre-commit",
"mypy",
"sqlalchemy-stubs",
"pytest",
"pytest-cov",
"mkdocs",
]
setup(
name="nimbus",
version="0.1",
author="Tony Benoy",
author_email="me@tonybenoy.com",
desc... | tonybenoy/nimbus | setup.py | setup.py | py | 1,021 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "setuptools.setup",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 24,
"usage_type": "call"
}
] |
37129724509 | from PyQt5 import QtCore, QtGui, QtWidgets
import pyqtgraph as pg
import controlpanel.model.units as units
import os
class Ui_SubWindow(object):
def setupUi(self, SubWindow, unit):
self.subwindow = SubWindow
self.unit = unit
SubWindow.setObjectName("SubWindow")
SubWindow.setMinimum... | Bloomdex/2.1-embedded-systems | Basestation/controlpanel/view/subwindow.py | subwindow.py | py | 22,862 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "PyQt5.QtCore.Qt",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtCore",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWid... |
8371173963 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import torch
from src.model import init_face_detection_model, get_face_detection_result
# --------------------路径参数--------------------
GPU_id = "cuda:3"
face_model_path = './models/... | MagicianQi/s3_face_detector | testing.py | testing.py | py | 1,072 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.device",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "src.model.init_f... |
17691184685 | import httplib2
import copy
import logging
import json
from . import exceptions
from . import utils
from .service_catalog import ServiceCatalog
logger = logging.getLogger(__name__)
class HTTPClient(httplib2.Http):
USER_AGENT = 'python-balancerclient'
def __init__(self, endpoint=None, token=None, username... | Mirantis/openstack-lbaas-cli | balancerclient/common/client.py | client.py | py | 5,188 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "httplib2.Http",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "copy.deepcopy",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
... |
12117501881 | import os
import random
import cv2
import csv
import gin
import imageio
import imageio.core.util
import numpy as np
from tf_agents.environments import py_environment
from tf_agents.environments import wrappers
from tf_agents.specs import array_spec
from tf_agents.trajectories import time_step as ts
from vizdoom import... | arunraja-hub/Preference_Extraction | agent/rl_env/DoomEnvironment.py | DoomEnvironment.py | py | 9,245 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "imageio.core",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "tf_agents.environments.py_environment.PyEnvironment",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "tf_agents.environments.py_environment",
"line_number": 41,
"us... |
72130666747 | import pandas as pd
from shapely import wkt
from src.constants import *
def nan_thresh_drop(df, thresh=10000):
""" Drop columns with too many nan values.
"""
nans = pd.DataFrame(df.isna().sum())
nans = nans[nans[0] >= thresh]
nan_cols = nans.index
df = df.drop(nan_cols, axis=1)
... | clint-kristopher-morris/Enabling-Risk-Aware-Routing | src/preprocessing.py | preprocessing.py | py | 3,578 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "pandas.DataFrame",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "shapely.wkt.loads",
"line_number": 117,
"usage_type": "attribute"
},
{
"api_name": "shapely.wkt",
"line_number": 117,
"usage_type": "name"
}
] |
71968088188 | #!/usr/bin/env nix-shell
#! nix-shell -i python -p "python3.withPackages (ps: [ps.influxdb])"
import json
import influxdb
import os
import sys
api_response = json.load(sys.stdin)
data = [
{
"measurement": "weight",
"time": datapoint["timestamp"],
"fields": { "value": datapoint["value"] },... | barrucadu/quantified-self-scripts | beeminder-weight-to-influx.py | beeminder-weight-to-influx.py | py | 491 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "influxdb.InfluxDBClient",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line... |
27773565570 | from telepyrobot.setclient import TelePyroBot
from pyrogram import filters
from pyrogram.types import Message
import os
from telepyrobot import COMMAND_HAND_LER
from telepyrobot.utils.msg_types import Types, get_note_type
from telepyrobot.utils.pyrohelpers import ReplyCheck
import asyncio
from telepyrobot.db import not... | Divkix/TelePyroBot | telepyrobot/plugins/notes.py | notes.py | py | 5,429 | python | en | code | 40 | github-code | 6 | [
{
"api_name": "os.path.basename",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "telepyrobot.COMMAND_HAND_LER",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "telepyrobo... |
19475615010 | import tweepy as tw
from unidecode import unidecode
class Grab():
def __init__(self):
self.TWITTER_CONSUMER_KEY = '1jyHN0gmb7kOrPs7raCZuYwNZ'
self.TWITTER_CONSUMER_SECRET = 'nrFnPcbVUAS7N1tHQowC08DdtHakyLr3vR1cEEhMRsbbwG02R7'
self.TWITTER_ACCESS_TOKEN = '1215248323579236353-c1VL0Ti9bntvKPH... | kholiqcode/skripsi | sentiment/grab.py | grab.py | py | 3,455 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tweepy.OAuthHandler",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tweepy.API",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "tweepy.Cursor",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "unidecode.unidecode",
... |
73831188989 | from grid_world import *
from agent import *
from config import *
seed = 6
torch.manual_seed(seed)
np.random.seed(seed)
config = config()
if (torch.cuda.is_available()):
torch.backends.cudnn.benchmark = True
cpu = grid_agent(config, device)
print("Beginning training of ", num_episodes, " episodes")
step = 0
max_t... | fhtanaka/TCC2018 | grid_world/test.py | test.py | py | 1,755 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "config.board_size",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "config.special",
"line_number": 16,
"usage_type": "attribute"
}
] |
30131971892 | import requests
import sys
def main():
if len(sys.argv) > 1:
abv_limit = sys.argv[1]
else:
print('ABV Limit not defined. Taking the default ABV limit as 6')
abv_limit = 6
parse_data("https://api.punkapi.com/v2/beers",abv_limit)
def connect_api(url):
response = requests.get(... | kalimuthusowndappan/DevOps-Test | brewdog.py | brewdog.py | py | 1,445 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
}
] |
31110526706 | from flask import Flask
from flask_jwt_extended import JWTManager
from src.presentation.container.ioc_container import Container
from src.presentation.controllers.users_controller import users_api
from src.presentation.controllers.login_controller import login_api
ENV_FILE_LOCATION = 'src/config/.env'
container = ... | nhmendes/pythonrestapi | app.py | app.py | py | 970 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "src.presentation.container.ioc_container.Container",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask_jwt_extended.JWTManager",
"line_number": 22,
"usage_type": "call"
... |
42639406715 | import networkx as nx
import matplotlib.pyplot as plt
import pickle
G = nx.DiGraph()
G.add_node("ROOT")
graph = {
'A': ['B', 'C', 'D'],
'B': ['E', 'F'],
'C': [],
'D': ['F'],
'E': [],
'F': ['G']
}
for p1 in graph:
if p1 not in G:
G.add_node(p1)
G.add_edges_from([('ROOT', p1)])
... | osssanitizer/maloss | airflow/data/test.py | test.py | py | 529 | python | en | code | 98 | github-code | 6 | [
{
"api_name": "networkx.DiGraph",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pickle.dump",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "networkx.draw",
"line_number": 27,
"usage_type": "call"
}
] |
32600055072 | import numpy as np
def p(x):
"""
所需概率密度函数
"""
return np.exp(-np.sum(x**2)/2)/np.pi/2
def q(x):
"""
原始样本的概率密度函数
"""
return 1/100
# 产生均匀分布的样本
x = np.random.random([1000, 2]) * 10 - 5
# 选择后样本
x_accept = []
x_reject = []
c = 100/np.pi/2
for itr in x:
alpha = p(itr) / q(itr) / c
# 产生... | YUZIYE/NeuralNetworkWithNumPy | 第二章/拒绝接受采样.py | 拒绝接受采样.py | py | 1,374 | python | zh | code | 3 | github-code | 6 | [
{
"api_name": "numpy.exp",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.random",
"line_number... |
32010748655 | import json
import xml.etree.ElementTree as ET
class Jsonable:
serializable_types = (
int,
float,
str,
list,
bool,
dict,
type(None),
)
def prepare_for_serialization(self):
class_name = self.__class__.__name__
dict_ = {}
for ... | 1oss1ess/HackBulgaria-Programming101-Python-2018 | week-5/01-Mixins/mixins.py | mixins.py | py | 1,975 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.dumps",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree.Element",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "xml.etree.Element... |
529683971 | from BTrees.OOBTree import OOBTree
from zope import interface, event
from zope.i18n import translate
from zope.component import getSiteManager
from zope.component import getUtility, queryUtility, getUtilitiesFor
from zope.app.component.hooks import getSite
from zope.app.component.interfaces import ILocalSiteManager
fr... | Zojax/zojax.product | src/zojax/product/product.py | product.py | py | 4,065 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "zope.interface.implements",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "zojax.product.interfaces.IProduct",
"line_number": 22,
"usage_type": "argument"
},
{
"api_name": "zope.interface",
"line_number": 22,
"usage_type": "name"
},
{
"ap... |
4077231756 | #!/usr/bin/env python
import sys
import os
import argparse
import subprocess
import json
def callAndPrint(cmd):
print(' '.join(cmd))
subprocess.call(cmd)
basedir = os.path.dirname(os.path.realpath(__file__))
scd_file = os.path.join(basedir, 'lilydrum.scd')
cachefile = os.path.expanduser('~/.lilydrum-cache')
pars... | nhthn/lilydrum | lilydrum.py | lilydrum.py | py | 1,678 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "subprocess.call",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"... |
15568478782 | # Author: Alex Zhu
# Last Updated: Jan 6, 2023
import json
import yfinance as yf
def getCloseData(start, end, tickers):
data = yf.download(
tickers = tickers,
start = start,
end = end,
interval = "3mo",
)
return data['Close'] | probablyalexzhu/B2-Stock-Trader | Backtester/getCloseData.py | getCloseData.py | py | 277 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "yfinance.download",
"line_number": 9,
"usage_type": "call"
}
] |
10044706309 | import json
output = open("params.new.pd", "w")
read_file = open("module.json", "r")
data = json.load(read_file)
lines = []
lines.append("#N canvas 0 25 1034 552 12;\n")
start = 22;
x = 109
increment = 25;
increment_x = 150
for param in data['parameters']:
y = start
minval = "0";
maxval = "1";
if param[0] != "... | adbrant/orac2_modules | standalone-wrapper/wrapper.py | wrapper.py | py | 1,388 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 4,
"usage_type": "call"
}
] |
811622936 | # Insert Delete GetRandom O(1) - https://leetcode.com/problems/insert-delete-getrandom-o1/
'''Implement the RandomizedSet class:
bool insert(int val) Inserts an item val into the set if not present. Returns true if the item was not present,
false otherwise.
bool remove(int val) Removes an item val from the set if pres... | Saima-Chaity/Leetcode | Miscellaneous/Insert Delete GetRandom O(1).py | Insert Delete GetRandom O(1).py | py | 6,442 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "random.choice",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 124,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 154,
"usage_type": "call"
}
] |
22551164595 | import logging
import string
from torchmetrics.functional.text import chrf_score, translation_edit_rate
from dataclasses import dataclass
from itertools import zip_longest
import sacrebleu
from typing import Final, Sequence
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
handler = logging.StreamHa... | ArturZhukovets/Metrics-evaluation | app/services/metrics_utils/evaluate_metrics.py | evaluate_metrics.py | py | 5,366 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "logging.StreamHandler",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "string.pun... |
484984307 | import os
import glob
import subprocess
import csv
import re
import pandas as pd
import pickle
import math
import numpy as np
import progressbar
import csv
import librosa
from Signal_Analysis.features.signal import get_HNR
from scipy.signal import find_peaks, peak_prominences, correlate, lfilter
from numpy import lina... | OvidiuGrec/Darwin-Project | xcorr_toolkit_features.py | xcorr_toolkit_features.py | py | 11,265 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "glob.glob",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path.split",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "os.path.split",
"line_number... |
16066117908 | import yaml
yaml.Dumper.ignore_aliases = lambda *args : True
features = {
"ss01": "Precursive",
"ss02": "Outline",
"ss03": "Cursive",
"ss04": "Outline Starters",
"ss05": "Outline Arrows",
"ss06": "Dotted"
}
STATICS = {
"Regular": 400,
"Medium": 500,
"SemiBold": 600,
"Bold": 700... | EbenSorkin/QLDSchoolHandAustralia | scripts/create-builder-config.py | create-builder-config.py | py | 2,912 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "yaml.Dumper",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "yaml.dump",
"line_number": 88,
"usage_type": "call"
}
] |
2697611462 | from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from passlib.hash import pbkdf2_sha256 as sha256
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.base import MIMEBase
from email import encoders
import os
import datetime
template = os.getc... | bhasindhruv117/confer-test | api/models.py | models.py | py | 5,398 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.getcwd",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "email.mime.multipar... |
19407536449 | #导入 requests 模块
import requests
#Get 请求
r1 = requests.get('https://api.github.com/events')
#Post 请求
r2 = requests.post('https://httpbin.org/post', data = {'key':'value'})
#其他Http 请求
r3 = requests.put('https://httpbin.org/put', data = {'key':'value'})
r4 = requests.delete('https://httpbin.org/delete')
r5 = requests.h... | BBBoZi/zhaojunshan | day2-1.py | day2-1.py | py | 2,242 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "requests.put",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "requests.delete",
"line_num... |
43342860476 | import logging
from typing import List
from telegram import Update, InlineKeyboardButton, InlineKeyboardMarkup
from telegram.ext import CallbackContext
from bot.util import restricted, build_menu, render_grade, to_callback_data, from_callback_data
from scrapers import get_scraper
from scrapers.base import courses_by_... | peng1999/nwpu-grade | bot/query.py | query.py | py | 3,354 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "scrapers.base.GradeItem",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "scrapers.base.s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.