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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5744062882 | import argparse
import GitPyService as gps
parser = argparse.ArgumentParser(description="Arguments Description")
parser.add_argument('--repo', nargs='?', default='https://github.com/takenet/lime-csharp', help='Repo to use')
parser.add_argument('--folder', nargs='?', default='', help='Folder to use')
parser.add_argumen... | rafaatsouza/ufmg-practical-assignments | software-repositories-mining/exercices/exercise-2.py | exercise-2.py | py | 2,147 | python | pt | code | 1 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "GitPyService.GitPyService",
"line_number": 16,
"usage_type": "call"
}
] |
13076195782 | import serial
import serial.tools.list_ports
import re
import sys
import pymysql
from time import sleep
db = pymysql.connect(host="twofast-RPi3-0", # your host
user="writer", # username
passwd="heiko", # password
db="NG_twofast_DB") # name of the datab... | kromerh/phd_python | 01_neutron_generator_contol/HBoxDueReadout_V0.py | HBoxDueReadout_V0.py | py | 2,299 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pymysql.connect",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "serial.tools.list_ports.comports",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "serial.tools",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "ser... |
24140152426 | from django.test import TestCase
import graphene
from api.query.story import Query
from api.tests.util import request_with_loaders
from story.factories import StoryFactory
class TestStoriesQuery(TestCase):
def setUp(self):
self.schema = graphene.Schema(query=Query)
self.request = request_with_lo... | dvndrsn/graphql-python-tutorial | api/tests/query/test_story.py | test_story.py | py | 1,833 | python | en | code | 16 | github-code | 36 | [
{
"api_name": "django.test.TestCase",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "graphene.Schema",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "api.query.story.Query",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "api.tests.u... |
24614942714 | from typing import Union
import numpy as np
from src.det import det, build_cofactor_matrix
# with extra space
# def transpose(matrix, size):
# transpose_matrix = matrix.copy()
#
# for i in range(size):
# for j in range(size):
# transpose_matrix[i][j] = matrix[j][i]
#
# return transpose... | Lakshmikanth2001/LinearAlgebra | src/inverse.py | inverse.py | py | 1,128 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "src.det.build_cofactor_matrix",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "src.det.det",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "typing.Union",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "numpy.array",
... |
72791842345 | from collections import deque
"""
Binary Search Tree — ia binary tree with the constraint:
- left subtree < currNode < right subtree
The left and right subtree each must also be a binary search tree.
"""
class Node:
def __init__(self, value, left=None, right=None):
self.value = value
self.left = left
self.ri... | cs50victor/dsa | dsa/non-linear/implement/Graphs/BinaryTrees/BinarySearchTrees.py | BinarySearchTrees.py | py | 3,330 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "collections.deque",
"line_number": 128,
"usage_type": "call"
}
] |
74470691304 | import os
import logging
import numpy
import random
from gensim.models import ldaseqmodel
analyze_topics_static = __import__('4a_analyze_topics_static')
config = __import__('0_config')
try:
import pyLDAvis
CAN_VISUALIZE = True
except ImportError:
CAN_VISUALIZE = False
if __name__ == "__main__":
logg... | Diego999/Risk-Analysis-using-Topic-Models-on-Annual-Reports | 4c_analyze_topics_through_time.py | 4c_analyze_topics_through_time.py | py | 2,519 | python | en | code | 6 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.seed",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.random",
... |
555988903 | import requests
import time
import numpy as np
from bs4 import BeautifulSoup as bs
def dict_vacancy():
return {'Вакансия': None,
'Зарплата мин': None,
'Зарплата мкс': None,
'Валюта': None,
'Ссылка': None,
'Сайт': None}
def salary_tpl(salary_str, dlm='—... | GruXsqK/Methods_scraping | Lesson_3/Scraper.py | Scraper.py | py | 4,763 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 105,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
... |
25209669435 | from django.shortcuts import render
from django.http import HttpResponse
from django.shortcuts import redirect
from django.db.models import Q
from django.db.models import Count,Sum,Avg,Min,Max
from django.core.paginator import Paginator
from django.shortcuts import get_object_or_404, redirect, render
from dj... | yamachanyama/Django_app | hello3/views.py | views.py | py | 3,978 | python | ja | code | 0 | github-code | 36 | [
{
"api_name": "models.Message",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "forms.MessageForm",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "models.Message.objects.all",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "models.Me... |
25842561969 | from sqlalchemy import ForeignKey, Table, Column
from sqlalchemy.sql.sqltypes import Integer, String, Float, Boolean, Date
from config.db import meta, engine
castings = Table("castings", meta,
Column("id", Integer, primary_key=True),
Column("castingDate", Date),
Column("name", String(255)),
Column("ca... | Lorea13/Profesionales-del-Arte | backend/models/casting.py | casting.py | py | 554 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sqlalchemy.Table",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "config.db.meta",
"line_number": 5,
"usage_type": "argument"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.sql.sql... |
23971685802 | from __future__ import unicode_literals
import os
import re
import json
from contextlib import contextmanager
from collections import defaultdict
from functools import wraps, partial
import psycopg2
from PyQt4.QtCore import Qt, QSettings, QRect
from PyQt4.QtGui import (
QIcon, QMessageBox, QDialog, QStandardItem,... | Oslandia/qgis-menu-builder | menu_builder_dialog.py | menu_builder_dialog.py | py | 32,979 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "PyQt4.QtGui.QDialog",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "menu_builder_dialog_base.Ui_Dialog",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "PyQt4.QtGui.QIcon",
"line_number": 53,
"usage_type": "call"
},
{
"api_name... |
3599441390 | from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(766, 569)
self.label = QtWidgets.QLabel(Dialog)
self.label.setGeometry(QtCore.QRect(30, 20, 61, 21))
self.label.setObjectName("label")
... | richespo/Image-Video-Frame | ImageViewerExample.py | ImageViewerExample.py | py | 2,364 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "PyQt5.QtWidgets.QLabel",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCore.QRect",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtCore",... |
24402887263 | import argparse, libmarusoftware, libtools, os
__version__="Marueditor b1.0.0"
__revision__="4"
__author__="Marusoftware"
__license__="MIT"
class DefaultArgv:
log_level=20
filepath=None
class Editor():
def __init__(self, argv=DefaultArgv):
self.argv=argv
self.opening={}
def Setup(self... | Marusoftware/Marutools | marueditor.py | marueditor.py | py | 17,550 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "libmarusoftware.core.adjustEnv",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "libmarusoftware.core",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "libtools.Addon",
"line_number": 23,
"usage_type": "call"
},
{
"api_name"... |
18424838554 |
import sys
from datetime import datetime, timedelta
from hashlib import sha1
from hmac import new as hmac
from os.path import dirname, join as join_path
from random import getrandbits
from time import time
from urllib import urlencode, quote as urlquote
from uuid import uuid4
from wsgiref.handlers import CGIHandler
... | jaredwy/taskoverflow | to-site/taskoverflow/twitteroauth.py | twitteroauth.py | py | 11,846 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "sys.path.insert",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"lin... |
39458596841 | from django.urls.resolvers import URLPattern
from django.urls import path
from . import views
urlpatterns = [
path('customer/', views.CustomerList.as_view()),
path('customer/<int:pk>', views.CustomerDetail.as_view()),
path('product/', views.ProductList.as_view()),
path('product/<int:pk>', views.Product... | ankitaggarwal1986/DjangoWorkforce | emart/products/urls.py | urls.py | py | 469 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"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",
... |
18875650180 | from __future__ import print_function
from stone import lexer, mytoken
import tempfile
f = tempfile.TemporaryFile()
f.write("""if (i==1) {
a=1
}
while i < 10 {
sum = sum + i
i = i + 1
}
sum
""")
f.seek(0)
l = lexer.Lexer(f)
while True:
t = l.read()
if t is mytoken.Token.EOF:
print('break')
... | planset/stone-py | chap3_lexer_runner.py | chap3_lexer_runner.py | py | 367 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "tempfile.TemporaryFile",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "stone.lexer.Lexer",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "stone.lexer",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "stone.mytoken.Tok... |
9815980344 | import sys
import requests
import random
token = sys.argv[1]
link = sys.argv[2]
useproxies = sys.argv[3]
if useproxies == 'True':
proxy_list = open("proxies.txt").read().splitlines()
def proxyjoin():
try:
proxy = random.choice(proxy_list)
requests.post(apilink, headers=heade... | X-Nozi/NoziandNiggarr24Toolbox | spammer/joiner.py | joiner.py | py | 612 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.argv",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "random.choice",
"line_numb... |
12038245832 | # SSCR Server - Simple Socket Chat Room Server
# Version: Alpha 0.9
# This is the server app of the Simple Socket Chat Room which handles all client connections
# todo: 1. [DONE] Clean up server side prints to only whats relevant to the eye in realtime and implement a log for later debugging/analysing
# 2. [D... | Argentix03/Simple-Socket-Chat-Room | sscr-server.py | sscr-server.py | py | 6,620 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "socket.socket",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "random.ran... |
34766714821 | import os
import gc
import time
import random
import warnings
import cv2
import hydra
from tqdm import tqdm
import numpy as np
import torch
import torch.optim as torch_optim
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter
from losses import DBLoss
from lr_schedulers import Wa... | huyhoang17/DB_text_minimal | src/train.py | train.py | py | 12,725 | python | en | code | 34 | github-code | 36 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "cv2.setNumThreads",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "data_loaders.TotalTextDatasetIter",
"line_number": 40,
"usage_type": "name"
},
{
"api_n... |
37290284583 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import render, redirect
from django.http import HttpResponse
from django.contrib.auth import authenticate, login
from django.contrib.auth.models import User
from .models import Image, Comment, Like
from .forms import userRegForm, log... | RAHUL-ALAM/Cookpad-Assignment | image/views.py | views.py | py | 4,575 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "models.Image.objects.all",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "models.Image.objects",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "models.Image",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "model... |
38031987622 | import csv
from ipaddress import ip_address
from .report import Host, Port
ALLOWED_COLUMNS = [
'ipv4',
'hostname',
'os_name',
'port',
'state',
'protocol',
'service',
'software_banner',
'version',
'cpe',
'other_info',
]
class CSVFileParser:
def load_hosts(self, fi... | delvelabs/batea | batea/core/csv_parser.py | csv_parser.py | py | 1,260 | python | en | code | 287 | github-code | 36 | [
{
"api_name": "csv.DictReader",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "report.Host",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "ipaddress.ip_address",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "report.Port",
"li... |
31050296898 | import unittest
import hypothesis.strategies as st
from django.test import RequestFactory
from hypothesis import assume, example, given
from ...serializers import HeaderSerializer
from ..payload_factories import PayloadRequestFactory
class TestHeaderSerializer(unittest.TestCase):
def setUp(self):
reque... | ryankask/prlint | prlint/github/tests/serializers/test_header_serializer.py | test_header_serializer.py | py | 2,183 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "unittest.TestCase",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "django.test.RequestFactory",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "serializers.HeaderSerializer",
"line_number": 21,
"usage_type": "call"
},
{
"ap... |
73508165543 | import pygame
from typing import Literal
# Init
pygame.init()
pygame.font.init()
# Janela
display = pygame.display.set_mode((1280, 720))
#3 Parte - formas - player
#pos e forma em retangulo
# 0,0 pos esquerda superior
#player1 = pygame.Rect(0, 0, 30, 150)
player1_img = pygame.image.load("assets/player1.png")
playe... | Gwynbleidd203/gameli_2 | main.py | main.py | py | 5,398 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pygame.init",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.font.init",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.font",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.set_mode",
... |
44393189173 | import sys
from PyQt5.QtWidgets import QMainWindow, QApplication
class CenterForm(QMainWindow):
def __init__(self):
super(CenterForm, self).__init__()
# 设置主窗口标题
self.setWindowTitle('深度废物')
# 设置窗口尺寸
self.resize(400,300)
def center(self):
# 获取屏幕坐标
screen... | Jrisking/pyqt6 | CenterForm.py | CenterForm.py | py | 828 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QApplication",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": ... |
14509567601 | # Import necessary libraries
from dash import Dash, dcc, html
from dash.dependencies import Input, Output, State
import dash_bootstrap_components as dbc
import plotly.express as px
import plotly.graph_objects as go
import pandas as pd
import numpy as np
import datetime
from bcb import sgs
from bcb import currency
from... | tharikf/WebApp_Cenario_Macroeconomico_Brasileiro | pages/page4.py | page4.py | py | 10,262 | python | pt | code | 1 | github-code | 36 | [
{
"api_name": "dash_bootstrap_components.themes",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "bcb.Expectativas",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "datetime.date.today",
"line_number": 67,
"usage_type": "call"
},
{
"api_na... |
11357570925 | import json
import asyncio
import time
from nats.aio.client import Client as NATS
async def sleep():
await asyncio.sleep(0.01)
async def pub_random(loop):
nc = NATS()
await nc.connect("localhost:4222", loop=loop)
if nc.last_error:
print("ERROR received from NATS: ", nc.last_error)
else:
... | saboyle/qt-python-nats-wiretap | Version 1 - Qt and Asyncio shared event loop (minimal)/nats_test_publisher.py | nats_test_publisher.py | py | 669 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "asyncio.sleep",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "nats.aio.client.Client",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "asyncio.get_event_loop... |
42443818863 | from datetime import date
maior = 0
menor = 0
for cont in range(1,8):
ano = int(input(f'Em que ano a {cont}° pessoa nasceu? '))
if (date.today().year - ano) >= 18:
maior += 1
else:
menor += 1
print(f'Ao todo tivemos {maior} pessoas maiores de idade')
print(f'E também tivemos {menor} pessoas ... | JosueFS/Python | Exercicios/Ex054.py | Ex054.py | py | 341 | python | pt | code | 0 | github-code | 36 | [
{
"api_name": "datetime.date.today",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 6,
"usage_type": "name"
}
] |
73603651945 | from django.contrib import admin
from django.urls import path, include
from . import views
from gcsemaths.exam_questions import exam_non_calc_views
from gcsemaths.a_number import aa_ordering_and_comparative_views, ab_ops_with_int_frac_dec_views
from gcsemaths.b_algebra import algebra_views
from gcsemaths.e_geometry_a... | devjolt/eqg | gcsemaths/urls.py | urls.py | py | 2,107 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "gcsemaths.exam_questions.exam_non_calc_views.modulesList",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "gcsemaths.exam_questions.exam_non_calc_views",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "gcsemaths.a_number.aa_ordering_and_comparat... |
36708187417 | """
Animate the prediction changes in a scene over training time by reading the predictions at different time steps during
the training process
Input:
- Path to a pickle file containing the points of a scene
- List of paths to pickle files containing the labels at different time steps of the training process
"""
imp... | tpfeifle/pointcloud-segmentation-attention | attention_points/visualization/labels_during_training.py | labels_during_training.py | py | 2,740 | python | en | code | 8 | github-code | 36 | [
{
"api_name": "os.path.join",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 1... |
12433436430 | from datetime import datetime
"""GPS class. Responsible for retrieving GPS data given connection and returning GPS data including lat, long, and time
Attributes: mav_connection:MAVLinkConnection
"""
class GPS:
def __init__(self, mavlink):
""" Initialize GPS class
Args:
mavlink:MAVLinkC... | shamuproject/mavimage | mavimage/gps.py | gps.py | py | 2,385 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "datetime.datetime.now",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "datetim... |
18729010139 | import spex_common.modules.omeroweb as omeroweb
from flask_restx import Namespace, Resource
from flask import request, abort, Response
from .models import responses, omero
from flask_jwt_extended import jwt_required, get_jwt_identity
from os import getenv
from urllib.parse import unquote
from spex_common.services.Utils... | Genentech/spex_backend | routes/api/v1/omero.py | omero.py | py | 2,937 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask_restx.Namespace",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "models.omero.omero_download_model",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "models.omero",
"line_number": 12,
"usage_type": "name"
},
{
"api_nam... |
16743362426 | from aiogram.types import InlineKeyboardButton, InlineKeyboardMarkup
def settings():
markup = InlineKeyboardMarkup()
shutdown = InlineKeyboardButton(text='🔽 Shutdown', callback_data='shutdown')
restart = InlineKeyboardButton(text='🔄 Restart', callback_data='restart')
lock = InlineKeyboardButton... | ToXic2290/pc-controller-bot | markup.py | markup.py | py | 2,456 | python | en | code | null | github-code | 36 | [
{
"api_name": "aiogram.types.InlineKeyboardMarkup",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "aiogram.types.InlineKeyboardButton",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "aiogram.types.InlineKeyboardButton",
"line_number": 6,
"usage_type": ... |
31309873828 | import sys
from ply import lex
from ply.lex import TOKEN
class Lexer:
def __init__(self, error_func):
self.error_func = error_func
def run(self):
self.lexer = lex.lex(object=self)
def reset_lineno(self):
self.lexer.lineno = 1
def input(self, text):
self.lexer.inpu... | EmilGrigoryan/Interpreter | lexer.py | lexer.py | py | 2,505 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "ply.lex.lex",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "ply.lex",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "ply.lex.TOKEN",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "ply.lex.TOKEN",
"line_number": ... |
69980575463 | import re
from bs4 import BeautifulSoup
def parse(html):
soup = BeautifulSoup(html, "html5lib")
# Get ingredients
title = soup.find(attrs={'data-testid': "ContentHeaderHed"}).get_text()
# We can't drill down to the list immediately because the yield is
# a sibling
ingredientList = s... | GarrettGeorge/Destijl | parsers/epicurious.py | epicurious.py | py | 1,080 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "bs4.BeautifulSoup",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number"... |
34623870443 | import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from minisom import MiniSom
from matplotlib.gridspec import GridSpec
import time
from pylab import plot, axis, show, pcolor, colorbar, bone
def load_data():
data = np.load('feature_vector.npy')
df = pd.read_csv('bbc-text.csv')... | elahesalari/Self-Organizing-Map-SOM | SOM-on-center library.py | SOM-on-center library.py | py | 3,545 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "numpy.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.unique",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "minisom.MiniSom",
"line_n... |
7804091778 | from scrapy import signals
from .logger import logger as lg
from time import sleep
from datetime import datetime as dt
from scrapy.http import HtmlResponse
from scrapy.utils.python import to_bytes
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common... | uniqon-truepoint/afreecatvCrawler | afreecatv/crawler/crawler/middlewares.py | middlewares.py | py | 9,541 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "scrapy.signals.spider_opened",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "scrapy.signals",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "scrapy.signals.spider_closed",
"line_number": 28,
"usage_type": "attribute"
},
{
... |
6789009521 | from rest_framework import serializers
from django.conf import settings
from django.contrib.auth import get_user_model
from actstream import action
from utils.mail import handlers
from custom_auth.helpers import UserProfileWrapper
class RequestContactSerializer(serializers.Serializer):
comment = serializers.C... | tomasgarzon/exo-services | service-exo-core/custom_auth/api/serializers/request_contact.py | request_contact.py | py | 1,545 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "rest_framework.serializers.Serializer",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.CharField",
"line_number": 14,
"usage_ty... |
29981226502 | from __future__ import absolute_import, print_function
import os.path
import collections
from . import hub, protocols, error, reader, http_ffi, logging, compat
from .hub import switchpoint
from .util import objref, docfrom
from ._version import __version__
try:
from urllib.parse import urlsplit
except ImportErro... | cocagne/gruvi | gruvi/http.py | http.py | py | 24,754 | python | en | code | null | github-code | 36 | [
{
"api_name": "urlparse.urlsplit",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "hub.switchpoint",
"line_number": 202,
"usage_type": "name"
},
{
"api_name": "util.docfrom",
"line_number": 203,
"usage_type": "call"
},
{
"api_name": "hub.switchpoint",
... |
31964896901 | import cv2
import time
import sys
from PIL import Image
from multiprocessing import Process
import os
os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = "hide"
import pygame
import fpstimer
import moviepy.editor as mp
savefile = open('data.txt', 'a', encoding='utf-8')
emojies = {
"🤍": [255, 255, 255],
"🐚": [220, 220... | lolLucoa/scripts | frame generator.py | frame generator.py | py | 6,637 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.environ",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "PIL.Image.fromarray",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"... |
34788460936 | from aiogram import Router
from aiogram.types import CallbackQuery
from bot.keyboards.inline.raffle import back_to_raffle_menu
crypto_payment = Router()
@crypto_payment.callback_query(lambda call: call.data.split(":")[0] == "Crypto")
async def send_payment_methods(call: CallbackQuery) -> None:
await call.messa... | lowfie/LotteryBot | bot/routers/raffle/crypto_payment.py | crypto_payment.py | py | 445 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "aiogram.Router",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "aiogram.types.CallbackQuery",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "bot.keyboards.inline.raffle.back_to_raffle_menu",
"line_number": 14,
"usage_type": "call"
}
] |
40319289149 | import numpy as np
from scipy import ndimage
from progress.bar import Bar
import argparse
import cv2
import os
import shutil
ImgFolderPathDict = {
"estimate": "estimate/",
"gt_flow": "gt_flow/",
"gt_traj": "gt_trajectories/",
"images": "images/",
"masks": "masks/"
}
SceneFolderName... | hanebarla/CrowdCounting_with_Flow | src/utils/make_human_gaussian.py | make_human_gaussian.py | py | 3,717 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.zeros",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "numpy.uint32",
"line_number... |
41921068479 | from selenium import webdriver
from bs4 import BeautifulSoup
import requests
from time import sleep
from selenium.webdriver.common.keys import Keys
def getNews():
print('getting news')
text_box = browser.find_element_by_class_name("_2wP_Y")
response = "Let me fetch and send top 5 latest news:\n"
text_box... | Nijaoui-Wassim/Whatsapp-Bot | main.py | main.py | py | 4,682 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "bs4.BeautifulSoup",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome... |
71491780585 | # -*- coding: utf-8 -*-
# HelenのデータセットからXMLファイルを構築してDlibに読み込ませられるXMLファイルを作成する
# 前準備
# 一つのディレクトリ下に以下のファイルを用意する
# 1. facebox のデータが入ったxmlファイル
# 2. annotationの点が入ったファイル(annotation ディレクトリ下に配置する)
#
# Helen_Dataset
# │─ helen_facebox.xml
# └─ annotation
# └─ annotation_data1.txt
# └─ annotation_data2.txt
# ... | chicn/render-dots | create_xml/helen_create_xml.py | helen_create_xml.py | py | 3,149 | python | ja | code | 0 | github-code | 36 | [
{
"api_name": "glob.glob",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree.parse",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "linecache... |
25657398507 | from django.urls import path, include
from rest_framework import routers
from src.api.views import UserUpdateView, UserImageView, CaloriesConsumptionListView, CaptureListView
app_name = 'api'
urlpatterns = [
path('capture/', CaptureListView.as_view(), name='capture-list-view'),
path('calories-consumption/', ... | IkramKhan-DevOps/exsapp-healthcare | src/api/urls.py | urls.py | py | 544 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "src.api.views.CaptureListView.as_view",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "src.api.views.CaptureListView",
"line_number": 9,
"usage_type": "name"
},
{
... |
21184237697 | from flask import request
from flask_restplus import Resource
from ..util.dto import TaskDto
from ..service.task_service import save_new_task, get_all_user_tasks, get_a_user_task, update_task, delete_task, get_all_expired_tasks
api = TaskDto.api
_task = TaskDto.task
_task_update = TaskDto.task_update
parser = api.pa... | dvdhinesh/task_management_rest_api | app/main/controller/task_controller.py | task_controller.py | py | 1,959 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "util.dto.TaskDto.api",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "util.dto.TaskDto",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "util.dto.TaskDto.task",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "ut... |
28764221918 | from tweepy import API, OAuthHandler
from tweepy.models import Status
from typing import Dict
def init_twitter_api(consumer_key : str,
consumer_secret : str,
access_token : str,
access_token_secret : str) -> API:
r"""Initialize cli... | p768lwy3/medium-telegram-tutorial | Ch. 1: Write a telegram bot to get twitter message/src/utils/twitter.py | twitter.py | py | 1,745 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "tweepy.OAuthHandler",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tweepy.API",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "tweepy.API",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "tweepy.models.Status",
"... |
36709812106 | from Genetic.selection import tournamentSelect,getRouletteWheel,rouletteWheelSelect,Individual
from django.shortcuts import render,get_object_or_404,redirect
from django.views.generic import TemplateView,DetailView,ListView
from .forms import FormularzPoczatkowy
from .models import Epoka,PojedynczaWartoscWyniku,Ustawi... | SJaskowski/OE_2 | Main/views.py | views.py | py | 21,028 | python | pl | code | 0 | github-code | 36 | [
{
"api_name": "django.views.generic.TemplateView",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "forms.FormularzPoczatkowy",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 23,
"usage_type": "call"
},
{
... |
43296898564 | from __future__ import with_statement
"""
This file is OBSCURE. Really. The purpose is to avoid copying and changing
'test_c.py' from cffi/c/ in the original CFFI repository:
https://foss.heptapod.net/pypy/cffi/
Adding a test here involves:
1. add a test to cffi/c/test.py
- if you need a C function to call, a... | mozillazg/pypy | pypy/module/_cffi_backend/test/test_c.py | test_c.py | py | 5,268 | python | en | code | 430 | github-code | 36 | [
{
"api_name": "py.test.importorskip",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "py.test",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "py.test.skip",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "py.test",
"line_nu... |
20456729952 | #!/usr/bin/env python
"""
Entry point for the ledfx controller. To run this script for development
purposes use:
[console_scripts]
python setup.py develop
ledfx
For non-development purposes run:
[console_scripts]
python setup.py install
ledfx
"""
import argparse
import importlib
import logg... | apophisnow/sub-backend | __main__.py | __main__.py | py | 12,252 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.version_info",
"line_number": 62,
"usage_type": "attribute"
},
{
"api_name": "ledfx.consts.REQUIRED_PYTHON_VERSION",
"line_number": 62,
"usage_type": "name"
},
{
"api_name": "ledfx.consts.REQUIRED_PYTHON_STRING",
"line_number": 63,
"usage_type": "argume... |
74249580265 | """"
Controls ECS Services
"""
import boto3
import logging
import os
DBTABLEENV = "ECSDYNTABLE"
DBREGION = "ECSDBREGION"
class ecsController:
def __init__(self, region, searchTag):
self.region = region
self.client = boto3.client('ecs', region_name= region)
self.searchTag = searchTag.lower... | evoraglobal/SleepSaver | ecsController.py | ecsController.py | py | 12,645 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "boto3.client",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "boto3.client",
"li... |
20976916712 | import datetime
import psycopg2
from psycopg2 import Error
connection = None
cursor = None
def romanToInt(s):
"""
:type s: str
:rtype: int
"""
roman = {'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000, 'IV': 4, 'IX': 9, 'XL': 40, 'XC': 90,
'CD': 400, 'CM': 900}
i = 0... | kiranfreelancer87/AWARDL_BACKEND | PostgretoMySql.py | PostgretoMySql.py | py | 1,875 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "psycopg2.connect",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "psycopg2.Error",
"line_number": 54,
"usage_type": "name"
}
] |
29124638883 | from select import select
import sqlite3
from sqlite3 import Error
def create_connection(db_file):
""" create a database connection to the SQLite database
specified by db_file
:param db_file: database file
:return: Connection object or None
"""
conn = None
try:
conn = sqlite3.connect(db... | JakubPazderski/6-subject-1-task | 6-subject-1-task.py | 6-subject-1-task.py | py | 3,331 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sqlite3.connect",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sqlite3.Error",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "sqlite3.OperationalError",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "sqlite3.E... |
20070029006 | from itertools import compress
def bool_code(number):
b = list()
while number != 0:
if number % 2 == 1:
b.append(True)
else:
b.append(False)
number >>= 1
return b
def bit_not(n, num_bits):
return (1 << num_bits) - 1 - n
def translate_code(items, mask... | mghorbani2357/TT-Miner-Topology-Transaction-Miner-for-Mining-Closed-Itemset | utils/tools.py | tools.py | py | 897 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "itertools.compress",
"line_number": 20,
"usage_type": "call"
}
] |
1917766531 | import numpy as np
import matplotlib.pyplot as plt
def load_bin_file(samplerate=2e6, type="complex", bfile="../data/file_source_test", plot=False, start_us=0, end_us=0):
if type not in ["complex", "real"]:
print("data type must be complex or real.")
exit()
with open(bfile, "rb") as f:
d... | HelloKevin07/RAScatter | reader/gr-rfid/misc/code/plot_signal.py | plot_signal.py | py | 1,008 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.fromfile",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "numpy.linspace",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"lin... |
18903346352 | from pathlib import Path
from logging import getLogger
from pypairtree.utils import identifier_to_path
from uchicagoldrtoolsuite import log_aware
from uchicagoldrtoolsuite.core.lib.convenience import log_init_attempt, \
log_init_success
from .abc.materialsuiteserializationreader import \
MaterialSuiteSerializ... | uchicago-library/uchicagoldr-toolsuite | uchicagoldrtoolsuite/bit_level/lib/readers/filesystemmaterialsuitereader.py | filesystemmaterialsuitereader.py | py | 2,400 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "abc.materialsuiteserializationreader.MaterialSuiteSerializationReader",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "uchicagoldrtoolsuite.core.lib.convenience.log_init_attemp... |
5222380259 | # -*- coding: utf-8 -*-
"""
@author: 葛怡梦
@Remark: 人脸识别
@inset: 陈佳婧
"""
import os
import numpy as np
import cv2
import face_recognition
from dvadmin.utils.mail import send_email_demo
from django.conf import settings
# Threshold = 0.65 # 人脸置信度阈值
'''
功能:计算两张图片的相似度,范围:[0,1]
输入:
1)人脸A的特征向量
2)人脸B的特征向量
输出:
1)sim:AB的相似度... | Applied-Energetic/Intelligent-classroom-management-system | django-vue-admin-main/backend/dvadmin/utils/face_identification2.py | face_identification2.py | py | 7,218 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "numpy.array",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.norm",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"line_nu... |
75174330665 | from math import hypot, pi, cos, sin
from PIL import Image
import numpy as np
import cv2
def hough(image, theta_x=600, rho_y=600):
"Calculate Hough transform."
print(image.shape)
height, width = image.shape
rho_y = int(rho_y/2)*2 #Make sure that this is even
him = np.zeros((theta_x, rho_y... | squeakus/bitsandbytes | opencv/hough_transform.py | hough_transform.py | py | 3,381 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "numpy.zeros",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "math.hypot",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "math.pi",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "cv2.cvtColor",
"line_number": 27,
... |
7396903634 | """
Based on:
https://devcenter.heroku.com/articles/getting-started-with-django
"""
from settings import *
import os
DEBUG = False
# Parse database configuration from $DATABASE_URL
import dj_database_url
DATABASES = {'default': dj_database_url.config() }
WSGI_APPLICATION = 'pdxtrees.wsgi_deploy.application'
SEC... | mattblair/pdx-trees-django | pdxtrees/settings_production.py | settings_production.py | py | 860 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "dj_database_url.config",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get"... |
7450851742 | from django.conf import settings
from django.conf.urls import url, include
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^user_profile/', include('user_profile.urls')),
url(r'^wd2csv/', include('wd2csv.urls')),
url(r'', include('homepage.urls')),
]
if setting... | Ash-Crow/ash-django | ash-django_app/urls.py | urls.py | py | 456 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": ... |
16703859938 | # Copyright 2020 University of Basel, Center for medical Image Analysis and Navigation
#
# Licensed under the Apache License, Version 2.0 (the “License”);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0... | JuliaWolleb/DeScarGAN | main.py | main.py | py | 1,954 | python | en | code | 31 | github-code | 36 | [
{
"api_name": "model.DeScarGAN.Solver",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "Evaluation.Evaluation_Chexpert.Solver",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 41,
"usage_type": "call"
}
] |
21008760995 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import subprocess as sp
from pwn import *
import re
import sys
import os
import tempfile
import argparse
def to_8bit(d9):
bits = ''
for c in d9:
bits += bin(ord(c))[2:].rjust(8, '0')
log.debug(bits)
d8 = ''
for i in range(0, len(bits), 9):
... | david942j/defcon-2017-tools | pcap/pcap_tool.py | pcap_tool.py | py | 5,202 | python | en | code | 92 | github-code | 36 | [
{
"api_name": "subprocess.Popen",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "re.search",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "re.search",
"line... |
3110641490 | """
Creator:
Dhruuv Agarwal
Github: Dhr11
Reference used for iou calculation:
https://github.com/warmspringwinds/pytorch-segmentation-detection/blob/master/pytorch_segmentation_detection/metrics.py
"""
import numpy as np
from sklearn.metrics import confusion_matrix
class custom_conf_matrix():
def __init__(self, ... | Dhr11/Semantic_Segmentation | metrics.py | metrics.py | py | 1,203 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "numpy.zeros",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.confusion_matrix",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.diag",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
... |
20860418193 | # Databricks notebook source
# MAGIC %md
# MAGIC ### Ingest qualifying folder
# COMMAND ----------
# MAGIC %run "../includes/configuration"
# COMMAND ----------
# MAGIC %run "../includes/common_funcs"
# COMMAND ----------
dbutils.widgets.text("p_data_source","")
v_data_source = dbutils.widgets.get("p_data_source"... | hdh997/f1-project | ingestion/8.ingest_qualifying_file.py | 8.ingest_qualifying_file.py | py | 3,035 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pyspark.sql.types.StructType",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.types.StructField",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.types.IntegerType",
"line_number": 34,
"usage_type": "call"
},
... |
37711853411 | def openfile():
import json
f = open('bonus.txt', 'r')
val = json.load(f)
return val
def viewfile(content):
print(content)
def binarySearch(alist,item):
alist.sort()
first = 0
last = len(alist)-1
found = False
print(alist)
while first<=last and not found:
middle = (first+last)//2
if alist[middle] == i... | adnanhf/Basic-Programming-Algorithm | Modul-7-Sequential-and-Binary-Search/Bonus/module.py | module.py | py | 500 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "json.load",
"line_number": 4,
"usage_type": "call"
}
] |
12491747552 | from pathlib import Path
import pandas as pd
import numpy as np
ROOT_DIRECTORY = Path("/code_execution")
DATA_DIRECTORY = Path("/data")
QRY_VIDEOS_DIRECTORY = DATA_DIRECTORY / "query"
OUTPUT_FILE = ROOT_DIRECTORY / "subset_query_descriptors.npz"
QUERY_SUBSET_FILE = DATA_DIRECTORY / "query_subset.csv"
def generate_qu... | drivendataorg/meta-vsc-descriptor-runtime | submission_src/main.py | main.py | py | 1,151 | python | en | code | 6 | github-code | 36 | [
{
"api_name": "pathlib.Path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.ndarray",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"lin... |
27545046731 | from tir import Webapp
import unittest
class OGAA580(unittest.TestCase):
@classmethod
def setUpClass(inst):
from datetime import datetime
DateSystem = datetime.today().strftime('%d/%m/%Y')
inst.oHelper = Webapp()
inst.oHelper.Setup('SIGAADV',DateSystem,'T1','D MG ... | ccpn1988/TIR | Modules/SIGAAGR/OGAA580TestCase.py | OGAA580TestCase.py | py | 1,561 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "unittest.TestCase",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.today",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "tir.W... |
7237082725 | #!/usr/bin/python3
# This Red Panda Lineage dataset management tool is useful for doing sweeping dataset
# revisions, such as ensuring that a field exists in each panda or zoo file, or removing
# photos taken by a specific credited author.
import git
import json
import os
import re
import sys
from shared import MEDI... | wwoast/redpanda-lineage | manage.py | manage.py | py | 30,773 | python | en | code | 22 | github-code | 36 | [
{
"api_name": "unidiff.PatchSet",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "shared.PANDA_PATH",
"line_number": 64,
"usage_type": "name"
},
{
"api_name": "shared.ZOO_PATH",
"line_number": 64,
"usage_type": "name"
},
{
"api_name": "shared.MEDIA_PATH"... |
15655149893 | import os
import pickle
import csv
import json
from copy import copy
import numpy as np
import datetime
from scipy.spatial.distance import jaccard, euclidean
def get_files(root_path):
dat_files = set()
for (root, dirs, files) in os.walk(root_path, topdown=True):
for file in files:
dat_files.add(root_... | ssikdar1/DeconstructingTheFilterBubble | replication_files/dump_to_dataset.py | dump_to_dataset.py | py | 7,917 | python | en | code | 5 | github-code | 36 | [
{
"api_name": "os.walk",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "scipy.spatial.distance.jaccard",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "csv.DictWriter",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "datetime.dateti... |
35076409139 | #!/bin/env python3.9
import sys
from base45 import b45decode
import zlib
from cbor2 import loads
from cose.messages import Sign1Message
from pyzbar.pyzbar import decode
from PIL import Image
import argparse
# Initialize components
CLI_PARSER = argparse.ArgumentParser()
def unpack_qr(qr_text):
compressed_bytes =... | ryanbnl/eu-dcc-diagnostics | print_payload_qr.py | print_payload_qr.py | py | 1,097 | python | en | code | 9 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "base45.b45decode",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "zlib.decompress",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "cose.message... |
29112759837 | import uuid
from personal_okrs import db
from personal_okrs.data_model.objective import Objective
from personal_okrs.data_model.goal import Goal
# id = db.Column(db.String(255), primary_key=True)
# title = db.Column(db.String(512))
# description = db.Column(db.Text())
# type = db.Column(db.Enum(GoalTyp... | xonev/personal-okrs | personal_okrs/core/objective_repo.py | objective_repo.py | py | 1,304 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "uuid.uuid4",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "uuid.uuid4",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "personal_okrs.data_model.goal.Goal",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "personal_okr... |
39850416701 | import os
import sqlite3
import unittest
from fastapi.testclient import TestClient
from main import app, create_table, increment_count, DB_FILE
class FastAPITest(unittest.TestCase):
def setUp(self):
self.client = TestClient(app)
self.db_file = DB_FILE
create_table()
def tearDown(self... | jevillanueva/fastapi-jenkins | test.py | test.py | py | 1,527 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "unittest.TestCase",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "fastapi.testclient.TestClient",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "main.app",
"line_number": 10,
"usage_type": "argument"
},
{
"api_name": "main... |
2551686389 | #!/usr/bin/env python3
import sys
from ete3 import NCBITaxa
ncbi = NCBITaxa()
def get_desired_ranks(taxid):
desired_ranks = ['phylum', 'genus', 'species']
try:
lineage = ncbi.get_lineage(taxid)
except ValueError:
lineage = []
lineage2ranks = ncbi.get_rank(lineage)
ranks2lineage =... | waglecn/helD_search | scripts/tax_csv.py | tax_csv.py | py | 859 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "ete3.NCBITaxa",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 35,
"usage_type": "attribute"
}
] |
74021404262 | """django_demo URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-b... | Abikwa/django_student_management | django_demo/urls.py | urls.py | py | 1,397 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.urls.path",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "... |
38227695787 | from typing import (
List,
Tuple,
Dict,
Optional,
Callable,
)
import os
import sys
import unittest
from allennlp.data import Vocabulary
from allennlp.modules.text_field_embedders import BasicTextFieldEmbedder
from allennlp.modules import TextFieldEmbedder, TokenEmbedder
from allennlp.data.token_i... | AkshatSh/DPD | tests/weak_supervision/cwr_func_test.py | cwr_func_test.py | py | 3,914 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.exists",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "dpd.constants.GLOVE_DIR",
"line_number": 27,
"usage_type": "argument"
},
{
"api_name": "os.path",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "unittest.Test... |
33706303531 | import torch
import matplotlib.pyplot as plt
from pathlib import Path
import sys
sys.path.append("../")
import diffoptics as do
# initialization
# device = do.init()
device = torch.device('cpu')
# load target lens
lens = do.Lensgroup(device=device)
lens.load_file(Path('./lenses/Thorlabs/ACL5040U.txt'))
print(lens.su... | vccimaging/DiffOptics | examples/spherical_aberration.py | spherical_aberration.py | py | 1,719 | python | en | code | 96 | github-code | 36 | [
{
"api_name": "sys.path.append",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.device",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "diffoptics.Lensgroup",
"... |
25947081758 | # idea: problem is very similar to medium vertical traversal but the one thing
# we have to sort the nested array with row value
# the idea is to add row + val to nested array and sort them
# than loop throught and call sort for every nested array as well and
# add second value from this array to result
from collecti... | dzaytsev91/leetcode-algorithms | hard/987_vertical_order_traversal_of_a_binary_tree.py | 987_vertical_order_traversal_of_a_binary_tree.py | py | 1,160 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "typing.Optional",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "collections.defaultdict",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 20,
"usage_type": "name"
}
] |
40082582688 | # import packages / libraries
import numpy
import torch
# import functions
from metrics import FOSC
class TemplatesHandler():
""" handles target updating and retrieving for the LOTS attack """
def __init__(self, template_size, num_classes, device):
self.templates = {i: [] for i in range(num_class... | michaelhodel/adversarial-training-with-lots | attacking.py | attacking.py | py | 8,200 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.rand",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "torch.stack",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "torch.no_grad",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "torch.max",
"line_number": 4... |
70580470825 | import cv2
import numpy as np
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BOARD)
captura = cv2.VideoCapture(0)
captura.set(cv2.CAP_PROP_FPS,90)
captura.set(cv2.CAP_PROP_FRAME_WIDTH,320)
captura.set(cv2.CAP_PROP_FRAME_HEIGHT,240)
#La resolucion de la camara es 640x480 ------> Tamaño de la ventana openCv
... | jlukas1001/Seguidor-con-camara | seguidor2/seguidorVelocista/programaCamara.py | programaCamara.py | py | 3,765 | python | es | code | 0 | github-code | 36 | [
{
"api_name": "RPi.GPIO.setmode",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "RPi.GPIO",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "RPi.GPIO.BOARD",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "cv2.VideoCapture",
"li... |
70230288424 | import graphene
class CreateAuctionInput(graphene.InputObjectType):
meme = graphene.List(graphene.NonNull(graphene.ID))
initial_price = graphene.Int(required = True)
limit = graphene.Int()
starts_at = graphene.DateTime(required = True)
ends_at = graphene.DateTime(required = True)
class Updat... | Bluefin-Tuna/meme-economy | ME/auction/GQL/inputs/auction.py | auction.py | py | 623 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "graphene.InputObjectType",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "graphene.List",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "graphene.NonNull",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "graphene.ID... |
13989797888 | # this is editorial soln
from collections import deque
from sys import maxint
class Solution(object):
def bfs_search(self, matrix, queue, min_dist):
n, m = len(matrix), len(matrix[0])
while queue:
(x, y), d = queue.popleft()
for i, j in ((x - 1, y), (x + 1, y), (x, y - 1),... | dariomx/topcoder-srm | leetcode/zero-pass/google/01-matrix/Solution15.py | Solution15.py | py | 1,046 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "collections.deque",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sys.maxint",
"line_number": 28,
"usage_type": "name"
}
] |
37974609826 | import numpy as np
import matplotlib.pyplot as plt
import random
def random_angle():
return random.uniform(0, 2*np.pi)
def next_step(x_pos, y_pos):
angle = random_angle()
x_pos += np.cos(angle)
y_pos += np.sin(angle)
return (x_pos, y_pos)
colors = ['black', 'red', 'yellow', 'blue', 'orange', 'pur... | Fadikk367/WFiIS-VPython | LAB07/ZAD1B.py | ZAD1B.py | py | 877 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "random.uniform",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "numpy.cos",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.sin",
"line_number": 1... |
2874693524 | import os
import cv2
import numpy as np
import tensorflow as tf
from tensorflow.keras import backend as K
from tensorflow.keras.applications import VGG19
from tensorflow.keras.layers import MaxPooling2D
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Settings
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... | CarlFredriksson/neural_style_transfer | neural_style_transfer.py | neural_style_transfer.py | py | 7,291 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.array",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 34,
... |
35566548820 | import torch
import json
import numpy as np
import torch.utils.data
class DataSet(torch.utils.data.Dataset):
def __init__(self, data_path: str, metadata_path: str, args):
with open(metadata_path, 'r') as j:
obj = json.load(j)
self.normalize = obj['normalized']
data_t... | kristofers-volkovs/Primed-UNet-LSTM | src/data_sets/data_rollout.py | data_rollout.py | py | 2,473 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.utils",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.memmap",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number":... |
28088792579 | import requests
from bs4 import BeautifulSoup
from .crawler import Crawler
from ..models.page import PageScraperModel
class SeedingCrawler(Crawler):
def __init__(self, base_url):
super().__init__(base_url + 'd/furniture/search/fua?')
self.stack = []
def scrape(self):
html = self.get... | philipk19238/klarity | api/app/scraper/crawlers/seeding_crawler.py | seeding_crawler.py | py | 1,372 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "crawler.Crawler",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "models.page.PageScraperModel",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "models.page.PageScraperModel",
"line_number": 34,
"usage_type": "call"
},
{
"api_name... |
72808863784 | from django.shortcuts import render,redirect
from django.http import JsonResponse
from rest_framework.decorators import api_view,permission_classes
from rest_framework.response import Response
from rest_framework.permissions import IsAuthenticatedOrReadOnly,IsAuthenticated
from .models import Advocate,Company
from .ser... | sakibsarker/REST_framework_Function-based | restwork/views.py | views.py | py | 3,777 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.resp... |
28564597089 | from functools import cache
import matplotlib.pyplot as plt
import numpy as np
from data import NICKEL_REGIMES, load_experiment_data
from experiment_setup import NI_FOIL
from intensity import output_intensity
from materials import Layer, Cell, KAPTON
def get_geometric_factor_ascan(plot=False):
# Limits determi... | ondraskacel/cellExperiments | geometry.py | geometry.py | py | 2,922 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "numpy.load",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_n... |
1434884470 | import json
import sys
from btcc_trade_collector import bttc_trade_collector
from btcc_client import Market
from btcc_log import create_timed_rotating_log
from btcc_log import set_log_name_prefix
with open("./collector_config.json") as config_file:
config = json.load(config_file)
if (len(sys.argv) != 2):
pr... | UnluckyNinja/hwindCode | python/btctrade/run_collector.py | run_collector.py | py | 823 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "json.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 20,
... |
3853633003 | from Logger import Logger
from ConsoleLogger import ConsoleLogger
from HTTPRequest import HTTPRequest
from HTTPProxyRequest import HTTPProxyRequest
from ProxyManager import ProxyManager
import multiprocessing
import multiprocessing.managers
import json
import re
regex_email = '([A-Z0-9%+\-\._]+@[A-Z0-9\.\-_]+\.[A-Z0-9... | dsypniewski/allegro-profile-crawler | main.py | main.py | py | 8,550 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "ProxyManager.ProxyManager.proxy_alert_count",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "ProxyManager.ProxyManager",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "HTTPProxyRequest.HTTPProxyRequest.headers",
"line_number": 23,
... |
70669125543 | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
# WDQ7005 - Data Mining
# Master of Data Science | University of Malaya
# Assignment Part A: Web Crawling of Real-time Data
# Group Members:
# Azwa Kamaruddin (WQD170089)
# Kok Hon Loong (WQD170086)
# In[1]:
import requests
import pandas as pd
import numpy as np
im... | hlkok/WQD7005DataMining-Assignments | Assignment-a-Web-Crawler_Final.py | Assignment-a-Web-Crawler_Final.py | py | 11,487 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "matplotlib.pyplot.style.use",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 23,
"usage_type": "name"
},
{
"api_na... |
35631463735 | from django.shortcuts import render
import requests
API_KEY = '09cdaa56db4d4a6cb93bf1bedde04bd7'
def home(request):
url = f'https://newsapi.org/v2/top-headlines?country=gb&apikey={API_KEY}'
response = requests.get(url)
data = response.json()
articles = data['articles']
context = {
... | CassandraTalbot32/News-API | api/newsapp/views.py | views.py | py | 399 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 21,
"usage_type": "call"
}
] |
30800479288 | import time, datetime
from decoder import Decoder, InvalidGearException
import os, yaml, shutil, json
from gear import Gear, Substat
import unidecode
from PIL import Image
def show_img(path):
img = Image.open(path)
img.show()
de... | FrenchieTucker/RPGgearDetection | main_correcter.py | main_correcter.py | py | 4,475 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "PIL.Image.open",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
... |
41761215227 | # coding:utf-8
from __future__ import unicode_literals
from django import forms
from .models import Student
class StudentForm(forms.ModelForm):
def clean_qq(self):
cleaned_data = self.cleaned_data['qq']
if not cleaned_data.isdigit():
raise forms.ValidationError('必须是数字!')
ret... | the5fire/django-practice-book | code/student_house/student_sys/student/forms.py | forms.py | py | 500 | python | en | code | 293 | github-code | 36 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.forms.ValidationError",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "d... |
27757909127 | # -*- coding: utf-8 -*-
import scrapy
'''以JSON格式导出爬取内容'''
class QuetosExtractSpider(scrapy.Spider):
name = 'quetos_extract'
def start_requests(self):
urls = [
'http://quotes.toscrape.com/page/1/',
'http://quotes.toscrape.com/page/2/',
]
for url in urls:
... | IceDerce/python-spider-practice | spider/scrapy_practice/scrapy_practice/spiders/quotes_extract.py | quotes_extract.py | py | 997 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "scrapy.Spider",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "scrapy.Request",
"line_number": 15,
"usage_type": "call"
}
] |
25077224694 | from collections import OrderedDict
import ctypes
import os
import random
import re
import sys
import pandas as pd
from psychopy import core, event, visual
import experiment as ex
from settings import get_settings
settings = get_settings(env="production", test=False)
par = None
experiment_timer = None
class Paradi... | julianstephens/FH-WordOA-PostTest | stimulus.py | stimulus.py | py | 14,113 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "settings.get_settings",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "psychopy.visual.Window",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "psychopy.visual",
"line_number": 48,
"usage_type": "name"
},
{
"api_name": "psychopy... |
4778234359 | import os
import re
import glob
import datetime
from prettytable import PrettyTable
from matplotlib import pyplot as plt
NUM_MOST_RECENT_RUNS = 100
te_path = os.getenv("TE_PATH", "/opt/transformerengine")
mlm_log_dir = os.path.join(te_path, "ci_logs")
te_ci_log_dir = "/data/transformer_engine_ci_logs"
te_ci_plot_dir... | NVIDIA/TransformerEngine | tests/pytorch/distributed/print_logs.py | print_logs.py | py | 4,204 | python | en | code | 1,056 | github-code | 36 | [
{
"api_name": "os.getenv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number":... |
25947079068 | from typing import List
class Solution:
def trap(self, height: List[int]) -> int:
if len(height) <= 2:
return 0
result = 0
left_max = height[0]
right_max = height[-1]
left = 1
right = len(height) - 1
while left <= right:
if height... | dzaytsev91/leetcode-algorithms | hard/42_trapping_rain_water.py | 42_trapping_rain_water.py | py | 699 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
}
] |
72809308264 | from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union
import attr
from ..models.extension_value_type import ExtensionValueType
from ..types import UNSET, Unset
if TYPE_CHECKING:
from ..models.reference import Reference
T = TypeVar("T", bound="Extension")
@attr.s(auto_attribs=True)
class Ext... | sdm4fzi/aas2openapi | ba-syx-submodel-repository-client/ba_syx_submodel_repository_client/models/extension.py | extension.py | py | 5,047 | python | en | code | 7 | github-code | 36 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "typing.TypeVar",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "typing.Union",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "types.Unset",
"li... |
73980074024 | from random import choice, sample
from datetime import timedelta, date
cooking = []
washing = []
print("#+title: Rota")
print("#+options: h:2 num:nil toc:t")
print("\n")
def create_rota(d):
for i in range(0, 7):
avail_cook = ["Noam", "Laura", "Louis", "David", "Nat", "Störm"]
if(i==0):
... | locua/rota-generator | generate_rota.py | generate_rota.py | py | 1,500 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "random.sample",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "random.sample",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "random.sample",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"l... |
27036133703 | import json
import threading
import time
import webbrowser
from multiprocessing import Process, Pipe
from tkinter import *
from tkinter import ttk
from tkinter.messagebox import *
from tkinter.ttk import Treeview
from PIL import Image, ImageTk
import course_do
import encrypt
import getCourse
import login
import setting... | ANDYWANGTIANTIAN/SZU_AutoCourseSelecter | gui.py | gui.py | py | 32,494 | python | en | code | 13 | github-code | 36 | [
{
"api_name": "getCourse.recommended_course",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "getCourse.in_course",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "getCourse.out_course",
"line_number": 37,
"usage_type": "attribute"
},
{
... |
2808406541 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
__version__ = "0.5.4"
__author__ = "Abien Fred Agarap"
from dataset.normalize_data import list_files
import matplotlib.pyplot as plt
import numpy as np
from sklearn.metrics import confusion_matrix
import tenso... | AFAgarap/gru-svm | utils/data.py | data.py | py | 3,939 | python | en | code | 136 | github-code | 36 | [
{
"api_name": "numpy.load",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "dataset.normalize_data",
"line_number": 49,
"usage_type": "argument"
},
{
"api_name": "numpy.float32",
"line_number": 53,
"usage_type": "attribute"
},
{
"api_name": "numpy.delete... |
74258842345 | import os
import json
import pandas as pd
import shutil
from PIL import Image
import matplotlib.pyplot as plt
import os
import cv2
import numpy as np
def rotate_bound(image, angle):
# 获取图像的尺寸
# 旋转中心
(h, w) = image.shape[:2]
(cx, cy) = (w / 2, h / 2)
# 设置旋转矩阵
M = cv2.getRotationMatrix2D((cx, c... | Dantong88/Medical-Partial-Body-Pose-Estimation | ViTPose/demo/process_coco.py | process_coco.py | py | 3,724 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "cv2.getRotationMatrix2D",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.abs",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.abs",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "cv2.warpAffine",
"lin... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.