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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
73279896638 | # -*- coding: utf-8 -*-
# @Author: ander
# @Date: 2020-12-22 16:19:51
# @Last Modified by: ander
# @Last Modified time: 2020-12-22 16:25:49
import pdfplumber
from PyPDF2 import PdfFileReader, PdfFileWriter, PdfFileMerger
import os.path
from .utilities import mkdir
class PDFBot(object):
"""docstring for ExcelB... | AndersonBY/python-makerbean | makerbean/PDFBot.py | PDFBot.py | py | 1,204 | python | en | code | 7 | github-code | 97 | [
{
"api_name": "os.path.path.splitext",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "os.path.path.basename... |
39361459865 | import streamlit as st
import os
from PIL import Image
import pickle
import numpy as np
import pickle
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras.preprocessing import image
from keras.layers import GlobalMaxPool2D
from keras.applications.resnet import ResNet50, preprocess_input
... | ideepankarsharma2003/ProductRecommendationSystem | app.py | app.py | py | 3,309 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.array",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "keras.applications.resnet.ResNet5... |
34572982800 | # -*- coding: utf-8 -*-
"""
Created on Sun Apr 12 13:18:17 2020
@author: user
"""
import cv2
import numpy
from keras.models import load_model
model = load_model('hand_sign.h5')
CLASS_MAP = {"A": 0,"B": 1,"C": 2,"D": 3,"E": 4,"F": 5,"G": 6,"H": 7,"I": 8,"K": 9,
"L": 10,"M": 11,"N": 12,"O": 1... | Ravindu-Dilshan/AI-Sign_Language_Classification | hand sign demo.py | hand sign demo.py | py | 2,476 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "keras.models.load_model",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2RGB",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "cv2.resiz... |
8388923650 | from django.conf.urls import include, url
from . import views, feed
urlpatterns = [
url(r'^$', views.PostIndex.as_view(), name='index'),
url(r'^p/(?P<slug>\S+)/$', views.PostDetail.as_view(), name='post'),
url(r'^t/(?P<slug>\S+)/$', views.TagIndex.as_view(), name='tag'),
url(r'^feed/$', feed.PostsFeed(... | wtee/djogger | djog/urls.py | urls.py | py | 410 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.conf.urls.url",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.co... |
75099758718 | import re
import scrapy
from scrapy.loader import ItemLoader
from w3lib.html import remove_tags
from ..items import AtikerItem
class AtikerSpider(scrapy.Spider):
name = 'atiker'
start_urls = ['http://www.atiker.bg/news/', 'http://www.atiker.bg/bg/%D0%BD%D0%BE%D0%B2%D0%B8%D0%BD%D0%B8/']
def parse(self, response... | hristo-grudev/atiker | atiker/spiders/spider.py | spider.py | py | 1,116 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "scrapy.Spider",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "w3lib.html.remove_tags",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "scrapy.loader.ItemLo... |
5818685140 | from pyautogui import *
import keyboard
import pyautogui
import win32api, win32con
#tile 1 1510
#tile 2 1620
#tile 3 1730
#tile 4 1840
#y 680
#rgb tile 101
time.sleep(5)
intial_pixel = [0]
def click(x,y):
win32api.SetCursorPos((x,y))
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,0,0)
win3... | FerranRm96/Python-Projects | Piano Tiles Bot/piano_bot.py | piano_bot.py | py | 743 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "win32api.SetCursorPos",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "win32api.mouse_event",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "win32con.MOUSEEVENTF_LEFTDOWN",
"line_number": 17,
"usage_type": "attribute"
},
{
"api... |
3935077242 | # -*- coding: utf-8 -*-
import Connect2Pi
import threading
import keyboard
import time
import sys
import cv2
from PyQt5.QtWidgets import QApplication, QMainWindow, QLabel
from PyQt5.QtGui import QImage, QPixmap
from PyQt5.QtCore import QTimer, QThread, Qt, QEvent
IP = ''
re_port = '5555'
se_port = '5556'
global Vx
gl... | ChengXiangLuo/home_robot | code_on_pc/Run.py | Run.py | py | 4,536 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "Connect2Pi._RecvImg",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "Connect2Pi._SendCmd",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "threading.Event",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidge... |
13953016449 | import mysql.connector
import config
import gspread
from google.oauth2 import service_account
from email.mime.text import MIMEText
import smtplib
# Connect to MySQL database
try:
mydb = mysql.connector.connect(
host="localhost",
user="root",
password="DTWP8o#GpPH#Egp",
database="tes... | CDProjects/License-Number-Test-Project | script.py | script.py | py | 3,377 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "mysql.connector.connector.connect",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "mysql.connector.connector",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "mysql.connector",
"line_number": 10,
"usage_type": "name"
},
{
"... |
37480348250 | from bs4 import BeautifulSoup
from urllib import request
import article
from datetime import datetime, timezone
class Scraper:
def __init__(self,url) -> None:
self.url = url
self.publisher = self.__class__.__name__
@staticmethod
def _generate_soup(url):
source = request.urlopen... | Ta7ar/Precis | scraper.py | scraper.py | py | 4,206 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "urllib.request",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "article.Artic... |
14924612171 | import os
import sys
from dataclasses import dataclass
import keras.callbacks
import tensorflow as tf
from keras import layers
from src.spamDetection.exception import CustomException
from src.spamDetection.logger import logging
from src.spamDetection.utils import save_object
tf.random.set_seed(42)
@dataclass
class... | amulyaprasanth/email_spam_detection_CVIP_Data_Science_Intern | src/spamDetection/components/model_trainer.py | model_trainer.py | py | 3,375 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "tensorflow.random.set_seed",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tensorflow.random",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.pat... |
43462190068 | # To add a new cell, type '# %%'
# To add a new markdown cell, type '# %% [markdown]'
# %%
import sys
sec_f = 24
from vinyl_srw.srwlib import *
from vinyl_srw.uti_plot import *
from scipy.ndimage.interpolation import zoom
import os
import numpy as np
import pandas as pd
from itertools import islice
from scipy.interpola... | IharLobach/fur | wiggler_radiation/SRW/generate_SRW_spectrum_script.py | generate_SRW_spectrum_script.py | py | 8,508 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "fur.path_assistant.get_srw_precalculated_spectrum_dir",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "fur.path_assistant",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "config.get_from_config",
"line_number": 27,
"usage_type": "call"... |
72566008318 | from jinja2 import Template
my_template = """
router bgp {{local_as}}
neighbor {{peer1_ip}} remote-as {{peer1_as}}
update-source loopback99
ebgp-multihop 2
address-family ipv4 unicast
neighbor {{peer2_ip}} remote-as {{peer2_as}}
address-family ipv4 unicast
"""
bgp_vars = {
"local_as" : 42,
... | dalrain/python-network-automation | week5/exercise1.py | exercise1.py | py | 505 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "jinja2.Template",
"line_number": 21,
"usage_type": "call"
}
] |
83252788 | import requests
import time
import json
import sys
TIMEOUT = 5
class HttpErrorDetails:
def __init__(self, request_code, request_name, request_message, try_again=False):
"""
This object holds the details of an http error and how to handle it.
:param request_code: The http error n... | RoybOG/CalcFarm2.0 | Calc_Farm_Communications.py | Calc_Farm_Communications.py | py | 15,960 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "json.dumps",
"line_number": 102,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 128,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 148,
"usage_type": "call"
},
{
"api_name": "requests.exceptions",
"line... |
20382140661 | import os
import time
from multiprocessing import Pool
import shutil
from pyrouge import Rouge155
def process(data):
candidates, references, pool_id = data
cnt = len(candidates)
current_time = time.strftime('%Y-%m-%d-%H-%M-%S', time.localtime())
tmp_dir = "rouge-tmp-{}-{}".format(current_time,pool_id... | baoyujing/MultiGraS | evaluators/eval_rouge.py | eval_rouge.py | py | 3,653 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "time.strftime",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "time.localtime",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
8473747378 | import datetime
import json
import icecream
from bson import json_util, ObjectId
from flask import request, Response
from settings import app
from controller import DbHelper
database_helper = DbHelper()
@app.route('/user', methods=['POST'])
def register_user():
data = json.loads(request.data)
database_hel... | moevm/nosql2h22-family-finance | backend/views.py | views.py | py | 3,529 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "controller.DbHelper",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "flask.request.data",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "flask.request"... |
22200174464 | import time
import random
from BrowserWindow import BrowserWindow
from CommSecDefs import CommSec
from selenium.webdriver.common.keys import Keys
from bs4 import BeautifulSoup
from CommonDefs import Fields
from Password import *
class Producer:
def __init__(self, consumer_group, syncgroup):
self.consumer_... | erandurage/asxbots | Producer.py | Producer.py | py | 5,527 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "BrowserWindow.BrowserWindow",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "CommSecDefs.CommSec.REFRESH",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "CommSecDefs.CommSec",
"line_number": 22,
"usage_type": "name"
},
{
"... |
4015987025 | from django.contrib.gis.db.models import PointField
from location_field.forms import spatial as forms
from location_field.models.base import BaseLocationField
class LocationField(BaseLocationField, PointField):
formfield_class = forms.LocationField
def __init__(self, *args, **kwargs):
super(Location... | caioariede/django-location-field | location_field/models/spatial.py | spatial.py | py | 521 | python | en | code | 533 | github-code | 97 | [
{
"api_name": "location_field.models.base.BaseLocationField",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.contrib.gis.db.models.PointField",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "location_field.forms.spatial.LocationField",
"line_number"... |
34358837321 | import logging
from flask import Flask
from flask_cors import CORS
from flask.logging import default_handler
from logging.handlers import RotatingFileHandler
app = Flask(__name__)
CORS(app)
app.config.from_pyfile('config.cfg')
app.logger.removeHandler(default_handler)
log_path = app.config["LOG_PATH"]
log_format = "... | kamsandhu93/visitor-signin | database_api/dbapi/__init__.py | __init__.py | py | 833 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.logging.default_handler",
"line_number": 11,
"usage_type": "argument"
},
{
"api_name": "logging.F... |
40455945598 | from odoo import api, fields, models, _
from odoo.exceptions import UserError, ValidationError
from odoo.addons.delivery_ups.models.ups_request import UPSRequest, Package
from odoo.tools import pdf
import logging
_logger = logging.getLogger(__name__)
class ProviderUPS(models.Model):
_inherit = 'delivery.carrier'
... | hibou-io/hibou-odoo-suite | delivery_ups_hibou/models/delivery_ups.py | delivery_ups.py | py | 22,000 | python | en | code | 38 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "odoo.models.Model",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "odoo.models",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "odoo.exceptions.Val... |
40712934699 | import csv
import json
import os
import re
import tact.processing.datetime_parser as datetime_parser
import tact.util.constants as constants
from tact.control.logging_controller import LoggingController as loggingController
logger = loggingController.get_logger(__name__)
def find_date_components(field_names):
m... | Dylan-Pugh/TACT | tact/processing/analyzer.py | analyzer.py | py | 6,834 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "tact.control.logging_controller.LoggingController.get_logger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tact.control.logging_controller.LoggingController",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "re.compile",
"line_number": 16... |
34271460693 | import math
import time
from copy import copy
import matplotlib.pyplot as plt
import random as rd
import string
import numpy as np
class Specimen:
def __init__(self, sectors: dict, points: float):
self.sectors = sectors
self.points = points
def __repr__(self):
return f"Specimen({self... | MatiMara/factory-optimization | genetic-alg.py | genetic-alg.py | py | 8,457 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "random.shuffle",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "string.ascii_uppercase",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "math.sqrt",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.std",
... |
4542113401 | # -*- coding: utf-8 -*-
plt.close("all")
clear_all()
import Volt_Imfunctions as im
from scipy.ndimage.filters import gaussian_filter
from scipy.ndimage.morphology import binary_fill_holes
from keras.models import load_model
from keras import backend as K
K.set_image_dim_ordering('th') # color channel first
path... | ahrens-lab/VoltageImaging_pipeline | Recognize_Neurons.py | Recognize_Neurons.py | py | 5,824 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "keras.backend.set_image_dim_ordering",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "keras.backend",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "keras.models.load_model",
"line_number": 25,
"usage_type": "call"
},
{
"api_na... |
8220656040 | from matplotlib import pyplot
import numpy
import scipy.stats
import seaborn
import pickle
import prob_spline
import test_common
import pandas as pd
import pickle
import joblib
from time import gmtime, strftime
def parallel_splines(to_be_run,file_name,N,Mos_Class=0,sigma=0,sample=0,combine_index=[],remove_index=[]... | mullert613/Probability_Spline | generate_splines.py | generate_splines.py | py | 3,232 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "time.strftime",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "time.gmtime",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "joblib.Parallel",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "joblib.delayed",
"line_... |
38637588935 | from OpenGL.GL import *
from OpenGL.GL import shaders
from OpenGL import arrays
from OpenGL.arrays.arraydatatype import GLfloatArray
from OpenGL.GL.VERSION import GL_1_1
import glfw
import pygame
import glm
import math
import numpy
from ctypes import sizeof, c_float, c_void_p, c_uint, c_short
from collections import O... | PitterL/PyOpenglSample | opg_wrapper.py | opg_wrapper.py | py | 18,195 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "glm.mat4",
"line_number": 113,
"usage_type": "call"
},
{
"api_name": "glm.mat4",
"line_number": 126,
"usage_type": "call"
},
{
"api_name": "glm.mat4",
"line_number": 137,
"usage_type": "call"
},
{
"api_name": "glfw.init",
"line_number": 155,
... |
13001829759 | # Original way to create a basic screen
# import pygame
# pygame.init()
#
# win = pygame.display.set_mode((500, 500))
#
# pygame.display.set_caption("First Game")
#
# x = 50
# y = 50
# width = 40
# height = 60
# vel = 5
#
# run = True
# while run:
# pygame.time.delay(100)
#
# for event in pygame.event.get():
# ... | yousefa00/Atwood | Main.py | Main.py | py | 16,074 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pymunk.pygame_util.to_pygame",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "pymunk.pygame_util",
"line_number": 57,
"usage_type": "attribute"
},
{
"api_name": "pygame.draw.circle",
"line_number": 58,
"usage_type": "call"
},
{
"api_name"... |
20344771222 | from nisnap.utils.aseg import basal_ganglia_labels, cortical_labels
from nisnap.utils.aseg import amygdala_nuclei, hippocampal_subfields
__format__ = '.png'
def pick_labels(data, labels):
"""Replaces all values by zero in a Numpy array (`data`) except values
passed in `labels`. Used to select some specific l... | xgrg/nisnap | nisnap/snap.py | snap.py | py | 13,455 | python | en | code | 8 | github-code | 97 | [
{
"api_name": "numpy.where",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.isin",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 23,
... |
29815400462 | import numpy as np
import matplotlib.pyplot as plt
def read_jam_factor(path):
last_time = 0
data = []
with open(path) as f:
line = f.readline()
while line:
s = line.split(' ')
s = [float(x) for x in s]
t = s[0]
if int(t) >= last_time + 30:
... | AdaCompNUS/summit | PythonAPI/examples/plot_jam_factor.py | plot_jam_factor.py | py | 2,444 | python | en | code | 151 | github-code | 97 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.xlim",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "m... |
30147922120 | import argparse
import numpy as np
from smac.env import StarCraft2Env
# import whatever you need to defined and load your trained model
##########################################################################
from learners import REGISTRY as le_REGISTRY
from runners import REGISTRY as r_REGISTRY
from controllers imp... | yongjin-shin/VBC_test | src/run_model.py | run_model.py | py | 7,518 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.average",
"line_number": 110,
"usage_type": "call"
},
{
"api_name": "utils.logging.get_logger",
"line_number": 125,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 128,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
5481864898 | import unittest
from sql import Validate, Parser, QueryBuilder
class CheckTests(unittest.TestCase):
def test_fail_on_sql_restricted_keywords(self):
keywords = ['select', 'Delete', 'fRom', 'join', 'wherE', 'ORDER BY', 'GROUP BY']
for k in keywords:
self.assertRaises(AssertionError, Validate.check_not_ke... | Polychart/polychart2 | backend/tests.py | tests.py | py | 5,686 | python | en | code | 374 | github-code | 97 | [
{
"api_name": "unittest.TestCase",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "sql.Validate.check_not_keywords",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "sql.Validate",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": ... |
18340839586 | import datetime
def compact_result(data: list) -> list:
buf = []
for item in data:
item = dict(item)
keys = item.keys()
for key in keys:
if type(item[key]) is datetime.datetime:
item[key] = str(item[key])
buf.append(item)
return buf
| vadim7j7/tornado-oauth | app/utils/__init__.py | __init__.py | py | 310 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "datetime.datetime",
"line_number": 11,
"usage_type": "attribute"
}
] |
18926304637 |
from config import *
import os, shutil, stat
import numpy as np
import cv2
class Data_Generator():
"""
this class contains method for generating synthetic data with and without circles in the images
Attributes:
perc_mix_images: float, percentage of images to be generated with mix shapes out of all th... | kjosh10/Circle-Detector-from-a-Synthetic-Data | util/synthetic_data_generator.py | synthetic_data_generator.py | py | 13,149 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.listdir",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "shutil.rmtree",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.chmod",
"line_number": 36,
... |
20040970732 | # -*- conding: utf-8 -*-
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from mmseg.ops import resize
from mmseg.core import add_prefix
from mmseg.models.builder import SEGMENTORS
# from mmseg.models.segmentors.encoder_decoder import EncoderDecoder
from .change_encoder_decoder imp... | aiearth-damo/deeplearning | aiearth/deeplearning/models/changedet/segmentors/change_detector.py | change_detector.py | py | 26,892 | python | en | code | 33 | github-code | 97 | [
{
"api_name": "change_encoder_decoder.ChangeEncoderDecoder",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "mmseg.models.builder.build_head",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "mmseg.models.builder",
"line_number": 71,
"usage_type": "name... |
42771215181 | from django.shortcuts import render
# Create your views here.
posts_data = [
{
"slug":"nature-at-its-best",
"title": "Nature at its best",
"image": "some image",
"description": "Some long text goes here, try loreol lumsum"
},
{
"slug":"mountaing-hiking",
"ti... | ansarkhalil/storefront | blog/views.py | views.py | py | 1,029 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.shortcuts.render",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 38,
"usage_type": "call"
}
] |
13438545921 | #!/usr/bin/env python3
import os
import sys
import ipaddress
def usage():
print(f"Usage: {os.path.basename(sys.argv[0])}: <netmask> [address]")
def main():
narg = len(sys.argv)
if narg == 1:
usage()
sys.exit(1)
try:
prefix = ipaddress.ip_network(sys.argv[1], strict=False)
... | piger/Preferences | bin/netmask.py | netmask.py | py | 839 | python | en | code | 6 | github-code | 97 | [
{
"api_name": "os.path.basename",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number"... |
22442226093 | import pygame
import sys
from pygame.locals import *
# include own libs
from Model import *
from Controller import *
from Utility import Vec2
import Utility as util
class View:
def __init__(self, MODEL=None, SCREEN_SIZE=(800, 600)):
self.model = MODEL
self.screen_size = SCREEN_SIZE
self.... | EphTron/blind-racers | View.py | View.py | py | 2,553 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pygame.display.set_mode",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.set_caption",
"line_number": 18,
"usage_type": "call"
},
{
"api_name":... |
278006067 | import numpy as np
import logging
from collections import Counter
from uuid import uuid4
from typing import Type, List
from embedding import SparseEmbeddingCloud
def timelines_overlap(a_s: int, a_e: int, b_s: int, b_e: int) -> bool:
"""
First overlapping condition:
D1, {T1, M1}:
4________... | supamee/sandbox | shepherd_tool/utils/farm_utils.py | farm_utils.py | py | 1,998 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.ndarray",
"line_number": 48,
"usage_type": "attribute"
},
{
"api_name": "embedding.SparseEmbeddingCloud",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "typing.Type",
"line_number": 54,
"usage_type": "name"
},
{
"api_name": "embeddi... |
31045101645 | # scripts/web_scraper.py
import requests
from bs4 import BeautifulSoup
def scrape_webpage_text(url):
response = requests.get(url)
soup = BeautifulSoup(response.text, 'html.parser')
# Remove any script or style elements
for script in soup(['script', 'style']):
script.extract()
# Get the te... | gyasis/Research_Assistant | scripts/web_scraper.py | web_scraper.py | py | 474 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 7,
"usage_type": "call"
}
] |
38898564750 | from django.core.management.base import BaseCommand, CommandParser
from conditions.models import Condition
from conditions.registry import register_condition_raster
class Command(BaseCommand):
help = "Loads rasters based on conditions existing in the database."
def add_arguments(self, parser: CommandParser) ... | romero61/Planscape | src/planscape/conditions/management/commands/load_rasters.py | load_rasters.py | py | 1,739 | python | en | code | null | github-code | 97 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.core.management.base.CommandParser",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "conditions.models",
"line_number": 27,
"usage_type": "nam... |
1626567628 | # Author @ Alex Boyce
import numpy as np
import time
import matplotlib.pyplot as plt
def getRandomInts(min, maxPlusOne, numInts):
"""Assumes the following:
min is an int which specifies the smallest random int to generate
maxPlusOne is an int which specifies one more than largets random int to generate
... | nood-leog/CS112-Current | Project3/boyce-project3.py | boyce-project3.py | py | 6,382 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.random.randint",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "time.time",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "time.time",
"lin... |
39870394459 | #!/usr/bin/env python3
# coding=utf-8
"""
Этот скрипт нужен, чтобы делать синаплоты покрытия генов однокопийных и многокопийных ортогрупп.
На вход он берёт
1) Файл logs.txt , который делает calculate_AG.py
2) Размер точки синаплота. Нормальный размер 2.5, но если ортогрупп очень много, то можно и уменьшить.
3) Какое... | shelkmike/Mabs | Additional_src/plot_gene_coverage_distribution.py | plot_gene_coverage_distribution.py | py | 6,145 | python | ru | code | 14 | github-code | 97 | [
{
"api_name": "sys.argv",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number... |
41752030588 | import csv
import pytz
import os
import smtplib
import requests
from datetime import datetime
from dotenv import load_dotenv,find_dotenv
from fastapi import FastAPI
#To load .env file from the project folder
load_dotenv(find_dotenv())
#Initializing FastAPI
app = FastAPI()
#Checking conditions to send messages
def se... | srb1998/sms-api | src/main.py | main.py | py | 2,830 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "dotenv.find_dotenv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "fastapi.FastAPI",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pytz.timezone",... |
6867661359 | import getopt
import math
import os
import sys
import bpy
from typing import List, Optional, Final
import blender_compat
from patches import apply_patches_by_model_name
from data.edit_mode import EditMode
from data.object_shading import ObjectShading
from data.pokemon_render_data import PokemonRenderData
from data.sh... | mikeyX101/PKX-IconGen | PKX-IconGen.Python/common.py | common.py | py | 18,146 | python | en | code | 6 | github-code | 97 | [
{
"api_name": "typing.Final",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "typing.Final",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "typing.Final",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "typing.Final",
"line_numbe... |
13279386650 | # -*- coding: utf-8 -*-
from kssum.submodular import SubmodularSummarizer
import math
import json
cnsummarizer = SubmodularSummarizer('chinese')
ensummarizer = SubmodularSummarizer('english')
def get_summary(
article,
language='chinese',
slimit=None,
wlimit=None,
ratio=None,... | xiezhongzhao/breaking_news | src/core/kssum/run_submodular.py | run_submodular.py | py | 2,708 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "kssum.submodular.SubmodularSummarizer",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "kssum.submodular.SubmodularSummarizer",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "math.floor",
"line_number": 29,
"usage_type": "call"
},
{
... |
28848533758 | from collections import defaultdict
import pymongo
from wsgi.db import DBHandler
DEFAULT_CT = ""
class SCStorage(DBHandler):
def __init__(self):
super(SCStorage, self).__init__(name="sub connections")
self.sub_connections = self.db["sub_connections"]
self.sub_connections.create_index(
... | alexeyproskuryakov/rr | wsgi/sub_connections.py | sub_connections.py | py | 2,008 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "wsgi.db.DBHandler",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "pymongo.DESCENDING",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "pymongo.ASCENDING",
"line_number": 23,
"usage_type": "attribute"
}
] |
12206832618 | import pandas as pd
import numpy as np
from sklearn import preprocessing
import datetime
import matplotlib.pyplot as plt
import matplotlib.dates as mdate
def interpolate(filename):
"""[从文件中读取数据并插值]
Arguments:
filename {[string]} -- [保存数据的文件路径]
"""
#从txt文件中读取数据,并命名为a-f列,其中a,c,e列为日期,b,d,f列为流... | YinZhaokai/python_tutorial | task3.py | task3.py | py | 6,343 | python | zh | code | 1 | github-code | 97 | [
{
"api_name": "pandas.read_table",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame"... |
2028537011 | # -*- coding: utf-8 -*-
import numpy as np
import numpy.linalg as LA
import os
import argparse
import torch
import matplotlib.pyplot as plt
import random
import math
import glob
import skimage.io
import scipy.optimize
import sklearn.metrics
import scipy.sparse
from sklearn.metrics import pairwise_distances
from sklearn... | yanconglin/VanishingPoint_HoughTransform_GaussianSphere | cluster_nyu.py | cluster_nyu.py | py | 7,010 | python | en | code | 62 | github-code | 97 | [
{
"api_name": "numpy.matrix",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.matrix",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.matrix",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.maximum",
"line_numb... |
17437039931 | # -- coding: utf-8 --
from flask import Flask
#from flask_cors import CORS
import urllib.request
import pymysql
import pandas as pd
from sklearn.metrics.pairwise import cosine_similarity
import collections
import numpy as np
from flask import request
#from flask_cors import CORS
import pickle
HOST = 'database-1.cfi9a... | Umbelievable/textmining | app.py | app.py | py | 6,639 | python | ko | code | 0 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pymysql.connect",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"... |
41616952280 | """Foundation for unit testing an extractor.
Example:
from maco import base_test
class TestExample(base_test.BaseTest):
name = "Example"
path = os.path.join(__file__, "../../extractors")
def test_run(self):
data = b"data with Example information"
ret = self.extract(io.BytesIO(data))
... | CybercentreCanada/Maco | maco/base_test.py | base_test.py | py | 2,555 | python | en | code | 15 | github-code | 97 | [
{
"api_name": "unittest.TestCase",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "maco.collector.Collector",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "maco.collector",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "import... |
985866067 | import matplotlib.pyplot as plt
import math
import numpy as np
import random
#QUESTIONS TO ASK
#Is connector the distance between amino acid pairs, which we would use to sum the distances
#All interactions vs spring interactions
#spring force vs LJ force
#where do we return vector coordinates
#############... | ViggyC/CSCI4314 | HW1/polymer_MD_Python_revised.py | polymer_MD_Python_revised.py | py | 9,806 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.mod",
"line_number": 81,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 98,
"usage_type": "call"
},
{
"api_name": "numpy.dot",
"line_number": 107,
"usage_type": "call"
},
{
"api_name": "numpy.random.rand",
"line_number... |
74740733438 | from bottle import post, response, request, redirect
import json
import data
import jwt
@post('/tweet-api-like/<tweet_id>')
def _(tweet_id):
try:
user_session_jwt = request.get_cookie("jwt_user")
if user_session_jwt not in data.SESSION:
return redirect("/login")
for ... | Elisha2605/Twitter | api/TWEETS/tweet_api_like_post.py | tweet_api_like_post.py | py | 1,213 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "bottle.request.get_cookie",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "bottle.request",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "data.SESSION",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "bottle.red... |
19465923971 | #!/usr/bin/env python
import sys
import configparser
import os
import shutil
import subprocess
# Read config file
home_dir = os.path.expanduser("~")
conf_path = os.path.join(home_dir, ".config/md2rjs/md2rjs.conf")
config = configparser.ConfigParser(delimiters=('='))
config.read(conf_path)
if len(sys.argv) == 2:
... | cnodell/md2rjs | md2rjs.py | md2rjs.py | py | 1,479 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.path.expanduser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numb... |
11246505227 | from django.shortcuts import render
from bs4 import BeautifulSoup
import requests # to send GET requests
def engtonepdict(request):
if request.method == 'POST':
word = request.POST['word']
context = {'q':word}
req = requests.get('https://www.englishnepalidictionary.com/',params=context)... | Sarad3993/english-to-nepali-dictionary | mydictapp/views.py | views.py | py | 603 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django.shortcu... |
8112830127 | from __future__ import absolute_import
from datetime import datetime
import gzip
import urllib2
import threading
try:
import xml.etree.cElementTree as ET
except ImportError:
import xml.etree.ElementTree as ET
try:
import cStringIO as StringIO
except ImportError:
import StringIO
from fiftyone_degrees.mob... | 51Degrees/Device-Detection | python/core/fiftyone_degrees/mobile_detector/usage.py | usage.py | py | 6,692 | python | en | code | 110 | github-code | 97 | [
{
"api_name": "threading.Thread",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "threading.Event",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "fiftyone_degrees.mobile_detector.conf.settings.USAGE_SHARER_ENABLED",
"line_number": 61,
"usage_typ... |
31674887136 | import shutil
from pathlib import Path
PARENT_DIR = Path(__file__).parent
def pytest_sessionfinish():
# delete locally-ephemeral files
media_dir = PARENT_DIR / ".media"
if media_dir.exists():
shutil.rmtree(media_dir)
| colecrtr/webgoods | conftest.py | conftest.py | py | 241 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pathlib.Path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "shutil.rmtree",
"line_number": 12,
"usage_type": "call"
}
] |
4139374636 | """
Evaluate Place Recognition results
Given:
- Descriptors for query and database.
- Poses information for both query and database.
Results:
- Recall@N metrics, where N in {1, 3, 5, 10}. The match is considered "true positive"
if the distance to the GT pose of the query is less than dist_threshold.
... | alexmelekhin/MinkLoc3Dv2 | eval_place_recognition.py | eval_place_recognition.py | py | 8,870 | python | en | code | null | github-code | 97 | [
{
"api_name": "matplotlib.use",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "cv2.FONT_HERSHEY_COMPLEX",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "cv2.LINE_AA",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "cv2.FON... |
40707535917 | import requests
from bs4 import BeautifulSoup
import spotipy
from spotipy.oauth2 import SpotifyOAuth
date = input("Which year do you want to travel to? Type the date in this format YYYY-MM-DD:")
URL = f"https://www.billboard.com/charts/hot-100/{date}/"
ID = "your client id"
SECRET = "your client secret"
response = re... | mrunalbhonde/billboard_top_100 | main.py | main.py | py | 1,564 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "spotipy.Spotify",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "spotipy.oauth2.Spotify... |
41806556931 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import os
import tensorflow as tf
from matplotlib import pyplot as plt
import skimage.io
import sys
# Add object_detection to system path
OBJECT_DE... | newbie-zju/pedestrian_detection_tracking | pedstrian_detection/script/detect_image.py | detect_image.py | py | 8,135 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line... |
41466094347 | #
# Complete the 'getArticleTitles' function below.
#
# The function is expected to return a STRING_ARRAY.
# The function accepts STRING author as parameter.
#
# URL for cut and paste:
# https://jsonmock.hackerrank.com/api/articles?author=<authorName>&page=<num>
#
#
import json,os
import requests
def getArticleTitl... | Janardhanpoola/100exercises-carbooking | hackerrank.py | hackerrank.py | py | 1,367 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 54,
"usage_type": "attribute"
}
] |
44675146029 | from flask.ext.restful import Resource,Api,reqparse,inputs,fields,marshal,marshal_with
from flask import Blueprint,url_for,abort
import models
review_fields={
'id':fields.Integer,
'rating': fields.Integer,
'comment':fields.String,
# 'created_at':fields.DateTime
}
def review_or_404(review_id):
tr... | kashyap32/flask-REST | reviews.py | reviews.py | py | 2,084 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "flask.ext.restful.fields.Integer",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "flask.ext.restful.fields",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "flask.ext.restful.fields.Integer",
"line_number": 10,
"usage_type": "attribu... |
34468161614 | import re
from collections import defaultdict
from functools import reduce
[info, myTicket, otherTickets] = open("16.txt").read().strip().split("\n\n")
# Get a set of ints of the range from a tuple of strings
# eg {1, 2, 3, 4} from ('1', '4')
def get_range_set(rng):
[lo, hi] = list(map(int, rng))
re... | rhamilt/advent-of-code | 2020/16.py | 16.py | py | 3,250 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "re.search",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "functools.reduce",
"... |
1388672133 | from typing import Dict
from space_tycoon_client.models.move_command import MoveCommand
from space_tycoon_client.models.attack_command import AttackCommand
from space_tycoon_client.models.repair_command import RepairCommand
from space_tycoon_client.models.rename_command import RenameCommand
from space_tycoon_client.mo... | azenahlik/space-tycoon-ducks | logic/special.py | special.py | py | 3,878 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "space_tycoon_client.models.data.Data",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "utils.ship_helpers.get_my_ships",
"line_number": 32,
"usage_type": "call"
},
{... |
6329077676 | import collections
import six
import re
from tensorflow.python.framework import errors
from tensorflow.python.framework import ops
from tensorflow.python.ops import control_flow_ops
from tensorflow.python.ops import io_ops
from tensorflow.python.ops import state_ops
from tensorflow.python.ops import variables as varia... | tensorflow/recommenders-addons | tensorflow_recommenders_addons/dynamic_embedding/python/ops/warm_start_util.py | warm_start_util.py | py | 7,967 | python | en | code | 520 | github-code | 97 | [
{
"api_name": "six.string_types",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.python.framework.ops.get_collection",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "tensorflow.python.framework.ops",
"line_number": 26,
"usage_type": "... |
18676331003 | import numpy as np
import cv2 as cv
import imutils
import argparse
import time
def pyramid(image, scale=1.5, minSize=(30, 30)):
yield image
while True:
w = int(image.shape[1] / scale)
image = imutils.resize(image, width=w)
if image.shape[0] < minSize[1] or image.shape[1] < minSize[0]:
break
yield image
de... | DedaKosta/Animals_Detector_Python | script.py | script.py | py | 1,933 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "imutils.resize",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "cv2.dnn.blobFromIma... |
74373147838 | import scrapy
from scrapy.loader import ItemLoader
from ..items import EmiratesnbdItem
from itemloaders.processors import TakeFirst
class EmiratesnbdSpider(scrapy.Spider):
name = 'emiratesnbd'
start_urls = ['https://www.emiratesnbd.com/en/media-centre/?ref=homepage-news&etm_action=hw-news&etm_content=hw-f16-news-... | hristo-grudev/emiratesnbd | emiratesnbd/spiders/spider.py | spider.py | py | 1,222 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "scrapy.Spider",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "scrapy.loader.ItemLoader",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "items.EmiratesnbdItem",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "item... |
31301130463 | import asyncio
import logging
from base64 import b64encode
from aiohttp import ClientSession, ClientTimeout, client_exceptions, web
import caller_utils.caller_configuration as conf
logging.basicConfig(format=conf.get_log_formatter())
ASTERISK_URL = conf.get_asterisk_url()
async def gen_headers(auth_string):
"... | jcfdeb/py-phone-caller | src/asterisk_caller/asterisk_caller.py | asterisk_caller.py | py | 7,448 | python | en | code | 6 | github-code | 97 | [
{
"api_name": "logging.basicConfig",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "caller_utils.caller_configuration.get_log_formatter",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "caller_utils.caller_configuration",
"line_number": 9,
"usage_type":... |
21758414647 | import dep_check
# Python module imports.
from os import sep
PIPE, Popen = None, None
if dep_check.subprocess_module:
from subprocess import PIPE, Popen
# relax module imports.
from lib.errors import RelaxError, RelaxNoSequenceError
from lib.io import mkdir_nofail, open_write_file
from lib.periodic_table import p... | nmr-relax/relax | specific_analyses/relax_disp/sherekhan.py | sherekhan.py | py | 4,810 | python | en | code | 10 | github-code | 97 | [
{
"api_name": "dep_check.subprocess_module",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pipe_control.pipes.check_pipe",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "pipe_control.mol_res_spin.exists_mol_res_spin_data",
"line_number": 33,
"us... |
1351404868 | import os
import json
class Store(object):
_instances = {}
data = {}
def __new__(cls, path, *args, **kwargs):
if path not in Store._instances:
print("creating instance at", path)
Store._instances[path] = super(Store, cls).__new__(cls, *args, **kwargs)
return Store._i... | Trexounay/YoutubeAlert | helpers/save.py | save.py | py | 1,712 | python | en | code | 0 | github-code | 97 | [
{
"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.isfile",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numbe... |
26070288224 | # -*- coding: utf-8 -*-
__author__ = "苦叶子"
from selenium import webdriver
if __name__ == "__main__":
driver = webdriver.Chrome()
driver.implicitly_wait(3)
driver.get("http://www.python.org")
# 通过正确css
ele = driver.find_element_by_css_selector("#fieldset >input[@id='id-search-field']")
pr... | small99/DevAuto | selenium_python/3/3.10_find_ele_by_css.py | 3.10_find_ele_by_css.py | py | 501 | python | en | code | 13 | github-code | 97 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 11,
"usage_type": "name"
}
] |
14430276293 | """
Varelse
By Dakota Madden-Fong
More Info in the Readme
"""
import pygame
import time
import random
print ("""Incoming Message From the Hegemon Command Station:
You, Brother, Have been Chosen to Defend the People
of the World from the Evil Space Buggers. Good Luck!
""")
name = "Joey"
pygame.init()
pygame.display.se... | RITGameDev/RGDCArcadeFrontend | RGDC_Arcade/games/Varelse/game/Varelse.py | Varelse.py | py | 10,036 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "pygame.init",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_caption",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "time.time"... |
36223604462 | from os import stat
import numpy as np
from scipy.interpolate import UnivariateSpline
from model import *
def read_file(file_path):
s = stat(file_path)
if s.st_size >= 1024:
cur_arr = []
with open(file_path, "r", encoding="utf8") as f:
for line in f.readlines()[1:]:
... | Roman-30/DS_chemistry | services.py | services.py | py | 4,238 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.stat",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.transpose",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "scipy.interpolate.UnivariateSpline",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "numpy.arra... |
15316868048 | import copy
from django.db.models import Q
from rest_framework import serializers, status
from rest_framework.response import Response
from rest_framework.exceptions import PermissionDenied, ValidationError
from oarndb.models import Family, AdultFamilyRelationship, ChildFamilyRelationship
from oarndb.models import A... | wire-rabbit/oarn-database | oarndb/serializers/nested_serializers.py | nested_serializers.py | py | 9,514 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "rest_framework.serializers.ListSerializer",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "oarndb.models.Organization.objects.get_read_orgs",
"line_number": 2... |
11658301189 | import torch
from torch.distributions import Normal
import torchaudio
import numpy as np
from typing import Tuple
class AudioAugmentator:
"""
Audio tensor augmentation class.
Args:
tempo (float): Range in which to time stretch audio
pitch (int): Range in which to pitch audio
nois... | erasedwalt/CTC-ASR | src/augmentations/augmentations.py | augmentations.py | py | 1,835 | python | en | code | 8 | github-code | 97 | [
{
"api_name": "torch.distributions.Normal",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "torch.Tensor",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.uniform",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "num... |
28435131789 | #!/usr/bin/env python
# coding: utf-8
# # DETECTION OF RECOLORED IMAGES USING DEEP DISCRIMINATIVE MODEL
# ## Training The Model
# In[1]:
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
from keras.preprocessing.image import ImageDataGenerator, load_img
fro... | kysgattu/Recolored-Image-Detection | RecImgDet.py/RecImgDetNet.py | RecImgDetNet.py | py | 7,645 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "os.listdir",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_numb... |
36446807207 | import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import os.path as osp
def comparison_plot(x_fn, y_fn, idx, title=None):
with open(x_fn, 'r') as fin:
xlines = fin.read().splitlines()[1:]
with open(y_fn, 'r') as fin:
ylines = fin.read().splitlines()[1:]
assert l... | ICRAR/skasdc1 | scripts/plot_flux.py | plot_flux.py | py | 2,653 | python | en | code | 5 | github-code | 97 | [
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "numpy.log10",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "matplotlib.py... |
30303570864 |
import itertools
class Combination:
def __init__(self, data):
self.data = data
def permutations(self, num):
All_Combination = []
for i in range(num):
Var_Index = list(range(self.data.shape[1]))
Var_Name = self.data.iloc[0,:].tolist()
Combination_Ind... | 19910101bacon/EDA_machine | Var_Analysis/Ratio/test1.py | test1.py | py | 5,373 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "itertools.permutations",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "itertools.permutations",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.... |
71521449919 | import eel
from json import loads
import db_dealer
from db_dealer import Entry
from matplotlib import pyplot
eel.init('web')
@eel.expose
def receive_form(form):
form = loads(form)
results = db_dealer.search(form)
eel.displaySearchResults(results)
@eel.expose
def chart_request(data):
sorted_data = {key: value f... | bernardolansing/brazil_impexp_data | interface.py | interface.py | py | 1,278 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "eel.init",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "db_dealer.search",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "eel.displaySearchResults",
"l... |
73812020157 | """
Create ASCII art with figlet
"""
import sys
from pyfiglet import Figlet
figlet = Figlet()
def main():
# Command line argument check
if len(sys.argv) not in (1, 3) or \
len(sys.argv) == 3 and (sys.argv[1] not in ("-f", "--font")) or \
len(sys.argv) == 3 and (sys.argv[2] not in (figlet.getFo... | kvnduff/CS50P | pset4/figlet/figlet.py | figlet.py | py | 813 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pyfiglet.Figlet",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_numbe... |
31121535340 | from bs4 import BeautifulSoup
from sklearn import preprocessing
from multiprocessing import Pool
import os
import glob
import time
import re
import cv2
import numpy as np
IMAGES_PATH = "/data/s2847485/PhD/jpg2/"
METADATA_PATH = "/data/s2847485/PhD/xml2/"
STORING_PATH = "/data/s2847485/PhD/labels/"
class XML_Parser... | paintception/RijksmuseumChallenge | data_utils/dataset_from_xml.py | dataset_from_xml.py | py | 3,479 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "bs4.BeautifulSoup",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number"... |
31101841846 | import matplotlib.pyplot as plt
import math
point1 = [1, 1]
point2 = [2, 1]
newpoints = []
distance = math.sqrt((point2[1] - point1[1])^2 + (point2[0] - point1[0])^2)
if distance > 0.2:
print(distance)
numofpoints = distance / 0.2
for x in range(1, int(numofpoints)+1):
addpoint = newpoints.append(... | Chaitya2108/BeyondTerraCode | square_map.py | square_map.py | py | 2,573 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "math.sqrt",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.t... |
29890873706 | import copy
import os
import torch
import time
from torch import nn
import statsmodels.api as sm
from wind_get_data import get_wind_data, get_toy_data
from wind_module import DoubleMSELoss, DoubleRMSELoss, DoubleICLoss, evaluate
from quant_finance_research.utils import load_pickle, save_pickle, set_seed
from quant_fi... | michael-qwq/quant_finance_research | experiment/RefineAlpha/wind_RefineAlpha_run.py | wind_RefineAlpha_run.py | py | 4,962 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "wind_get_data.get_wind_data",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "wind_preprocess.get_loss_label",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "wind_preprocess.get_loss_label",
"line_number": 31,
"usage_type": "call"
},
... |
6261098640 | '''
fabfile -- deployment using Fabric
=================================================================
expecting local fabric.json with following content
{
"connect_kwargs": {
"key_filename": sshkeyfilename (export OpenSSH key from puttygen)
},
"user": "appuser"
}
execut... | louking/mysql-docker | fabfile.py | fabfile.py | py | 1,525 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "invoke.Exit",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "invoke.Exit",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "fabric.task",
"line_number": 34,
"usage_type": "call"
}
] |
10382743623 | from tkinter import *
from tkinter import filedialog
from tkinter import messagebox
from PyPDF2 import PdfFileMerger
import os
class Merge():
def __init__(self, ui):
self.ui = ui
# list
self.ui.fileList = Listbox(
self.ui.workFrm, width=82, height=20, selectmode='extended')
... | fzboffice/pdf-tool | merge.py | merge.py | py | 4,256 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "tkinter.filedialog.askopenfilenames",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "tkinter.filedialog",
"line_number": 62,
"usage_type": "name"
},
{
"api_name": "PyPDF2.PdfFileMerger",
"line_number": 82,
"usage_type": "call"
},
{
"api_n... |
38889450952 | import time
from selenium.webdriver.common.by import By
from Locators.locators import Locators
from Pages.contactPage import Contact
from tests.test_base import TestBaseHome
import pytest
class TestContactTest(TestBaseHome):
@pytest.mark.abc
def test_lunch_checking(self):
drv = self.driver
... | mmTareque01/zoombangla_automation_using_selenium | tests/test_contact.py | test_contact.py | py | 2,750 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "tests.test_base.TestBaseHome",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "Pages.contactPage.Contact",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "Loc... |
21444685276 | from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from os import path
import mysql.connector
UPLOAD_FOLDER = 'website/static/uploads/'
db = SQLAlchemy()
DB_NAME = "flask_project1"
def create_app():
app = Flask(__name__)
app.config['SECRET_KEY'] = 'hjshjhdjah kjshkjdhjs'
app.config['SQLALCHE... | aashish141294/flask_project_with_mysql | flask_reg/website/__init__.py | __init__.py | py | 1,093 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "website.controller.views.views",
"line_number": 25,
"usage_type": "argument"
},
{
"api_nam... |
39631014054 | from flask import Flask, request, jsonify
from flask_cors import CORS
from process import main
app = Flask(__name__)
CORS(app)
@app.route('/api', methods=["POST"])
def process_data():
data = request.json
fresult = process_function(data)
return jsonify(fresult)
def process_function(fdata):
result = m... | harneeth/health-ai | api.py | api.py | py | 463 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.request.json",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
... |
14886914509 | import os
import asyncio
import time
from pymongo import MongoClient
from utils.config import config
client = MongoClient(config["MONGODB_URI"])
if os.environ.get("ENVIRONMENT") == "DEVELOPMENT":
database = client.appeal_dev
else:
database = client.appeal
import discord
from discord.ext import commands
in... | azure-badr/Appeal | bot/main.py | main.py | py | 5,190 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "utils.config.config",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "os.environ.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.environ",
... |
2782038249 | import numpy as np
import matplotlib.pyplot as plt
def drawMoons(names, xpositions, xlim=[-500,500], labels=False, color=False):
'''
Draw a plot of the positions of moons relative to Jupiter.
This function requires two input arguments. They should
both be lists, and they should be the same size as ... | MichaelSBennett/Jupiter | galileo.py | galileo.py | py | 2,221 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.zeros_like",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "matplotli... |
30505874960 | import torch
def getRotationAngle(R):
return torch.arccos((torch.trace(R) - 1 - 1e-5) / 2)
def hat(v, device):
v = v.flatten()
R = torch.tensor([
[0, -v[2], v[1]],
[v[2], 0, -v[0]],
[-v[1], v[0], 0]]).to(device)
return R
def matExp(omega, device):
I = torch.eye(3).to(... | uzh-rpg/learned_inertial_model_odometry | src/learning/utils/torch_math.py | torch_math.py | py | 638 | python | en | code | 160 | github-code | 97 | [
{
"api_name": "torch.arccos",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "torch.trace",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "torch.tensor",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torch.eye",
"line_number": 18... |
33257973651 | import os
import pathlib
import shutil
import sys
import zipfile
from PyQt5.QtWidgets import QMainWindow, QFileDialog
from check_db import *
from GUI.des import *
from GUI.archive import *
class Interface(QtWidgets.QWidget):
def __init__(self, parent=None):
super().__init__(parent)
self.ui = Ui_Fo... | MykolaKutsyk/Archiver | main.py | main.py | py | 3,504 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 64,
"usage_type": "name"
},
{
"api_name": "os.path.exists",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 79,
"usage_type": "attribute"
},
{
"api_name": "os.remove",
... |
3087197270 | """Module for dealing with the transformations."""
import numpy as np
from numpy import ndarray
from scipy.spatial.transform import Rotation
# TODO: use only this as match as possible
# TODO: test this
def homogenize(vector: ndarray, is_point: bool = True) -> ndarray:
"""Adds 1 or zeros to the last coordinate o... | shaigue/LiveCapCover | lib/utils/transformation.py | transformation.py | py | 4,864 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.ndarray",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "numpy.ndarray",
"line_number": 14,
"usage_type": "argument"
},
{
"api_name": "numpy.full",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.concatenate",
"l... |
10213744332 | """
该文件用于bert进行特征提取
然后利用BLSTM与Attention进行文本分类,训练模型并且保存。
"""
import pymysql
import matplotlib.pyplot as plt
from keras.utils import to_categorical
from keras.layers import Input, BatchNormalization, Dense,Bidirectional, LSTM,Dropout
from keras import Input, losses, Sequential
from keras import backend as K
from keras.la... | sidan-dan/bertServer | nlp_classify.py | nlp_classify.py | py | 13,868 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "keras.callbacks.Callback",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "numpy.argmax",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.argmax",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.f1... |
73328008959 | from typing import List
import torch
from torch import nn
import numpy as np
from torchvision.models import resnet18
def get_resnet_18():
model = resnet18()
model.fc = nn.Linear(in_features=512,out_features=10,bias=True)
return model
class EarlyStopping:
def __init__(self, tolerance=5, min_delta=0):
... | d22cs051/dlops-23 | assignment/D22CS051 Lab Assignment 8/models.py | models.py | py | 697 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "torchvision.models.resnet18",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.nn.Linear",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 9,
"usage_type": "name"
}
] |
19916205837 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 28 14:41:23 2019
@author: shaun
"""
def centroid(region, img):
""" Takes input in terms of coordinates of region
and returns its centroid"""
x_centre = 0
y_centre = 0
elements = 0
for i in region:
x_centre += i[0]*im... | ShaunZac/Feature-Extraction | centroiding_initial.py | centroiding_initial.py | py | 2,859 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.array",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 71,
... |
17985923706 | # -*- coding: utf-8 -*-
import base64
import logging
import base64
import xlwt
from io import BytesIO
try:
from BytesIO import BytesIO
except ImportError:
from io import BytesIO
import zipfile
from datetime import datetime
from odoo import http, exceptions
from odoo.http import request
from odoo.http import con... | 13655699934/melon_addons | attach_zip_download/controllers/main.py | main.py | py | 3,888 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "odoo.http.Controller",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "odoo.http",
... |
41512894967 | from subprocess import getoutput
import argparse, platform
###############################################
# #
# Us3r Unl0ck3d #
# Author: azazelm3dj3d #
# GitHub: https://github.com/azazelm3dj3d #
# ... | azazelm3dj3d/us3r-unl0ck3d | src/main.py | main.py | py | 9,650 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "platform.system",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "subprocess.getoutput",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "subproce... |
17902999046 | """Mixins for (API) views in the whole project."""
from bleach import clean
from rest_framework import generics, status
from rest_framework.response import Response
class CleanMixin():
"""Model mixin class which cleans inputs."""
# Define a map of fields avaialble for import
SAFE_FIELDS = {}
def cr... | rohankumardubey/InvenTree | InvenTree/InvenTree/mixins.py | mixins.py | py | 2,965 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "rest_framework.response.Response",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "rest_framework.status.HTTP_201_CREATED",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.status",
"line_number": 20,
"usage_type": "na... |
70833851198 | # Advent of Code day 12, part 2, Hot Springs.
# https://adventofcode.com/2023/day/12
from icecream import ic
import functools
# From, https://medium.com/@nkhaja/memoization-and-decorators-with-python-32f607439f84
def memoize(func):
cache = func.cache = {}
@functools.wraps(func)
def memoized_func(*args, **... | johntelforduk/advent-of-code-2023 | 12-hot-springs/part2.py | part2.py | py | 2,732 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "functools.wraps",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "icecream.ic",
"line_number": 87,
"usage_type": "call"
},
{
"api_name": "icecream.ic",
"line_number": 90,
"usage_type": "call"
}
] |
22835267372 | #!/usr/bin/python3
from PIL import Image
import os
import array
import time
import sys
import argparse
from ctypes import *
import numpy
numpy.set_printoptions(threshold=numpy.nan)
numpy.set_printoptions(linewidth=2000)
colorScheme = numpy.array([(0x00, 0x00, 0x8F), \
(0x00, 0x0F, 0xFF), \... | cccitron/mastersThesis | pythonSAD/cToPy.py | cToPy.py | py | 1,755 | python | en | code | 7 | github-code | 97 | [
{
"api_name": "numpy.set_printoptions",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.nan",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "numpy.set_printoptions",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.ar... |
29780045786 | import requests
from pathlib import Path
class WeatherForecast:
"""
{
"state": "晴れ",
"max": "13℃",
"min": "5℃",
"max_diff": "[-5]",
"min_diff": "[0]",
"icon": "https://s.yimg.jp/images/weather/general/next/size150/100_night.png",
"rainy-percent": [
... | showgayaki/otenkisan | backend/otenkisan/weather_forecast.py | weather_forecast.py | py | 2,500 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_numbe... |
14185499746 | """
Pushes new music library data up into the cloud (i.e. the AppEngine
data store). This causes the newly-added tracks to appear in the DJ
database and other chirpradio apps.
TODO(trow): Some of this is a bit hacky; it was put together quickly
to do the initial import. It needs cleaning up before it can be put
into... | chirpradio/chirpradio-machine | chirp/library/do_push_to_chirpradio.py | do_push_to_chirpradio.py | py | 5,919 | python | en | code | 12 | github-code | 97 | [
{
"api_name": "sys.argv",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "chirp.common.timestamp.parse_human_readable",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "chirp.common.timestamp",
"line_number": 37,
"usage_type": "name"
},
{
"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.