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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
19488329471 | from rest_framework import serializers
from .models import Order, Product, Customer
class OrderListSerializers(serializers.ModelSerializer):
unique_identifier_for_order = serializers.CharField(max_length=8, read_only=True)
customer = serializers.StringRelatedField()
product = serializers.StringRelatedFie... | chanmyay/challenge | web_portal/serializers.py | serializers.py | py | 1,008 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.CharField",
"line_number": 7,
"usage_... |
30529133196 | print("Hello world")
from flask import Flask
from flask import render_template
from flask_wtf import FlaskForm, RecaptchaField
from wtforms import StringField, SubmitField, TextAreaField
from wtforms.validators import DataRequired
from flask_wtf.file import FileField, FileAllowed, FileRequired
from flask_bootstrap impo... | Mayumayumau/WebDev-Lab1-practice- | flaskapp/some_app.py | some_app.py | py | 2,301 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "flask_bootstrap.Bootstrap",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "flask_wtf... |
22504185229 | """Base class for ironmarch datasets.
Implements the basics of the functional API for ironmarch datasets and
dataset-like objects. (For example DatasetView)
"""
from typing import Any, Callable, Sequence, Tuple, List, Union
import os
import random
from torch.utils.data import Dataset
import torch
import hatespace.da... | HesitantlyHuman/hatespace | hatespace/datasets/base/functional.py | functional.py | py | 13,556 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "hatespace.datasets.base.dataset.DatasetView",
"line_number": 64,
"usage_type": "call"
},
{
... |
3636259004 | import socket
import time
import datetime
import uuid
website = 'www.example.com'
#proxy server and port
proxy_port = 8901
proxy_host = str(socket.gethostbyname(socket.gethostname()))
#socket the client will use to communicate with the proxy server
client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
cl... | telsaabii/eece350-project1 | CLIENT.py | CLIENT.py | py | 1,059 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "socket.gethostbyname",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "socket.gethostname",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "socket.socket",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
... |
10374472375 | import sys
from collections import deque
input = sys.stdin.readline
dy = [-1, 1, 0, 0]
dx = [0, 0, -1, 1]
board = [[0 for _ in range(501)] for _ in range(501)]
life = [[int(2e9) for _ in range(501)] for _ in range(501)]
n = int(input())
for _ in range(n):
x1, y1, x2, y2 = map(int, input().split())
... | yejin7211/Algorithm | 백준/Gold/1584. 게임/게임.py | 게임.py | py | 1,372 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.stdin",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 30,
"usage_type": "call"
}
] |
18403794109 | from itertools import accumulate,permutations; from math import floor,ceil,sqrt; import operator; import random; import string; from bisect import *; from collections import deque, defaultdict, Counter, OrderedDict; from functools import reduce, cache, cmp_to_key; from heapq import heappop,heappush,heapify; import unit... | afzalsiddique/problem-solving | Problem_Solving_Python/leetcode/lc1223.py | lc1223.py | py | 2,658 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "typing.List",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "functools.cache",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "functools.cache",
"line_num... |
73441985332 | import requests, json
from neo4j_interfacer import Constructor
from env_variables import EnvVariables
class ApiDataExtractor:
"""
Get the data out from Sidebrain's backed via an API and use it to construct the graph.
Functions:
- Init
environment variables, object of constructor cla... | anudeep22003/simple-langauge-pipeline | src/interfacers/sb_backend_interfacer.py | sb_backend_interfacer.py | py | 2,491 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "env_variables.EnvVariables.base_url",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "env_variables.EnvVariables",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "env_variables.EnvVariables.payload",
"line_number": 29,
"usage_type":... |
36099168241 | import dearpygui.dearpygui as dpg
from Editor.gui.error_windows import Error_Window
from Editor.add_obj import *
from Editor.project import *
class Object(Error_Window, Add_obj):
def add_to_OnClickFile(self):
f = open(on_clickFile, 'r').read()
y = json.loads(f)
pos_l, pos_r = 300, 0
... | EngineX3D/EngineX | Editor/gui/vs/vs.py | vs.py | py | 4,859 | python | en | code | 5 | github-code | 21 | [
{
"api_name": "Editor.gui.error_windows.Error_Window",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "dearpygui.dearpygui.get_value",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "dearpygui.dearpygui",
"line_number": 13,
"usage_type": "name"
},
{... |
42743511197 | #!/usr/bin/env python
import sys
import click
from gym_tictactoe.env import TicTacToeEnv, agent_by_mark, next_mark
class HumanAgent(object):
def __init__(self, mark):
self.mark = mark
def act(self, ava_actions):
while True:
uloc = input("Enter location[1-9], q for quit: ")
... | haje01/gym-tictactoe | examples/human_agent.py | human_agent.py | py | 1,704 | python | en | code | 66 | github-code | 21 | [
{
"api_name": "gym_tictactoe.env.TicTacToeEnv",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "gym_tictactoe.env.agent_by_mark",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "gym_tictactoe.env.next_mark",
"line_number": 44,
"usage_type": "call"
},... |
25084414571 | # -*- coding: utf-8 -*-
import xml.etree.ElementTree as ET
from lxml import etree
import pandas as pd
import re
import sys
import nltk
import random
import os.path
from collections import defaultdict, Counter
#import magic
import tarfile
import peep_tar as peep
from langdetect import detect
from langdetect.lang_detect_... | lab156/arxivDownload | parsing_xml.py | parsing_xml.py | py | 23,637 | python | en | code | 7 | github-code | 21 | [
{
"api_name": "pdb.set_trace",
"line_number": 101,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 103,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 130,
"usage_type": "call"
},
{
"api_name": "enum.Flag",
"line_number": 141,
... |
17718852856 | import math
import sys
import time
import numpy as np
import torch
from torch.utils.data import DataLoader
from torchvision import datasets, transforms
TOTAL_BAR_LENGTH = 80
LAST_T = time.time()
BEGIN_T = LAST_T
def linearHingeLoss(output, target):
bin_target = output.new_empty(*output.size()).fill_(-1)
for... | sonLe-Thanh/PHDimExperiments | utils.py | utils.py | py | 3,596 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "time.time",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.cat",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "torch.no_grad",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "torch.device",
"line_number": 4... |
17935475954 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2022-07-26 5:02 PM
# @Author : myloe
# @File : tests.py
import json
import time
from kafka import KafkaProducer
server = "192.168.0.201"
port = 9092
version = "2.8.1"
print(tuple([int(i) for i in version.split(".")]))
print(f"{server}:{port}")
producer = K... | myloe00/django_myloe | kafka_command/tests.py | tests.py | py | 558 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "kafka.KafkaProducer",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 18,
"usage_type": "call"
}
] |
5577946734 | import re
import os
import argparse
from string import punctuation
import yaml
import json
import mindspore.context as context
import numpy as np
from g2p_en import G2p
from pypinyin import pinyin, Style
from fastspeech2_ms.utils.tools import synth_samples
from fastspeech2_ms.text import text_to_sequence
from mindspor... | mindspore-ai/zidongtaichu | src/tools/synthesize.py | synthesize.py | py | 8,396 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "mindspore.context.set_context",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "mindspore.context",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "mindspore.context.PYNATIVE_MODE",
"line_number": 19,
"usage_type": "attribute"
},
{
... |
21268544490 | """Модуль для инициализации подключения к БД."""
from sqlalchemy.ext.asyncio import AsyncSession, create_async_engine
from sqlalchemy.orm import sessionmaker
from app.config import settings
engine = create_async_engine(
settings.DATABASE_URL,
echo=True,
)
async_session = sessionmaker(
engine, class_=Asyn... | dafun34/nanosemantika_test | app/db.py | db.py | py | 391 | python | ru | code | 0 | github-code | 21 | [
{
"api_name": "sqlalchemy.ext.asyncio.create_async_engine",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "app.config.settings.DATABASE_URL",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "app.config.settings",
"line_number": 8,
"usage_type": "nam... |
32801220092 | from typing import Tuple, Sequence, List
BrailleArray=Tuple[
Tuple[int, int],
Tuple[int, int],
Tuple[int, int]
]
def _render_single(braille: BrailleArray) -> str:
"""
Convert a 2x3 braille array into an actual braille character
"""
code=0
for i in range(6):
code+=braille[i % 3... | dosisod/zen | zen/render.py | render.py | py | 1,173 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "typing.Tuple",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number":... |
7840153348 | import numpy as np
import cv2 as cv
def divider(img):
size = 128 #set the dimentions for your model like (128,128,3)
h, w, c = img.shape
pad_h = size - (h % size)
pad_w = size - (w % size)
img = cv.copyMakeBorder(img, 0, pad_h, 0, pad_w, cv.BORDER_CONSTANT, value=0)
parts = np.split(im... | Martico09/image-divider-and-recombiner-for-deeplearning-models | Image Divider and Recombiner.py | Image Divider and Recombiner.py | py | 1,122 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "cv2.copyMakeBorder",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.BORDER_CONSTANT",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "numpy.split",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.split",
... |
31844088674 | from functools import cmp_to_key
lines = [eval(line.strip())
for line in open(input()).readlines() if line.strip() != ""] + [[[2]], [[6]]]
def check(l, r):
if type(l) == int and type(r) == int:
if l < r:
return 1
elif l == r:
return 0
else:
... | HectorxH/advent-of-code | 2022/Day13/main2.py | main2.py | py | 905 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "functools.cmp_to_key",
"line_number": 33,
"usage_type": "call"
}
] |
16514725379 | # ---------------------------------------------------------------------------------
# Name: VirusTotal
# Description: Checks files for viruses using VirusTotal
# Author: @hikka_mods
# ---------------------------------------------------------------------------------
# 🔒 Licensed under the GNU AGPLv3
# 🌐 https://ww... | CodWize/ReModules | VirusTotal.py | VirusTotal.py | py | 5,369 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "hikkatl.types.Message",
"line_number": 59,
"usage_type": "name"
},
{
"api_name": "os.listdir",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_num... |
14312360597 | """
Author : Akshay Joshi
GitHub : https://github.com/ijoshi90
Created on 31-12-2019 at 14:53
"""
from selenium import webdriver
import time
from selenium.webdriver.common.keys import Keys
driver = webdriver.Firefox()
driver.get("https://www.linkedin.com/in/ijoshi90/")
time.sleep(10)
driver.get("https://www.google.co... | ijoshi90/Python | Python/selenium_basic_example.py | selenium_basic_example.py | py | 557 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "selenium.webdriver.Firefox",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "time.sleep",... |
42904973153 | # -*- coding: utf-8 -*-
import vtk #to trzeba doinstalowac, "pip install vtk"
import sys
import os
import math
from stl_render_fun import *
from PIL import Image
#import vtkOSPRayPass
cfolder = "E:/GIT/DOKTORAT/STL_ORIENT2" #folder z plikami stl
cfolder = "/home/maciejm/GIT/DOKTORAT/STL_ORIENT2/"
ifolder1 = ... | maciu665/stepy | stl_render_series_list.py | stl_render_series_list.py | py | 8,141 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.listdir",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "vtk.vtkWindowToImageFilter",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "vtk.vtkPNGWriter",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "sys.exit",
... |
12763488274 | import datetime
import sounddevice as sd
import soundfile as sf
filename = 'alarm_sound.wav'
data, sample_rate = sf.read(filename, dtype='float32')
def main():
valid_user_input = False
print('Please set an alarm time.')
while not valid_user_input:
time = input('(HH:MM): ')
try:
... | michael-je/Simple-Alarm | alarm_v1.py | alarm_v1.py | py | 1,167 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "soundfile.read",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "datetime.time",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "sounddevice.sleep",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",... |
26158340410 | from functools import partial
import gym
import textworld
import textworld.gym
from textworld import EnvInfos
from textworld.utils import make_temp_directory
from textworld.envs import JerichoEnv
from textworld.envs.batch.batch_env import AsyncBatchEnv, SyncBatchEnv
def test_batch_env():
batch_size = 4
max_... | microsoft/TextWorld | textworld/envs/batch/tests/test_batch_env.py | test_batch_env.py | py | 2,195 | python | en | code | 1,102 | github-code | 21 | [
{
"api_name": "textworld.utils.make_temp_directory",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "textworld.GameOptions",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "textworld.make",
"line_number": 21,
"usage_type": "call"
},
{
"api_name... |
22773871183 | from django.contrib.auth.models import Group, User
from profiles.models.team import Team
from tests.test_service_catalog.base import BaseTest
class TestGroupBase(BaseTest):
def setUp(self):
super(TestGroupBase, self).setUp()
self.my_group = Group.objects.create(name='test_group')
self.my... | EliasBoulharts/squest | tests/test_profile/test_group/test_group_base.py | test_group_base.py | py | 1,180 | python | en | code | null | github-code | 21 | [
{
"api_name": "tests.test_service_catalog.base.BaseTest",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.models.Group.objects.create",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.models.Group.objects",
"line_numb... |
30587433479 | from __future__ import print_function
import json
import requests
import urllib3
class CheckpointApi(object):
def __init__(self, checkpoint, username, password):
self.checkpoint = checkpoint
self.username = username
self.password = password
self.session = None
def get_session... | StackStorm-Exchange/stackstorm-checkpoint | actions/lib/checkpoint.py | checkpoint.py | py | 9,767 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "json.loads",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 153,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 162,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number":... |
70864333492 | from __future__ import absolute_import, division, print_function, unicode_literals
import tensorflow as tf
from keras.models import Sequential
from keras.layers import Dense, Conv2D, Flatten, Dropout, MaxPooling2D
from keras.preprocessing.image import ImageDataGenerator
import os
import numpy as np
import matplotlib.p... | albae3333/design_cps | app/test/tensorflow/tensorflow_test.py | tensorflow_test.py | py | 3,184 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.listdir",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 25,
... |
38181413765 | import sys
import logging
def setup_custom_logger(name):
formatter = logging.Formatter(fmt='%(asctime)s %(levelname)-8s %(message)s', datefmt='%Y-%m-%d %H:%M:%S')
handler = logging.FileHandler('../benchmark.log', mode='w')
handler.setFormatter(formatter)
screen_handler = logging.StreamHandler(stream=s... | IntelLabs/Auto-Steer | utils/custom_logging.py | custom_logging.py | py | 611 | python | en | code | 14 | github-code | 21 | [
{
"api_name": "logging.Formatter",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "logging.FileHandler",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "logging.StreamHandler",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.stdout",... |
40594472975 | # Implement basic gray level transformation for the Linear
import cv2
import numpy as np
img = cv2.imread('resources/gray.jpg')
out = 2.0 * img
out[out > 255] = 255
out = np.around(out)
out = out.astype(np.uint8)
cv2.imshow("Original Image", img)
cv2.imshow("Linear transformed", out)
cv2.waitKey(0)
cv2.destroyAllWi... | dwaipayanbiswas2017/Digital_Image_Processing | Assignment_3/Q1_linear.py | Q1_linear.py | py | 327 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "cv2.imread",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.around",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "cv2.imshow",
"line_number"... |
72880819574 | import boto3
import pandas as pd
import awswrangler as wr
def get_bucket_inventory(bucket: str, profile="default") -> list[str]:
"""Extract the list of files from a s3 bucket.
Args:
bucket (str): The name of the bucket for which we extracts the objects inventory.
profile (str, optional): The ... | gbto/terraform-aws | lambda-functions/s3-event-notifications-python-lambda/scripts/create-batch-operations-job-manifest.py | create-batch-operations-job-manifest.py | py | 3,707 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "boto3.setup_default_session",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "awswrangler.s3.list_objects",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "awswrangler.s3",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_n... |
27694421958 | import sqlite3
from datetime import datetime, timedelta
from therm.model.thermometer import Thermometer
class DB:
def __init__(self, dbName):
self._connection = sqlite3.connect(dbName)
self._initialize()
def _initialize(self):
# make sure all tables exist
cursor = self._connec... | yvonguy/pi_thermostat | therm/database/db.py | db.py | py | 6,865 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sqlite3.connect",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 118,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 118,
"usage_type": "name"
},
{
"api_name": "therm.m... |
37933086502 | # -*- coding: utf-8 -*-
"""
Created on Wed Jul 27 16:28:09 2016
@author: tomasz, Bartosz, Romain
"""
from __future__ import print_function
import numpy as np
import numba
from scipy import stats
import math
import pylab as plt
#from PoissonPointProcess import SNCP_corr, corr_poisson, CCVF
def generate_poisson_old... | ModelDBRepository/244700 | inputs.py | inputs.py | py | 6,505 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "numpy.cumsum",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "scipy.stats.expon.rvs",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "scipy.stats.expon",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "scipy.stats... |
32348097746 | from typing import List
TEST_CASES = [
{
"input": {
"heights": [2,1,5,6,2,3]
},
"result": 10
},
{
"input": {
"heights": [2,4]
},
"result": 4
}
]
class Solution:
def largestRectangleArea(self, heights: List[int]) -> int:
... | jsparadacelis/exercising | stack/largest_rectangule_area.py | largest_rectangule_area.py | py | 1,190 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "typing.List",
"line_number": 19,
"usage_type": "name"
}
] |
11613241406 | import requests
from settings import GOOGLE_MAPS_API_KEY
GOOGLE_MAPS_GEOCODING_URL = 'https://maps.googleapis.com/maps/api/geocode/json'
async def quality_google(quality):
if quality == 'ROOFTOP':
quality_spanish = "Ubicación exacta"
elif quality in ('RANGE_INTERPOLATED', 'GEOMETRIC_CENTER', 'APPROX... | Eduardoscar/Geolocation | src/controllerGeolocationAutomatic.py | controllerGeolocationAutomatic.py | py | 2,220 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "settings.GOOGLE_MAPS_API_KEY",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_number": 29,
"usage_type": "call"
}
] |
4500243964 | import kivy
#for run app and software
kivy.require('1.9.0')
from kivy.app import App
from kivy.uix.label import Label
#simple libel with kivy python3
class Simple_app(App):
def build(self):
# title, icon of app
self.icon = 'lable.PNG'
self.title= 'Label'
#simple label
... | madocoin/kivypython3 | lable.py | lable.py | py | 474 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "kivy.require",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "kivy.app.App",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "kivy.uix.label.Label",
"line_number": 13,
"usage_type": "call"
}
] |
26302198915 | from django.contrib import messages
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.models import User
from . import models
from rest_framework import generics
from rest_framework import mixins
from rest_framework.response import Response
from rest_framework import status
from rest_... | moataz-bellah/electronic_shop | OnlinShop/shop/views.py | views.py | py | 16,958 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "shop.forms.SignupForm",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.authenticate",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.login",
"line_number": 51,
"usage_type": "call"
},
{
"... |
10948367737 | from glob import glob
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
from descartes import PolygonPatch
import json
from scipy.interpolate import RegularGridInterpolator
from matplotlib import gridspec
from shapely.geometry import Polygon
from shapely.ops im... | galselo/gw_mini | map.py | map.py | py | 4,721 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "json.load",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 62,
... |
16250164054 | from .utils import TestCase
from currencyexchange import create_app
class AuthViewTest(TestCase):
def test_home_page(self):
"""
GIVEN a Flask application configured for testing
WHEN the '/' page is requested (GET)
THEN check that the response is valid
"""
flask_app ... | jerryshikanga/currency-exchange | currencyexchange/tests/test_views.py | test_views.py | py | 807 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "utils.TestCase",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "currencyexchange.create_app",
"line_number": 12,
"usage_type": "call"
}
] |
32348089676 | from typing import List
class Solution:
def will_collide(self):
pass
def carFleet(self, target: int, position: List[int], speed: List[int]) -> int:
# sorting cars by their position
cars_data = zip(position, speed)
sorted_data = list(sorted(cars_data, key=lambda car: car[0]))... | jsparadacelis/exercising | stack/car_fleet/v2.py | v2.py | py | 1,137 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "typing.List",
"line_number": 9,
"usage_type": "name"
}
] |
2965531807 | import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
import requests
from io import BytesIO
def preset_10lamb_rgb():
i_w_0 = 137
i_w_1 = 143
i_h_0 = 47
i_h_1 = 51
return i_w_0, i_w_1, i_h_0, i_h_1
def preset_10lamb_ir():
i_w_0 = 137
i_w_1 = 143
i_h... | infelane/lamb-segmentation | data/webscraping.py | webscraping.py | py | 5,550 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "numpy.arange",
"line_number": 132,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 133,
"usage_type": "call"
},
{
"api_name": "numpy.pad",
"line_number": 185,
"usage_type": "call"
},
{
"api_name": "numpy.cumsum",
"line_numbe... |
6280257318 | import matplotlib
import numpy as np
from utils.common_utils import load_pkl, save_pkl, is_digit, file_exsit, dir_exsit
import matplotlib.pyplot as plt
import networkx as nx
from itertools import islice
import pathlib
from collections import Counter
from typing import List, Tuple, Dict
import cplex
from utils.common_u... | Erde-Sonne/Simulation | routing/ksp/ilp2.py | ilp2.py | py | 11,123 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "matplotlib.use",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "path_utils.get_prj_root",
... |
21626451678 | import matplotlib.pyplot as plt
from numpy.lib.arraysetops import unique
import seaborn as sns
import numpy as np
from seaborn.utils import relative_luminance
def predict1v1(X, unique_classes, clf_dict):
pred_labels = []
for x in X:
x = x.reshape(1, -1)
votes = [0]*len(unique_classes)
... | amw-18/ML-Implementations | Neural Networks, SVMs/utils.py | utils.py | py | 6,363 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.array",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "seaborn.heatmap",
"line_numbe... |
14285374519 | #!/usr/bin/env python3
from sys import argv
from subprocess import run
from os import unlink, rmdir, listdir
from os.path import isfile, join, islink, isdir
from shutil import rmtree
run(('pip', 'install', '--upgrade', 'gitpython'))
from git import Repo, InvalidGitRepositoryError
def recursive_tree_delete(node):
... | Wicloz/Reversible | scripts/remove-managed-repo.py | remove-managed-repo.py | py | 1,322 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "subprocess.run",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.rmdir",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path.islink",
"line_number":... |
2105331670 | import os.path
from typing import List
import numpy as np
from munch import Munch
import itertools
from nltk.translate.bleu_score import sentence_bleu
from sentence_transformers import SentenceTransformer, util
import scipy
from datasets import load_dataset
from tqdm import tqdm
import jsonlines
import statistics
imp... | UKPLab/CATfOOD | src/cf_generation/analysis/diversity.py | diversity.py | py | 11,645 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "random.seed",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datasets.load_dataset",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_n... |
18597108350 | import numpy as np
from reinforcement_learning.time_sensitive_envs.base_time_sensitive_env import BaseTimeSensitiveEnv
import gym
class AcrobotTSEnv(BaseTimeSensitiveEnv):
def __init__(self, max_episode_steps: int = 250, sparse: bool = True, time_sensitive: bool = True):
super().__init__(max_episode_step... | twobackfromtheend/quRL | reinforcement_learning/time_sensitive_envs/acrobot_env.py | acrobot_env.py | py | 1,297 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "reinforcement_learning.time_sensitive_envs.base_time_sensitive_env.BaseTimeSensitiveEnv",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "gym.envs.register",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "gym.envs",
"line_number": 10,
"u... |
73552909171 | from nose.plugins.skip import SkipTest
from nose.tools import nottest
# from .test_fos_apps import OUTDIR, INDIR
import os.path
from marcds.importer import djvu
from utils import INFILES, INDIR
class TestDJVU:
def setUp(self):
self.context = djvu.Context()
self.path = INFILES[0]
@nottest
... | eugeneai/marcds | tests/tests.py | tests.py | py | 1,109 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "marcds.importer.djvu.Context",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "marcds.importer.djvu",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "utils.INFILES",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "nose.... |
13198052309 | import dataclasses
import importlib
import logging
import pkgutil
from distutils.version import LooseVersion
from types import ModuleType
from typing import Callable, List, Optional
from qkan.database.dbfunc import DBConnection
logger = logging.getLogger("QKan.database.migrations")
@dataclasses.dataclass(init=True)... | hoettges/QKan | qkan/database/migrations/__init__.py | __init__.py | py | 2,784 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "distutils.version.LooseVersion",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "typing.Callable",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "qkan... |
73535194293 | from rest_framework import serializers
from url_shortener.models import URL, URL_MAX_SHORT_ID_LEN
class URLSerializer(serializers.ModelSerializer):
class Meta:
model = URL
fields = ('short_id', 'url', 'added_date')
read_only_fields = ('added_date',)
extra_kwargs = {
'sho... | kinghrothgar/lurl | url_shortener/serializers.py | serializers.py | py | 360 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "url_shortener.models.URL",
"line_number": 6,
"usage_type": "name... |
71570978614 | #!/usr/bin/env python3
#
# ** License **
#
# Helper for logging module to be able to use colors
#
# Home: http://resin.io
#
# Author: Andrei Gherzan <andrei@resin.io>
#
import logging
# Color codes
WHITE = 37
RED = 31
GREEN = 32
YELLOW = 33
# Sequences
RESET_SEQ = "\033[0m"
COLOR_SEQ = "\033[0;%dm"
BOLD_SEQ = "\03... | balena-os/balenahup | app/modules/colorlogging.py | colorlogging.py | py | 1,252 | python | en | code | 33 | github-code | 21 | [
{
"api_name": "logging.Formatter",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "logging.Formatter.__init__",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "logging.Formatter",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name... |
39813076484 | import os
import argparse
import numpy as np
import paddle
import yaml
from paddle.io import DataLoader
from paddle.static import load_program_state
from src.postprocess import plot_cae_transformer_prediction
from src.dataset import create_transformer_dataset
from src.dataset import create_cae_dataset
from src.model_c... | CSYYYYXX/kh1 | cae_transformer_prediction.py | cae_transformer_prediction.py | py | 5,042 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.random.seed",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "paddle.seed",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "yaml.safe_load",
... |
11288343383 | from django.shortcuts import render, redirect
from .forms import *
from .models import *
from django.contrib.auth.decorators import login_required
from django.shortcuts import Http404, HttpResponseRedirect, reverse
from django1 import settings
from django.contrib.auth.views import login as auth_login
from django.contri... | WeGotOnTheRun/BookApp | users/views.py | views.py | py | 5,376 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.contrib.auth.authenticate",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.login",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 31,
"usage_type": "call"
},
{
... |
31270265946 | import os
import sys
import numpy as np
import numpy.random as nr
import h5py
import open3d
import argparse
import shutil
from shutil import copyfile
from pathlib import Path
from pcd_aligning import pcd_aligning
from init_filelist import init_filelist
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
BASE_DIR = ... | jerryzsj/data_prep | data_arrangement.py | data_arrangement.py | py | 2,469 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.path.dirname",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"l... |
12051275715 | from django import forms
from django.core.exceptions import ValidationError
from .models import Product
class ProductForm(forms.ModelForm):
title = forms.CharField(label='', widget=forms.TimeInput(attrs={"placeholder": "You title"}))
# email = forms.EmailField()
description = forms.CharField(
... | Kingsley872/Django_learning | products/forms.py | forms.py | py | 1,672 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.forms.CharField",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.f... |
27739543933 | import requests
import pandas as pd
from bs4 import BeautifulSoup
# Mata Pelajaran TIK | ANALISIS DATA
# X TKJ 1
# SMK RADEN PAKU
# 2022
th = "https://www.jobs.id/lowongan-kerja?kata-kunci=part time"
halaman = requests.get(th)
hasil = BeautifulSoup(halaman.content, 'html.parser')
lowkers = hasil.find_all(class_="sin... | Dhikaweb7/TIK-ANALISIS-DATA | analisis-data.py | analisis-data.py | py | 958 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "plotly.express.bar",
... |
24664814836 |
import os
import random
import time
import math
import json
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.utils.data.dataset import Dataset # For custom datasets
from optparse import OptionParser
from ad_util import weights_init
from ... | darkgs/AdressaRecommend | src/sequence_difference.py | sequence_difference.py | py | 13,394 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "optparse.OptionParser",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"li... |
20907904345 | import sys
from collections import deque
n = int(input())
m = int(input())
ind = [0]* (n+1)
blue_print = [([0]*n) for _ in range(n+1)]
total = [([0]*n) for _ in range(n+1)]
parent_child = [[]for _ in range(n+1)]
for _ in range(m):
goal, parts, num = map(int,sys.stdin.readline().split())
ind[goal] +=1
blu... | Suyeon-B/week03_team | dd0114/21_2637_장난감조립.py | 21_2637_장난감조립.py | py | 1,038 | python | ko | code | 1 | github-code | 21 | [
{
"api_name": "sys.stdin.readline",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "collections.deque... |
19287582761 | from tkinter import filedialog
from tkinter import *
from tkinter.ttk import *
from random import shuffle
import glob
from pygame import mixer
from tinytag import *
from threading import Thread
import time
_BASE_DIR = 'c:/temp/mp3'
class MP3Frame(Frame) :
def __init__(self,master,base_dir=_BASE_DIR):
Frame.... | hongjunhyeok/python_mp3 | GUI - mp3.py | GUI - mp3.py | py | 10,100 | python | ko | code | 0 | github-code | 21 | [
{
"api_name": "pygame.mixer.init",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "pygame.mixer",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "pygame.mixer.music.get_pos",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "pygame.mixe... |
31927849894 | import itertools
preambleList, validNums, numbers = [], [], []
with open("input.txt", "r") as infile:
for line in infile:
part = line.rstrip()
numbers.append(int(part))
PREAMBLE = 25
count = 0
for c in range(PREAMBLE):
preambleList.append(numbers[c])
for c in range(PREAMBLE, le... | kyle-98/AdventOfCode | 2020/day_9/day9_part1.py | day9_part1.py | py | 701 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "itertools.combinations",
"line_number": 16,
"usage_type": "call"
}
] |
71577448372 | import numpy as np
from operator import mul
import sparse_pauli as sp
from sys import version_info
if version_info.major == 3:
from functools import reduce
product = lambda itrbl: reduce(mul, itrbl)
TOL = 10.**-14
class PauliErrorModel(object):
"""
Small, dense Pauli Error Model.
Wraps an array an... | bcriger/sc_decoding | error_model.py | error_model.py | py | 6,931 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "sys.version_info.major",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "sys.version_info",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "functools.reduce",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "operator.m... |
21846305552 | # catalog.py
# By: BentoBot02
# karuta catalog catalog command
import discord
import os
from discord.ext import commands
import aiorwlock
import time
import asyncio
from copy import deepcopy
import globalValues
async def catalog(ctx):
catalogList = deepcopy(globalValues.catalog.getViewableCatalo... | BentoBot02/Karuta-Catalog | catalog.py | catalog.py | py | 1,642 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "copy.deepcopy",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "globalValues.catalog.getViewableCatalog",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "globalValues.catalog",
"line_number": 17,
"usage_type": "attribute"
},
{
"a... |
43549319615 | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
from py2neo import Graph
from py2neo.ogm import GraphObject, Property, RelatedTo
class Artist(GraphObject):
__primarykey_... | headsrooms/scrape-your-music | rym/rym/pipelines.py | pipelines.py | py | 3,185 | python | en | code | 5 | github-code | 21 | [
{
"api_name": "py2neo.ogm.GraphObject",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "py2neo.ogm.Property",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "py2neo.ogm.GraphObject",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "py2... |
9100130425 | import os
import sys
import logging
import json
import typing
import collections
from ConfigSpace.configuration_space import ConfigurationSpace, Configuration
from ConfigSpace.hyperparameters import FloatHyperparameter, IntegerHyperparameter
__author__ = "Marius Lindauer"
__copyright__ = "Copyright 2016, ML4AAD"
__li... | timothyyu/ml_monorepo | SMAC3/smac/utils/io/traj_logging.py | traj_logging.py | py | 8,113 | python | en | code | 59 | github-code | 21 | [
{
"api_name": "collections.namedtuple",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
17370366047 |
from pymongo import MongoClient
import pymongo
import os
import getpass, imaplib
import os
import sys
import email
import base64
from tqdm import tqdm
from PIL import Image
from PIL.ExifTags import TAGS
import schedule
from datetime import datetime
import time
from email import utils
from deepstack_sdk import ServerC... | vhenrixon/Wild-Game-data-tracking | app.py | app.py | py | 8,946 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pymongo.errors",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "deepstack_sdk.ServerConfig",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "de... |
71528063094 | """create mavlink timeseries db
Revision ID: 10a897dc176b
Revises: c7f93ecc8c88
Create Date: 2023-05-19 19:45:09.209058
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "10a897dc176b"
down_revision = "c7f93ecc8c88"
branch_labels = None
depends_on = None
def upg... | searchwingCV/log-viewer | server/migrations/versions/10a897dc176b_create_mavlink_timeseries_db.py | 10a897dc176b_create_mavlink_timeseries_db.py | py | 1,201 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "alembic.op.create_table",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integ... |
14337011753 | import cv2 as cv
from geojson import Polygon, FeatureCollection, Feature
import geojson
import geopandas as gpd
import json
import numpy as np
import yaml
def read_config(config_name):
if '/' not in config_name and '\\' not in config_name:
config_name = f'configs/{config_name}'
with open(config_name,... | ivanvykopal/Cardiac-transplant-rejection-diagnosis | Final cycle/utils/utils.py | utils.py | py | 6,616 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "json.load",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "yaml.safe_load",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.expand_dims",
"line_nu... |
12857070512 | from typing import Tuple
from transformers import TFBertModel
from headliner.model.transformer_util import *
class Encoder(tf.keras.Model):
def __init__(self,
num_layers: int,
num_heads: int,
feed_forward_dim: int,
embedding_shape: Tuple[int, ... | as-ideas/headliner | headliner/model/bert_model.py | bert_model.py | py | 6,701 | python | en | code | 231 | github-code | 21 | [
{
"api_name": "typing.Tuple",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "transformers.TFBertModel.from_pretrained",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "transformers.TFBertModel",
"line_number": 27,
"usage_type": "name"
},
{
"ap... |
12541436844 | # -*- coding: utf-8 -*-
"""
Created on Fri Dec 4 13:31:04 2015
@author: aromanenko
"""
import re
import json
import numpy as np
class NGrammer(object):
_phrase2freq = {}
_delimiters = None
_delimiters_regex = None
_lengthInWords = 0
def __init__(self):
self._phrase2freq = {}
... | Gernar/opinion_mining | result/ngrammer.py | ngrammer.py | py | 8,543 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "re.compile",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 102,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 160,
... |
74748145011 | import javaobj
import serial
import socket
import cv2
import time
import torch
import queue
import threading
import numpy as np
import matplotlib.pyplot as plt
from CNN_ER_FA import CNN
from PID import PID
from globals_and_utils import Timer
from numba import jit
import tkinter as tk
from params import... | Ntwdc/Labyrinth | labi_PID.py | labi_PID.py | py | 16,208 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.array",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "cv2.getOptimalNewCameraMatrix",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
... |
28794435585 | from typing import List, Dict
from PyQt5.QtCore import QUrl, pyqtSignal, pyqtSlot
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QLabel, QProgressBar, QPushButton
class ExcelLoadingWidget(QWidget):
exit = pyqtSignal()
def __init__(self, files: List[QUrl], parent=None, *args, **kwargs):
QWidget.__... | merdovash/VisitCount | Client/MyQt/Window/ExcelLoadingWindow/__init__.py | __init__.py | py | 1,634 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCore.pyqtSignal",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCor... |
33897088433 | import datetime
from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from dateutil.parser import isoparse
from ..types import UNSET, Unset
T = TypeVar("T", bound="InvoiceData")
@attr.s(auto_attribs=True)
class InvoiceData:
r"""Invoice number and date.
Attributes:
invoice_number (st... | milyord/sp-api | sp/easy_ship_2022_03_23/models/invoice_data.py | invoice_data.py | py | 2,277 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "typing.TypeVar",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "typing.Union",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "types.Unset",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "datetime.datetime",
"line_... |
5395968235 | from PySide6.QtWidgets import (
QApplication,
QMainWindow,
QPushButton,
QLabel,
QVBoxLayout,
QWidget
)
from random import randint
class AnotherWidget(QWidget):
def __init__(self):
super().__init__()
layout = QVBoxLayout()
self.label = QLabel(f'Another Window {randin... | flyfire/learning-qt | pyside6-tutorial/app6.py | app6.py | py | 2,392 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "PySide6.QtWidgets.QWidget",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "PySide6.QtWidgets.QVBoxLayout",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "PySide6.QtWidgets.QLabel",
"line_number": 16,
"usage_type": "call"
},
{
"... |
73401470131 | import random
from typing import List
alphabet = "abcdefghijklmnopqrstuvwxyz"
def weight_gen():
if random.random() < 0.6:
return 1
else:
return random.choice([2, 3, 4])
def generate_word(head, tail, size, no_same) -> List[str]:
if no_same:
result = set()
while len(result... | Chenrt-ggx/WordListProject | utils/data_generator.py | data_generator.py | py | 2,908 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "random.random",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_nu... |
71838139573 | import cv2
import os
import numpy as np
input_dir = '../AllHandwritingImages'
output_dir = '../SeniorExperience/ReshapedImages'
for filename in os.listdir(input_dir):
# Load image
img_path = os.path.join(input_dir, filename)
img = cv2.imread(img_path)
# Preprocessing
# Resize image to (384,3... | CS4360-Senior-Project/API | config/api/backend/imageProcessing/MLpreProcessing.py | MLpreProcessing.py | py | 641 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.listdir",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "cv2.imread",
"line_number": 1... |
73486778612 | import sys
from multiprocessing import Pool as ThreadPool
from datetime import datetime
from temperature import tempControl
from tqdm import tqdm
_num_queens = 12 # default number of queens
_num_thread = 4 # default number of threads
_its_safe = 0 # queen on a safe position
_not_safe = 1 # queen not... | lemariva/rPI-Tests | scripts/queenpool_multithread.py | queenpool_multithread.py | py | 3,904 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "multiprocessing.Pool",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "datetime... |
492515097 | import json
class JsonDefinitionReader:
#read json file class
_jsonFileName=""
#def __init__(self,jsonFileName):
#self._jsonFileName=jsonFileName
def ReadJsonDefinition(_jsonFileName,definition:str):
# Opening JSON file
f = open(str(_jsonFileName))
retdict={} ... | moti-levi/tKinter | PyClass/readTestSuiteDefinition.py | readTestSuiteDefinition.py | py | 640 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "json.load",
"line_number": 16,
"usage_type": "call"
}
] |
36782326025 | import os
from flask import Flask
from tempfile import mkdtemp
def create_app():
# common prefix for all routes in blueprints
APP_URL_PREFIX = os.environ.get('MY_APP_PREFIX',None)
# common prefix will also be prefix for static files
APP_STATIC_URL = '/static'
APP_STATIC_FOLDER = 'static'
if APP_URL_PREFIX:
AP... | gpasxalis/QRify | myapp/app.py | app.py | py | 760 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.environ.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "flask.Flask",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "tempfile.mkdtemp",
"line... |
43388029901 | import os
import numpy as np
import time
import scipy
from sklearn import svm
from utils import euclidean_dist, read_img, read_txt, load_train_data, load_val_data, get_labels
category = ['aeroplane', 'car', 'horse', 'motorbike', 'person'] # DON'T MODIFY THIS.
data_dir = '/w11/hyewon/data/practical-category-r... | mandiehyewon/CS576 | assignment2/nonlinear_svm.py | nonlinear_svm.py | py | 2,601 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "utils.load_train_data",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sklearn.svm.NuSVC",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sklearn.svm",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "time.time",
"... |
23386997587 | # -*- coding: utf-8 -*-
"""
Created on Sat Aug 6 20:59:32 2016
@author: raulv
"""
import numpy as np
import matplotlib.pyplot as plt
from tta_analysis import tta_analysis
#from rv_utilities import add_colorbar
from rv_utilities import add_floating_colorbar
from matplotlib import rcParams
rcParams['xtick.labelsize'... | rvalenzuelar/tta_climatology | plot_wdir_seasonal_hist.py | plot_wdir_seasonal_hist.py | py | 6,481 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "matplotlib.rcParams",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "numpy.zer... |
28378381354 | #!/usr/bin/env python3
# on windows need python.exe -m pip install requests
# on linux pip install requests
import json
import sys
import requests
import traceback
import json
ip = '169.254.169.254'
port = '80'
default_version = 'latest_internal'
default_headers = {'Metadata' : 'True'}
def is_json(myjson):
try... | abhinababasu/share | TestCase.py | TestCase.py | py | 11,046 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "json.loads",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number... |
40836521861 | #!/usr/bin/env python
import lxml.html
import sys
# doc.xpath("//node()[@src]") - gets elements not just strings
def staticize(content):
doc = lxml.html.fromstring(content)
srcs = doc.xpath("//@src")
srcs = [s for s in srcs if not s.startswith('http') and not s.startswith("{%")]
srcs = set(srcs)
... | sivang/staticutils | djangoize.py | djangoize.py | py | 767 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "lxml.html.html.fromstring",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "lxml.html.html",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "lxml.html",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "sys.argv",
"... |
14242294254 | """empty message
Revision ID: c3f7997d9050
Revises: aa01fc72001a
Create Date: 2023-06-10 18:00:41.894838
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = 'c3f7997d9050'
down_revision = 'aa01fc72001a'
branch_labels = None
depe... | alexey000035/tppo_project | web/migrations/versions/c3f7997d9050_.py | c3f7997d9050_.py | py | 1,311 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "alembic.op.drop_table",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "alembic.op.create_table",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "alembic.op",... |
40411547598 | import re
import simplejson
from google.appengine.api import users, memcache
from gaelord import models
"""
Local copy of the entities from the datastore in a dictionary.
{'jid' : [(RecordFilter, Key), (RecordFilter, Key)], }
"""
_subscriptions = {}
"""Init flag for the datastore entities."""
_init = False
def su... | pulilab/gaelord | gaelord/filters.py | filters.py | py | 5,970 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "re.compile",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "gaelord.models.Subscription.all",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "gaelord.models.Subscription",
"line_number": 73,
"usage_type": "attribute"
},
{
"api_n... |
31626965150 | '''
Created on Nov 2, 2015
@author: Andrew Roth
'''
import biowrappers.components.variant_calling.utils as utils
import pandas as pd
import vcf
from bx.bbi.bigwig_file import BigWigFile
def get_mappability(
mappability_file,
vcf_file,
out_file,
region=None,
append_chr=True):
... | shahcompbio/biowrappers | biowrappers/components/variant_calling/mappability/tasks.py | tasks.py | py | 1,442 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "bx.bbi.bigwig_file.BigWigFile",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "vcf.Reader",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "biowrappers.components.variant_calling.utils.parse_region_for_vcf",
"line_number": 23,
"usage_ty... |
1846002222 | import fractions
import typing as tp
def frequency_controller(
target_ratio: float,
max_len: int,
) -> tp.Generator[int, None, None]:
ratio = fractions.Fraction(target_ratio).limit_denominator()
phase = max(fractions.Fraction(0), 1 - ratio)
for period in range(max_len):
phase += ratio
... | GiveMeTheReason/pose_classifier | loaders/utils.py | utils.py | py | 391 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "fractions.Fraction",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "fractions.Fraction",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "typing.Generator",
"line_number": 8,
"usage_type": "attribute"
}
] |
23336145917 | import os
import shutil
from PIL import Image
from struct import pack
input_folder = "./images"
output_folder = "C:/Users\James/OneDrive/Documents/Arduino/libraries/ESK8/controller/data/icons"
if __name__ == '__main__':
# check if input folder exists
if not os.path.isdir(input_folder):
print("Input f... | peempeem/ESK8 | src/graphics/icons/icon2bitmap.py | icon2bitmap.py | py | 1,647 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.path.isdir",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_numbe... |
41698260590 | __authors__ = "Johannes Köster, Sven Nahnsen"
__copyright__ = "Copyright 2019, Johannes Köster, Sven Nahnsen"
__email__ = "johannes.koester@uni-due.de"
__license__ = "MIT"
from tempfile import TemporaryDirectory
from pathlib import Path
import os
import shutil
import stat
from snakemake.logging import logger
from sna... | mbond0718/MPRApipe | env/lib/python3.6/site-packages/snakemake/caching/local.py | local.py | py | 4,478 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "snakemake.caching.AbstractOutputFileCache",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.access",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.W... |
71655069494 |
from mosestokenizer import MosesTokenizer
from transliteration import ethiopic2latin
def process_text(fname):
txt = ''
tokenize = MosesTokenizer('en')
with open(fname) as file_in:
for line in file_in:
if len(line) > 2:
line = ethiopic2latin(line)
... | andmek/AmTokenizer | tokenize_am_file.py | tokenize_am_file.py | py | 686 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "mosestokenizer.MosesTokenizer",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "transliteration.ethiopic2latin",
"line_number": 12,
"usage_type": "call"
}
] |
28034448807 | #!/usr/bin/env python3
import sys
import math
import numpy
import typing
import qm3.utils.grids
import qm3.utils.interpolation
def taylor( igrd: object, iniX: float, iniY: float, direc: float, fdsc: typing.IO ):
# ------------------------------------------------------------------------------
ndeg = 2
... | sergio-marti/ren-qm3 | tools/s_path.py | s_path.py | py | 3,567 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "typing.IO",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number... |
15377466012 | from collections.abc import Callable
from pgzero.actor import Actor
from boing.constants import *
from boing.pos import Pos
from boing.utils import normalised
class Ball(Actor):
def __init__(self, dx):
super().__init__("ball", (0, 0))
self.hit_bat_callback = None
self.hit_wall_callback =... | welblade/code-the-classics-boing | boing/ball.py | ball.py | py | 2,439 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pgzero.actor.Actor",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "boing.pos.Pos",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "boing.pos.Pos",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "boing.pos.Pos",
"l... |
39404906645 | import argparse
import datetime
import requests
# This is my Alpha Vantage key. Please register your own Alpha Vantage key and replace with it in the following line
ALPHA_VANTAGE_KEY = 'OYAJLARX2ZAA2T1B'
STOCK_URL = 'https://www.alphavantage.co/query?function=TIME_SERIES_DAILY&outputsize=full&apikey=' \
... | bill-ying/highest-stock-price | highest_stock_price.py | highest_stock_price.py | py | 1,597 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.today",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name":... |
24464017185 | import sys
import os
import requests
import json
import RPi.GPIO as GPIO
import time
BUTTON_GPIO = 18
USER_ID = 0
register_user_url = "http://164.92.97.79/request_user_id/"
user_id_file_path = "user_id.txt"
def request_user_id(channel):
try:
r = requests.get(url, timeout=1) #wait for response for 1 ... | sarpuser/Grocer.io | rpi/register_user.py | register_user.py | py | 1,483 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "os.remove",
"line_number... |
554323318 | import os
import zipfile
import sys
import nltk
from pyspark import SparkContext, SparkConf
from pyspark.sql import SparkSession
from pyspark.streaming import StreamingContext
def remove_existing_file(path):
URI = sc._gateway.jvm.java.net.URI
Path = sc._gateway.jvm.org.apache.hadoop.fs.Path
FileSystem = s... | comp7305-group-1/group-project | app/m.py | m.py | py | 3,228 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "nltk.tokenize.sent_tokenize",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "nltk.tokenize",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "pyspark.SparkConf",
"line_number": 89,
"usage_type": "call"
},
{
"api_name": "pysp... |
38102865944 | import asyncio
import random
from typing import List, Optional
from dynaconf import settings
from tqdm import tqdm
from tiktokpy.client import Client
from tiktokpy.utils.client import catch_response_and_store
from tiktokpy.utils.logger import logger
FEED_LIST_ITEM = 'div[data-e2e="recommend-list-item-container"]'
FE... | sudoguy/tiktokpy | tiktokpy/client/trending.py | trending.py | py | 2,413 | python | en | code | 575 | github-code | 21 | [
{
"api_name": "tiktokpy.client.Client",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "dynaconf.settings.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "dynaconf... |
27324218692 | import os
import re
from pathlib import Path
import django
import pytest
import requests
from django.conf import settings
from portaladmin.constants import STATUSGROUP_FRONTEND
from portaladmin.models.MDstatement import MDstatement
from portaladmin.views import getstarturl
assert 'portaladmin' in settings.INSTALLED_A... | identinetics/PVZDweb | portaladmin/tests/test_sign_sigproxy.py | test_sign_sigproxy.py | py | 2,468 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.conf.settings.INSTALLED_APPS",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "django.setup",
"line_number": 14,
"usage_type": "call"
},
{
"api_na... |
28747721044 | # aoc_template.py
#RUN - python3 aoc_3_2021.py aoc_3_puzzle_input.txt
import pathlib
import sys
from functools import reduce
from operator import xor
print("AOC Day 3 - BINARY DIAGNOSTIC!!!")
NUM_BITS = 12
def parse(puzzle_input):
"""Parse input - break into lines"""
return list(filter(bool,puzzle_input.spli... | AnthonyDiPerna/algos_and_ds | advent_of_code_2021/aoc_3_2021.py | aoc_3_2021.py | py | 6,055 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.argv",
"line_number": 175,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 177,
"usage_type": "call"
}
] |
23344697420 | import io
from unittest import TestCase
from unittest.mock import patch
from game import boss_encounter
class TestBossEncounter(TestCase):
@patch('game.boss_combat', return_value=True)
@patch('sys.stdout', new_callable=io.StringIO)
def test_boss_encounter_boss_defeated(self, mock_output, _):
char... | dvalle22/BooBoo | UnitTests/test_boss_encounter.py | test_boss_encounter.py | py | 1,405 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "unittest.TestCase",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "game.boss_encounter",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "unittest.mock.patch",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "unittest.mock... |
5665772631 | import os
import threading
import time
from datetime import datetime, timedelta
import pandas as pd
import tushare as ts
import tarfile
import sys
import os
from datetime import datetime, timedelta
AMOUNT_BILLION = 1000000000
def un_tar(file_name, dir):
(shotname, extension) = os.path.splitext(f... | aaronbackup/python | auction_up_stat.py | auction_up_stat.py | py | 8,976 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.path.splitext",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "tarfile.open",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"li... |
38165577915 | import cv2
from pygame import mixer
import time
class QuestioningState(object):
def __init__(self, handTracker, scan_interval=100, stopping_crit=5):
self.handTracker = handTracker
self.scan_interval = scan_interval
self.stopping_crit = stopping_crit
self.state = 'questioning state'
... | Maddi97/cognitive_interaction_w_robots | control_unit/questioning_state.py | questioning_state.py | py | 2,484 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.destroyAllWindows",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "cv2.destroyAllWind... |
10206290880 | from discord.ext import commands
import discord, json, os
ROLES_CHANNEL = 923893701225349120
ROLES = [
{"name": "Programmer", "aname": "Programming and Technology", "emoji":"<:programming:923903358245408810>", "emojiname":"programming"},
{"name": "Weeb", "aname": "Anime", "emoji":"<:shine:852074265419186186>"... | Sajan491/Asuma | cogs/roleshandler.py | roleshandler.py | py | 3,819 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 18... |
31990656012 | import dataDef as data
import dataRL
import matplotlib.pyplot as plt
def plotting():
"""plotting function : plots conflicts, fuel, holding duration, holding distance and Q norm in function of iterations"""
l_fuel_min = [data.saving[i - 1, 3] for i in range(1, dataRL.maxIter)]
l_fuel_max = [data.saving[i ... | celinedemouge/Reinforced_Learning_BlueSky | plugins/plotting.py | plotting.py | py | 2,102 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "dataDef.saving",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "dataRL.maxIter",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "dataDef.saving",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "dataRL.maxI... |
12519677430 | import sys, os, inspect, platform
from os.path import isfile
# Third-party imports
from PyQt5.QtCore import QCoreApplication, \
QTranslator, \
QLocale, \
QLibraryInfo, \
QSettings
from PyQt5.QtWidgets import QApplicatio... | orestesmas/pycirkuit | pycirkuit/main.py | main.py | py | 5,914 | python | en | code | 29 | github-code | 21 | [
{
"api_name": "PyQt5.QtCore.QCoreApplication.translate",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtCore.QCoreApplication",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCore.QSettings",
"line_number": 27,
"usage_type": "cal... |
13413362685 | from http import HTTPStatus
from typing import List, Tuple
from fastapi import APIRouter, Depends, HTTPException, Request, Response
from fastapi_redis_cache import cache
from vigorish.app import Vigorish
from vigorish.util.string_helpers import validate_at_bat_id
from app.api.dependencies import get_pitch_app_params
... | a-luna/vig-api | app/api/api_v1/endpoints/pfx.py | pfx.py | py | 1,875 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "fastapi.Request",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "fastapi.Response",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.