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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
41378387257 | from django import urls
from django.conf.urls import url
from django.urls import path
from django.conf import settings
from django.conf.urls.static import static
from . import views
urlpatterns = [
url(r'^allVehicles/(?P<otype>[\w]+)/$',
views.filterVehicle_view, name='VehicleFilter'),
url(r'^editPers... | WWalusiak/Fleetmanager | FleetManager/manager/urls.py | urls.py | py | 3,185 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.conf.urls.url",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django... |
7740117405 | import pandas as pd
import numpy as np
import os
path, dirs, files = next(os.walk("./input/Dataset/GlobalDataset/Splitted/"))
file_count = len(files)
data1 = pd.DataFrame()
for nb_files in range(file_count):
datag = pd.read_csv(f'{path}{files[nb_files]}', encoding="ISO-8859โ1", dtype = str)
data1 = pd.concat(... | EagleEye1107/E-GNNExplainer | src/dataset_analysis/select_k_best.py | select_k_best.py | py | 3,500 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.walk",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_numb... |
38729573666 | import tensorflow as tf
# Reading data and set variables
# MNIST Dataset
from tensorflow.examples.tutorials.mnist import input_data
# Check out https://www.tensorflow.org/get_started/mnist/beginners for
# more information about the mnist dataset
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
# prin... | The-G/PYTHON_study | Tensorflow study/Lecture07-Learning rate, Evaluation, MNIST/Lab7-2.py | Lab7-2.py | py | 11,779 | python | ko | code | 0 | github-code | 1 | [
{
"api_name": "tensorflow.examples.tutorials.mnist.input_data.read_data_sets",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "tensorflow.examples.tutorials.mnist.input_data",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "tensorflow.placeholder",
"line_num... |
26466912861 | '''
Created on 17.2.2016
@author: Claire
'''
import urllib, codecs
from requests import Request, Session
import requests, json, logging
logger = logging.getLogger('lasQuery')
hdlr = logging.FileHandler('/tmp/linguistics.log')
formatter = logging.Formatter('%(asctime)s %(name)s %(levelname)s %(message)s')
hdlr.setForm... | SemanticComputing/aatos | las_query.py | las_query.py | py | 5,981 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.FileHandler",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.Formatter",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG... |
41210654822 | from pymongo import MongoClient
client= MongoClient('localhost:27017')
db = client.train
def read():
try:
trainCol=db.traincsv.find()
print("All data From database")
for train in trainCol:
print(train)
except Exception as e:
print(str(e))
read()
| kaif3120/manuals | BIG DATA PRACTICALS/PRAC 8 MONGO FIND.py | PRAC 8 MONGO FIND.py | py | 303 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 2,
"usage_type": "call"
}
] |
43901190306 | import tkinter as tk
import random
from names import name_list
from traits import trait_list
from appearence import appearence_list
from inventory import inventory_list
# tkinter shit
root = tk.Tk()
root.configure(bg = 'grey')
# functions
def save():
with open("Saved NPCs.txt", "a") as file:
... | bonsaipropaganda/NPC-Generator | main.py | main.py | py | 4,049 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "tkinter.Tk",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "names.name_list",
"line_number": 35,
"usage_type": "argument"
},
{
"api_name": "random.choice",
"line... |
5873286899 | from credentials import aws_key, aws_id, aws_region, sqs_name, arn
from time import sleep
import json
import boto.sqs
import boto.sns
from boto.sqs.message import Message
import ast
from alchemyapi import AlchemyAPI
from elasticsearch import Elasticsearch, RequestsHttpConnection
from requests_aws4auth import AWS4Auth
i... | litesaber15/elastictweetmap | Worker/worker.py | worker.py | py | 2,465 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "boto.sqs.sqs.connect_to_region",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "credentials.aws_region",
"line_number": 18,
"usage_type": "argument"
},
{
"api_name": "boto.sqs.sqs",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_n... |
30721629451 | import numpy as np
import pandas as pd
import torch
import torch.nn.functional as F
from torch.utils.data import Dataset, DataLoader, RandomSampler, SequentialSampler
import sklearn as sk
#from rouge_score import rouge_scorer
from transformers import T5Tokenizer, T5ForConditionalGeneration
import os
import torch
if t... | vksoniya/fakenewsdetectionframework | Utils/T5Summarizer.py | T5Summarizer.py | py | 5,261 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torch.cuda.cu... |
40903031893 | '''
In this project, you will visualize the feelings and language used in a set of
Tweets. This starter code loads the appropriate libraries and the Twitter data you'll
need!
'''
import json
from textblob import TextBlob
import matplotlib.pyplot as plt
from wordcloud import WordCloud
#Get the JSON data
tweetFile = o... | RachelA314/Aboutme | DataVisualizationProject/Data_vis_project_pt1.py | Data_vis_project_pt1.py | py | 2,883 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "json.load",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "textblob.TextBlob",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "textblob.TextBlob",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "textblob.TextBlob",
... |
25463176927 | import bz2
import csv
import argparse
import os
import numpy as np
import tensorflow as tf
from sklearn.naive_bayes import GaussianNB
def parse_argument():
parser = argparse.ArgumentParser(description='arg parser')
parser.add_argument('--input_dir', default='cp_loss_count_per_game')
parser.add_argument('-... | CSSLab/maia-individual | 4-cp_loss_stylo_baseline/train_cploss_per_game.py | train_cploss_per_game.py | py | 5,449 | python | en | code | 18 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.norm",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.listdi... |
35672480130 | import os
import json
import csv
class dirSummary:
def __init__(self, dirName):
self.dirName = dirName
self.file = open(os.path.join(self.dirName, self.dirName+"_map.csv"), "w")
fieldnames = ["ID", "Title", "Acitvity Type", "Date", "Time", "Distance","Moving Time"]
self.writer = csv.DictWriter(self.file, fiel... | Abhiram98/strava-scraper | scraper/dirSummary.py | dirSummary.py | py | 1,381 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.join",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "csv.DictWriter",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 1... |
72495902115 | import argparse
from functools import partial
import json
import logging
from multiprocessing import Pool
import os
import sys
sys.path.append(".") # an innocent hack to get this to run from the top level
from tqdm import tqdm
from openfold.data.mmcif_parsing import parse
from openfold.np import protein, residue_co... | aqlaboratory/openfold | scripts/generate_chain_data_cache.py | generate_chain_data_cache.py | py | 4,124 | python | en | code | 2,165 | github-code | 1 | [
{
"api_name": "sys.path.append",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.path.splitext",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numb... |
32434406258 | from contextlib import ExitStack, contextmanager
from fnmatch import fnmatch
from glob import glob
from params_proto import ParamsProto, Proto, Flag
class UploadArgs(ParamsProto):
""" ML-Logger upload command
Example:
ml-upload --list # to see all files in the current directory for upload
m... | geyang/ml_logger | ml_logger/cli/upload.py | upload.py | py | 4,894 | python | en | code | 176 | github-code | 1 | [
{
"api_name": "params_proto.ParamsProto",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "params_proto.Flag",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "params_proto.Proto",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "params_p... |
25327899692 |
import datetime
import pandas as pd
import random
import simpy
import numpy as np
from scipy.stats import uniform
class Elevator:
"""
Elevator that move people from floor to floor
Has a max compatity
Uses a event to notifiy passengers when they can get on the elevator
... | jeroensimacan/simulating_logistics_processes | elevator.py | elevator.py | py | 9,910 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "scipy.stats.uniform",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "scipy.stats.uniform",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "simpy.Resource",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "numpy.random.u... |
22386637474 | import serial
import time
import binascii
ser = serial.Serial("COM8", 9600)
t = (0x1F00FFFF).to_bytes(4, byteorder="big")
print(t)
while True:
time.sleep(0.1)
ser.write(t)
result = ser.read_all()
if result != b'':
print(result) | yato-Neco/Tukuba_Challenge | main_program/rust/Robot/sw.py | sw.py | py | 254 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "serial.Serial",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 11,
"usage_type": "call"
}
] |
34002926250 | from urllib2 import Request, urlopen
import xml.etree.ElementTree as ET
import json
url_request = Request('http://inciweb.nwcg.gov/feeds/rss/incidents/state/3')
try:
url_response = urlopen(url_request)
rss_content = url_response.read()
except Exception as e:
print(str(e))
xml_root = ET.fromstring(rss_con... | anshulankush/CronkitePython | PhpToPython/wildfire_python_parser.py | wildfire_python_parser.py | py | 1,518 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "urllib2.Request",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "urllib2.urlopen",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree.fromstring",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "xml.et... |
32195310986 | from django.conf.urls.defaults import *
from django.contrib.syndication.views import feed as feed_view
from django.views.generic import date_based, list_detail
from django.contrib import admin
from ebblog.blog.models import Entry
from ebblog.blog import feeds
admin.autodiscover()
info_dict = {
'queryset': Entry.o... | brosner/everyblock_code | ebblog/ebblog/urls.py | urls.py | py | 1,167 | python | en | code | 130 | github-code | 1 | [
{
"api_name": "django.contrib.admin.autodiscover",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "ebblog.blog.models.Entry.objects.order_by",
"line_number": 11,
"usage_type": "call"
... |
35939540734 | '''
Created on Nov 28, 2012
@author: cosmin
'''
from google.appengine.ext import webapp, db
import jinja2
import os
import logging as log
jinja_environment = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)))
class ClustersP(webapp.RequestHandler):
def get(self):
'''... | cosminstefanxp/freely-stats | remote-code/ClustersP.py | ClustersP.py | py | 1,456 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "jinja2.Environment",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "jinja2.FileSystemLoader",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
23228107132 | import cv2
import numpy as np
from tensorflow.keras.models import load_model
from tensorflow.keras.applications.mobilenet_v2 import preprocess_input
from tensorflow.keras.preprocessing.image import img_to_array
import subprocess
import kakao_MES_api
facenet = cv2.dnn.readNet('face_detector/deploy.prototxt', 'face_dete... | parksj0923/KORartilleryman | 5corps_artillery/makerthon/final/raspberry/main.py | main.py | py | 2,810 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "cv2.dnn.readNet",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.dnn",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.keras.models.load_model",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.Vid... |
20157899929 | import os
os.environ['PYOPENGL_PLATFORM'] = 'egl'
from render_utils import load_obj_mesh, param_to_tensor, rotate_mesh, \
pers_get_depth_maps, get_depth_maps, pers_add_lights, add_lights
from tqdm import tqdm
import numpy as np
import pickle
import smplx
import cv2
import torch
from scipy.spatial.transform import R... | SangHunHan92/2K2K | render/render.py | render.py | py | 18,787 | python | en | code | 170 | github-code | 1 | [
{
"api_name": "os.environ",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line... |
2879811950 | import tensorflow as tf
import numpy as np
from sklearn.metrics import mean_squared_error, mean_absolute_error
from tensorflow.keras import optimizers
from datetime import datetime as dt
from load_data import load_wph_train, inverse_transform, load_wph_test
from EnvConfounderIRM import EnvAware
path = '/data/u... | RoeyW/ood-for-smart-cities | Model/PIRM_wph.py | PIRM_wph.py | py | 7,828 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "datetime.datetime.now",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "tensorflow.keras.metrics.Mean",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": ... |
25541238216 | import traceback
from django.shortcuts import render
from django.http import HttpResponse
from django.template import loader
from django.shortcuts import redirect
import json
from . import ibood_db
from .ibood_scraper import POSSIBLE_FILTERS
def home(request):
if request.method == 'POST':
data = req... | wardgeronimussmets/Aviato | master/aviato/iBOOD/views.py | views.py | py | 3,913 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "ibood_scraper.POSSIBLE_FILTERS",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "django.template.loader.get_template",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "django.template.loader",
"line_number": 28,
"usage_type": "name"
},
... |
11207175018 | """
Tests for data obfuscation tasks.
"""
import errno
import json
import logging
import os
import shutil
import tarfile
import tempfile
import xml.etree.ElementTree as ET
from unittest import TestCase
from luigi import LocalTarget
from mock import MagicMock, sentinel
import edx.analytics.tasks.export.data_obfuscati... | openedx/edx-analytics-pipeline | edx/analytics/tasks/export/tests/test_data_obfuscation.py | test_data_obfuscation.py | py | 31,225 | python | en | code | 90 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "unittest.TestCase",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "mock.sentinel.ignored",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "mock.s... |
72374385954 | import MySQLdb
import MySQLdb.cursors as cursors
from Pattern import Pattern
import datetime
from pprint import pprint
import uuid
from pypika import MySQLQuery, Table, Field, Order, functions as fn, JoinType
import time
import json
import socket
from openpyxl import Workbook
import copy
import requests
import time
imp... | hlmn/TA | checkReplikasi.py | checkReplikasi.py | py | 3,402 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "MySQLdb.connect",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "Pattern.Pattern",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "MySQLdb.connect",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "MySQLdb.cursors.DictC... |
18096915998 | import requests
import csv
import bs4 as bs
from calendar import monthrange as mr
import pandas as pd
import arrow
# Grabs the url for the selected month and parses it using html
urls = ['http://clubomgsf.com/calendar/month/2019/01/']
for url in urls:
response = requests.get(url)
soup = bs.BeautifulSoup(respon... | Astatham98/EventWebScrape | webscrape1/clubomg.py | clubomg.py | py | 5,250 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "calendar.monthrange",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "arrow.get",
"l... |
72861963873 | import os
from read_configure import ReadConfigure
import requests
rc = ReadConfigure()
class InterfaceTest:
global rc
def __init__(self):
self.__protocol = rc.getmethod('protocol')
self.__method = rc.getmethod('method')
self.__url = rc.geturl('url')
pidict = rc.getparameters... | cwk0099/PythonProject | request_test/test.py | test.py | py | 758 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "read_configure.ReadConfigure",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 23,
"usage_type": "call"
}
] |
29598589421 |
# coding: utf-8
# In[2]:
#!pip install --upgrade pip
#!pip install casadi
# In[3]:
# Import casadi
from casadi import *
# Import Numpy
import numpy as np
# Import matplotlib
import matplotlib.pyplot as plt
# Import Scipy to load .mat file
import scipy.io as sio
import pdb
# In[4]:
def simulate_MPC(d_full, S... | ell-hol/mpc-DL-controller | data_generator.py | data_generator.py | py | 11,272 | python | en | code | 61 | github-code | 1 | [
{
"api_name": "numpy.array",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": ... |
44302804442 | # -*- coding: utf-8 -*-
"""
Created on Mon Nov 21 08:43:08 2016
@author: RDCHLMTR
"""
import numpy as np
import matplotlib.pyplot as plt
import scipy.optimize as opt
x = np.array([41,79,82,85,87,89,90,92,93,94,95,96,97,98,99,100,101,102,103,106])
y = np.array([4,11,14,16,17,18,21,23,25,27,30,32,34,37,40,... | passaloutre/kitchensink | python/exp_fit_example.py | exp_fit_example.py | py | 641 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.array",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
37900967768 | import random
import sosbet
import datetime
import math
import sosfish_constants
def SellerText(data, user):
fish = FishOfTheDay(data)
output = f"You hear a local merchant offering to buy three {fish} for a {sosbet.CURRENCY}."
if fish in data[user]["catchlog"].keys():
if fish not in data[user]["sell_log"].key... | Aster-Iris/menatbot | sosfish_market.py | sosfish_market.py | py | 2,169 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sosbet.CURRENCY",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "sosbet.addMoney",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "sosbet.saveMoney",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "sosbet.CURRENCY... |
71074785634 | # Quadratic Model (in x) from the UQ4K paper
#
# Author : Mike Stanley
# Created : Sep 30, 2021
# Last Modified : Sep 30, 2021
from collections.abc import Iterable
import numpy as np
from uq4k.models.base_model import BaseModel, Modelparameter
class QuadraticModel(BaseModel):
"""
Implementatio... | JPLMLIA/UQ4K | uq4k/models/quadratic_model.py | quadratic_model.py | py | 1,603 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "uq4k.models.base_model.BaseModel",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "collections.abc.Iterable",
"line_number": 36,
"usage_type": "argument"
},
{
"api_name": "uq4k.models.base_model.Modelparameter",
"line_number": 37,
"usage_type": "c... |
70122758435 | from typing import Any, Dict
from django.forms.models import BaseModelForm
from django.http import HttpRequest, HttpResponse
from django.shortcuts import render
from django.contrib import messages
from django.contrib.auth.views import LoginView, LogoutView
from django.urls import reverse_lazy
from django.views.generic ... | Lifanna/geology_proj | geology_proj/main/views.py | views.py | py | 19,256 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.contrib.auth.views.LoginView",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "django.urls.reverse_lazy",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "django.contrib.messages.error",
"line_number": 25,
"usage_type": "call"
},... |
21181509403 | from mpl_toolkits.mplot3d import axes3d
import numpy as np
import matplotlib.pyplot as plt
def read(filename, delimiter=','):
return np.genfromtxt(filename, delimiter=delimiter)
def plot(array):
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d') # 111 means "1x1 grid, first subplot"
p = ... | CIFASIS/wganvo | vgg_trainable/test/plot_traj.py | plot_traj.py | py | 1,301 | python | en | code | 9 | github-code | 1 | [
{
"api_name": "numpy.genfromtxt",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "matplotlib... |
31298542819 |
'''
Read COVID-19 case data from HDX and store as a set of json files.
This can be used to provide a no-backend API if the files are saved
in the DocumentRoot of a server. For example:
http://some.host/all.json # global data, plus manifest of other countries
http://some.host/CAN.json # a specific country
Usage:
... | hkashiwase/decdg-covid19 | python/cvapi.py | cvapi.py | py | 4,710 | python | en | code | null | github-code | 1 | [
{
"api_name": "docopt.docopt",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strftime",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "datetime.d... |
5053673486 | from application.Models.models import User
from flask import escape
from base64 import b64decode, b64encode
import json
from datetime import datetime
from application import app
import os
from geopy.distance import geodesic
notLoggedIn = dict({
"isLoggedIn": False,
'message': 'Your are not logged in'
})
found ... | theirfanirfi/flask-book-exchange-apis | application/API/utils.py | utils.py | py | 2,536 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.escape",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "base64.b64decode",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "application.Models.models.User.query.filter_by",
"line_number": 55,
"usage_type": "call"
},
{
"api_... |
4614264680 | import pygame
import os
pygame.init()
FONTS = [
pygame.font.Font(pygame.font.get_default_font(), font_size) for font_size in [48, 36, 16, 12]
]
DEFAULT_FONT = 2
COLORS = {
"bg": (200, 200, 200), # ่ๆฏ้ข่ฒ
"select": (0, 139, 139),
"current": (255, 192, 203),
"line": (175, 175, 175),
"wall": (50... | BigShuang/Pathfinding-algorithm-display | square block grid/basic_animation.py | basic_animation.py | py | 11,175 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "pygame.init",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.font.Font",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.font",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pygame.font.get_default_fo... |
73619854753 | from bs4 import BeautifulSoup
import time
from openpyxl import Workbook
import pandas as pd
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from webdriver_manager... | Debraj-Das/Search_Engine | Web_Scripting/LeetCodeTemp.py | LeetCodeTemp.py | py | 5,020 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.DataFrame",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "openpyxl.Workbook",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.ChromeOptions",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "s... |
72963427555 | from __future__ import division
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
def load_dataset():
CLASS_NUM = 3
FILE_NUM = 1000
dataset = list()
for itr_class in range(CLASS_NUM):
file_dir = "./data/Data_Train/Class{:d}/".format(itr_class + 1)
for idx in... | wu0607/2018-Spring-ML-Graduate | HW3/Machine Learning hw3/src/util.py | util.py | py | 2,458 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "numpy.array",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "numpy.meshgrid",
"line_numbe... |
6086114417 | import torch.nn as nn
import torch.distributed as dist
def initialize_weights(model):
for m in model.modules():
if isinstance(m, nn.Linear):
nn.init.xavier_normal_(m.weight)
# m.bias.data.zero_()
elif isinstance(m, nn.BatchNorm1d):
nn.init.constant_(m.weight, 1... | jinxixiang/low_rank_wsi | mil/models/model_utils.py | model_utils.py | py | 515 | python | en | code | 7 | github-code | 1 | [
{
"api_name": "torch.nn.Linear",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "torch.nn.init.xavier_normal_",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.nn.init... |
43472299216 | from django.contrib.auth.hashers import make_password
from django.contrib.auth.models import Group
from django.db import transaction
from django.shortcuts import render, redirect
from django.urls import reverse_lazy
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_exemp... | chrisstianandres/pagos | apps/cliente/views.py | views.py | py | 8,331 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "apps.backEnd.nombre_empresa",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "apps.mixins.ValidatePermissionRequiredMixin",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "apps.user.models.User",
"line_number": 29,
"usage_type": "name"
... |
22147146770 | import json
import os
import time
from flask import Flask, jsonify, make_response
from flask import request
from flask_cors import CORS
import logging
import requests
from models.reqdb import Request, Base
from models.model import Model
from models.container import Container
from models.configurations import RequestsS... | NicholasRasi/ROMA2 | components/requests_store/main.py | main.py | py | 13,696 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "models.reqdb",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "prometheus_client.Gauge",
... |
71552736995 | import numpy as np
import cv2
import tqdm
import argparse
import os
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("--image_path", help="path to the image", required=True)
parser.add_argument("--patch_size", default="15", help="patch size")
args = parser.parse_args()
retur... | ErmiasBahru/wave-art | main.py | main.py | py | 1,440 | python | en | code | 13 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_nu... |
73546122274 | #!python
import json
import argparse
import sys
from datetime import datetime
class Hypothesis:
'''
this class represents a guess
'''
def __init__(self, name, hypothesis, confidence, notes, dtime):
self.name = name
self.hypothesis = hypothesis
self.confidence = confidence
... | josh-mcq/hypothesis | guess.py | guess.py | py | 2,813 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "json.dump",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_numb... |
26979634933 | import math
import numpy
from numpy.typing import ArrayLike
from search import embedding
from sklearn.cluster import KMeans
from tenseal.tensors.ckksvector import CKKSVector
class Index:
"""
Index class for efficient searching in a corpus using clustering and matrix representation.
Parameters:
- mod... | fpiedrah/private-search | search/index.py | index.py | py | 3,120 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "search.embedding.Model",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "search.embedding",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "math.ceil",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
... |
8027377031 | # -*- coding: utf-8 -*-
'''
'''
#############
## LOGGING ##
#############
import logging
from fitsbits import log_sub, log_fmt, log_date_fmt
DEBUG = False
if DEBUG:
level = logging.DEBUG
else:
level = logging.INFO
LOGGER = logging.getLogger(__name__)
logging.basicConfig(
level=level,
style=log_sub,... | waqasbhatti/fitsbits | fitsbits/_modtemplate.py | _modtemplate.py | py | 544 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "logging.DEBUG",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "logging.INFO",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "logging.basicC... |
11514219682 | # Released under the MIT License. See LICENSE for details.
#
"""Tools related to ios development."""
from __future__ import annotations
import pathlib
import subprocess
import sys
from dataclasses import dataclass
from efrotools import getprojectconfig, getlocalconfig
MODES = {
'debug': {'configuration': 'Debug... | efroemling/ballistica | tools/efrotools/ios.py | ios.py | py | 6,959 | python | en | code | 468 | github-code | 1 | [
{
"api_name": "dataclasses.dataclass",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 52,
"usage_type": "attribute"
},
{
"api_name": "efrotoo... |
9539722024 | from gensim.models.doc2vec import Doc2Vec, TaggedDocument
from nltk.tokenize import word_tokenize
from gensim import corpora
import gensim
import gensim.downloader as api
from gensim.matutils import softcossim
#from gensim import fasttext_model300
from gensim import *
import fasttext
import gensim.downloader as api
#im... | kungfumas/similaritas-dokumen | Doc2Vec/train.py | train.py | py | 2,421 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "gensim.corpora.Dictionary",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "gensim.corpora",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "gensim.downloader.load",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "gensi... |
19074849435 | import logging
from odoo.addons.base_rest import restapi
from odoo.addons.base_rest.components.service import to_int
from odoo.addons.base_rest_datamodel.restapi import Datamodel
from odoo.addons.component.core import Component
_logger = logging.getLogger(__name__)
class CyclosService(Component):
_inherit = "bas... | Lokavaluto/lokavaluto-addons | lcc_cyclos_base/services/cyclos_services.py | cyclos_services.py | py | 2,113 | python | en | code | 5 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "odoo.addons.component.core.Component",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "odoo.addons.base_rest.restapi.method",
"line_number": 20,
"usage_type": "call"
},... |
833867895 | #coding:utf-8
import requests
import threading
from bs4 import BeautifulSoup
import re
import os
import time
import sys
content_url = "http://www.biquge.com.tw/12_12603/"
kv = {'user_agent': 'Mozilla/5.0'} # ่กจ็คบๆฏไธไธชๆต่งๅจ
try:
r = requests.get(content_url, headers=kv)
r.raise_for_status()
r.encoding = r.appare... | smilepasta/PythonDemo | basic/note.py | note.py | py | 1,893 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"... |
29147395643 | import matplotlib.image as mpimg
from tensorflow.keras.utils import img_to_array, load_img
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
from keras.models import load_model
# Load the model
model = load_model('model12.h5')
# Convert the model to a quantized model
converter = tf... | maazjamshaid123/early_detection_pneumonia | detect.py | detect.py | py | 1,337 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "keras.models.load_model",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "tensorflow.lite.TFLiteConverter.from_keras_model",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "tensorflow.lite",
"line_number": 12,
"usage_type": "attribute"
... |
15133768093 | """
Benjamin Granat
ITP 449
Assginment 9
Trains and tests a logistic regression based on diabetes classification data
Produces confusion matrix visualization
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import confusi... | bengranat/ITP449 | Diabetes Classification.py | Diabetes Classification.py | py | 2,658 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model.LogisticRegression",
"line_number": 56,
"usage_type": "call... |
35914507591 | #! /usr/bin/env python3
# (re)construit les fichiers README.md de description des challenges
import json
import glob
import os
import io
from collections import namedtuple
import yaml
# tuple
Slug = namedtuple('Slug', ['order', # numรฉro pour maintenir l'ordre
'link', # lie... | rene-d/hackerrank | hr_table.py | hr_table.py | py | 9,670 | python | en | code | 72 | github-code | 1 | [
{
"api_name": "collections.namedtuple",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "glob.iglob",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_nu... |
29861647037 | import streamlit as st
from sklearn import datasets
from sklearn.neighbors import KNeighborsClassifier
from sklearn.svm import SVC
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import RandomForestClassifier
from sklearn.neural_network import MLPClassifier
from sklearn.ensemble import AdaBoostCla... | yaswanth2802/machine-learning-web-app | app.py | app.py | py | 3,258 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "streamlit.title",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "streamlit.sidebar.selectbox",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "streamlit.sidebar",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "st... |
74480044513 | import main
import alg_cluster
import random
import matplotlib.pyplot as plt
import time
def get_random_clusters(num_clusters):
result_list = []
for num in range(num_clusters):
result_list.append(alg_cluster.Cluster(set([num]), random.random()*2 - 1, random.random()*2 - 1,0,0))
return result_list
... | pakzaban/Clustering_Algorithmic_Thinking_Project_3 | myPlots.py | myPlots.py | py | 1,189 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "alg_cluster.Cluster",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "random.random",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "main.slow_closest_pair",
... |
29376346831 | from django.urls import path
from .views import solicitar_turno, turnos_cliente, turnos_veterinario, VerTurnoVeterinario, ver_turno_cliente
urlpatterns = [
path('solicitar_turno', solicitar_turno, name='solicitar_turno'),
path('turnos_cliente', turnos_cliente, name='turnos_cliente'), # No me gusta el nombre, ... | bautimercado/oh-my-dog | ohmydog/turnos/urls.py | urls.py | py | 624 | python | es | code | 0 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "views.solicitar_turno",
"line_number": 5,
"usage_type": "argument"
},
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "views.turnos... |
36937078898 | import bpy
import os
import logging
from pathlib import Path
log = logging.getLogger(__name__)
# in future remove_prefix should be renamed to rename prefix and a target prefix should be specifiable via ui
def fixBones(remove_prefix=False, name_prefix="mixamorig:"):
bpy.ops.object.mode_set(mode = 'OBJECT')
... | RichardPerry/Mixamo-Root | mixamoroot.py | mixamoroot.py | py | 15,617 | python | en | code | 11 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "bpy.ops.object.mode_set",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "bpy.ops",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "bpy.ops",
"... |
25093423154 | from __future__ import print_function
import argparse
import codecs
import numpy as np
import json
import requests
"""
This file is part of the computer assignments for the course DD1418/DD2418 Language engineering at KTH.
Created 2017 by Johan Boye and Patrik Jonell.
"""
"""
This module computes the... | aljica/spraktek | assignment-1/Aligner/Aligner.py | Aligner.py | py | 8,035 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 185,
"usage_type": "call"
},
{
"api_name": "codecs.open",
"line_number": 197,
"usage_type": "call"
},
{
"api_name": "codecs.open",
"line_number": 199,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"... |
20176565752 | #!/usr/bin/env python
# -----------------------
# Supplementary Material for Deith and Brodie 2020; โPredicting defaunation โ accurately mapping bushmeat hunting pressure over large areasโ
# doi: 10.1098/rspb.2019-2677
#------------------------
# Code to iterate through GFLOW results files, modify the outputs based ... | mairindeith/DeithBrodie2020_PredictingDefaunationBorneo | Circuit-theory simulations/GFLOWOutput_Summation.py | GFLOWOutput_Summation.py | py | 9,286 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.defaultdict",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "os.pa... |
29990285621 | ## The wext merged datafile
import sys
input_file = sys.argv[1]
data_file = sys.argv[2]
output_file = sys.argv[3]
cutoff = float(sys.argv[4])
#cutoff = 5
import pandas as pd
from sklearn.metrics import precision_recall_curve
from random import random
import math
from scipy.stats import chi2
import numpy as np
import ... | raphael-group/SC-hap | scripts/create_hapcut_input_fishers.py | create_hapcut_input_fishers.py | py | 3,765 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "sys.argv",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": ... |
73550094432 | import numpy as np
from sympy import symbols, pi, sin, cos, atan2, sqrt, simplify
from sympy.matrices import Matrix
import tf
"""
Test file for building the Kuka 6 DoF manipulator's forward and inverse
kinematic code.
FK(thetas) -> pose
IK(pose) -> thetas
"""
def build_mod_dh_matrix(s, theta, alpha, d, a):
"""B... | camisatx/RoboticsND | projects/kinematics/kuka_kr210/kuka_ik.py | kuka_ik.py | py | 7,730 | python | en | code | 57 | github-code | 1 | [
{
"api_name": "sympy.matrices.Matrix",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "sympy.cos",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "sympy.sin",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "sympy.sin",
"line_numbe... |
354278636 | from html_parser import MyHTMLParser
import urllib.request
from bs4 import BeautifulSoup
import requests
from language_detecter import LanguageDetector
parser = MyHTMLParser()
#url = "https://www.vpnverbinding.nl/beste-vpn/netflix/"
url = "https://www.vpnconexion.es/blog/mejor-vpn-para-netflix/?_ga=2.224715098.13068... | ferchovzla/translated_words_checker | main.py | main.py | py | 1,587 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "html_parser.MyHTMLParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "urllib.request.request.Request",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 12,
"usage_type": "attribute"
},
{
... |
12287855696 | import cv2
import numpy as np
from calibrate_frame import *
from socket import gethostname
class Camera(object):
"""
Camera access wrapper.
"""
def __init__(self, pitch=0, port=0, test = 0):
self.capture = cv2.VideoCapture(port)
self.pitch = pitch
self.test = test
def get... | pbsinclair42/SDP-2016 | vision/camera.py | camera.py | py | 757 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 28,
"usage_type": "call"
}
] |
27178702909 | from flask import Flask, request, render_template
students = [
{'studentNo': '10001', 'studentName': 'Student 1'},
{'studentNo': '10002', 'studentName': 'Student 2'},
]
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html', students=students)
app.run(debug=True)
| pytutorial/flask_students1 | app.py | app.py | py | 320 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 12,
"usage_type": "call"
}
] |
26205226971 | #!/usr/bin/env python3
import json
import logging
from watchdog.events import FileSystemEventHandler, FileModifiedEvent
from watchdog.observers import Observer
import xml.etree.ElementTree as ET
logger = logging.getLogger(__name__)
class IoMBianAvahiServicesFileHandler(FileSystemEventHandler):
def __init__(sel... | Tknika/iombian-services-uploader | src/iombian_avahi_services_file_handler.py | iombian_avahi_services_file_handler.py | py | 1,997 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "watchdog.events.FileSystemEventHandler",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "watchdog.observers.Observer",
"line_number": 26,
"usage_type": "call"
},
{
... |
12047781262 | import argparse
import json
from pyspark.sql import SparkSession
def main(input_hfs_path,
outliers_output_hfs_path,
clean_output_hfs_path,
config):
from filters.api import resolve_filter
spark = SparkSession \
.builder \
.appName("TextOutlier") \
.getOrCreat... | zphang/big_data_proj | main.py | main.py | py | 3,316 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pyspark.sql.SparkSession.builder.appName",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pyspark.sql.SparkSession",
"line_number": 12,
"usage_type"... |
72593883233 | """ pretrain a word2vec on the corpus"""
import argparse
import os
from os.path import join, exists
from time import time
from datetime import timedelta
import gensim
class Sentences(object):
""" needed for gensim word2vec training"""
def __init__(self, data_path):
with open(data_path, '... | behome/tianchi | code/train_word2vec.py | train_word2vec.py | py | 1,821 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "time.time",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "gensim.models.Word2Vec",
"li... |
25476349860 | # -*- coding: utf-8 -*-
import datetime
from pathlib import Path
import emoji
import os
import re
from logzero import logger as log
from peewee import fn
from telegram import (
ForceReply,
InlineKeyboardButton,
InlineKeyboardMarkup,
KeyboardButton,
ReplyKeyboardMarkup,
TelegramError,
)
from tel... | JosXa/BotListBot | botlistbot/components/admin.py | admin.py | py | 38,333 | python | en | code | 56 | github-code | 1 | [
{
"api_name": "botlistbot.settings.ADMINS",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "botlistbot.settings",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "botlistbot.models.Revision.get_instance",
"line_number": 47,
"usage_type": "call"
}... |
28228061323 | import openai
import os
import random
import json
def get_json(path):
with open(path, 'r') as f:
d = f.read()
try:
return eval(d)
except:
return json.loads(d.replace("\\\\", "\\"))
def json_to_prompt(question_json):
# chatgpt can handle parsing the json
return f"Here is a json of a question, choose the... | kennethgoodman/llm_take_tests | lsat/chat_gpt_takes_lsat.py | chat_gpt_takes_lsat.py | py | 3,382 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "json.loads",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "openai.ChatCompletion.create",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "openai.ChatCompletion",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "op... |
23259752199 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from lmfit import Model
import scienceplots
elements=['Al','Mo','Ni','Ti','Zn']
alphas=[1.486,17.480,7.480,4.512,8.637]
mpos=[200,1600,800,500,900]
Mpos=[-3800,-2100,-3200,-3525,-3100]
resolutions=[]
res_unc=[]
def gaussian(x,amp,cen,sig):
re... | g-Baptista-gg/TecEsp | enRes.py | enRes.py | py | 1,594 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.exp",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "lmfit.Model",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number"... |
4911617378 | import json
from django.core.management.base import BaseCommand
from domain.policies.models import Policy
class Command(BaseCommand):
help = "seeds the database with default data from a JSON file"
def handle(self, *args, **options):
with open("seed.json", "r") as json_file:
seed = json.lo... | antoniopataro/decision-engine | config_backend/api/management/commands/seed.py | seed.py | py | 548 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "json.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "domain.policies.models.Policy.objects.create",
"line_number": 16,
"usage_type": "call"
... |
74934217314 | import logging
from datetime import timedelta
from typing import Optional
_LOGGER = logging.getLogger(__name__)
class WorkInterval:
def __init__(self, duration: timedelta, minimum: timedelta, maximum: timedelta, warmup: Optional[timedelta], tick_duration: timedelta):
self._tick_duration = tick_duration.s... | yanoosh/home-assistant-heating-radiator | custom_components/heating_radiator/WorkInterval.py | WorkInterval.py | py | 1,660 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 9,
"usage_type": "name"
}
] |
17436198272 | from flask import Flask, request, render_template
app = Flask(__name__)
## Q1. Create a Flask application that displays "Hello, World!" on the homepage.
@app.route("/")
def index():
return "Hello World"
## Q2. Write a Flask route that takes a name parameter and returns "Hello, [name]!" as plain text.
@app.rou... | abhisunny2610/Data-Science | Python Practice Set/Practice Solution 11/app.py | app.py | py | 1,022 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "flask.request.args.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask.request.args",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "flask.reque... |
15212267498 | import pandas_profiling
from pathlib import Path
import glob
import argparse
import matplotlib.pyplot as plt
import pandas as pd
import os.path as osp
import xml.etree.ElementTree as ET
import numpy as np
from collections import Counter
title =['filename',
'img_width',
'img_height',
'img_dep... | fanqie03/mmdetection.bak | tools/analyze_voc.py | analyze_voc.py | py | 3,061 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree.parse",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 42,
"usage_type": "name"
},
{
"api_nam... |
29867234262 | import pytest
import requests
import json
def test_product():
url = 'http://commdity-develop.kapeixi.cn/product/PPI1001001'
headers = {"content-type": "application/json"}
para = {'skuIdList': [773, 778, 788]}
r = requests.post(url, json=para, headers=headers)
print(json.dumps(r.json(),indent=2,en... | jmc517/HogwartsANDY15 | service/api_test.py | api_test.py | py | 405 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.post",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pytest.main",
"line_number": 15,
"usage_type": "call"
}
] |
73033974433 | # -*- coding: utf-8 -*-
'''
Management of PostgreSQL extensions (e.g.: postgis)
===================================================
The postgres_extensions module is used to create and manage Postgres extensions.
.. code-block:: yaml
adminpack:
postgres_extension.present
.. versionadded:: 2014.7.0
'''
fr... | shineforever/ops | salt/salt/states/postgres_extension.py | postgres_extension.py | py | 5,852 | python | en | code | 9 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "salt.modules.postgres._EXTENSION_NOT_INSTALLED",
"line_number": 102,
"usage_type": "attribute"
},
{
"api_name": "salt.modules.postgres",
"line_number": 102,
"usage_type": "name"
... |
32244769321 | from tkinter import *
import tkinter as tk
from tkinter import ttk
import tkinter.messagebox as messagebox
import sqlite3
from PIL import Image,ImageTk
from OperationUI.OperationCommandGUI import *
from OperationUI.Colors import *
if __name__ == "__main__":
# Create the main window:
root.geometry("1440x826")
... | iamnopkm/python-project | main.py | main.py | py | 4,422 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PIL.Image.open",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "PIL.ImageTk.PhotoImage",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "PIL.ImageTk",
"li... |
1024252645 | import csv
import mysql.connector
import argparse
from matplotlib import pyplot as plt
def query(sql, cursor):
result = []
cursor.execute(sql)
row = cursor.fetchone()
while row is not None:
result.append(row)
row = cursor.fetchone()
return result
def query_result_to_parrellel_lis... | dmaahs2017/Se413-final | graph_datalake_data.py | graph_datalake_data.py | py | 1,276 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "mysql.connector.connector.connect",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "mysql.connector.connector",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "mysql.connector",
"line_number": 26,
"usage_type": "name"
},
{
"... |
3090309836 | #!/usr/bin/python
"""
Script used to connect to the edX MongoDB produce a file with the course
content nicely printed to it.
"""
import argparse
import json
import os
import re
def is_id(string):
"""Check string to see if matches UUID syntax of alphanumeric, 32 chars long."""
regex = re.compile('[0-9a-f]{32}\... | powersj/ocv | src/edx_course_json.py | edx_course_json.py | py | 4,356 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "re.compile",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "re.I",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 128,
"usage_type": "call"
},
{
"api_name": "os.path.split",
"line_number": 13... |
1473194817 | import random
import math
import string
from django.shortcuts import render,HttpResponseRedirect, HttpResponse
from main.models import *
def home(request):
return render(request, "Employee/home.html")
def approval(request):
enrollments = Enrollment.objects.filter(status="pending")
return render... | CodingSectorDeveloper/sms-1 | employee/views.py | views.py | py | 4,093 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.shortcuts.render",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 16,
"usage_type": "call"
},
{
"api_name":... |
23784084308 | # coding=utf-8
from django import forms
from django.urls import reverse
from .models import Ad
from app.models import City, Metro
from categories.models import Category
class SearchForm(forms.Form):
search_word = forms.CharField(max_length=255, widget=forms.TextInput(attrs={
'type': 'search',
'pl... | asmuratbek/tumar24 | ad_app/forms.py | forms.py | py | 2,916 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.forms.Form",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.forms.CharField",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.for... |
32702787469 | # Como se dijo que la app manejaria las vistas, se creo este archivo. Aqui se
# manejaran los mapeos de las direcciones dentro de la app. Esto con el
# objetivo de que sea modular
# Modificamos la url de categoria para pasar el parametro category_name_slug
from django.conf.urls import url
from rango import views
# Cr... | alehpineda/tango_with_django_project | rango/urls.py | urls.py | py | 748 | python | es | code | 0 | github-code | 1 | [
{
"api_name": "django.conf.urls.url",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "rango.views.index",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "rango.views",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "django.conf.u... |
17065761069 | # -*- coding: utf-8 -*-
"""
Created on Sun Jun 7 20:13:28 2020
@author: Neha Shinkre
"""
import requests
url = 'http://localhost:5000/predict_api'
r = requests.post(url,json={'Age':18, 'EstimatedSalary':9000})
print(r.json)
| Nehaprog/IEEE-codersweek | new/request.py | request.py | py | 229 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.post",
"line_number": 10,
"usage_type": "call"
}
] |
6033578794 | import asyncio
"""
WRAPPING COROS INTO TASKS
Wrapping coros into tasks, so that they could be run concurrently
.ensure_future() = .create_task()
"""
async def say_after(delay: int, what: str) -> int:
print(f"Sleeping {delay}. Word: {what}")
await asyncio.sleep(delay)
print(what)
return delay
asyn... | EvgeniiTitov/coding-practice | coding_practice/concurrency/asyncio/chapter_presentation/example_2.py | example_2.py | py | 656 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "asyncio.sleep",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "asyncio.create_task",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "asyncio.create_task",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "asyncio.run",
... |
34559411929 | import os
os.environ['TOKENIZERS_PARALLELISM']='false'
import sys
import torch
import time
import math
import shutil
import pandas as pd
from dataclasses import dataclass
from collections import defaultdict
from torch.cuda.amp import GradScaler
from torch.utils.data import DataLoader
from transformers import get_const... | KonradHabel/learning_equality | train.py | train.py | py | 26,975 | python | en | code | 9 | github-code | 1 | [
{
"api_name": "os.environ",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "os.name",
"line_number": 111,
"usage_type": "attribute"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 114,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
... |
22690451449 | from django.shortcuts import render, redirect, get_object_or_404
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
from django.contrib import messages
from django.http import HttpResponse
from django.shortcuts import render, redirect
from django.views.... | MasterZesty/QuickNote | quicknote/notes/views.py | views.py | py | 3,152 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "json.loads",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "json.JSONDecodeError",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "django.http.HttpResponse",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "models.... |
33403336012 |
from subprocess import call
import math
# S1 = 500
# S2 = 250
import sys
import numpy as np
import os
from joblib import Parallel, delayed
import multiprocessing
# def run(Para1, Para2, Para3, S2_amp):
def run(Para1, Popul_ID):
# global mut
#call(["./main","BCL", str(S1), "S2", str(S2), "Mutation", mut, "S1_... | drgrandilab/Ni-et-al-2023-Human-Atrial-Signaling-Model | PV-like_Populations/Simulations/run_pop.py | run_pop.py | py | 1,799 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "subprocess.call",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_numb... |
11725823156 | import numpy as np
from PIL import Image
from sys import argv
import side_by_side
L = 256
def histogram(im):
return side_by_side.histogram_rgb(im)
def uniform_hist(im):
histogram_r, accum_r, histogram_g, accum_g, histogram_b, accum_b = histogram(im)
def w_dot(r):
wr = accum_r[r[0]]
wg = ac... | gciruelos/imagenes-practicas | practica2/ej01-b.py | ej01-b.py | py | 759 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "side_by_side.histogram_rgb",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
... |
34813097933 | import requests
from bs4 import BeautifulSoup as bs
import time
import sqlite3
'''
็ฑไบ็ฝ็ซๅๆ่ฎพ็ฝฎ๏ผๆญค่ๆฌไป
่ฝ็ฌๅ้จๅ็ซ ่
Summary:
soup.get_text("|", strip=True) ่ทๅtagๅ
่ฃน็ๅ
ๅฎนๅนถๅป้คๅๅ็็ฉบๆ ผ
a['href'] ่ฟๅaๆ ็ญพไธhrefๅฑๆง็ๅผ
ๅฟซๆท้ฎ๏ผ่พๅ
ฅmainๆฒๅ่ฝฆๅณๅฏๅฟซ้่ฎพ็ฝฎไธปๅฝๆฐ
re.findall()ๅ ไธre.Sๅๆฐๅฏไปฅๅน้
ๅฐๆข่ก็ฌฆ๏ผๅณๆๆข่ก็ฌฆๅ
ๅซ่ฟๅป
for key, value in urlst.items():ๅฏไปฅ่ฟญไปฃๅญๅ
ธ็keyๅvalu... | mediew/pynote | spyder/biquge/biquge.py | biquge.py | py | 2,674 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
... |
11910443233 | from flask import jsonify, request
from app.models import Clinical_info, Token
from app import db
def deleteClinicalInfo(id):
'''delete clinical info record'''
token = request.headers['TOKEN']
t=Token.query.filter_by(token=token).first()
is_expired=t.status
if id is... | the1Prince/drug_repo | app/deletes/deleteClinicalInfo.py | deleteClinicalInfo.py | py | 899 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.request.headers",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "app.models.Token.query.filter_by",
"line_number": 12,
"usage_type": "call"
},
{
"api_name"... |
44697268734 | import discord
import os
import requests
import json
import random
from replit import db
from keep_alive import keep_alive
from discord.ext import commands,tasks
from pytube import YouTube
from pytube import Search
import pafy
import asyncio
from discord import FFmpegPCMAudio
bot = commands.Bot(command_prefix = '//')... | seikhchilli/EncourageBot | main.py | main.py | py | 6,126 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "discord.ext.commands.Bot",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "discord.File",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "discord.Fi... |
38745175764 | import cgi
import logging
import os
import random
import string
from google.appengine.api import images
from google.appengine.ext import db
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
from google.appengine.ext.webapp.util import run_wsgi_app
KEY_RANGE = range(random.randin... | ademirao/legendario | legendario.py | legendario.py | py | 10,488 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "random.randint",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "string.ascii_letters",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "google.appengine.ext.db.Model",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_n... |
1393116208 | import collections
class Solution:
"""
@param formula: a string
@return: return a string
"""
def countOfAtoms(self, formula):
# write your code here
if not formula:
return ""
stack,l,i = [collections.Counter()],len(formula), 0
while i < l:
if f... | NeroNL/algorithm | src/main/python/countOfAtoms.py | countOfAtoms.py | py | 1,319 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.Counter",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 14,
"usage_type": "call"
}
] |
14443118585 | import dash
from dash import dcc
from dash import html
from dash import dash_table
from dash.dependencies import Input, Output
import dash_bootstrap_components as dbc
from flask import Flask
from flask import render_template, Response
import pandas as pd
import edgeiq
import cv2
import time
# edgeIQ
camera = edgeiq... | alwaysai/dash-interactive-streamer | app.py | app.py | py | 4,157 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "edgeiq.WebcamVideoStream",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "edgeiq.ObjectDetection",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "edgeiq.Engine",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "pa... |
19092172950 | import torch.nn as nn
import torch.nn.functional as F
import torch
from ..builder import LOSSES
from .utils import weight_reduce_loss
def cross_entropy(pred,
label,
weight=None,
reduction='mean',
avg_factor=None,
class_weight=N... | jichengyuan/semantic_loss_detection | mmdet/models/losses/semantic_loss.py | semantic_loss.py | py | 2,907 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "torch.nn.functional.cross_entropy",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "torch.nn.functional",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "utils.weight_reduce_loss",
"line_number": 35,
"usage_type": "call"
},
{
"ap... |
1858956859 | import cv2
import numpy as np
import random
#########################################################
# FUNCTION TO FIND THE CONNECTED COMPONENTS
#########################################################
def drawComponents(image, adj, block_size):
#ret, labels = cv2.connectedComponents(image)
#pri... | AgilePlaya/Image-Processing-Basics | Codes/Connected-Components/connected.py | connected.py | py | 5,497 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "cv2.connectedComponents",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"... |
5812062496 | from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium import webdriver
import time
import math
browser = webdriver.Chrome()
try:
def ln(x):
return math.log(x)
def sin(x):
... | utkin7890/stepik_auto_tests_course | part2_lesson4_step8.py | part2_lesson4_step8.py | py | 1,193 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "math.log",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "math.sin",
... |
39604455911 | import multiprocessing
import os
import glob
import sys
import json
from tqdm import tqdm
from extractors.default import *
def main():
if not os.path.exists('../finished'):
os.makedirs('../finished')
for parser in availableParsers:
if not os.path.exists('../finished/%s' % pars... | schollz/parseingredient | src/parseHTML.py | parseHTML.py | py | 1,163 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "os.path.exists",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_nu... |
34196708642 | from facenet_pytorch import MTCNN, InceptionResnetV1
import torch
from torchvision import datasets
from torch.utils.data import DataLoader
import datetime
# ๅๅงๅ้ข่ฎญ็ป็pytorchไบบ่ธๆฃๆตๆจกๅMTCNNๅ้ข่ฎญ็ป็pytorchไบบ่ธ่ฏๅซๆจกๅInceptionResnet
mtcnn = MTCNN(image_size=240, margin=0, keep_all=False, min_face_size=40)
resnet = InceptionResnetV1(pr... | YKK00/Face-Recognition-using-Python | Face-Recognition-PyTorch/train.py | train.py | py | 1,404 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "facenet_pytorch.MTCNN",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "facenet_pytorch.InceptionResnetV1",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torchvision.datasets.ImageFolder",
"line_number": 12,
"usage_type": "call"
},
{... |
24537225227 | from pywinauto import Desktop
import time, requests, os, threading
import pyautogui
from pywinauto import timings
BASEURL = 'http://127.0.0.1:8000/'
PING_TIMEOUT = 45
PING_FREQUENCY = 45
QUEUE_LIMIT = 10
QUEUE_FREQUENCY = 5
q_processor = None
def exit_gracefully():
if q_processor:
q_processor.stop()
... | jemartpacilan/converterServer | queue_processor.py | queue_processor.py | py | 2,804 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "threading.Thread",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_numbe... |
72122261475 | import uuid
from random import randint
class Producto:
def __init__(self,descripcion,codigoBarras,precio,proveedor):
self.id = uuid.uuid4()
self.descripcion = descripcion
self.clave = randint(1,200)
self.codigoBarras = codigoBarras
self.precio = precio
self.proveedor... | arcaex/TUP-Programacion-I | Python/POO/Prรกctica_Parcial.py | Prรกctica_Parcial.py | py | 2,625 | python | es | code | 5 | github-code | 1 | [
{
"api_name": "uuid.uuid4",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 8,
"usage_type": "call"
}
] |
10786424127 | #
# Create on 4/17/2018
#
# Author: Sylvia
#
"""
202. Happy Number
A happy number is a number defined by the following process: Starting with any positive integer, replace the number by
the sum of the squares of its digits, and repeat the process until the number equals 1 (where it will stay), or it loops
endlessly in... | missweetcxx/fragments | leetcode/happy_number.py | happy_number.py | py | 1,107 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pytest.mark.parametrize",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 44,
"usage_type": "attribute"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.