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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5302525624 | from selenium import webdriver
import time
class chrome_demo:
def chrome_test(self):
# instantiate the chrome browser
driver = webdriver.Chrome(executable_path="C:\\Users\\gaura\\workspace_python\\drivers\\chromedriver.exe")
driver.get("http://www.facebook.com")
time.sleep(30)
o... | gy09/python-selenium-practice | Basic_selenium/chrome_wd_demo.py | chrome_wd_demo.py | py | 357 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 11,
"usage_type": "call"
}
] |
39974113332 | # -*- coding: utf-8 -*-
# -*- coding: cp1252 -*-
import os, sys, subprocess, inspect
from Framework.Utilities import CommonUtil
from lxml import etree
from io import StringIO
from xml.etree import ElementTree as ET
from xml.sax.handler import ContentHandler
from xml.sax import make_parser
from glob import glob
MODU... | AutomationSolutionz/Zeuz_Python_Node | Framework/Utilities/xmlValidation.py | xmlValidation.py | py | 4,635 | python | en | code | 7 | github-code | 21 | [
{
"api_name": "inspect.getmodulename",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
23584561863 | import tensorflow as tf
import tensorflow.contrib as tf_contrib
import os
from scipy import misc
import numpy as np
import cv2
def up_sample(x, scale_factor=2):
_, h, w, _ = x.get_shape().as_list()
new_size = [h * scale_factor, w * scale_factor]
return tf.image.resize_nearest_neighbor(x, size=new_s... | fwz1021/JCEVC | ops.py | ops.py | py | 7,207 | python | en | code | 6 | github-code | 21 | [
{
"api_name": "tensorflow.image.resize_nearest_neighbor",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tensorflow.image",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.layers.flatten",
"line_number": 12,
"usage_type": "call"
},
... |
19798432764 | import numpy as np
from thesis_galljamov18.python import tools, settings
# enables additional plots
THESIS = False
# -------------------------
# helper functions
# -------------------------
def rad(degrees):
return np.multiply(degrees,np.pi)/180
def deg(angles_in_rad):
return np.divide(angles_in_rad,np.pi)*1... | rgalljamov/deephop | python/training/human_hopping_data/process_human_hopping_data.py | process_human_hopping_data.py | py | 15,606 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "numpy.multiply",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "numpy.divide",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number... |
6383281623 | import json
from datetime import datetime
from rest_framework.test import APITestCase, APIClient
from unittest import mock
from unittest.mock import patch
from core.utils.redis_queue import RedisQueue
from users.models import User
from raids.models import RaidHistory
from gameduo.settings import RE... | pasitoapasito/wantedP.O-gameduo | raids/tests/tests_raid_enter.py | tests_raid_enter.py | py | 8,596 | python | ko | code | 0 | github-code | 21 | [
{
"api_name": "rest_framework.test.APITestCase",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "users.models.User.objects.create_user",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "users.models.User.objects",
"line_number": 43,
"usage_type": "attri... |
2970728792 | # -*- coding: utf-8 -*-
"""
Created on Wed Jun 3 14:50:46 2020
@author: Baran Akçakaya-170401010
"""
import socket
from datetime import datetime
TCP_IP = "192.168.1.35"
TCP_PORT = 142
UTC = 0
try:
sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
sock.bind((TCP_IP,TCP_PORT))
print(... | nyucel/blm304 | final/170401010/Sunucu/sunucuTCP.py | sunucuTCP.py | py | 1,749 | python | tr | code | 8 | github-code | 21 | [
{
"api_name": "socket.socket",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_STREAM",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "socket.erro... |
2226190680 | from django.shortcuts import render, get_object_or_404, reverse, redirect
from django.views import generic, View
from django.http import HttpResponseRedirect
from .models import Article, Comment
from .forms import CommentForm
class ArticleList(generic.ListView):
model = Article
queryset = Article.objects.filte... | Annausername/fashion-news | fashion/views.py | views.py | py | 3,268 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.views.generic.ListView",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.views.generic",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "models.Article",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "m... |
41033696088 | """
URL configuration for paradise_lost project.
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name... | Ryael/paradise-lost | paradise_lost/urls.py | urls.py | py | 1,598 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.urls.path",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "... |
13002725936 | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | HuiyanWen/mindspore_hccr | code/train&eval/dataset.py | dataset.py | py | 3,086 | python | en | code | 5 | github-code | 21 | [
{
"api_name": "os.getenv",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 45,
... |
73982996853 | #!python3.6
import os
from flask import Flask, request, render_template
from flask_sqlalchemy import SQLAlchemy
from dictogram import Dictogram
import time
app = Flask(__name__, instance_relative_config=True)
app.config['SQLALCHEMY_DATABASE_URI'] = os.environ.get('DATABASE_URL')
print(os.environ.get('DATABASE_URL'))
ap... | AlirieGray/Tweet-Generator | app.py | app.py | py | 2,170 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_nu... |
72904444853 | import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
def plot_decision_regions(X, y, classifier, resolution=0.02):
# настроить генератор маркеров и цветовую карту
markers = ('s', 'x', 'o', '^', 'v')
colors = ('red', 'blue', 'lightgreen', 'gray', 'cyan')
cmap... | bodichkhomych/binary_classification | binary_classification_problem/visualizer.py | visualizer.py | py | 1,283 | python | ru | code | 0 | github-code | 21 | [
{
"api_name": "matplotlib.colors.ListedColormap",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.unique",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.meshgrid",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.ar... |
33717377688 | from flask import Flask, render_template, request, json, jsonify, make_response
app = Flask(__name__)
app.config['JSON_AS_ASCII'] = False # json属性配置
@app.route('/index')
def index(): # put application's code here
data = {
'name': '张三'
}
# return make_response(data)
# return make_response(j... | jjc09uiom/flaskStudy | test/返回json数据给前端.py | 返回json数据给前端.py | py | 576 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 19,
"usage_type": "call"
}
] |
9428609106 | import os
import ast
import time
import argparse
from multiprocessing import Pool
parser_auto_cali = argparse.ArgumentParser(description='uto_cali params.', conflict_handler='resolve')
parser = argparse.ArgumentParser(description='auto_cali_test params.')
parser.add_argument('--exclude', type=str, default='onnx', help... | sophgo/tpu-mlir | regression/eval/run_eval.py | run_eval.py | py | 10,236 | python | en | code | 366 | github-code | 21 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.popen",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "time.sleep",
... |
6708179828 | from typing import Iterable, List
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QVBoxLayout, QWidget, QScrollArea, QCheckBox, QPushButton
from src.metadata.data_classes.basic_data import BasicData
def show_views_widget(basic_data: Iterable[BasicData], _hide_sweeps_func) -> QWidget:
views_layout = QVBoxL... | Elements-SRL/EDA_python | src/gui/views_widget.py | views_widget.py | py | 1,704 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "typing.Iterable",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "src.metadata.data_classes.basic_data.BasicData",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QVBoxLayout",
"line_number": 8,
"usage_type": "call"
},
... |
29310608925 |
from django.contrib import admin
from django.urls import path
from . import views
app_name='gestion'
urlpatterns=[
path('',views.index,name='index'),
path('crear/empleado',views.index,name='index2'),
path('crear/balance',views.crearBalance,name='crearBalance'),
path('detalle/balance/<int:pk>',view... | pauguz1/FinanzasX | gestion/urls.py | urls.py | py | 1,300 | python | es | code | 0 | github-code | 21 | [
{
"api_name": "django.urls.path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django.urls.path",... |
951657749 |
from network.tests import create_post
from django.urls import path
from . import views
urlpatterns = [
path("", views.index, name="index"),
path("create-post", views.create_post, name="create-post"),
path("all-posts", views.all_posts, name="all-posts"),
# Can add optional page argument to get a speci... | ArthurAllilaire/CS50-Web-programming | project4/network/urls.py | urls.py | py | 1,126 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
42826096892 | import traceback
from PIL import Image, ImageDraw
from cwt.modules.CalendarClass import EPaperCalendar
from cwt.modules.TimeClass import EPaperTime
from cwt.modules.WeatherClass import EPaperWeather
from cwt.modules.SentenceClass import EPaperSentence
from cwt.utils.DrawUtils import Line
from cwt.waveshare import ep... | SteveZhengMe/single-weather-calendar-quote | cwt/main.py | main.py | py | 2,017 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "PIL.Image.new",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "PIL.Image.new",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": ... |
28157395253 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import time
time_start=time.time()
print("***************************the program starts***************************")
from my_tokenizers2 import SmilesTokenizer
import numpy as np
import torch
import os
os.environ["CUDA_VISIBLE_DEVICES"] = "1"
tokenizer = SmilesTokenizer(... | fanganpai/fp2bert | pre-trained/EIECTRA-train.py | EIECTRA-train.py | py | 5,311 | python | en | code | 8 | github-code | 21 | [
{
"api_name": "time.time",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "my_tokenizers2.SmilesTokenizer",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "transformers.... |
26618400526 | import json
import os
import pandas as pd
import pickle
from sklearn import metrics
import xgboost as xgb
import shutil
from sklearn.model_selection import train_test_split
from xgboost.sklearn import XGBClassifier
working_directory = os.getcwd()
ORIGINAL_TRAINING_DATASET_PATH = r'/Data/BankChurners_clean... | kolbevich/Bank-Churners-App | model_fitter.py | model_fitter.py | py | 7,090 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.getcwd",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number"... |
9107966395 | import time
import unittest
from locust.core import HttpLocust, TaskSet, task
from locust.inspectlocust import get_task_ratio_dict
from locust.rpc.protocol import Message
from locust.stats import CachedResponseTimes, RequestStats, StatsEntry, diff_response_time_dicts, global_stats
from six.moves import xrange
from .t... | timothyyu/ml_monorepo | locust/locust/test/test_stats.py | test_stats.py | py | 13,439 | python | en | code | 59 | github-code | 21 | [
{
"api_name": "unittest.TestCase",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "locust.stats.RequestStats",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "locust.sta... |
31576812787 | import os
from pathlib import Path
from snek5000.util import files
def test_next_path_no_files(tmpdir):
tmpdir = Path(tmpdir)
# Create no files, multiple suffixes
target = tmpdir / "test.tar.gz"
assert str(files.next_path(target, force_suffix=True)) == str(
tmpdir / "test_00.tar.gz"
)
... | snek5000/snek5000 | tests/test_files.py | test_files.py | py | 2,170 | python | en | code | 20 | github-code | 21 | [
{
"api_name": "pathlib.Path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "snek5000.util.files.next_path",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "snek5000.util.files",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "pathlib... |
42440555504 | import cv2
import numpy as np
from matplotlib import pyplot as plt
def calculate_circle(img):
n=[]
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
(a,b,c)=img.shape
circles = cv2.HoughCircles(gray, cv2.HOUGH_GRADIENT, 1,20, param1=100, param2=30, minRadius=1, maxRadius=100)
if circles is None:
return 0
els... | linaustin/dot_recognize | Braille.py | Braille.py | py | 3,771 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "cv2.cvtColor",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "cv2.HoughCircles",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.HOUGH_GRADIEN... |
4611257667 | import pytest
import os
import pandas as pd
import numpy as np
import filecmp
from windtools.windrose import WindRose
from tests.aux_testing_tools import samples_fld, tmp_fld, TestExcel
test_excel = TestExcel(fpath=samples_fld('testing.xlsx'))
@pytest.fixture()
def sample_wr():
fpath = samples_fld('sample_data.cs... | gabrielecalvo/windtools | tests/test_windrose.py | test_windrose.py | py | 1,769 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "tests.aux_testing_tools.TestExcel",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "tests.aux_testing_tools.samples_fld",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "tests.aux_testing_tools.samples_fld",
"line_number": 13,
"usage_type"... |
17581953292 | import numpy as np
from functions import *
from stock import *
from keras.models import load_model
import prediction
import pandas as pd
from coinmarketcapapi import CoinMarketCapAPI
from datetime import datetime
cmc = CoinMarketCapAPI(api_key='acfb8bea-4917-4cac-85ee-44e8a5d94754')
def Greeting(res,message,user_name)... | yassernamez03/Finance-Chatbot | Bot_functions.py | Bot_functions.py | py | 4,310 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "coinmarketcapapi.CoinMarketCapAPI",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 29,
"usage_type": "name"
},
{
"api_name... |
70753565492 | import requests
from bs4 import BeautifulSoup as BSoup
url = 'https://www.goodreads.com/quotes?page=1'
r = requests.get(url)
soup = BSoup(r.text, 'html.parser')
text_quotes = soup.find_all('div', class_='quoteText')
quotes = [i.text for i in text_quotes]
text_authors = soup.find_all('span', class_='authorOrTit... | timih18/Parser | parser_quotes_authors.py | parser_quotes_authors.py | py | 543 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 6,
"usage_type": "call"
}
] |
32492757960 | import pygame
import random
import time
from Spot import Spot
from Button import Button
current_milli_time = lambda: int(round(time.time() * 1000))
pygame.init()
width = height = 600
width_tot = width + 200
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
RED = (255, 0, 0)
GREEN = (0, 255, 0)
BLUE = (0, 0, 255)
WINDOW_SI... | arblitroshani/maze_solver | main.py | main.py | py | 7,599 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "time.time",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.init",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"lin... |
40542886842 | import json
from typing import Any, Mapping
from common.types import JSONSerializable
from monkey_island.cc.repositories import StorageError
DOT_REPLACEMENT = "_D0T_"
def mongo_dot_encoder(serializable_input: JSONSerializable) -> JSONSerializable:
"""
Mongo can't store keys with "." symbols (like IP's and f... | guardicore/monkey | monkey/monkey_island/cc/repositories/utils/mongo_encoder.py | mongo_encoder.py | py | 1,393 | python | en | code | 6,367 | github-code | 21 | [
{
"api_name": "common.types.JSONSerializable",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "json.dumps",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "monkey_island.cc.repositories.StorageError",
"line_number": 19,
"usage_type": "call"
},
{
... |
6061406984 | import numpy as np
import matplotlib.pyplot as plt
import streamlit as st
import pandas as pd
import sqlite3
import os
def gaussian(x, mu, sigma):
return 1 / (sigma * np.sqrt(2 * np.pi)) * np.exp(-0.5 * ((x - mu) / sigma) ** 2)
def cargar_datos_ejemplo(conn):
conn.execute("CREATE TABLE IF NOT E... | moisesvillalba/ejemplo_distribucion_normal_campana_gauss_streamlit | distribucion_normal_python_streamlit_ejemplo_prfuncional.py.py | distribucion_normal_python_streamlit_ejemplo_prfuncional.py.py | py | 5,880 | python | es | code | 0 | github-code | 21 | [
{
"api_name": "numpy.sqrt",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "numpy.exp",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number"... |
24002547594 | from scipy import stats
from tabulate import tabulate
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
#Get values from Table 2 file
df = pd.read_csv('/home/yorch/Documents/DTU/02450_Machine_Learning/Project 2/Plots 10/Table2_10.csv')
print(tabulate(df, headers='keys', tablefmt='psql', showind... | georgiostsimplis/Introduction_to_Machine_Learning | Project_2/classification_statistics.py | classification_statistics.py | py | 1,836 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tabulate.tabulate",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "scipy.stats.t.ppf",
... |
18014935865 | import sys
import os
from appscript import *
from PyQt5 import QtCore
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from functools import partial
from preferences import Preferences
from file_handler import ConfigHandler
from about import About
# Creates tray icon and tray options
class TrayIcon(QApplication... | matuzalemmuller/Frevo | frevo/tray_icon.py | tray_icon.py | py | 3,214 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "preferences.Preferences",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtCore.pyqtSlot",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtCore",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "about.Abou... |
34708634617 | import sys
import pytest
@pytest.mark.skipif(sys.platform == "darwin", reason="do not run on mac os")
def test_hf_data():
from flaml import AutoML
import requests
from datasets import load_dataset
try:
train_dataset = (
load_dataset("glue", "mrpc", split="train[:1%]").to_pandas().... | GqiqiPS/FLAML_distiller | test/nlp/test_autohf.py | test_autohf.py | py | 3,518 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "datasets.load_dataset",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datasets.load_dataset",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datasets.load_dataset",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "req... |
42969837123 | from pathlib import Path
import pytest
from render_engine.page import Page
from render_engine.collection import Collection
from render_engine_youtube_embed.youtube_embed import (
extract_youtube_id,
replace_youtube_links_with_embeds,
)
test_urls = (
"https://www.youtube.com/watch?v=5qap5aO4i9A",
... | kjaymiller/render-engine-youtube-link-embed | tests/test_link_detect.py | test_link_detect.py | py | 3,700 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "render_engine_youtube_embed.youtube_embed.extract_youtube_id",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 23,
"usage_type": "attr... |
1760403733 | from sqlalchemy import inspect
from sqlalchemy.sql import sqltypes
# see: https://www.cubrid.org/manual/en/9.3.0/sql/datatype.html
class _NumericType(object):
"""Base for CUBRID numeric types."""
def __init__(self, **kw):
super(_NumericType, self).__init__(**kw)
class _FloatType(_NumericType, sqltyp... | sqlalchemy-cubrid/sqlalchemy-cubrid | sqlalchemy_cubrid/types.py | types.py | py | 7,313 | python | en | code | 5 | github-code | 21 | [
{
"api_name": "sqlalchemy.sql.sqltypes.Float",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sqlalchemy.sql.sqltypes",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.sql.sqltypes.Integer",
"line_number": 17,
"usage_type": "attribute"... |
32466199416 | import requests
import pandas as pd
import matplotlib.pyplot as plt
from datetime import datetime
import seaborn as sns
def split_date1(df):
#Split one colum according to space
new=df.Päiväys.str.split("-",expand=True)
df["Date"]=new[0]
df2=df.astype({"Date":str})
df3=df2.drop(columns="Päiv... | NaelSk/Coronavirus | KeskiSoumi.py | KeskiSoumi.py | py | 1,623 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pandas.read_html",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "datetime.dat... |
33712151010 | '''
Project class
'''
import pygame as pg
from settings import *
class NewProject(pg.sprite.Sprite):
'''
Class that holds reference to all cakes in project.
'''
def __init__(self, name, width=480, height=40, x=WIDTH*3/4, y=HEIGHT/3):
pg.sprite.Sprite.__init__(self)
self.name = name
self.cakes = []
#... | lucaromanowski/MagicCake | src/resources/project.py | project.py | py | 1,290 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pygame.sprite",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pygame.sprite.Sprite.__init__",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pygame.sprite",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "p... |
5755656206 | import os
import gzip
import pickle
import numpy as np
from collections import defaultdict
from composes.utils import io_utils
from composes.semantic_space.space import Space
from scipy.sparse import coo_matrix, csr_matrix
from composes.matrix.sparse_matrix import SparseMatrix
def get_sentences(corpus_file):
"""... | vered1986/UnsupervisedHypernymy | source/dsm_creation/common.py | common.py | py | 4,953 | python | en | code | 50 | github-code | 21 | [
{
"api_name": "gzip.open",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "composes.utils.io_utils.save",
"line_number": 97,
"usage_type": "call"
},
{
"api_name": "compos... |
10217185299 | #!/usr/bin/env python3
"""
Fit model parameters to time series positions using tsFit class objects.
"""
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import scipy.optimize as opt
from tstools import timeSeries as ts
from tstools import inputFileIO as ifio
from ts... | pkmcfarland/TSTools | python/src/tstools/fit.py | fit.py | py | 7,600 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "matplotlib.use",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "tstools.timeSeries.TimeSeries",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "tstools.timeSeries",
"line_number": 54,
"usage_type": "name"
},
{
"api_name": "tstool... |
7904315224 | import os
import matplotlib
import subprocess
import numpy as np
import tkinter as tk
matplotlib.use('TkAgg')
from tkinter import ttk
from PIL import ImageTk,Image
import agg_main_vF as aggr_main
from matplotlib.figure import Figure
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
from matplotlib.backend... | collint8/EdgeComputing | AggCode/GUI.py | GUI.py | py | 5,332 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "matplotlib.use",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "tkinter.Tk",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "tkinter.Tk.__init__",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "tkinter.Tk",
"l... |
25083852361 | # ---
# jupyter:
# jupytext:
# formats: ipynb,py:light
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.5.2
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# +
import glob
import re... | lab156/arxivDownload | Planetmath exploring data.py | Planetmath exploring data.py | py | 3,908 | python | en | code | 7 | github-code | 21 | [
{
"api_name": "collections.Counter",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "lxml.etree.Element",
"li... |
7996493372 | from django.shortcuts import render
from Base.base_group_views import ManagerRequiredView
from ..forms import AnnotationFilterForm
from ..services import UserInfoServices
class ProgressUserInfoHome(ManagerRequiredView):
def get(self, request):
context = super().build_context()
uis = UserInfoServ... | plomgrading/plom | plom_server/Progress/views/progress_userinfo.py | progress_userinfo.py | py | 2,431 | python | en | code | 10 | github-code | 21 | [
{
"api_name": "Base.base_group_views.ManagerRequiredView",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "services.UserInfoServices",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "forms.AnnotationFilterForm",
"line_number": 13,
"usage_type": "call"
... |
594199873 | # _*_coding :utf-8 _*_
# @Time :2022/9/28 9:55
# @File : 测试4
# @Project : python_web
#coding = utf-8
from zhconv import convert
code_lib = []
scr_lib = []
real_lib = []
code = '岆嵐困嶇的任岕,岜么样的动嶴水平效峴最高?()'
scr = '俄国十月革命开辟了世界世界无产阶级社会主义革命的新时代'
for i in code:
decode = ord(i)
code_lib.append(decode)
for j in scr:
... | wufake70/myPython | python_web/测试4.py | 测试4.py | py | 712 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "zhconv.convert",
"line_number": 28,
"usage_type": "call"
}
] |
33137865600 | import django.utils.timezone
from django.conf import settings
from django.core.mail import send_mail
from django.template.loader import render_to_string
def send_registration_mail(user_name, user_mail):
subject = 'TheShoppingCArt WELCOME'
message = f'Hi {user_name}, Thank you for registering in TheShoppingCAr... | KumarSantosh22/TheShoppingCArt | Shop/sendmail_gmail.py | sendmail_gmail.py | py | 2,402 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.conf.settings.EMAIL_HOST_USER",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.core.mail.send_mail",
"line_number": 12,
"usage_type": "call"
},
... |
36380805951 | from PyQt5 import QtWidgets, QtCore, QtGui, QtMultimedia, QtMultimediaWidgets
class VideoPlayer(QtWidgets.QWidget):
def __init__(self, parent=None):
super(VideoPlayer, self).__init__(parent)
#self.frame = QtWidgets.QFrame()
self.setMinimumSize(600, 400)
self.layout ... | Python-Cameroun/pylearner | dev/snippets/video_player.py | video_player.py | py | 1,209 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QVBoxLayout",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": ... |
10911942446 | import streamlit as st
import requests
from bs4 import BeautifulSoup
import json
st.title("Find Songs from movie Easy Peasy")
with st.form('find song'):
query = st.text_input('your movie ?')
submited = submited = st.form_submit_button("find")
if submited:
found = requests.get(f'https://www.tunefin... | alipyth/movie_song_finder | streamlit_app.py | streamlit_app.py | py | 1,664 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "streamlit.title",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "streamlit.form",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "streamlit.text_input",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "streamlit.form_submi... |
30688547971 | #https://adventofcode.com/2022/day/17
from __future__ import annotations
from aoc_utils import test_input, get_raw_data
from aoc_utils import Rocas, Jets, VerticalChamber, VerticalChamberLite
import itertools as it
from aoc_recipes import progress_bar
import numpy
def main(data:str, simulate:int=2022, play_... | copperfield42/Advent-of-Code-2022 | day17/part1.py | part1.py | py | 1,721 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "aoc_utils.VerticalChamber",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "aoc_utils.VerticalChamberLite",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "aoc_recipes.progress_bar",
"line_number": 10,
"usage_type": "name"
},
{
"... |
36919784941 | #!/usr/bin/env python3
import re
import sys
import fileinput
from datetime import datetime
if len(sys.argv) <= 1:
print('Please tell me which license file(s) to update')
sys.exit(1)
PATTERN = re.compile(r'^([Cc]opyright.+) ([0-9-]{4,9}) (.+)$')
NEW_YEAR = datetime.now().year
for line in fileinput.input(inplace=Tr... | actions-marketplace-validations/p3lim_license-year-updater | update.py | update.py | py | 488 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.argv",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_nu... |
34019884415 | import collections
import json
import sqlite3
import argparse
import openreview_db as ordb
parser = argparse.ArgumentParser(
description='Example for accessing OpenReview data')
parser.add_argument('-d', '--dbfile', default="db/or.db",
type=str, help='path to database file')
def prune_unofficial(parents, com... | nnkennard/openreview-analysis | analysis_scripts/comment_types.py | comment_types.py | py | 2,441 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 18,
"usage_type": "call"
},
{
"api_name":... |
2071230547 | #!/usr/bin/env python
import os
import logging
import json
from http import HTTPStatus
from flask import Flask
from flask import render_template
from flask import request
from flask import Response
import requests
from rest.databases.shoes import get_products, get_product_by_id
# create the application object
app = ... | dgwartney/flask-rest | rest/__init__.py | __init__.py | py | 5,460 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "flask.Response",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": ... |
23386976067 | # -*- coding: utf-8 -*-
"""
Created on Sat Aug 27 12:06:26 2016
@author: raulv
Reads matfiles from surface obs (NOAA/ESRL/PSD)
and save pandas dataframes in HDF5 files.
"""
import os
import pandas as pd
from rv_utilities import datenum_to_datetime
from parse_data import quality_control, get_statistical
from scipy.i... | rvalenzuelar/tta_climatology | mat_to_hdf5.py | mat_to_hdf5.py | py | 1,426 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "os.environ",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "scipy.io.loadmat",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "rv_utilities.datenum... |
34196549987 | from __future__ import annotations
import numpy as np
import numpy.typing as npt
import scipy.optimize
from cflib.localization.lighthouse_types import Pose
class LighthouseSystemAligner:
"""This class is used to align a lighthouse system to a few sampled positions"""
@classmethod
def align(cls, origin: ... | bitcraze/crazyflie-lib-python | cflib/localization/lighthouse_system_aligner.py | lighthouse_system_aligner.py | py | 5,261 | python | en | code | 227 | github-code | 21 | [
{
"api_name": "numpy.typing.ArrayLike",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "numpy.typing",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "cflib.localization.lighthouse_types.Pose",
"line_number": 14,
"usage_type": "name"
},
{
... |
18428762770 |
import os
from PIL import Image
import pickle # allows
import numpy as np
import cv2
BASE_DIR=os.path.dirname(os.path.abspath(__file__))
#wherever this file is saved, look at where this path is. Give directory
#ie. /Dev
image_dir = os.path.join(BASE_DIR,"images") #image file
face_cascade = cv2.CascadeClassifier('Open... | RScicomp/Face-Detection-w-OpenCV | faces-train.py | faces-train.py | py | 1,871 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.path.dirname",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_nu... |
10290947789 | import traceback
from operator import gt, lt
from pathlib import Path
from pprint import pprint
from typing import Any, Callable, Dict, List, Optional, Tuple
import numpy as np
import pandas as pd
import ray
from tensorboardX import SummaryWriter
from exptune.exptune import (
ComposeStopper,
ExperimentConfig,... | shyam196/exptune | exptune/train_final.py | train_final.py | py | 6,751 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "typing.Optional",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "tensorboardX.SummaryWriter",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "typing.Any",
... |
40982491938 | #!~miniconda3/envs/rl/bin python
from logging import config
import hydra
from hydra.utils import instantiate
from omegaconf import DictConfig, OmegaConf
from time import time
import torch
import numpy as np
from Src.Utils.utils import TrajectoryBuffer, DataManager
import sys
import random
import logging
class Config:
... | mfclinton/implicit_reward_optimization | Src/run_baseline.py | run_baseline.py | py | 6,106 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "hydra.utils.instantiate",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "Src.Utils.utils.TrajectoryBuffer",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 100,
"usage_type": "call"
},
{
"api_name": "t... |
12493352921 | import streamlit as st
import pandas as pd
import datetime as dt
def build_monthly_overview(df: pd.DataFrame) -> pd.DataFrame:
monthly_overview = df.groupby("year_month")[
["Heart rate variability (ms)", "Asleep duration (min)", "Resting heart rate (bpm)", "Sleep consistency %",
"Skin temp (celsi... | lkemkes/deeper-whoop-analytics | pages/2_Monthly_Metrics.py | 2_Monthly_Metrics.py | py | 4,595 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.DataFrame",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "datetime.time",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "streamlit.session_state",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "strea... |
73588665014 | import time
from typing import Annotated, Any
from fastapi import Depends, FastAPI, Header, HTTPException, Request
from fastapi.middleware.cors import CORSMiddleware
app = FastAPI()
origins = [
'http://localhost.ghpi.com',
'https://localhost.ghpi.com',
'http://localhost',
'http://localhost:8080',
]
app.a... | pogs-1218/pre-service | fastapi/di.py | di.py | py | 2,545 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "fastapi.middleware.cors.CORSMiddleware",
"line_number": 15,
"usage_type": "argument"
},
{
"api_name": "typing.Annotated",
"line_number": 33,
"usage_type": "name"
},
{
"api_na... |
36027950495 | import pygame
from pygame.locals import *
from game.ui_text_button import UTTextButton
class MainMenu:
def __init__(self, fonts):
self.showMenu = True
self.showEditor = False
self.isStartGameSelected = True
self.isRunEditorSelected = False
self.startGame = False
... | MyreMylar/scrolling_shooter | game/main_menu.py | main_menu.py | py | 2,154 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pygame.image.load",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "game.ui_text_button.UTTextButton",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "... |
38104947828 | from fastapi import FastAPI
from fastapi.responses import UJSONResponse
from api.router import api_router
from core.di.container import Container
def get_app() -> FastAPI:
"""
Get FastAPI application.
This is the main constructor of an application.
:return: application.
"""
app = FastAPI(
... | koroteevdmitry/sidus | app/core/app.py | app.py | py | 712 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "fastapi.responses.UJSONResponse",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "core.di.container.Container",
"line_number": 26,
"usage_type": "call"
},
{
"api_n... |
73455263734 | from rest_framework.decorators import api_view
from rest_framework.response import Response
from .serializer import search_serializer
from bs4 import BeautifulSoup
import requests
@api_view(['POST'])
def img(request):
image_search=search_serializer(data=request.data)
if image_search.is_valid():
... | balamurugan0007/Bing_searchapi_django_REST_API | app/img_search.py | img_search.py | py | 2,064 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "serializer.search_serializer",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "rest_fram... |
5550476372 | from dataclasses import dataclass
from enum import IntEnum
import datetime
from psycopg2.extras import execute_values
from pypika import PostgreSQLQuery, Table, Order, Criterion, functions as pfn
from typing import Iterable, Dict, Optional, Union, TypedDict, List, Set, Iterator
from db.repositories.base import BaseRe... | juananpe/forum40 | backend/db/repositories/comments.py | comments.py | py | 8,230 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "typing.TypedDict",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
... |
8473236865 | from django.conf import settings
from django.db import migrations
def copy_data(apps, schema_editor):
if not apps.is_installed('students'):
return
StudentDictionary = apps.get_model('students', 'Dictionary')
NewDictionary = apps.get_model('dictionary', 'Dictionary')
old_objects = StudentDict... | Rezenhorn/english_teacher | english/dictionary/migrations/0002_copy_old_data.py | 0002_copy_old_data.py | py | 838 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.RunPython",
"line_number": 31,
"usage_type": "call"
},
... |
30524958225 |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker
import seaborn as sns
import sys
sys.path.insert(0,"../bowshock-shape/Dust-wave/")
sys.path.insert(0,"../bowshock-shape/")
import json
import glob
import bow_projection as bp
import ancantoid_shape
import bow_diagnostic
import matplotlib.ticke... | Lxndrs/Thesis | Programs/obs-diagram.py | obs-diagram.py | py | 6,018 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "sys.path.insert",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "sys.path.insert",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_numbe... |
38898261113 | import numpy as np
import pandas as pd
import tensorflow as tf
import os
import pickle
import os
from tensorflow.python.platform import gfile
import matplotlib.pyplot as plt
class DataReader:
def __init__(self, feature_columns):
self.featureColumns = feature_columns
self.listOfSequences = []
... | ufukcbicici/sequence_data_generation_with_vae | data_reader.py | data_reader.py | py | 3,501 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "os.path.join",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.python.platform.gfile.Glob",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "tenso... |
30580342817 | import torch.nn as nn
def conv3x3(in_planes, out_planes, stride=1):
"""3x3 convolution with padding"""
return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride,
padding=1, bias=False)
def conv1x1(in_planes, out_planes, stride=1):
"""1x1 convolution"""
return nn.Conv2... | Wilbertz/Project-Dog-Classification | res_net.py | res_net.py | py | 2,313 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torch.nn.Conv2d",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": ... |
70127849972 | import os
import smtplib
import sqlite3 as database
import matplotlib.pyplot as plt
import matplotlib.colors as mcolors
import pandas as pd
import zipfile
from src.database.DatabaseMethods import DatabaseMethods as db
from jinja2 import Template
from email.mime.text import MIMEText
from email.mime.multipart import ... | kaique-ryan-santos-chagas/face-emotions-detection | src/Reports.py | Reports.py | py | 6,060 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "sqlite3.connect",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "dotenv.load_dotenv",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_n... |
22074081302 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.lines as mlines
from matplotlib.animation import FuncAnimation
# import draw_input
import new_draw_input
"""
returns
fft: frequency distribution based on 'points'
phase: initial phase angles
fft_ind: indicies of the 'num' largest fft values
"""
def ... | liamc628/dft_draw | convert.py | convert.py | py | 3,894 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.fft.fft",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.fft",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "numpy.angle",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.abs",
"line_number... |
19056802450 | from jinja2.environment import Template
from db import db
from datetime import datetime
from pytz import timezone
class MasterVehicleModel(db.Model):
__tablename__ = 'master_vehicle_tbl'
id = db.Column(db.Integer,primary_key=True)
name = db.Column(db.String(80))
status = db.Column(db.Boolean,default... | RamHaridas/test-map-api | models/master_vehicle.py | master_vehicle.py | py | 1,950 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "db.db.Model",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "db.db",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "db.db.Column",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "db.db",
"line_number": 11,
... |
5778736316 | # 347. Top K Frequent Elements
from typing import List
from collections import defaultdict
import heapq
class Solution:
# O(n)
def topKFrequent(self, nums: List[int], k: int) -> List[int]:
map = defaultdict(int)
result = []
for n in nums:
map[n] += 1
bucket = [[]... | jowls/challenges | leetcode/python/347.py | 347.py | py | 1,606 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "typing.List",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "collections.defaultdict",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "collections.defaultdi... |
10738076986 | from lxml import html
from lxml import etree
from .contents import parsecontent
from .toc import menu
import requests
import re
import boto3
import json
"""
Retrieves the HTML from a webpage for processing.
Uses:
contents.py for parsing the data of the webpage
toc.py for parsing the menu actions of the webpage
login.... | maxzli/coen241 | 241project/Scraper/scraper.py | scraper.py | py | 2,492 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "lxml.html.fromstring",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "lxml.html",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "toc.menu",
"line_numb... |
3544037823 | import cv2
import numpy as np
from tensorflow.keras.models import load_model
from tensorflow.keras.preprocessing.image import img_to_array
cascade_faces = "/app/Material/Material/haarcascade_frontalface_default.xml"
caminho_modelo = "/app/Material/Material/modelo_01_expressoes.h5"
#cascade_faces = "/home/mtarginoo/Per... | Mtarginoo/face-express | predict.py | predict.py | py | 2,307 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "cv2.CascadeClassifier",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.models.load_model",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": ... |
19056710990 | """empty message
Revision ID: 5eda9ceff134
Revises: a751c8229367
Create Date: 2020-09-08 18:30:39.508583
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '5eda9ceff134'
down_revision = 'a751c8229367'
branch_labels = None
depends_on = None
def upgrade():
# ... | RamHaridas/test-map-api | migrations/versions/5eda9ceff134_.py | 5eda9ceff134_.py | py | 844 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "alembic.op.add_column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integer... |
42102575658 | import discord
from discord.ext import commands
from random import randint
import asyncio
## ----------- SETUP ----------- ##
client = discord.Client(status = "say !help")
bot = commands.Bot(command_prefix = '!')
bot.remove_command("help") #disabling, may want to override later
print("API Version {0}".format(discord.... | alexbgomes/Pye-Chan | main.py | main.py | py | 3,354 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "discord.Client",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands.Bot",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "discord.__v... |
70866212532 | import openai
openai.api_key = "SOME_API_KEY"
conversation = ""
i=1
while (i!=0):
question = input("Humano: ")
conversation += "\nHumano: " + question + "\nAI:"
response = openai.Completion.create(
engine = "ada",
prompt = conversation,
temperature=0.9,
max_tokens=150,
... | pjmssb/MiaRobbie | simple_openai_bot/chatbot.py | chatbot.py | py | 551 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "openai.api_key",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "openai.Completion.create",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "openai.Completion",
"line_number": 12,
"usage_type": "attribute"
}
] |
3083859521 | #!/usr/bin/python3
# DISABLE SHADOWS IN RINS_WORLD BEFORE STARTING THE PROGRAM - CLEARS THE IMAGE SIGNIFICANTLY
# from operator import contains
import rospy
import numpy as np
import tf2_geometry_msgs
import tf2_ros
from sensor_msgs.msg import Image
from geometry_msgs.msg import PointStamped, Vector3, Pose
from visua... | BlazBone/RINS | ROS/src/exercise6/scripts/only_movement.py | only_movement.py | py | 5,332 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "rospy.init_node",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line... |
4116666020 | import sys, os
# Append the path to the /models folder for access to shared models
sys.path.append(os.path.join(os.path.dirname(os.path.dirname(__file__)), 'models'))
# https://www.nltk.org/howto/sentiment.html
import logging
import azure.functions as func
from cosmos import Cosmos # internal wrapper class for persist... | a-wallen/stm-toolkit | sentiment_analyzer/__init__.py | __init__.py | py | 2,154 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.path.append",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": ... |
23639873813 | #!/usr/bin/env python3
"""
This file is part of GNUKhata: A modular,robust and Free Accounting System.
License: GPLv3 https://www.gnu.org/licenses/gpl-3.0-standalone.html
Summary:
========
This script performs two functions:
1. Convert the hsn/sac spreadhseet provided by the GST portal
into valid json file to use wi... | gnukhata/gkcore | update_fin_codes.py | update_fin_codes.py | py | 2,864 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pathlib.Path",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "io.BytesIO",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "openpyxl.load_workbook",
"li... |
70566404213 | # -*- coding: utf-8 -*-
import os
import shutil
import zipfile
from distutils.dir_util import copy_tree
import config_epitarendu
import data_epitarendu
### configfile
def createconfigfile():
open(data_epitarendu.configfile, "a").close()
print("Init config file : " + data_epitarendu.configfile)
data = d... | cedricfarinazzo/EPITA-rendu | src/func_epitarendu.py | func_epitarendu.py | py | 4,443 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "data_epitarendu.configfile",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "data_epitarendu.configfile",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "data_epitarendu.defaultconfigfile",
"line_number": 17,
"usage_type": "att... |
74061816054 | import os
import itertools
# Reading a file
print(os.getcwd())
input_file = open('u4d3/file.txt')
print(input_file.read())
input_file.close()
with open('u4d3/file.txt') as input_file:
print(input_file.read())
# Writing a file
input_file = open('u4d3/file.txt', 'w')
input_file.write('Apple are delicious\n')
in... | 3lueberry/GAonGitHub | Unit_4/u4d3/main.py | main.py | py | 1,597 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.getcwd",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "itertools.groupby",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "itertools.groupby",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "itertools.chain",
"l... |
4213473829 | import numpy as np
import random
import tensorflow as tf
import h5py
import pickle
import mmnrm.modelsv2
import math
from datetime import datetime as dt
def set_random_seed(seed_value=42):
tf.random.set_seed(seed_value)
random.seed(seed_value)
np.random.seed(seed_value)
def save_model_weights(f... | bioinformatics-ua/EACL2021-reproducibility | _other_dependencies/mmnrm/mmnrm/utils.py | utils.py | py | 8,634 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "tensorflow.random.set_seed",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tensorflow.random",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "random.seed",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.r... |
14861962480 |
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# 2. Redistributions in binar... | nathanwbrei/matmatmult | cursors/tiledcursor.py | tiledcursor.py | py | 6,626 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "typing.Tuple",
"line_number": 108,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 126,
"usage_type": "name"
},
{
"api_name": "typing.cast",
"line_number": 172,
"usage_type": "call"
}
] |
18006900747 | from WebApp.config import Config
from flask import Flask, url_for, redirect
from flask_sqlalchemy import SQLAlchemy
from flask_admin import Admin
from flask_admin.contrib.sqla import ModelView
db = SQLAlchemy()
admin = Admin()
def create_app(config_class=Config):
app = Flask(__name__)
app.url_map.strict_sla... | iamharryliu/FlaskMigrationTool | WebApp/__init__.py | __init__.py | py | 790 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask_admin.Admin",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "WebApp.config.Config",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "flas... |
26815868043 | #!/usr/bin/env python3
_license = """
big
Copyright 2022-2023 Larry Hastings
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation... | larryhastings/big | tests/test_time.py | test_time.py | py | 6,101 | python | en | code | 22 | github-code | 21 | [
{
"api_name": "bigtestlib.preload_local_big",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "unittest.TestCase",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "re.compile",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "big.al... |
24118319725 | import torch
from torch import nn
from torch import optim
import torch.nn.functional as F
from torch.autograd import Variable
class Seq2Seq(nn.Module):
"""
Sequence to Sequence model wrapper
In the case of a chatbot, the source vocab size and the target vocab size are the same.
"""
def __ini... | patricebechard/chatbot | seq2seq.py | seq2seq.py | py | 5,560 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torch.nn.Module",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "torch.nn.Module",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line... |
34982234601 | import torch
import torch.nn.functional as F
import numpy as np
def PPO_step(optimizer, agent, transitions, nSteps=3, batchSize=10, epsilon=0.2):
for i in range(nSteps):
batch = transitions.sample(batchSize)
actor_terms=[]
critic_terms=[]
for (s0, logits, action, targetValue, s1, ad... | mpgussert/fundamentalRL | sandbox/algorithms.py | algorithms.py | py | 2,139 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "torch.min",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.clamp",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.mean",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.mean",
"line_number": 18,
... |
16149544432 | #importações
import socket
import threading
import time
import http.server
#Constantes:
FORMATO = 'utf-8'
SERVER = "127.0.0.1"
PROTOCOL= "HTTP/1.0"
#--------------------------------------------------------------------------------
#função que bloqueia ou desbloqueia hidrometro através de comunicação TCP
def funcioname... | danrleiaraujo/MI_Concorrencia_e_Conectividade | Problema 1/API.py | API.py | py | 4,297 | python | pt | code | 1 | github-code | 21 | [
{
"api_name": "socket.socket",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_STREAM",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "time.sleep"... |
8077930600 | import re
from pathlib import Path
from typing import Dict, List, Mapping, Optional, Sequence, Tuple, Union
import inflect
from pydantic import BaseModel
class Reference(BaseModel):
path: str
original_name: str
name: str
loaded: bool = True
actual_module_name: Optional[str]
@property
def... | Chilipp/datamodel-code-generator | datamodel_code_generator/reference.py | reference.py | py | 6,376 | python | en | code | null | github-code | 21 | [
{
"api_name": "pydantic.BaseModel",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "typing.Optional",
... |
69864358774 | import matplotlib.pyplot as plt
import sys
sys.path.append("/home/aleksei/Dropbox/GiriStat/giristat_main")
snatch = 'Рывок (очки)'
def draw_cartesian(df, category, year, save=False, dpi=100, test=False):
df = df[df['Discipline'] == 'Двоеборье']
df = df[(df['WC'] == category) & (df['Year'] == year)]
med... | GiriStats/giristat_main | plots/cartesian.py | cartesian.py | py | 2,248 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "sys.path.append",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyp... |
45678029505 | """Side Chain Loss Functions"""
import math
import torch
from torch import nn, Tensor
from typing import Optional
from protein_learning.common.data.data_types.model_output import ModelOutput
from protein_learning.common.helpers import masked_mean
from protein_learning.common.helpers import exists
import prote... | MattMcPartlon/AttnPacker | protein_learning/networks/loss/side_chain_loss.py | side_chain_loss.py | py | 5,767 | python | en | code | 50 | github-code | 21 | [
{
"api_name": "torchtyping.patch_typeguard",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torchtyping.TensorType",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "torchtyping.TensorType",
"line_number": 21,
"usage_type": "name"
},
{
"api_nam... |
43894287821 | import unittest
import time
import uuid
from wazo_auth import token
def new_uuid():
return str(uuid.uuid4())
class TestToken(unittest.TestCase):
def setUp(self):
self.id_ = new_uuid()
self.auth_id = 'the-auth-id'
self.pbx_user_uuid = new_uuid()
self.xivo_uuid = new_uuid()
... | wazo-platform/wazo-auth | wazo_auth/tests/test_tokens.py | test_tokens.py | py | 1,726 | python | en | code | 7 | github-code | 21 | [
{
"api_name": "uuid.uuid4",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "unittest.TestCase",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "wazo_auth.token.Token",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "wazo_auth.toke... |
40543169292 | import threading
from typing import Optional
from .aws_metadata import fetch_aws_instance_metadata
AWS_FETCH_METADATA_TIMEOUT = 10.0 # Seconds
class AWSTimeoutError(Exception):
"""Raised when communications with AWS timeout"""
class AWSInstance:
"""
Class which gives useful information about the curr... | guardicore/monkey | monkey/monkey_island/cc/services/aws/aws_instance.py | aws_instance.py | py | 1,621 | python | en | code | 6,367 | github-code | 21 | [
{
"api_name": "threading.Event",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "aws_metadata.fetch_aws_instance_metadata",
"line_number": 28,
"usage_type": "call"
},
{
"api_nam... |
5717366833 | from ..utils import iterlines
def get_elf_calories(is_test):
elves = []
current_elf = 0
for line in iterlines(1, is_test):
line = line.strip()
if line == '':
elves.append(current_elf)
current_elf = 0
else:
current_elf += int(line)
elves.append... | jansenk/advent-of-code | advent/2022/solutions/1.py | 1.py | py | 544 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "utils.iterlines",
"line_number": 6,
"usage_type": "call"
}
] |
4733343222 | from django.db import models
from lockable_resource.exceptions import AlreadyFreeException, AlreadyLockedException
import lockable_resource.constants as const
import json
class LockableResource(models.Model):
# Fields:
# id - Primary key to identify each lockable resource obj. (Auto Generated)
# provider ... | jimdevops19/rlocker | lockable_resource/models.py | models.py | py | 6,899 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "django.db.models.Model",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": ... |
4823824154 |
import time
import functools
def timmer(func):
@functools.wraps(func) #保持函数签名一致 wrapper.__name__ = func.__name__
def wrapper(*args,**kwargs):
print(args)
for a,b in (kwargs.items()):
print(a,b)
start_time = time.time()
res = func(*args,**kwargs)
end_time = ... | huotong1212/mylearnpy | code/day03/decorator2.py | decorator2.py | py | 582 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "time.time",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "functools.wraps",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 20... |
70961672694 | import os
import tempfile
import pytest
from qulacsvis.utils.latex import _LatexCompiler, _PDFtoImage
@pytest.mark.runlatex
def test_has_pdflatex() -> None:
latex = _LatexCompiler()
assert latex.has_pdflatex()
@pytest.mark.runlatex
def test_convert() -> None:
code = r"""
\documentclass{article}
... | Qulacs-Osaka/qulacs-visualizer | tests/latex_test.py | latex_test.py | py | 1,061 | python | en | code | 6 | github-code | 21 | [
{
"api_name": "qulacsvis.utils.latex._LatexCompiler",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "tempfile.TemporaryDirectory",
"line_number": 24,
"usage_type": "call"
},
{
"... |
25619778285 | import hydra
from hydra.utils import instantiate
from omegaconf import DictConfig, OmegaConf
import torch
torch.multiprocessing.set_sharing_strategy('file_system')
@hydra.main(version_base=None, config_path="config", config_name="train")
def main(cfg : DictConfig) -> None:
model = instantiate(cfg.lightningmo... | badulion/dynabench | main.py | main.py | py | 722 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torch.multiprocessing.set_sharing_strategy",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "torch.multiprocessing",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "omegaconf.DictConfig",
"line_number": 9,
"usage_type": "name"
},
... |
1881437422 | # Author: Juan Carlos Martinez
import numpy as np
from datetime import datetime as dt
from collections import OrderedDict
class sensor_statistics:
def __init__(self, all_sensors, folder):
# Construct a dictionary that holds the data from the csv files
self.sensors = OrderedDict()
for sen... | Lab-Work/sensor_quality | sensor_quality/sensor_quality.py | sensor_quality.py | py | 7,735 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.OrderedDict",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.atleast_2d",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.genfromtxt",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.da... |
8989116819 | import utilities
import subprocess
import statistics
def decode(args):
print(args)
out = subprocess.run(args)
return out.returncode
def main():
times = []
tets_len = 100
for i in range(100):
times.append(
# decode("..\jxs_cpp\cmake-build-release\jxs_decoder.exe bitstream_... | jxs-development/jxs_utils | idwt_benchmark.py | idwt_benchmark.py | py | 777 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "subprocess.run",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "statistics.stdev",
"line_number": 21,
"usage_type": "call"
}
] |
2020410979 | #
# SQLite.py - Ed Bartosh <bartosh@gmail.com>, <Peter.Bienstman@gmail.com>
#
import os
import sys
import time
import string
import datetime
import copy as objcopy
from openSM2sync.log_entry import EventTypes
from mnemosyne.libmnemosyne.tag import Tag
from mnemosyne.libmnemosyne.fact import Fact
from mnemosyne.libmn... | mnemosyne-proj/mnemosyne | mnemosyne/libmnemosyne/databases/SQLite.py | SQLite.py | py | 72,368 | python | en | code | 443 | github-code | 21 | [
{
"api_name": "string.Template",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "mnemosyne.libmnemosyne.database.Database",
"line_number": 208,
"usage_type": "name"
},
{
"api_name": "mnemosyne.libmnemosyne.databases.SQLite_sync.SQLiteSync",
"line_number": 208,
"... |
12532621717 | import sys
import os
import re
import requests
sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__),
'..')))
__author__ = 'Anirudh Anand <anirudh.anand@owasp.org>'
from Modules.loggingManager.logging_manager import LoggingManager
class Others():
# def __init__(self):
d... | a0xnirudh/WebXploiter | Recon/others.py | others.py | py | 1,170 | python | en | code | 63 | github-code | 21 | [
{
"api_name": "sys.path.insert",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
6173894806 | # -*- coding: utf-8 -*-
"""
Created on Thu Jun 28 22:24:42 2018
@author: Administrator
"""
import pandas as pd
pd.set_option('display.width',450)
import plotly as py
import plotly.graph_objs as pygo
pyplt=py.offline.plot
#read the data
df=pd.read_csv(r'F:\Python Files\Python Project\Github\PythonPlotlyCodes\PythonP... | gao0552/TestCode | scatter_apply.py | scatter_apply.py | py | 1,372 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.set_option",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "plotly.offline",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "plotly.graph_obj... |
35391942952 | # By < @xditya >
# // @BotzHub //
import glob
from pathlib import Path
from TelethonBot.utils import load_plugins
import logging
from . import BotzHub
logging.basicConfig(format='[%(levelname) 5s/%(asctime)s] %(name)s: %(message)s',
level=logging.WARNING)
path = "TelethonBot/plugins/*.py"
files =... | xditya/TelethonBot | TelethonBot/__main__.py | __main__.py | py | 627 | python | en | code | 55 | github-code | 21 | [
{
"api_name": "logging.basicConfig",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.WARNING",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "glob.glob",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.