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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
37475762208 | import json
import multiprocessing
import socket
class Client:
def __init__(self,
server_host,
server_port_tcp=1234,
server_port_udp=1234,
client_port_udp=8888):
"""
Create a game server client
"""
self.sock_tcp = ... | Im-Adriano/BPC2Revamp | Networking/client.py | client.py | py | 6,591 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "socket.socket",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_STREAM",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "multiproces... |
24336858103 | # -*- coding: utf-8 -*-
from odoo import api, fields, models, SUPERUSER_ID, _
import datetime
from odoo.osv import expression
from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT
from odoo.tools.float_utils import float_compare, float_is_zero, float_round
from odoo.exceptions import UserError
from odoo.addons.stock.m... | aitmlouk/BMC | bmc/models/quality.py | quality.py | py | 21,543 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "odoo.models.Model",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "odoo.models",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "odoo.fields.Text",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "odoo.fields",
... |
29861951323 | import numpy as np
import pandas as pd
import os
import matplotlib as mpl
mpl.rcParams.update({'font.size': 14})
mpl.use('Agg')
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
fig.set_size_inches(5,3)
file = "/home/alfuerst/repos/faas-keepalive-20/experiments/sub_lit_tests.csv"
cols = ["LitmusTest","vanill... | aFuerst/faascache-sim | code/split/plotting/plot_faas_litmus.py | plot_faas_litmus.py | py | 13,660 | python | en | code | 12 | github-code | 21 | [
{
"api_name": "matplotlib.rcParams.update",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.use",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matpl... |
34570080785 | """
Estimators : Empirical, Catoni, Median of means, Trimmed mean
Random truncation for u=empirical second moment and for u=true second moment
Data distributions:
- Normal (with mean=0, sd = 1.5, 2.2, 2.4)
- Log-normal (with log-mean=0, log-sd = 1.25, 1.75, 1.95)
- Pareto (a=3,xm= 4.1,6,6.5)
The parameters are... | ElMehdiHaress/Risk-averse-feedback | Estimators_n.py | Estimators_n.py | py | 9,460 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.mean",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.var",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "numpy.log",
"line_number": 46,
... |
8960193944 | import discord
import asyncio
import sys
from os import environ as env_vars
client = discord.Client()
REACTION_CHANNEL_ID = ""
MOD_CHANNEL_ID = ""
REACTION_THRESHOLD = 5
try:
REACTION_CHANNEL_ID = int(env_vars['DISCORD_REACTION_CHANNEL_ID'])
except KeyError:
print("No Discord channel ID specified. Please set... | hwsuk/reaction-bot | bot.py | bot.py | py | 2,478 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "discord.Client",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "sys.exit",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 19,... |
42698252127 | ###############################################################################
# face_tracker.py
#
# Description:
# Class definition for face trackers. Implements face detect algorithms based
# on argument frames, and then keeps track of them using a face tracker
# (using dlib correlation tracker). Thus, this module ... | msaifee786/low_vision_retargeting | includes/face_tracker.py | face_tracker.py | py | 5,450 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "cv2.CascadeClassifier",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "dlib.correlation_tracker",
"line_number": 156,
"usage_type": "call"
},
{
"api_name": "dlib.rectangle",
"line_number": 158,
"usage_type": "call"
}
] |
43797601149 | import os
from tinydb import TinyDB, Query
db = TinyDB(os.path.abspath('/etc/monzo/db.json'))
def get_tokens(name):
data = Query()
result = db.get(data.name == name)
if result is None:
return {}
return result
def save(name, access_token, refresh_token, expires):
data = Query()
db.... | mattgogerly/monzo-amex-pot-sync | monzo_amex_pot_sync/db.py | db.py | py | 458 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "tinydb.TinyDB",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "tinydb.Query",
"line_numb... |
40697072175 | from flask import render_template, session, current_app, g, request, jsonify
from info import constants
from info.models import User, News, Category
from info.utils.common import user_login_data
from info.utils.response_code import RET
from . import index_blu
# 测试
@index_blu.route('/')
@user_login_data
def index():
... | 18882028307/flask_newworld | info/modules/index/views.py | views.py | py | 3,595 | python | zh | code | 0 | github-code | 21 | [
{
"api_name": "flask.g.user",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "flask.g",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "info.models.News.query.order_by",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "info.models... |
10908682070 | import pygame, os
from pygame.locals import *
import menu, data
def main():
os.environ["UNIVERSIDAD NACIONAL DANIEL ALCIDES CARRION"] = "1"
#pygame.mixer.pre_init(44100, -16, 2, 4096)
pygame.init()
pygame.mouse.set_visible(0)
pygame.display.set_icon(pygame.image.load(data.filepath("TUXPRINCIPAL.gif... | cslapasco/TuxGame | gamelib/main.py | main.py | py | 470 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "os.environ",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pygame.init",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.mouse.set_visible",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pygame.mouse",
... |
9250654845 | """
statki.gui.kontrola
~~~~~~~~~~~~~~~~~~~
Sekcje kontroli zajmujące prawą stronę głównego interfejsu gry.
"""
import tkinter as tk
from tkinter import ttk
from PIL import Image, ImageTk
from collections import namedtuple
import math
from statki.plansza import Statek, Salwa
from .sekcja import Sekcja
... | z33kz33k/statki | statki/gui/kontrola.py | kontrola.py | py | 35,151 | python | pl | code | 0 | github-code | 21 | [
{
"api_name": "sekcja.Sekcja",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "tkinter.ttk.Style",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "tkinter.ttk",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "tkinter.CENTER",
"lin... |
40549606462 | import pytest
from monkey_island.cc.repositories import StorageError
from monkey_island.cc.repositories.utils import mongo_dot_decoder, mongo_dot_encoder
from monkey_island.cc.repositories.utils.mongo_encoder import DOT_REPLACEMENT
DATASET = [
({"no:changes;expectes": "Nothing'$ changed"}, {"no:changes;expectes":... | guardicore/monkey | monkey/tests/unit_tests/monkey_island/cc/repositories/utils/test_mongo_encoder.py | test_mongo_encoder.py | py | 1,521 | python | en | code | 6,367 | github-code | 21 | [
{
"api_name": "monkey_island.cc.repositories.utils.mongo_encoder.DOT_REPLACEMENT",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "monkey_island.cc.repositories.utils.mongo_encoder.DOT_REPLACEMENT",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "monkey_island... |
17391947833 | # -*- coding:utf-8 -*-
"""==========================================================
|
|
| creater:george
| email:15921315347@163.com
| description:树形结构处理
|
|
|
============================================================="""
import datetime
from bson import ObjectId
from core import clone_dict
__aut... | hulingfeng211/mywork | core/treeutils.py | treeutils.py | py | 1,426 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "core.clone_dict",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "bson.ObjectId",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "datetime.datetime... |
24440409654 | from collections import deque
def solution(queue1, queue2):
q1, q2 = deque(queue1), deque(queue2)
s1, s2 = sum(q1), sum(q2)
count, length = 0, len(q1)
while count < length*4:
if s1 > s2:
n = q1.popleft()
q2.append(n)
s1, s2 = s1-n, s2+n
elif s2 > s1:
... | bassyu/ps | programmers/2_두_큐_합_같게_만들기.py | 2_두_큐_합_같게_만들기.py | py | 487 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.deque",
"line_number": 4,
"usage_type": "call"
}
] |
35547688746 | import json
import logging
import mimetypes
import os
from base64 import b64encode
from datetime import datetime
from http import HTTPStatus
from typing import List, Mapping, Optional, Union
from urllib.parse import ParseResult, urlparse
import uritemplate
import urllib3
from pydantic import BaseModel, Field, HttpUrl
... | jwilges/monocat | monocat/github.py | github.py | py | 9,995 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "pydantic.BaseModel",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "pydantic.HttpUr... |
40476188381 | # -*- coding: UTF-8 -*-
import requests
from bs4 import BeautifulSoup
import time
import re
import pymysql
from channel import channel #这是我们第一个程序爬取的链接信息
import random
# 循环遍历请求到界面,然后解析
#这是上面的那个测试函数,我们把它放在主函数中
def mains(url):
pass
wb_data = requests.get("https://book.douban.com/subject/1007305/")
soup = Be... | MaGuiSen/pythonCatchData | book/douban_catch.py | douban_catch.py | py | 3,798 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 15,
"usage_type": "call"
}
] |
39673683280 | import os
import re
import shutil
import stat
import subprocess
import tempfile
from contextlib import contextmanager
from glob import glob
from shutil import which
from textwrap import dedent
import snapcraft
from snapcraft import file_utils
from snapcraft.common import isurl
class PythonPlugin(snapcraft.BasePlugin... | pachulo/snapcraft | snapcraft/plugins/python.py | python.py | py | 11,461 | python | en | code | null | github-code | 21 | [
{
"api_name": "snapcraft.BasePlugin",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 86,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
... |
14053819401 | from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import collections
from apitools.base.py import list_pager
from googlecloudsdk.api_lib.storage import errors
from googlecloudsdk.api_lib.storage.gcs_json import client as gcs_json_client
from googlecloudsdk... | Flank/gcloud_cli | google-cloud-sdk/lib/googlecloudsdk/api_lib/storage/insights_api.py | insights_api.py | py | 25,164 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "googlecloudsdk.api_lib.storage.gcs_json.client.JsonClient",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "googlecloudsdk.api_lib.storage.gcs_json.client",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "collections.namedtuple",
"line_numbe... |
8720036204 | from random import random
from src.modeling.model import Model
from optuna import Trial
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import StratifiedKFold
from sklearn.metrics import roc_auc_score
import numpy as np
from optuna import... | Servando1990/personal-pipeline | src/modeling/models/tree_models.py | tree_models.py | py | 2,946 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "src.modeling.model.Model",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "optuna.Trial",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "sklearn.model_selection.StratifiedKFold",
"line_number": 23,
"usage_type": "call"
},
{
"api... |
19353189257 | from pathlib import Path
from requests import get
from requests.exceptions import HTTPError, ConnectionError, Timeout, RequestException
from src.logger.base_logger import log
def get_photo_account(acc_id: str, photo_id: str) -> bytes:
log.info('Поиск аватарки манга аккаунта')
log.debug(f'acc_id={acc_id}, pho... | Hafurfur/MangaNotificationBotTg | src/tele_bot/bot_back/site_data.py | site_data.py | py | 3,868 | python | ru | code | 0 | github-code | 21 | [
{
"api_name": "src.logger.base_logger.log.info",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "src.logger.base_logger.log",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "src.logger.base_logger.log.debug",
"line_number": 10,
"usage_type": "call"
},
... |
2229047293 | #! /usr/bin/python3
import os
import numpy as np
import cv2
import subprocess
from numpy.lib.type_check import imag
import rospy, ros_numpy, rospkg
from sensor_msgs.msg import Image
from cv_bridge import CvBridge
class CameraNode:
def __init__(self, width=1280, height=720):
self.width = width
s... | tomoya-yamanokuchi/docker-ros-connection | catkin_ws/src/ros_camera/src/camera_node.py | camera_node.py | py | 4,507 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "subprocess.check_output",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "rospkg.RosPack",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
... |
3214184558 | """ Utility routines related to MHW Systems"""
import numpy as np
import pandas
from datetime import date
from collections import Counter
import warnings
from numba import njit, prange
from scipy.interpolate import interp1d
import healpy as hp
from oceanpy.sst import io as sst_io
from oceanpy.sst import utils as sst_... | profxj/mhw_analysis | mhw_analysis/systems/utils.py | utils.py | py | 4,062 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "pandas.DataFrame",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "pandas.Series",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "datetime.date.fromordinal",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "datetime.dat... |
35394630262 | import json
import os
import subprocess
import requests
from telebot import CMD_HELP
from telebot.utils import admin_cmd
@telebot.on(admin_cmd(pattern="labstack ?(.*)"))
@telebot.on(sudo_cmd(pattern="labstack ?(.*)", allow_sudo=True))
async def labstack(event):
if event.fwd_from:
return
await eor(ev... | xditya/TeleBot | telebot/plugins/labstack.py | labstack.py | py | 2,141 | python | en | code | 197 | github-code | 21 | [
{
"api_name": "os.path.getsize",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "os.path.basename",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
71902408693 | import os
import re
import csv
import sys
import json
import decimal
import time
import numpy as np
from pprint import pprint
from flask import Flask, request, render_template, Response,jsonify
app = Flask(__name__)
app.config['SEND_FILE_MAX_AGE_DEFAULT'] = 1.0
# save file
file_path = os.path.dirname(__file__)
def ge... | creek0810/Probability_final | server.py | server.py | py | 3,058 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "flask.request.files",
"l... |
18463920983 | from urllib.request import urlopen
import bleach
import lxml.html
from django import forms
from django.contrib import messages
from django.core.files.base import ContentFile
from django.core.files.storage import default_storage
from django.db import transaction
from django.db.models import Max
from django.http import ... | HannesEURESA/pretix-additional-links | pretix_additional_links/views.py | views.py | py | 5,657 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pretix.control.permissions.EventPermissionRequiredMixin",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "django.views.generic.ListView",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "models.Links",
"line_number": 26,
"usage_type": "na... |
6938177427 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.Create... | ayegemen/vrije | cities_news/migrations/0001_initial.py | 0001_initial.py | py | 4,931 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.swappable_dependency",
"line_number": 11,
"usage_type": "call... |
21795028771 | from rest_framework import viewsets
from .models import Plant
from .serializers import PlantSerializer
from rest_framework import status
from rest_framework.decorators import api_view
from rest_framework.response import Response
def get_plant_image(request, plant_id):
# Ambil objek tanaman berdasarkan ID
plan... | wildandr/petraServer | plants/views.py | views.py | py | 2,056 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "models.Plant",
"line_number": 11,
"usage_type": "argument"
},
{
"api_name": "serializers.PlantSerializer",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "rest_framework.response.Response",
"line_number": 40,
"usage_type": "call"
},
{
"api... |
30546951758 | from bs4 import BeautifulSoup
from glob import glob
import pandas as pd
from tqdm import tqdm
import bs4
import csv
import os
import re
### regex commands: https://github.com/dnc1994/Grad-Cafe-Data-Analysis/blob/master/gradcafe.ipynb
re_decision = re.compile('((?:Accepted)|(?:Rejected)|(?:Interview)|(?:Wait listed)|(?... | aobaruwa/Graduate-Admissions-Analytics | extract.py | extract.py | py | 5,193 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "re.compile",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 27,
... |
28562374666 | import glob
import os
import time
from multiprocessing.pool import ThreadPool
import cv2
import imutils
import numpy as np
from retina_face.retinaface import RetinaFace
from arc_face.face_recognition import FaceRecognition
# count = 1
# detector = RetinaFace(retina_face_model, 0, 0, 'net3')
# test_img = './test_dat... | rabbicse/py-face-recognition | face_recognizer/examples/fr_bak.py | fr_bak.py | py | 11,563 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "cv2.FONT_HERSHEY_SIMPLEX",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "time.time",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "cv2.getTextSize",
... |
72729412532 | import nltk
nltk.download('punkt')
nltk.download('wordnet')
import numpy as np
import pickle
from nltk.stem import WordNetLemmatizer
from spellchecker import SpellChecker
def tokenize(str,speller=False): #lemmatize and tokenize input. if speller=True then apply spell correction
tokens=nltk.word_tokenize(str)
if s... | darkknight314/Vector-Based-IR-system | Part 2 Improvement 1/test_queries.py | test_queries.py | py | 3,477 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "nltk.download",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "nltk.download",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "nltk.word_tokenize",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.log10",
"line_... |
18837005158 | from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from .models import Tournaments, Games, Players
from datetime import datetime
from django.db.models import Q
import re
def mobile(request):
MOBILE_AGENT_RE=re.compile(r".*(iphone|mobile|androidtouch)",re.IGNORECASE)
... | captaindamien/GKRES | tennis/views.py | views.py | py | 6,529 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "re.compile",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "re.IGNORECASE",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "models.Tournaments.objects.all",
"line_number": 103,
"usage_type": "call"
},
{
"api_name": "models.... |
5850077985 | from flask import abort
from sqlalchemy.exc import SQLAlchemyError
from model import session
from model.store import Store
from model.product import Product
def enrollment_store(store_name, description, score, average_price, picture_url):
try:
add_store = Store(name=store_name, description=description, ... | chelrothy/oioi | oioi/controller/enrollment.py | enrollment.py | py | 1,077 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "model.store.Store",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "model.session.add",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "model.session",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "model.session.commi... |
33530105266 | from numpy import *
def loadDataSet(fileName, delim = '\t'):
fr = open(fileName)
stringArr = [line.strip().split(delim) for line in fr.readlines()]
datArr = [list(map(float, line)) for line in stringArr]
return mat(datArr)
def pca(dataMat, topNfeat = 9999999):
'''
pca算法
:param dataMat: 进行... | caimengyuan/MachineLearning | PCA/pca.py | pca.py | py | 2,250 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 40,
"usage_type": "name"
}
] |
72154918134 | from random import randint, seed
import numpy as np
import pandas as pd
from sklearn.metrics import pairwise_distances
def fetch_threshold(df: pd.DataFrame,
percentile: np.float,
num_iter: int=100,
num_sample: int=1000
):
seed(42) # ... | adraismawur/thesis-scripts | bigscape_functions.py | bigscape_functions.py | py | 1,013 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.DataFrame",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "numpy.float",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "random.seed",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"l... |
36333776592 | import state
import blue
from time import time
char_orders = []
last = None
g_station = 60003760 # jita
g_solarsys = 30000142 # jita
g_nodeID = 1000000130
g_updateOrderID = 10122
g_charOrderID = 10123
g_itemOrderID = 10124
g_itemOrderRange = 100
def getOrders(type, callID):
return {'__class__': 'carbon.common.... | tostercx/eve_probe | eve_probe/py/trade.py | trade.py | py | 8,201 | python | en | code | 5 | github-code | 21 | [
{
"api_name": "state.status",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "state.status",
"line_number": 66,
"usage_type": "attribute"
},
{
"api_name": "blue.os.GetWallclockTimeNow",
"line_number": 94,
"usage_type": "call"
},
{
"api_name": "blue.... |
10706388692 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import pyglet
import sounds.music
import data.assets
from data.graphics import *
from data.scenemanager import SceneManager
from data.controllers import Controllers
# Start the Server
"import net"
def main():
# The pyglet.resource module handles efficient loading of ass... | gizmolinuxos/Anotherwar | main.py | main.py | py | 1,429 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pyglet.resource",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "pyglet.resource.reindex",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pyglet.resource",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "pyg... |
11638659305 | import pygame
from pygame.locals import *
from world import World
def init():
global screen
global world
global font
global x
global y
global move_x
global move_y
global zoom
global world_surface
global simulation_speed
global width
global height
simulation_speed =... | taydus30/Project-1 | project 3/main.py | main.py | py | 786 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pygame.Surface",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "world.World",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "world.spawnWorldObjects",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pygame.init",
... |
23866387777 | import tkinter as tk
import threading
import requests
from tkinter.filedialog import asksaveasfilename
import csv
class ChatApplication(tk.Tk):
def __init__(self, api_url):
super().__init__()
self.title("Tarams ChatBot")
# Server Requirements
self.api_url = api_url
... | ArjunChang/db_chatbot | chatbot.py | chatbot.py | py | 4,293 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "tkinter.Tk",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "tkinter.Frame",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "tkinter.Scrollbar",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "tkinter.RIGHT",
"l... |
70486873654 | """buynsell URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-base... | Dokeey/Buy-Sell | buynsell/urls.py | urls.py | py | 1,757 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "django.urls.path",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "... |
7621959462 | import matplotlib.pyplot as plt
from cartopy import config
import cartopy.crs as ccrs
import xarray as xr
import numpy as np
import geopandas as gp
from mpl_toolkits.axes_grid1 import make_axes_locatable
font = {'weight' : 'bold',
'size' : 12}
plt.rcParams["font.family"] = "Times New Roman"
plt.rc('font', *... | arun312/Main | Worker Codes/Ploting-2-Averages-MERRA.py | Ploting-2-Averages-MERRA.py | py | 3,174 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.rc",
"line_number": 13,
"usage_type": "call"
},
{
"api_name":... |
70309698294 | """Pareto tail indices plot."""
import logging
import numpy as np
from xarray import DataArray
from ..rcparams import rcParams
from ..stats import ELPDData
from ..utils import get_coords
from .plot_utils import format_coords_as_labels, get_plotting_function
_log = logging.getLogger(__name__)
def plot_khat(
kha... | arviz-devs/arviz | arviz/plots/khatplot.py | khatplot.py | py | 7,565 | python | en | code | 1,461 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.ndarray",
"line_number": 165,
"usage_type": "attribute"
},
{
"api_name": "stats.ELPDData",
"line_number": 171,
"usage_type": "argument"
},
{
"api_name": "xarray.Data... |
17219753036 | from ._base import BaseEvent
from . import register_event
from ..schema import types
@register_event('url_verification')
class UrlVerification(BaseEvent):
"""
.. code-block:: json
:caption: Example json response
{
"token": "Jhj5dZrVaK7ZwHHjRyZWjbDl",
... | huntcsg/slackly | src/slackly/events/url_verification.py | url_verification.py | py | 706 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "_base.BaseEvent",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "schema.types.String",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "schema.types",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "schema.types.Str... |
14760799730 | import torch
from torch import nn
import torch.nn.functional as F
class Conv(nn.Module):
def __init__(
self, in_channels, out_channels, kernel_size=3, stride=1, activation=nn.ReLU()
):
super().__init__()
padding = kernel_size // 2
block = []
block.append(
... | krulllab/DirectDenoiser | unet.py | unet.py | py | 5,744 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "torch.nn.Module",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.nn.ReLU",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number"... |
30059152534 | import torch
import pytorch_lightning as pl
from pytorch_lightning.loggers import WandbLogger
from src.ppomario import PPOMario
from pytorch_lightning.callbacks import ModelCheckpoint, LearningRateMonitor, ModelSummary
def main(world: int = 1, stage: int = 1, max_steps: int = 10000, ckpt_path: str = None, use_ppg: boo... | ArchiMickey/PPOMario | ppo_train.py | ppo_train.py | py | 1,829 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "src.ppomario.PPOMario",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pytorch_lightning.callbacks.ModelCheckpoint",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pytorch_lightning.loggers.WandbLogger",
"line_number": 37,
"usage_type"... |
10802723060 | from django.urls import path, include
from .views import mysql_loader, add_name, delete_names, add_document, manage_documents, database_upload
urlpatterns = [
path('', mysql_loader, name="mysql_loader"),
path('add_name', add_name, name="add_name"),
path('delete_names', delete_names, name="delete_names"),
... | LukaszMalucha/Data-Loader | mysql_loader/urls.py | urls.py | py | 535 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "views.mysql_loader",
"line_number": 6,
"usage_type": "argument"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "views.add_name"... |
71948502772 | # -*- coding: utf-8 -*-
"""
Created on Tue Feb 6 12:15:31 2018
@author: arfas
"""
#import the libraries
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
#importing the dataset
dataset=pd.read_csv('50_Startups.csv')
X=dataset.iloc[:,:-1]
y=dataset.iloc[:,4].values
#Creating dummy variable
X=pd... | arfas/Machine-Learning | multiplelinearregression.py | multiplelinearregression.py | py | 2,048 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.read_csv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pandas.get_dummies",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sklearn.cross_validation.train_test_split",
"line_number": 23,
"usage_type": "call"
},
{
"api_... |
24261772130 | #Importing the libraries and functions
import pandas as pd
import numpy as np
import tensorflow as tf
import os
import keras
from keras import backend as k
from keras.models import Sequential
from keras.layers import Convolution2D,MaxPooling2D,ZeroPadding2D,Flatten,Dense,Dropout
from keras.preprocessing.image import Im... | saurabhsem/Gender-classification | code/code_manvswomen_classv2.py | code_manvswomen_classv2.py | py | 16,892 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.random.seed",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "tensorflow.set_random_seed",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "keras.models.Sequential",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "... |
25289327842 | import sys
sys.path.append("../../")
from xml.dom.minidom import parseString
from appJar import gui
xml= """<people cont='europe'>
<person><name a='1' b='2' lowercase='false'>Fred</name><age>45</age><gender>Male</gender></person>
<person><favourites f='5'><a>Cheese</a><b>Ham</b></favourites><name>Tina<... | jarvisteach/appJar | examples/issues/issue457.py | issue457.py | py | 1,644 | python | en | code | 615 | github-code | 21 | [
{
"api_name": "sys.path.append",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "xml.dom.minidom",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "xml.dom.minidom",
"lin... |
71896721972 | # coding: utf-8
import nltk
def basic_features(sentence):
'''
Input: raw sentence string
Output:
sentence length (# words): int
number of periods: int
percent of characters that are capitalized: float
'''
# sentence length
sentLen = len(nltk.word_tokenize(sentence))
numPeriod... | luimagroup/bva-summarization | summarization/type_classifier/basic_features.py | basic_features.py | py | 931 | python | en | code | 7 | github-code | 21 | [
{
"api_name": "nltk.word_tokenize",
"line_number": 15,
"usage_type": "call"
}
] |
28860649934 | from django.shortcuts import render, redirect
from django.contrib import messages
from .forms import FeedbackForm
from .models import Project
def index(request):
if request.method == 'POST':
form = FeedbackForm(request.POST)
if form.is_valid():
form.save()
# messages.succes... | wwangwe/Portfolio | wangwe/views.py | views.py | py | 838 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "forms.FeedbackForm",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": ... |
72956302454 | import json
from pathlib import Path
from PIL import Image
import time
import torch
import torch.nn as nn
from torch.optim import Adam
from torch.optim.lr_scheduler import LambdaLR
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms
class TubDataset(Dataset):
def __init__(self, root... | alexbarthhd/3DCV_project | ML/custom_model.py | custom_model.py | py | 5,044 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
... |
39083777044 | # importing the requests library
import streamlit as st
from streamlit_autorefresh import st_autorefresh
import numpy as np
import pandas as pd
import layers
from datetime import datetime
import time
import requests
import csv
import super_hero
# update every minute (60*1000)
st_autorefresh(interval= 5* 60 * 1000,... | TrinhQuocNguyen/radiocaca_price | streamlit_app.py | streamlit_app.py | py | 7,931 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "streamlit_autorefresh.st_autorefresh",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 25,
"usage_type": "name"
},
{
"api_... |
16173038887 |
from watsontalker import sayWords
import time
# This module is imported so that we can
# play the converted audio
from playsound import playsound
#import os
import speech_recognition as sr
import yaml
#try to read the config data from config.yaml
config = []
with open("config.yaml", 'r') as stream:
try:
... | candrewlee14/py-face-rec-and-talk | speechListener.py | speechListener.py | py | 3,145 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "yaml.safe_load",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "yaml.YAMLError",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "watsontalker.sayWords",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "time.sleep",... |
20151871690 | from nltools import Brain_Data
from scipy.stats import ttest_ind
from nltools import expand_mask
import sys
import os
import pandas as pd
sys.path.append(os.path.abspath("../../ml/"))
from apply_loocv_and_save import *
import gc
import nibabel as nib
nonbids_data_path = "/gpfs/projects/sanlab/shared/DEV/nonbids_data... | UOSAN/DEV_scripts | fMRI/ml/SST/rsa_within_subject.py | rsa_within_subject.py | py | 5,228 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.path.append",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
3454404332 | # Написать приложение и функцию, которые собирают основные новости с сайта на выбор dzen.ru, lenta.ru, mail.ru . Для парсинга использовать XPath
# Структура данных должна содержать:
# * название источника
# * наименование новости
# * ссылку на новость
# * дата публикации
# минимум один сайт максимум все
impo... | polefremova/Scraping | Homework_2.py | Homework_2.py | py | 1,574 | python | ru | code | 0 | github-code | 21 | [
{
"api_name": "requests.Session",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "lxml.html.fromstring",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "lxml.html",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "datetime.date.today",... |
5330614689 | import random
import json
import os
import pickle
import csv
import argparse
import numpy as np
import math
from tqdm import tqdm
import shutil
import cv2 as cv
import sys
import tarfile
import glob
from pathlib import Path
from os.path import join,getsize
from difflib import SequenceMatcher
def similar(a, b):
re... | muxiddin19/Action-recognition-on-CrossFit-and-Figure-skating-datasets | create_data_1cut.py | create_data_1cut.py | py | 19,778 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "difflib.SequenceMatcher",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"lin... |
42744694976 | """
This is the main file for running the Bot
"""
import logging
import os
from .core import Bot
from .core.helpers import BotConfig
from .core.tortoise_config import tortoise_config
from .env import bot_config, db_config, lavalink_config
os.environ.setdefault("JISHAKU_HIDE", "1")
os.environ.setdefault("JISHAKU_RETAI... | CaffeineDuck/HariBot | bot/__main__.py | __main__.py | py | 845 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.environ.setdefault",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.environ.setdefault",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.enviro... |
14520025991 | #!/usr/bin/python
DOCUMENTATION = '''
---
module: alb_listener_rule
short_description: create or delete a listener rule
description:
- Creates or deletes listener rules.
author:
- "Pablo Munoz"
requirements: [ json, botocore, boto3 ]
options:
state:
description:
- The desired state of the l... | pablerass/ansible-module-alb-listener-rule | alb_listener_rule.py | alb_listener_rule.py | py | 8,090 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "ansible.module_utils.ec2.get_aws_connection_info",
"line_number": 101,
"usage_type": "call"
},
{
"api_name": "ansible.module_utils.ec2.boto3_conn",
"line_number": 104,
"usage_type": "call"
},
{
"api_name": "botocore.exceptions",
"line_number": 128,
"usage_t... |
27480010210 | # -*- coding: utf-8 -*-
#
# Sending a SMS with Python and pyserial via an USB 3G Modem on pfSense/FreeBSD
# tested with: Huawei Technologies Co., Ltd. E620 USB Modem
# and a Telekom SIM card
import glob
import serial
import time
import sys
import getopt
import argparse
def get_serial_port():
""" Lists serial port ... | bartoseb/raspberry_pi_projects | alarm/send_sms.py | send_sms.py | py | 3,586 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.platform.startswith",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sys.platform",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "sys.platform.startswith",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sys... |
27732611885 | from django.shortcuts import render
from django.views.generic import TemplateView
from django.db import models
from django.contrib.auth.models import User
from django.contrib.auth import authenticate, login, logout
from django.http import HttpResponseRedirect, HttpResponse
from django.urls import reverse
from django.co... | Kunnaalsoni/CodeSena | hospital/views.py | views.py | py | 1,878 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.views.generic.TemplateView",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.authenticate",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.login",
"line_number": 28,
"usage_type": "call"
... |
22678898040 | import os
from datetime import datetime
import logging
import requests
import boto3
import settings
from services.Personalize import Personalize
from services.Bwrite import Bwrite
from data_adapter.Items import Items
from utils.dataset_schema import to_dataset_schema
logging.basicConfig(level = logging.INFO)
log = lo... | rami8k/samples | py-recommendations-engine/src/tasks/delete_solution.py | delete_solution.py | py | 2,374 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "logging.basicConfig",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.date... |
10374520795 | import sys
from collections import deque
input = sys.stdin.readline
n, m, p = map(int, input().split())
s = [0] + list(map(int, input().split()))
board = [list(input().rstrip()) for _ in range(n)]
pos = [[] for _ in range(p+1)]
for i in range(n):
for j in range(m):
if board[i][j].isdigit():
... | yejin7211/Algorithm | 백준/Gold/16920. 확장 게임/확장 게임.py | 확장 게임.py | py | 1,441 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.stdin",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 20,
"usage_type": "call"
}
] |
35263912396 | import streamlit as st
import pandas as pd
import folium
from streamlit_folium import folium_static
from folium.plugins import MarkerCluster
st.set_page_config(
page_title="Home"
)
# ==============================
# Funções
# ==============================
COUNTRIES = {
1: "India",
14: "Australia",
30: "Brazil"... | CarvalhooNeto/fome_zero_cds | Home.py | Home.py | py | 4,438 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "streamlit.set_page_config",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "streamlit.sidebar.header",
"line_number": 92,
"usage_type": "call"
},
{
"api_name": "str... |
32660452473 | import sklearn.metrics
from sklearn.metrics import auc
import numpy as np
import torch
from termcolor import colored
import sys
import warnings
import json
class eval(object):
def __init__(self):
with open('config/item_info.json') as json_file:
self.item_info = json.load(json_file)
w... | pko89403/Recommender | Personalize_DLRM/eval/metric.py | metric.py | py | 2,672 | python | en | code | 6 | github-code | 21 | [
{
"api_name": "json.load",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.no_grad",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 30... |
8676078916 | import random
import cv2
import numpy as np
import pyglet
from PIL import Image
import sys
import cv2.aruco as aruco
import os
NET_WIDTH = 128
NET_HEIGHT = NET_WIDTH
video_id = 0
points = []
fingertip = None
score = 0
lives = 3
# image from https://www.svgrepo.com/svg/321919/bug-net?edit=true
net_path = os.path.norm... | ITT23/assignment-04-markers-and-computer-vision-Michael1Mueller | ar_game/opencv_pyglet.py | opencv_pyglet.py | py | 8,081 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.path.normpath",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "os.path.normpath",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_nu... |
12506133190 | import logging
import logging.handlers
from tanner.config import TannerConfig
class LevelFilter(logging.Filter):
"""Filters (lets through) all messages with level < LEVEL"""
def __init__(self, level):
self.level = level
def filter(self, record):
# "<" instead of "<=": since logger.setLe... | mushorg/tanner | tanner/utils/logger.py | logger.py | py | 1,600 | python | en | code | 196 | github-code | 21 | [
{
"api_name": "logging.Filter",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "tanner.config.TannerConfig.get",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tanner.config.TannerConfig",
"line_number": 21,
"usage_type": "name"
},
{
"api_... |
70355948532 | from functools import partial
from itertools import combinations
import tensorflow as tf
from tensorflow import keras
from tensorflow.experimental import numpy as tnp
from tensorflow.keras import layers, losses, optimizers
from i2i_gans.common.layers import conv2D, deconv2D
from i2i_gans.common.losses import gan_los... | lubosmj/I2I-GANs | i2i_gans/architectures/travelgan.py | travelgan.py | py | 6,679 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "tensorflow.keras.losses.BinaryCrossentropy",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.losses",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "tensorflow.keras.losses.Reduction",
"line_number": 22,
"usage_type": "... |
25092417145 | import pytesseract as pt
from PIL import Image
import tkinter as tk
from tkinter import filedialog
import random
from docx import Document
from docx.shared import Inches
import os
class Utils:
"""Contain the various methods to to convert images to text of different languages and returns them in a Word
doc."""... | ranellegomez/PySee | PyRead.py | PyRead.py | py | 3,023 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "docx.Document",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "docx.shared.Inches",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "tkinter.filedialog.asksaveasfilename",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": ... |
71126305972 | #! /usr/bin/env python3
import sys
import os
from pyscf.pbc import scf, gto, tools
import numpy
import time
import h5py
alat0 = 3.6
nks = 1
ngs = 12
cell = gto.Cell()
cell.a = (numpy.ones((3,3))-numpy.eye(3))*alat0/2.0
cell.atom = (('C',0,0,0),('C',numpy.array([0.25,0.25,0.25])*alat0))
cell.basis = 'gth-szv'
cell.ps... | QMCPACK/qmcpack | tests/afqmc/C_1x1x1_szv/pyscf/scf.py | scf.py | py | 1,083 | python | en | code | 261 | github-code | 21 | [
{
"api_name": "pyscf.pbc.gto.Cell",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pyscf.pbc.gto",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "numpy.ones",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.eye",
"line_num... |
9694437681 | import psycopg2
#No idea why below import exists
from psycopg2 import Error
try:
connection = psycopg2.connect(user = "postgres",
password = "Iwilldoit#1",
host = "127.0.0.1",
port = "5432",
... | chaudharyachint08/hspro | python-interface/sample_connection.py | sample_connection.py | py | 905 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "psycopg2.connect",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "psycopg2.DatabaseError",
"line_number": 17,
"usage_type": "attribute"
}
] |
38596491531 | from os import path
from setuptools import setup, find_packages
from version import current_version
"""
Setup file
License: GNU
"""
# Content of the README file
current_path = path.abspath(path.dirname(__file__))
with open(path.join(current_path, "README.md")) as f:
long_description = f.read()
def read_... | andrew-drogalis/Ideal-Home-Location-Matcher | setup.py | setup.py | py | 1,230 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.path.abspath",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_numb... |
27142807780 | from math import log
from operator import concat
from random import random
from typing import List
from argparse import ArgumentParser
def getArgs():
parser = ArgumentParser()
parser.add_argument('totalTime', type=float)
parser.add_argument('fIn', type=float)
parser.add_argument('fOut', type=float)
... | ronynudelman/236334-hw3 | simulator.py | simulator.py | py | 3,407 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "math.log",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "random.random",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "math.log",
"line_nu... |
17451353871 | from __future__ import division, print_function, absolute_import
from pylab import *
from matplotlib2tikz import save as tikz_save
import numpy as np
import matplotlib2tikz
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.cm
import matplotlib.colors
#Direct input
# plt.rcParams['text.latex.... | LukasRauch/BeamValiadation | pathon_anurbs/data/Save/Benchmark Kragarm/plot_runtime.py | plot_runtime.py | py | 6,510 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.array",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": ... |
73874427894 | import pygame
import pygame_gui
import threading
from solver.Solver import Solver
from views.view import View
from views.solveview import SolveView
from views.inputboardview import InputBoardView
class GenerateChoice(View):
def create_objects(self):
self.generate_button = pygame_gui.elements.UIButton(relat... | AuriTheGreat/GoDoku | views/generatechoice.py | generatechoice.py | py | 4,126 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "views.view.View",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "pygame_gui.elements.UIButton",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pygame_gui.elements",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "... |
8770037920 | from linebot.models import TextSendMessage, SourceGroup, SourceRoom
from . import line_bot_api
def postback_leave(event):
if isinstance(event.source, SourceGroup):
line_bot_api.reply_message(event.reply_token,
messages=TextSendMessage('Leaving group'))
line_bot_a... | c-bata/chalice-linebot | chalicelib/postback_events.py | postback_events.py | py | 749 | python | en | code | 30 | github-code | 21 | [
{
"api_name": "linebot.models.SourceGroup",
"line_number": 6,
"usage_type": "argument"
},
{
"api_name": "linebot.models.TextSendMessage",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "linebot.models.SourceRoom",
"line_number": 10,
"usage_type": "argument"
},
... |
18666421494 | import config
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
# for debugging
class Print(nn.Module):
def forward(self,x):
print('x.shape:', x.shape)
return x
class ResidualBlock(nn.Module):
"""Residual Block with instance normalization."""
def __init_... | dhananjaisharma10/face_generation | code/model.py | model.py | py | 4,786 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "torch.nn.Module",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "torch.nn.Module",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line... |
18380622361 | import os
import platform
import pytest
import wazuh_testing.execd as execd
from wazuh_testing.tools import WAZUH_PATH, get_version
@pytest.fixture(scope="session")
def set_ar_conf_mode():
"""Configure Active Responses used in tests."""
folder = 'shared' if platform.system() == 'Windows' else 'etc/shared'
... | wazuh/wazuh-qa | tests/integration/test_active_response/test_execd/conftest.py | conftest.py | py | 1,855 | python | en | code | 29 | github-code | 21 | [
{
"api_name": "platform.system",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "wazuh_testing.tools.WAZUH_PATH",
"line_number": 13,
"usage_type": "argument"
},
{
"api_name": "os.pa... |
23053644631 | import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as F
from torch.nn import Parameter
import math
class AMLinear(nn.Module):
def __init__(self, in_features, out_features, m = 0.35, phiflag=True):
super(AMLinear, self).__init__()
self.in_features = i... | harora/Primnet-pytorch | net_sphere.py | net_sphere.py | py | 3,255 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "torch.nn.Module",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "torch.nn.Parameter",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.Tensor",
"... |
9149066910 | import random
import torch
from model import util
import math
boundary_len = 2
def create_boundary_mask(start, end, context_size):
mask = torch.zeros(context_size, dtype=torch.bool)
mask[start:end] = 1
return mask
def create_boundary_dual_mask(start, mid, end, context_size):
if mid == start:
... | Luxhr47/A-Controlled-Attention-for-Nested-Named-Entity-Recognition | CA/boundary/model/sampling.py | sampling.py | py | 22,827 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torch.zeros",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.bool",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "torch.tensor",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "torch.float",
"line_numb... |
74477259891 | '''
This module has functions that print content on terminal.
'''
import os
from rich.console import Console
from rich.columns import Columns
from rich import box, print
from rich.panel import Panel
from rich.table import Table
from database import get_all_notes
from pygithub import display_github_connection
cons... | Fareed-Ahmad7/Kitaab | kitaab/src/terminal.py | terminal.py | py | 2,300 | python | en | code | 15 | github-code | 21 | [
{
"api_name": "rich.console.Console",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.name",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "rich.print",
"line_nu... |
35394719032 | import os
import requests
from telebot import CMD_HELP, OCR_SPACE_API_KEY, TEMP_DOWNLOAD_DIRECTORY, bot
from telebot.utils import admin_cmd
async def ocr_space_file(
filename, overlay=False, api_key=OCR_SPACE_API_KEY, language="eng"
):
"""OCR.space API request with local file.
Python3.5 - not tested... | xditya/TeleBot | telebot/plugins/ocr.py | ocr.py | py | 2,141 | python | en | code | 197 | github-code | 21 | [
{
"api_name": "telebot.OCR_SPACE_API_KEY",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "requests.post",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "telebot.TEMP_DO... |
11872361129 | import torch
from torch import nn
from torch.nn import functional as F
from detectron2.modeling.roi_heads.fast_rcnn import (
FastRCNNOutputLayers,
FastRCNNOutputs,
)
# focal loss
class FastRCNNFocaltLossOutputLayers(FastRCNNOutputLayers):
def __init__(self, cfg, input_shape):
super(FastRCNNFocaltL... | facebookresearch/unbiased-teacher | ubteacher/modeling/roi_heads/fast_rcnn.py | fast_rcnn.py | py | 2,869 | python | en | code | 406 | github-code | 21 | [
{
"api_name": "detectron2.modeling.roi_heads.fast_rcnn.FastRCNNOutputLayers",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "detectron2.modeling.roi_heads.fast_rcnn.FastRCNNOutputs",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "torch.nn.Module",
"line_... |
36757018594 | from datetime import datetime
def decorator(func):
def wapper(*args, **kwars):
start = datetime.now()
result = func(*args, **kwars)
print(datetime.now() - start)
return result
return wapper
@decorator
def zadacha(args, k):
otvet = []
for i in range(len(args))... | BekaZR/Decorator | decorator.py | decorator.py | py | 753 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "datetime.datetime.now",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "datetime.d... |
72357534773 | import unittest
from os import getenv
import numpy as np
import requests
from config import PIANO_API
from orm import Patient
from sumo.sumo_model import Sumo
DELETE_AUTH_KEY = getenv('DELETE_AUTH_KEY')
EUPHO_AUTH_KEY = getenv("EUPHO_AUTH_KEY", "eupho")
OBOE_AUTHKEY = getenv("OBOE_AUTH_KEY", "eobo")
class TestSumo... | auspayroll/evidentli | sumo/test/test.py | test.py | py | 11,552 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.getenv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "unittest.TestCase",
"line_number": ... |
8918095525 | import random
import arcade
from constants import (COLUMN_COUNT, HEIGHT, MARGIN, ROW_COUNT, WIDTH)
from cell_strategy import mutation_context
EMPTY = arcade.color.WHEAT
FILLED = arcade.color.RED
def create_cell_list() -> list:
"""
Generate random 2-dim list with alive or dead cells
:return: list
""... | darcsoel/game_of_life | utils.py | utils.py | py | 3,046 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "arcade.color",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "arcade.color",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "constants.ROW_COUNT",
"line_number": 20,
"usage_type": "argument"
},
{
"api_name": "constants.C... |
73039439733 | """Class to perform under-sampling based on the condensed nearest neighbour
method."""
from __future__ import division, print_function
from collections import Counter
import numpy as np
from sklearn.neighbors import KNeighborsClassifier
from sklearn.utils import check_random_state
from ..base import BaseMulticlassSa... | LiuFang816/SALSTM_py_data | python/scikit-learn-contrib_imbalanced-learn/imbalanced-learn-master/imblearn/under_sampling/condensed_nearest_neighbour.py | condensed_nearest_neighbour.py | py | 9,620 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "base.BaseMulticlassSampler",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "sklearn.neighbors.KNeighborsClassifier",
"line_number": 115,
"usage_type": "call"
},
{
"api_name": "sklearn.neighbors.KNeighborsClassifier",
"line_number": 118,
"usage_ty... |
20950920047 | import math
import matplotlib.pyplot as plt
import numpy as np
anton = 100.0
delta_anton = 0.0
bernd = 100.0
delta_bernd = 0
christian = 100.0
delta_christian = 0.0
dieter = 100.0
delta_dieter = 0.0
monat = 0
while anton > 1 or bernd > 1 or christian > 1 or dieter > 1:
monat = monat + 1
# verz... | fabian2798/Feldberechnung | Feldberechnung_1.0.py | Feldberechnung_1.0.py | py | 3,618 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.array",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",... |
75038707253 | from collections import deque
def solution(rc, operations):
rows = len(rc)
columns = len(rc[0])
left = deque()
middle = deque()
right = deque()
for i in range(rows):
left.append(rc[i][0])
middle.append(deque(rc[i][1:-1]))
right.append(rc[i][-1])
for operat... | Sh-IT0311/Coding-Test | programmers/level4/행렬과 연산.py | 행렬과 연산.py | py | 1,065 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.deque",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "collections.deque"... |
28601102686 | import streamlit as st
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import quandl
import plotly.graph_objects as go
from plotly import tools
import plotly.offline as py
import plotly.express as px
import yfinance as yf
import datetime
from datetime import date
st.title('Stock Price Dashboard... | abhisheksoni-iitb/Stock-price-dashboard | archive-app.py | archive-app.py | py | 4,791 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "streamlit.title",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "streamlit.markdown",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "streamlit.selectbox",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "streamlit.sele... |
10406407968 | from typing import final
import cv2
import numpy as np
import util
import csv
ALPHABET_SET = "0123456789abcdefghijklmnopqrstuvwxyz"
BLANK = '-'
CHAR_SET = BLANK + ALPHABET_SET
# Read input file for bounding boxes coordinates
def read_bounding_boxes(filename: str):
# Store each coordinates
bounding_boxes_coor... | Adilius/OCR-python | app/text_recognition.py | text_recognition.py | py | 3,026 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "csv.reader",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.argmax",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "cv2.dnn.readNet",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "cv2.dnn",
"line_number": ... |
23054188182 | from driver import Driver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import NoSuchElementException
from datetime import date
import time
def format_date(event_date):
"""Convert date from string to datetime object"""
convert_mont... | canasmh/USCUCEI | startgrowupstate.py | startgrowupstate.py | py | 5,166 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "datetime.date",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "driver.Driver",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.common.by.By.TAG_NAME",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_nam... |
38588808978 | import errno
import logging
import random
import re
import string
import struct
import sys
import time
from datetime import datetime
from threading import Thread
from .crtpdriver import CRTPDriver
from .crtpstack import CRTPPacket
from .crtpstack import CRTPPort
from .exceptions import WrongUriType
from cflib.crazyfli... | hibetterheyj/Crazyflie_Auto_Navigation_Landing | code/crazyflie-lib-python/cflib/crtp/debugdriver.py | debugdriver.py | py | 38,308 | python | en | code | 7 | github-code | 21 | [
{
"api_name": "sys.version_info",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "crtpdriver.CRTPDriver",
"line_number": 55,
"usage_type": "name"
},
{
"api_name": "queue.Q... |
6632620500 | import typing
T = typing.TypeVar("T")
def to_string(node: "Node") -> str:
output = node.to_string()
left, right = node.left, node.right
if left:
output += "\n" + to_string(left)
if right:
output += "\n" + to_string(right)
return output
def pretty_print(node: "Node... | danielafriyie/algos | trees/python/binary_tree.py | binary_tree.py | py | 6,536 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "typing.TypeVar",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "typing.Generic",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "typing.Optional",
"line_number": 23,
"usage_type": "attribute"
}
] |
33930966371 | from django import template
register = template.Library()
@register.filter(name='to_string')
def to_string(value):
bytes_literal = value
return bytes_literal.decode('utf-8')
@register.filter(name='num_to_string')
def num_to_string(value):
bytes_literal = value
return int(bytes_literal.decode('utf-8... | SleepinNinja/catalyst-count | query_builder/templatetags/custom_tags.py | custom_tags.py | py | 323 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.template.Library",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 2,
"usage_type": "name"
}
] |
72277345333 | import os
from torch.cuda import is_available
# device HP
CUDA = is_available()
Device = 0
# experiment name HP
Language = 'en'
Paradigm = 'V'
ExpansionIterations = 0
OrthoAlg = False
ExpDir = '' # should be set only for continued work on interrupted runs
FixLemmas = True
## PATHS
RootDir = os.path.dirname(os.pat... | OnlpLab/morphodetection | hyper_params.py | hyper_params.py | py | 1,328 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",... |
29653331150 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('public', '0007_checkout_currency_string'),
]
operations = [
migrations.RemoveField(
model_name='checkout',
... | NobleSF/Cobra | apps/public/migrations/0008_remove_checkout_currency.py | 0008_remove_checkout_currency.py | py | 361 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.RemoveField",
"line_number": 14,
"usage_type": "call"
},
... |
7754944824 | """
Constants for testing
Constants
---------
REL : float
almost equal resolution
"""
from pathlib import Path
"tolerance for floating point comparisons"
REL = 1e-4
"database path"
DATA_PATH = Path(__file__).parent.parent / "data"
| peeeyow/star-field-image-simulator | tests/image_generation/constants.py | constants.py | py | 239 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pathlib.Path",
"line_number": 16,
"usage_type": "call"
}
] |
1347442826 | #!/usr/bin/python3
"""0-hello_route module"""
from flask import Flask
app = Flask(__name__)
@app.route('/', strict_slashes=False)
def hello_hbnb():
"""Route definition"""
return "Hello HBNB!"
if __name__ == '__main__':
"""App entering point"""
app.run(host='0.0.0.0', port=5000)
| Zuribaby/AirBnB_clone_v2 | web_flask/0-hello_route.py | 0-hello_route.py | py | 301 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
}
] |
32764071192 | import sys, os, re
from openpyxl import Workbook
import logging
logging.basicConfig(level=logging.DEBUG, format=' %(asctime)s - %(levelname)s - %(message)s')
#logging.basicConfig(filename='myProgramLog.log', level=logging.DEBUG, format=' %(asctime)s - %(levelname)s - %(message)s')
logging.disable(logging.DEBUG)
def d... | zyq5428/python-project | chp12/text2excel.py | text2excel.py | py | 1,968 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "logging.basicConfig",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "logging.disable",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
... |
33571579598 | import praw
import json
import datetime
import os
from auth import client_id, client_secret, user_agent
from config import subreddit, limit
# Create a Reddit instance with your credentials
reddit = praw.Reddit(
client_id=client_id,
client_secret=client_secret,
user_agent=user_agent
)
# Fetch hot posts
# h... | JanProvaznik/alginmentjam-mental-chat | reddit.py | reddit.py | py | 970 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "praw.Reddit",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "auth.client_id",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "auth.client_secret",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "auth.user_agent",
"l... |
17593923786 | """
Text File
---------
Takes file or directory path, uses the dictionary
in the file(s) to pass into the extractor.
**Plugin name:** ``text_file``
.. list-table::
:header-rows: 1
* - Option
- Value Type
- Description
* - ``filepath``
- ``string``
- ``REQUIRED`` the path to input... | cedadev/stac-generator | stac_generator/plugins/inputs/text_file.py | text_file.py | py | 1,389 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "stac_generator.core.input.BaseInput",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "os.path.isdir",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "os.lis... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.