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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
32156093476 | import torch
def xform_transpose(xform):
s = list(range(len(xform.shape)))
s[-1], s[-2] = s[-2], s[-1]
return xform.permute(*s)
def xform_fk_vel(lxform, lpos, lvrt, lvel, parents):
gr, gp, gt, gv = [lxform[..., :1, :, :]], [lpos[..., :1, :]], [lvrt[..., :1, :]], [lvel[..., :1, :]]
for... | ubisoft/ubisoft-laforge-ZeroEGGS | ZEGGS/anim/txform.py | txform.py | py | 1,378 | python | en | code | 331 | github-code | 1 | [
{
"api_name": "torch.matmul",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.matmul",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.matmul",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.matmul",
"line_numbe... |
39560810668 | import copy
from BU.NTS.dataCheck.dataCheck import getNowAccount,warning_rate,isOpen,t_risk_limit_leverage
from param.dict import SuccessMessage,FailMessage
from common import mysqlClient
from common.other import httpCheck as e
from UnitTest.com import LogName
from common.util import truncate, printc, printl, d, Count,... | wuzhiding1989/newqkex | BU/NTS/dataCheck/Formula.py | Formula.py | py | 31,378 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "common.mysqlClient.mysql",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "common.mysqlClient",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "common.util.d",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "copy.deepco... |
28957556961 | from django.urls import path
from .views import PostList, PostSearch, CreatePost, EditPost, UserPostDetail, DeletePost
urlpatterns = [
path('posts/', PostList.as_view()),
path('search/', PostSearch.as_view()),
path('user/create/', CreatePost.as_view(), name="create_post"),
path('user/edit/posts/<int:pk>... | prakash472/DjangoRestFrameworkBasics | blogs/urls.py | urls.py | py | 468 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "views.PostList.as_view",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "views.PostList",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "django.urls.path"... |
6095050503 | '''
created on 09 June 2019
@author: Gergely
'''
import random
def run_game(env, policy, display=True, should_return=True):
env.reset()
episode = []
done = False
while not done:
s = env.env.s
if display:
env.render()
timestep = [s]
action = po... | imimali/ReinforcementLearningHeroes | td/sarsa.py | sarsa.py | py | 2,768 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "random.choice",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "gym.make",
"line_number": 115,
"usage_type": "call"
}
] |
14191657465 | # -*- coding: utf-8 -*-
from numpy.testing import assert_array_almost_equal
from pmdarima.preprocessing import LogEndogTransformer
from pmdarima.preprocessing import BoxCoxEndogTransformer
def test_same():
y = [1, 2, 3]
trans = BoxCoxEndogTransformer(lmbda=0)
log_trans = LogEndogTransformer()... | jose-dom/bitcoin_forecasting | env/lib/python3.9/site-packages/pmdarima/preprocessing/endog/tests/test_log.py | test_log.py | py | 658 | python | en | code | 10 | github-code | 1 | [
{
"api_name": "pmdarima.preprocessing.BoxCoxEndogTransformer",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pmdarima.preprocessing.LogEndogTransformer",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.testing.assert_array_almost_equal",
"line_numb... |
39332262964 | import os
import webbrowser
import shapely
from folium import Map, Marker, CircleMarker
from folium.plugins import MarkerCluster
from folium.features import PolygonMarker
from utility_functions import get_state_contours, get_state_fullname
class SpatialPlotter:
'''
A class helps visualize commonly used spatial... | HaigangLiu/spatial-temporal-py | visualize_spatial_info.py | visualize_spatial_info.py | py | 6,009 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "folium.Map",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "folium.Marker",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "folium.plugins.MarkerCluster",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "folium.Marker",... |
19830801226 | import serial
import time
import calendar
connected = False
ser = serial.Serial("COM3", 9600)
ser.close()
ser.open()
while not connected:
serin = ser.read()
connected = True
#ser.write("1")
#while ser.read() == '1':
# ser.read()
while True:
string = "T" + str(calendar.timegm(time.localtime())) + "\n"
se... | IRQBreaker/arduino_info_display | sync.py | sync.py | py | 368 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "serial.Serial",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "calendar.timegm",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "time.localtime",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_nu... |
40147521188 | # -*- coding: utf-8 -*
# author: unknowwhite@outlook.com
# wechat: Ben_Xiaobai
# from os import add_dll_directory
import sys
# from threading import Event
# from traceback import print_exception
sys.path.append("./")
sys.setrecursionlimit(10000000)
from configs import admin,kafka
import time
from component.public_func... | white-shiro-bai/ghost_sa | component/access_control.py | access_control.py | py | 10,985 | python | en | code | 256 | github-code | 1 | [
{
"api_name": "sys.path.append",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "sys.setrecursionlimit",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "time.time",
"lin... |
26399582069 | from translate import Translator
translator= Translator(to_lang="pt")
try:
with open('C:/Users/LENOVO/Desktop/Translator/tarans.txt',mode = 'r') as my_file:
text= my_file.read()
translation = translator.translate(text)
print(translation)
with open('C:/Users/LENOVO/Desktop/Translator/tarans-ja.txt',mode='w' ) a... | sonalambadesonal/background-genrator | transscript.py | transscript.py | py | 428 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "translate.Translator",
"line_number": 2,
"usage_type": "call"
}
] |
12836997597 | #!/usr/bin/env python
import sys
import os
import django
import pytz
from datetime import datetime
print("I am alive!.")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pim.settings")
django.setup()
from web.models import ProductData
#Some mappings for readability
EanCode=0
ProductDescription=1
NutritionDescript... | hackcasa/zappa_final | import_coreproductdata.py | import_coreproductdata.py | py | 1,623 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "os.environ.setdefault",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "django.setup",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pytz.timezone",
... |
20046232564 | from io import BytesIO
import multiprocessing
import streamlit as st
from XOR_file_enc_threading import XOR_encryption, XOR_decryption
# streamlit run app.py 2>NUL
st.title('XOR Cipher')
st.header('FILE ENCRYPTION USING XOR CIPHER')
st.write("""
File encryption using the XOR cipher is a method of securing the conten... | githubgithub101/project | app.py | app.py | py | 3,488 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "streamlit.title",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "streamlit.header",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "streamlit.write",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "streamlit.write",
... |
20169614876 | import logging
import sqlite3
import __init__ # noqa pylint: disable=W0611
from time import sleep
logger = logging.getLogger(__name__)
class Inventory:
def __init__(self): # noqa
logger.info("Connecting to database")
self.connection = sqlite3.connect("products.db")
self.connection.set_... | logistic-bot/product | main.py | main.py | py | 6,962 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 13,
"usage_type": "call"
}
] |
28426222784 | import cv2
import numpy as np
import time
import imutils
from pyimagesearch.panorama import Stitcher
left =cv2.VideoCapture("http://192.168.43.1:8080/video")
right =cv2.VideoCapture("http://192.168.43.180:8080/video")
while True:
start = time.time()
left_check, left_frame = left.read()
right_check, right_f... | prince001996/Vision | feed and stitch.py | feed and stitch.py | py | 1,076 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "imutils.resize",
"line_... |
25431182159 | from collections import deque
import sys
input = sys.stdin.readline
dx = [0,1,-1,0]
dy = [1,0,0,-1]
def bfs(hx, hy, ex, ey):
queue = deque()
queue.append([hx,hy,0])
visited = [[[-1]*m for _ in range(n)] for __ in range(2)]
visited[0][hy][hx] = 0
while queue:
x,y,use = queu... | reddevilmidzy/baekjoonsolve | 백준/Gold/14923. 미로 탈출/미로 탈출.py | 미로 탈출.py | py | 1,231 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "sys.stdin",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 10,
"usage_type": "call"
}
] |
72920705315 | from django.conf import settings
from django.contrib import messages
from django.contrib.auth.mixins import LoginRequiredMixin
from django.http.response import HttpResponseRedirect
from django.urls.base import reverse
from django.views.generic.edit import ProcessFormView
from edc_appointment.models.appointment import A... | botswana-harvard/edc-subject-dashboard | edc_subject_dashboard/views/requisition_print_actions_view.py | requisition_print_actions_view.py | py | 6,976 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.contrib.auth.mixins.LoginRequiredMixin",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "edc_label.printers_mixin.PrintersMixin",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "django.views.generic.edit.ProcessFormView",
"line_number... |
2340154996 | from flask import Flask, render_template, request, redirect, url_for
app = Flask(__name__)
tasks = []
class Task:
def __init__(self, description):
self.description = description
self.completed = False
@app.route('/')
def index():
return render_template('index.html', tasks=tasks)... | Thymester/Todo-Site | app.py | app.py | py | 1,030 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.request.form.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "flask.request... |
10004379077 | """
Cedric Pereira, Steven Hurkett, Zack Bowles-Lapointe
December 6 2023
Weather App - User Interaction
"""
import sqlite3
import json
from datetime import datetime
from scrape_weather import WeatherScraper
from db_operations import DBOperations
from plot_operations import PlotOperations
class WeatherProcessor:
"... | Steeeeeeeve/PythonWeather | weather_processor.py | weather_processor.py | py | 7,254 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sqlite3.connect",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "scrape_weathe... |
21620611456 | # -*- coding: utf-8 -*-
import scrapy
from power_market.items import CurrentItem
from power_market.items import PdfItem
class EvnSpider(scrapy.Spider):
name = 'EVN'
allowed_domains = ['en.evn.com.vn']
start_urls = ['https://en.evn.com.vn/c3/gioi-thieu-l/Annual-Report-6-13.aspx']
base_url = "https://en... | realAYAYA/power_market | power_market/spiders/EVN.py | EVN.py | py | 2,139 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "scrapy.Spider",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "scrapy.Request",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "scrapy.Request",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "power_market.items.Pd... |
22895278898 | # This is a sample Python script.
import yfinance as yf
import pandas as pd
import numpy as np
import math as math
def get_stock_info(name):
# Use a breakpoint in the code line below to debug your script.
stock = yf.Ticker(name)
return stock.history(period="1y")
def get_change(current, previous):
if c... | DIGVIJAYMALI/initStockPro | main.py | main.py | py | 13,911 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "yfinance.Ticker",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "math.isnan",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_numbe... |
24881402559 | import queue
import shlex
import ssl
import subprocess
import sys
import time
from abc import ABC, abstractmethod
from shutil import copyfileobj
from threading import Thread
from typing import Tuple, Union
from urllib.error import URLError
from urllib.request import urlopen
from downloader.constants import K_DOWNLOADE... | theypsilon-test/downloader | src/downloader/file_downloader.py | file_downloader.py | py | 25,141 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "abc.ABC",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "downloader.logger.DebugOnlyLoggerDecorator",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": ... |
38681288341 | import numpy as np
import sklearn.metrics
import matplotlib.pyplot as plt
import tqdm
def prcurve_from_similarity_matrix(GT_MAP, SIM_MAP, nintervals, visualize = False):
GTP = np.sum(GT_MAP)
alt_GTP = np.sum(np.sum(GT_MAP,axis=1) > 0)
precisions = []
recalls = []
alt_precisions = []
alt_recall... | ivano-donadi/sdpr | lib/utils/eval_utils.py | eval_utils.py | py | 5,345 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.sum",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.max",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.min",
"line_number": 15,
"u... |
23620492131 | import SuperClass as sc
import tkinter as tk
from PIL import Image,ImageTk
class Entity(sc.SpaceInvader):
def __init__(self):
sc.SpaceInvader.__init__(self)
self.canvas.bind("<Configure>", self.update)
self.vie = 1
self.sprite = Image.open("media/image/male_sprite_model.png")
... | 12dorian12/projet_Space_Invader | Entity.py | Entity.py | py | 2,295 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "SuperClass.SpaceInvader",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "SuperClass.SpaceInvader.__init__",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "SuperClass.SpaceInvader",
"line_number": 7,
"usage_type": "attribute"
},
... |
33382878650 | # This code is based on the following example:
# https://discordpy.readthedocs.io/en/stable/quickstart.html#a-minimal-bot
import discord
from discord.ext import commands
import os
import spotipy
from spotipy.oauth2 import SpotifyClientCredentials
client_id = os.getenv('SPOTIPY_CLIENT_ID')
client_secret = os.getenv('S... | jjneutron/BAST.bot | main.py | main.py | py | 1,699 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.getenv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "discord.Intents.default",
"line_num... |
22418667308 | from enum import Enum
class InsertType(Enum):
"""Type of inserted in google suite."""
TEXT = "text"
TABLE = "table"
GRAPH = "graph"
IMAGE = "image"
class ScopeType(Enum):
"""Type of scopes for google suite.
PRESENTATION_EDITABLE: Allows read/write access to the user's presentations and... | ktro2828/py2gsuite | py2gsuite/utils/types.py | types.py | py | 2,031 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "enum.Enum",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 43,
"... |
17626284356 | import os
import pandas as pd
import numpy as np
import pickle
import json
from uuid import uuid4
from time import time
from importlib import import_module
from sklearn.pipeline import Pipeline
from sklearn.model_selection import GridSearchCV
from sklearn.metrics import make_scorer
from params import Params
# input f... | MurreyCode/completion_rate_case_study | pipeline/src/search_n_train.py | search_n_train.py | py | 3,720 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.getenv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number":... |
14266536126 | import numpy as np
from sklearn.metrics.pairwise import cosine_similarity
def calculate_hit_rate(left_out_dict, user_ids_lst, top_20_recommended_ids):
'''
Claculate hit rate for top 20 using left-one-out set
'''
hit_rate = 0
total_users = len(user_ids_lst)
for user, ids_lst in zip(user_id... | ShalyginaA/30Music-artist-recommendation | utils/CF_recommender_utils.py | CF_recommender_utils.py | py | 2,547 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "numpy.array",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.pairwise.cosine_similarity",
"line_number": 35,
"usage_type": "call"
}
] |
15623826738 | from rest_framework import serializers
from books.models import Book, Book_Review
from users.models import CustomUser
class CustomUserModelSerializer(serializers.ModelSerializer):
class Meta:
model = CustomUser
fields = ('username', 'first_name', 'last_name', 'email')
class BookModelSeria... | ubaydulloh1/goodreads | api/serializers.py | serializers.py | py | 897 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "users.models.CustomUser",
"line_number": 7,
"usage_type": "name"... |
19511514367 | """
Created on Oct 19, 2017
@author: ionut
"""
import sqlite3
def get_config():
"""Return dict of key-value from config table"""
conn = sqlite3.connect("openexcavator.db")
cursor = conn.cursor()
cursor.execute("SELECT key,value FROM config")
config = {}
rows = cursor.fetchall()
for row i... | BWiebe1/openexcavator | openexcavator/database.py | database.py | py | 3,315 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "sqlite3.connect",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
... |
30576627522 | import pygame
class Obstacle:
def __init__(self,x,y,width,height):
self.x = x
self.y = y
self.width = width
self.height = height
def collision(self,dot):
#Assume a class called dot with positions x and y
if (dot.pos.x > self.x) and (dot.pos.x < self.x + self.width) and (dot.pos.y > self.y) and (dot.pos.... | MoMus2000/Genetic-Algorithm | Obstacles.py | Obstacles.py | py | 624 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pygame.Surface",
"line_number": 17,
"usage_type": "call"
}
] |
72101922274 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 28 13:35:15 2022
@author: andres
"""
#El procesamiento de la información fue realizado en python y las estimaciiones en R
#Librerias utilizadas para el preprocesamiento
import pandas as pd
import numpy as np
from datetime import datetime, timede... | AOchoaArangoA/Public_Opinion | Preparacion_Datos_Grado.py | Preparacion_Datos_Grado.py | py | 17,665 | python | es | code | 0 | github-code | 1 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 60,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 100,
"usage_type": "call"
},
{
"api_name... |
31992094934 | import re
from typing import Optional, Tuple, Union
from snake.utils import format_number
def get_episode_tag(number: Union[int, str], leading_zeroes: int = 2) -> str:
return f"E{format_number(number, leading_zeroes=leading_zeroes)}"
def extract_episode_tag(filename: str, return_as_upper: bool = True) -> Tuple... | ajutras/plexsnake | snake/utils/tv.py | tv.py | py | 1,213 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.Union",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "snake.utils.format_number",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "re.findall",
"lin... |
70862066275 | from .models import Comment, Post
from django import forms
from django.utils.text import slugify
from PIL import Image
import io
class CommentForm(forms.ModelForm):
class Meta:
model = Comment
fields = ('body', 'image')
widgets = {
'image': forms.FileInput(attrs={'class': 'btn,... | lukaszglowacz/norton-innovation-platform | blog/forms.py | forms.py | py | 2,244 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "models.Comment",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.forms.Fi... |
35826985836 | from django.urls import path
from events.apps import EventsConfig
from events import views
app_name = EventsConfig.name
urlpatterns = [
path('', views.EventListView.as_view(), name='list'),
path('create/', views.EventCreateView.as_view(), name='create'),
path('<int:pk>/', views.EventGetView.as_view(), na... | raymanzarek1984/tikoExercise | events/urls.py | urls.py | py | 706 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "events.apps.EventsConfig.name",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "events.apps.EventsConfig",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_nam... |
8885931053 | """
A module with auxiliary functions for working with all around numbers
"""
import itertools
import math
from collections import deque
from pzeug.number.prime import sieve_of_eratosthenes
def reverse(n):
reversed_n = 0
while n > 0:
reversed_n = 10 * reversed_n + (n % 10)
n //= 10
retu... | inteldict/pzeug | number/number.py | number.py | py | 4,389 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "itertools.permutations",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 147,
"usage_type": "call"
},
{
"api_name": "pzeug.number.prim... |
2657548095 | #!/usr/bin/env python3
import requests
import spacy
url = "https://query.wikidata.org/sparql"
url_api = "https://www.wikidata.org/w/api.php"
params_entity = {'action': 'wbsearchentities', 'language': 'en', 'format': 'json'}
params_prop = {'action': 'wbsearchentities', 'language': 'en', 'format': 'json', 'type':... | Liya7979/LanguageTechnologyProject | Dueto.py | Dueto.py | py | 2,700 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "spacy.load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 32,
"usage_type": "call"
}
] |
5934931034 | from fastapi import APIRouter, status, Depends
from fastapi.responses import JSONResponse
from sqlalchemy.orm import Session
from slugify import slugify
from schemas import BlogRequest
from schemas import BlogOut
from models import Blog
from database import db_dependency
blog_router = APIRouter(prefix='/blog', tags=... | slvler/fast-api | routers/blog.py | blog.py | py | 2,618 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.Session",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "fastapi.Depends",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "database.db_... |
19751365526 | import csv
from dataclasses import dataclass
from typing import List
# def load_sales(sales_path='./sales.csv'):
# sales = []
# with open(sales_path, encoding='utf-8') as f:
# for sale in csv.DictReader(f):
# # 値の変換
# try:
# sale['price'] = int(sale['price'])
# ... | yoshikikasama/python | best_practice/code_implementation/unittest/case2/sales.py | sales.py | py | 2,084 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "dataclasses.dataclass",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 50,
"usage_type": "name"
},
{
"api_name": "csv.DictReader",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "dataclasses.dataclas... |
39011959286 | # -*- coding: utf-8 -*-
"""
Created on Thr Jan 10 09:13:24 2018
@author: takata@innovotion.co.jp
@author: harada@keigan.co.jp
"""
import argparse
import sys
import os
import pathlib
from time import sleep
current_dir = pathlib.Path(__file__).resolve().parent
sys.path.insert(0, str(current_dir) + '/../') # give 1st pr... | keigan-motor/pykeigan_motor | examples/usb-torque-control.py | usb-torque-control.py | py | 3,090 | python | en | code | 10 | github-code | 1 | [
{
"api_name": "pathlib.Path",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.path.insert",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
... |
22941199712 | import logging
import os
import time
from concurrent.futures import ThreadPoolExecutor
from dicomweb_client import DICOMwebClient
from pydicom.dataset import Dataset
from pydicom.filereader import dcmread
from monailabel.utils.others.generic import md5_digest, run_command
logger = logging.getLogger(__name__)
def g... | Project-MONAI/MONAILabel | monailabel/datastore/utils/dicom.py | dicom.py | py | 4,693 | python | en | code | 472 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "monailabel.utils.others.generic.md5_digest",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 20,
"usage_type": "call"
},
{
"api_name":... |
70983117153 | from django.http import JsonResponse
class InvalidToken(BaseException):
def __init__(self, message='Invalid token', code=401):
self.message = message
self.code = code
super().__init__(self.message)
def handleError(self):
response = {
'result': False,
... | tranlong58/django_mysql_project | tts/exceptions/InvalidToken.py | InvalidToken.py | py | 579 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.http.JsonResponse",
"line_number": 22,
"usage_type": "call"
}
] |
71015635875 | # Self Number
# https://www.acmicpc.net/problem/4673
from functools import reduce
numbers = list(range(1, 10001))
def d(n):
return n + reduce(lambda x, y: x + y, list(map(int, list(str(n)))))
for i in numbers:
if i != 0:
next = d(i)
# numbers.remove(1)
while True:
... | yskang/AlgorithmPractice | baekjoon/python/selfNumber.py | selfNumber.py | py | 487 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "functools.reduce",
"line_number": 9,
"usage_type": "call"
}
] |
38592569457 | import sys
import os
from urllib.request import urlretrieve
from zipfile import ZipFile
if not os.path.isdir('../data'):
os.mkdir('../data')
def reporthook(blocknum, blocksize, totalsize):
bytesread = blocknum * blocksize
if totalsize > 0:
percent = bytesread * 1e2 / totalsize
s = "\r%5.1f... | hoffstadt/pilotlight | scripts/download_assets.py | download_assets.py | py | 1,329 | python | en | code | 67 | github-code | 1 | [
{
"api_name": "os.path.isdir",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.mkdir",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.stderr.write",
"line_number"... |
4945479177 | from django.contrib import admin
from django.urls import path
from .views import TopView, ClothingDetail, ClothingRegister, ClothingDelete, ClothingUpdate, ClothingList, signupfunc, loginfunc, logoutfunc, form, forecast
urlpatterns = [
path('signup/', signupfunc, name='signup'),
path('login/', loginfunc, name... | kibachi02/morningleader | morning/urls.py | urls.py | py | 968 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "views.signupfunc",
"line_number": 7,
"usage_type": "argument"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "views.loginfunc",... |
2736655443 | '''
https://www.codewars.com/kata/54d7660d2daf68c619000d95/python
'''
import math
import functools
def convert_fracts(lst):
lcm = lambda a, b : abs(a*b) // math.gcd(a, b)
tmp_list = list(map(lambda x : x[1] ,list(lst)))
lcm_num = functools.reduce(lcm,tmp_list)
return list(map(lambda x : [x[0] * lcm_num... | SzybkiRabarbar/CodeWars | 2022-03/2022-03-22Common Denominators.py | 2022-03-22Common Denominators.py | py | 2,125 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "math.gcd",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "functools.reduce",
"line_number": 10,
"usage_type": "call"
}
] |
30262927884 | import random
from logging import getLogger
import torch
logger = getLogger(__name__)
def set_seed(seed: int = 0) -> None:
# set seed
random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
torch.backends.cudnn.deterministic = True
logger.info("Finished setting up seed.")... | yiskw713/pytorch_template | src/libs/seed.py | seed.py | py | 321 | python | en | code | 22 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "random.seed",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.manual_seed",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.cuda.manual_seed... |
21763797469 | import streamlit as st
# Function predicts house prices using the regression pipeline
#Credit to Ulrike Riemenschneider for providing the format for this
# page - link to repo at https://github.com/URiem/heritage-housing-PP5
def predict_price(X_live, features, sale_price_pipeline):
# from live data, subset feat... | sonetto104/CI-PP5-Peter-Regan-Heritage-Housing-Project | src/machine_learning/predictive_analysis_ui.py | predictive_analysis_ui.py | py | 1,409 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "streamlit.write",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "streamlit.write",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "streamlit.write",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "streamlit.write",
... |
9450769007 | from datetime import datetime, timedelta
from airflow import DAG
from airflow.operators.bash import BashOperator
default_args = {
'owner': 'airflow',
'depends_on_past': False,
'start_date': datetime(2023, 5, 6),
'retries': 0
}
dag = DAG(
'workSample_bash',
default_args=default_args,
descri... | yyk722/riskThinkingWorkSample | airflow/dags/worksample_bash.py | worksample_bash.py | py | 781 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "datetime.datetime",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "airflow.DAG",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "airflow.operators.bash.BashOperator",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "airf... |
75140687072 | import sys
import time
import pyotp
import pyperclip
def run(token: str ='', _continue: bool=False):
if token == '':
with open('secret', 'r') as fin:
token = fin.read().splitlines()[0]
totp = pyotp.TOTP(token)
if _continue:
print('This program will continue copy totp code to clipboard,\npress Control+C to... | KunoiSayami/simple-totp-paste | totp.py | totp.py | py | 803 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "pyotp.TOTP",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pyperclip.copy",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pyperclip.copy",
"line_numbe... |
30405538314 | # 84. Largest Rectangle in Histogram
# Hard
# Given an array of integers heights representing the histogram's bar height where the width of each bar is 1, return the area of the largest rectangle in the histogram.
# Input: heights = [2,1,5,6,2,3]
# Output: 10
# Explanation: The above is a histogram where width of eac... | akarsh1995/advent-of-code | src/leetcode/lc_84.py | lc_84.py | py | 1,064 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.List",
"line_number": 13,
"usage_type": "name"
}
] |
41129675056 | # -*- coding: utf-8 -*-
import scrapy
from jiandan.items import JiandanItem
class ArticleSpider(scrapy.Spider):
name = 'article'
allowed_domain = 'i.jandan.net'
start_urls = ['http://i.jandan.net/']
def parse(self, response):
url_list = response.xpath("//h2[@class='thetitle']/a/@href").extrac... | xxllea/Spider-Work | jiandan/jiandan/spiders/article.py | article.py | py | 1,352 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "scrapy.Spider",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "scrapy.Request",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "scrapy.Request",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "jiandan.items.Jiandan... |
25158830328 | import os
import json
import time
import h5py
import logging
import numpy as np
from annoy import AnnoyIndex
from tensorflow.keras import optimizers
from tensorflow.keras.models import Model
from tensorflow.keras.preprocessing import image
from tensorflow.keras.applications.vgg16 import VGG16
from tensorflow.keras.app... | SteveVu2212/Image-to-Image-Search | Code/Image_Search.py | Image_Search.py | py | 5,742 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_nu... |
38748247827 | #!/usr/bin/python3.2
import sys
import os
import re
import subprocess
import logging
import optparse
logging.basicConfig(level=logging.INFO,
format='%(asctime)s %(levelname)s %(message)s')
def main():
logging.info('Switching to master branch')
for e in sys.argv:
print (e)
#output,_... | mikelemus27/lemus-code | antlr4/antlr4Test/antlr4.py | antlr4.py | py | 868 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.basicConfig",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "logging.info",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line... |
36972729466 | # Import OpenCV2 for image processing
import cv2
import os
import time
##from twilio.rest import Client
import RPi.GPIO as GPIO
import RPi.GPIO as GPIO
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
IR=19
LASER=17
IN5=23
IN6=24
IN7=25
IN8=8
RED = 2 #Associate pin 23 to TRIG
GREEN ... | 9ightcor3/Camouflage-Multifunctional-Bot | face_recognition.py | face_recognition.py | py | 5,321 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "RPi.GPIO.setwarnings",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "RPi.GPIO",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "RPi.GPIO.setmode",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "RPi.GPIO",
"line_n... |
16675681390 | """
实现生成cookie 的脚本
1,创建gen_gsxt_cookies.py文件,在其中创建GenGsxtCookie的类
2,实现一个方法,用于把一套代理IP,User-Agent,Cookie绑定在一起的信息放到Redis的list中
随机获取一个User-Agent
随机获取一个代理IP
获取request的session对象
把User-Agent,通过请求头,设置给session对象
把代理IP,通过proxies,设置给session对象
使用session对象,发送请求,获取需要的cookie信息
把代理IP ,User-Agent,Cookie放到字典... | luopeixiong/python-test | 爬虫项目/scrapy项目/dishonest_失信人/dishonest/spiders/get_gsxt_cookies.py | get_gsxt_cookies.py | py | 5,913 | python | zh | code | null | github-code | 1 | [
{
"api_name": "gevent.monkey.patch_all",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "gevent.monkey",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "redis.StrictRedis",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "gevent.pool.P... |
31478942286 | from pygame import sprite, transform, image, font, event
class Gui(sprite.Group):
def __init__(self, rect_size):
super().__init__()
self.heart_sprites = sprite.Group()
self.bomb_sprites = sprite.Group()
self.rect_size = rect_size
self.hp = 5
self.bomb = 5
se... | Rogozhin-Dmitry/lyceum_project_2 | gui_file.py | gui_file.py | py | 2,964 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pygame.sprite.Group",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "pygame.sprite",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "pygame.sprite.Group",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.sprite... |
2020300464 | from flask import request, jsonify, make_response, abort, Blueprint
from app import db
import uuid
import copy
import datetime
from .helpers import remove_item_from_location, add_item_to_location, change_item_location, get_unassigned
#Blueprints
user_bp = Blueprint("user", __name__, url_prefix="/users")
game_bp = Blue... | DeeJMWilliams/nodwick-back-end | app/routes.py | routes.py | py | 12,154 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Blueprint",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.Blueprint",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "app.db.collection",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "app.db",
"line_n... |
18263639584 | from sqlalchemy.exc import InvalidRequestError
import logging
from multiprocessing import cpu_count, Pool
from pathlib import Path
from bitglitter.config.palettemodels import Palette
from bitglitter.config.readmodels.streamread import StreamRead
from bitglitter.read.process_state.videoframegenerator import video_fram... | MarkMichon1/BitGlitter-Python | bitglitter/read/process_state/framereadhandler.py | framereadhandler.py | py | 11,681 | python | en | code | 10 | github-code | 1 | [
{
"api_name": "logging.info",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "bitglitter.config.palettemodels.Palette.query.filter",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "bitglitter.config.palettemodels.Palette.query",
"line_number": 23,
"usa... |
26584511593 | # pylint: disable=protected-access
import logging
from datetime import datetime
from odoo import http, models, fields, SUPERUSER_ID, _
from odoo.http import request
_logger = logging.getLogger(__name__)
def get_invoice_values(data: dict) -> dict:
"""Prepares the values for the invoice creation.
* Company: ... | calyx-servicios/account-invoicing | cx_api_invoice_payments/controllers/main.py | main.py | py | 14,672 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "odoo.SUPERUSER_ID",
"line_number": 39,
"usage_type": "argument"
},
{
"api_name": "odoo.http.request.env",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "odo... |
35878967311 | '''
▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄ ▄ ▄▄▄▄ ▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄
▐░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░▌ ▐░▌ ▄█░░░░▌ ▐░░░░░░░░░▌ ▐░░░░░░░░░▌
▐░▌ ▐░█▀▀▀▀▀▀▀█░▌ ▀▀▀▀▀▀▀▀▀█░▌▐░▌ ▐░▌▐░░▌▐░░▌ ▐░█░█▀▀▀▀▀█░▌▐░█░█▀▀▀▀▀█░▌
▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ... | bksahu/Lazy100 | Lazy100.py | Lazy100.py | py | 7,191 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "inspect.getframeinfo",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "inspect.currentframe",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
29370143691 | """ohmydog URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based... | bautimercado/oh-my-dog | ohmydog/ohmydog/urls.py | urls.py | py | 2,566 | python | es | code | 0 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "... |
33971192494 | import attr
from swh.core.utils import decode_with_escape
from swh.storage import get_storage
from swh.storage.tests.test_postgresql import db_transaction
def headers_to_db(git_headers):
return [[key, decode_with_escape(value)] for key, value in git_headers]
def test_revision_extra_header_in_metadata(swh_stora... | SoftwareHeritage/swh-storage | swh/storage/tests/test_revision_bw_compat.py | test_revision_bw_compat.py | py | 1,342 | python | en | code | 6 | github-code | 1 | [
{
"api_name": "swh.core.utils.decode_with_escape",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "swh.storage.get_storage",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "attr.evolve",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "... |
38425988516 | import datetime
from django.core.cache import cache
from django.db.models import Q
from common import keys, errors
from social.models import Swiped, Friend
from swiper import config
from user.models import User
def get_recd_list(user):
now = datetime.datetime.now()
max_brith_year = now.year - user.profile.m... | cy777/swiper | social/logic.py | logic.py | py | 2,477 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "datetime.datetime.now",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "user.models.profile",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": ... |
1926384493 | import add_parent_path # PyFlakesIgnore
import copy
import logging
import assertions
from StringIO import StringIO
class AssertTestingHelper(object):
def __init__(self,b_raise_exception=True):
self.b_raise_exception = b_raise_exception
def install_hooks(self):
self._orig_assert_logger ... | giltayar/Python-Exercises | tests/assert_testing_helper.py | assert_testing_helper.py | py | 1,326 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "assertions.Assertions",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.WARNING",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "cop... |
199318416 | import socketserver
import xmltodict
import dicttoxml
import json
import xml.parsers.expat
import ast
HOSTNAME = 'localhost'
PORT = 8182
class MyTCPHandler(socketserver.StreamRequestHandler):
def handle(self):
print(f'connection received: {self.client_address}')
data = self.rfile.readline().st... | Vadim-212/python-itstep-dz | dz8_(20.02.20)/server.py | server.py | py | 1,106 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "socketserver.StreamRequestHandler",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "xmltodict.parse",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "xml... |
13417303225 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Wed May 8 20:32:44 2019
@author: kamini
"""
import sys
import wave
import matplotlib.pyplot as plt
import numpy as np
import struct
import scipy
import scipy.io.wavfile as wav
from scipy import signal
import pdb
def melFilter(Fs,Nfft):
flow=0
fhi... | sujoyrc/multimodal_raga_analysis | Code/Kamini_Code/energyContoursfunc.py | energyContoursfunc.py | py | 13,877 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.log",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.log",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 25,... |
8320557537 | #! /usr/bin/env python3
import re
from functools import partial
DEFAULT_ENCODING = "utf-8"
def pre_repl(self, p, match):
string = match.group()[2:-1] # Rule: ${var}
#print("Found: {0:s}".format(string))
if ":" in string:
filename = string.split(":")[1] + ".html"
self.create_pag... | lmlwci0m/gen-scripts | htmlgen.py | htmlgen.py | py | 3,626 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "re.compile",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "functools.partial",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "functools.partial",
"line... |
16906652773 | import amino
from tabulate import tabulate
from src.utils import Login
from src.utils import Communities
from src.utils import Chats
from src.scripts.raid_box import RaidBox
from src.scripts.activity_box import ActivityBox
from src.scripts.profile_box import ProfileBox
from src.scripts.chat_box import ChatBox... | TheCuteOwl/Amino-Boxes-But-Better | src/service.py | service.py | py | 2,768 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "shutil.get_terminal_size",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "shutil.get_terminal_size",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sys.platform.startswith",
"line_number": 28,
"usage_type": "call"
},
{
"api_nam... |
4691161197 | import os
import sys
import subprocess
from setuptools import find_packages, setup
from setuptools.command.build_py import build_py
class Build(build_py):
def run(self):
make_runsolver = ["make", "runsolver"]
runsolver_dir = os.path.join(
os.path.dirname(__file__), "runsolver", "runso... | rkkautsar/runsolver-py | setup.py | setup.py | py | 690 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "setuptools.command.build_py.build_py",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path... |
71509372195 | import time
import datetime
def convert_mil(ms):
"""Converts a time in milliseconds from midnight format into a
compatible time format of HH:MM:SS, currently the time provided
in milliseconds is floored to avoid having times in the future.
"""
# Floor the results to avoid rounding errors for secon... | gnu-user/finance-research | scripts/util.py | util.py | py | 2,825 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "datetime.time",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.time",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "datetime.datet... |
16751302675 | """RedLogo PERSONAL GPU fan speed curve tuning project
on Linux Ubuntu, GPU: GTX 1080 Ti"""
import matplotlib.pyplot as plt
import numpy as np
old_profile_temperature = np.array([])
old_profile_fan_speed = np.array([])
new_profile_temperature = np.array([])
new_profile_fan_speed = np.array([])
fan_speed_curve_file_cu... | redlogo/Linux-Ubuntu-GPU-fan-speed-curve-control | GPU-fan-control-tune-curve.py | GPU-fan-control-tune-curve.py | py | 1,777 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "numpy.array",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 9,
... |
72680595875 | from .cart import Cart
import json
from django.shortcuts import render, HttpResponse, redirect, get_object_or_404
from django.contrib import messages
from django.contrib.auth.models import User
from django.http import HttpResponseRedirect
from django.views.generic import View
import time
from math import ceil
from .mod... | Fahad-CSE16/SellOrBuy | product/views.py | views.py | py | 11,500 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.views.generic.CreateView",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "django.views.generic",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "models.Product",
"line_number": 19,
"usage_type": "name"
},
{
"api_name... |
17780386462 | """fixed category model
Revision ID: 35b0f0000908
Revises: 6cfa0419ad9a
Create Date: 2021-10-08 11:51:06.628030
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '35b0f0000908'
down_revision = '6cfa0419ad9a'
branch_labels = None
depends_on = None
def upgrade():... | ywakili18/HIITdontQUIT | migrations/versions/35b0f0000908_fixed_category_model.py | 35b0f0000908_fixed_category_model.py | py | 872 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "alembic.op.drop_constraint",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "alembic.op.drop_column",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "alembic.... |
39202685667 | import dash
from dash.dependencies import Input, Output, State
import dash_core_components as dcc
import dash_bootstrap_components as dbc
import dash_table
import dash_html_components as html
from app.models import Wineset
from app.plotlydash.results import Result
from app import mongo
import math
def get_log(value, ... | gmendonc/winescrapper | mvp/app/plotlydash/dashboard.py | dashboard.py | py | 4,756 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "math.log10",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "dash_bootstrap_components.NavbarSimple",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "dash_bootstrap_components.NavItem",
"line_number": 19,
"usage_type": "call"
},
{
... |
70721287074 | # -*- coding: utf-8 -*-
"""
Created on Wed May 8 14:10:24 2019
@author: iremn
"""
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from tflearn.data_utils import image_preloader
import numpy as np
X, Y = image_preloader('dataset', image_shape=(256, 256), mode='fol... | iremnurk/Universite-BitirmeProjesi-DerinOgrenme-YuzTanima | 03modelEgitim.py | 03modelEgitim.py | py | 2,661 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "tflearn.data_utils.image_preloader",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sklearn.mo... |
32973108172 | import numpy as np
import matplotlib.pyplot as plt
import ipywidgets as wd
import pandas as pd
from IPython.display import display, update_display, Javascript, HTML
from inspect import signature
from graphviz import Digraph
import scipy.stats as sp
import plotly.express as px
import plotly.graph_objects as go
import wa... | sensesensibilityscience/datascience | old/causality_simulation2.py | causality_simulation2.py | py | 45,718 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "IPython.display.display",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "IPython.display.HTML",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "IPython.display.display",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "... |
38760269349 | import streamlit as st
from deta import Deta
DETA_KEY="c05lph41_umJvMdPncrzTfw3dLRynCV8Fb8cQYEaq"
deta=Deta(DETA_KEY)
db=deta.Base("perlengkapan_db")
st.title("Danbox")
st.header("PERALATAN")
st.subheader('Perlengkapan Laboratorium')
from PIL import Image
import streamlit as st
pilihan = st.selectbox(
'Piliha... | erlandesvarapramedya/Deployment-Danbox | pages/3_Peralatan.py | 3_Peralatan.py | py | 3,968 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "deta.Deta",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "deta.Base",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "streamlit.title",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "streamlit.header",
"line_number... |
73376081633 | import os
import sys
import pickle
import argparse
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
from scipy.optimize import curve_fit
from scipy.optimize import least_squares
import math
from matplotlib import cm
from matplotlib.ticker import LinearLocator
from mpl_toolkits.mplot3d import ... | zhaoxs1121/IRL | functions.py | functions.py | py | 9,339 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.all",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.count_nonzero",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "numpy.intersect1d",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "numpy.all",
"line... |
37440181439 | # Author : Bryce Xu
# Time : 2020/1/17
# Function:
import torch
import torch.nn as nn
import torch.nn.functional as F
class BasicConv(nn.Module):
def __init__(self, in_planes, out_planes, kernel_size, stride=1, padding=0, dilation=1, groups=1, relu=True, bn=True, bias=False):
super(BasicConv, self).__ini... | brycexu/SAA | Few-Shot Classification/SAAM.py | SAAM.py | py | 3,960 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "torch.nn.Module",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numb... |
14921838958 | from webium.driver import get_driver
from webium.driver import close_driver
from Login import loginpage
from selenium.webdriver.support.ui import Select
import time
from creds import admin_login, admin_password
import random
from random import choice
from string import digits
from navigation_bar import Navigat... | 6196511/GoDo-AutoTests-Python-with-Selenium | Tests Marketing Hub-Channels/test_GODO-327-341 Add new channel (Channel name only)-2channels same channel name.py | test_GODO-327-341 Add new channel (Channel name only)-2channels same channel name.py | py | 4,374 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "webium.driver.close_driver",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "webium.driver.get_driver",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "Login.loginpage",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "c... |
14618555086 | #!/usr/bin/env python3
import argparse
import os
import pickle
import MultiProcess
def main():
parser = argparse.ArgumentParser(description="Will test mulitple resolution and return the resolution that give a the file size closer to the goad file size");
parser.add_argument('outputDir', type=str, help='path ... | xmar/360Transformations | transformation/Scripts/client.py | client.py | py | 2,600 | python | en | code | 68 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "MultiProcess.WorkerArg",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "MultiProcess.RunClient",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": ... |
37811907070 | from micarraylib.arraycoords.core import micarray
from micarraylib.arraycoords import array_shapes_raw
from micarraylib.arraycoords.array_shapes_utils import _polar2cart
import pytest
import numpy as np
def test_micarray_init():
arr = micarray(array_shapes_raw.cube2l_raw, "cartesian", None, "foo")
assert arr... | micarraylib/micarraylib | tests/test_arraycoords_core.py | test_arraycoords_core.py | py | 2,263 | python | en | code | 12 | github-code | 1 | [
{
"api_name": "micarraylib.arraycoords.core.micarray",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "micarraylib.arraycoords.array_shapes_raw.cube2l_raw",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "micarraylib.arraycoords.array_shapes_raw",
"li... |
42214484809 | #!/usr/bin/env python
# coding: utf-8
import copy
import logging
import numpy as np
import os
import pandas as pd
import random
import sys
from tarquinia.experiments import get_results
from tarquinia.model_selection import MeasureStratifiedKFold, \
FragmentStratifiedKFold, kfold_... | dariomalchiodi/JAS-Tarquinia-classification | experiments/JAS/experiments-with-dim-reduction.py | experiments-with-dim-reduction.py | py | 6,585 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.environ",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "random.seed",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"lin... |
4693870026 | from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from time import sleep
from itertools import product
from string import ascii_uppercase
from difflib import SequenceMatcher
import json
base_url = "https://www.oscaro.es/"
browser = webdriver.Chrome(ChromeDriverManager().install()... | IllicLanthresh/random-stuff | matricula selenium database.py | matricula selenium database.py | py | 3,786 | 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": "webdriver_manager.chrome.ChromeDriverManager",
"line_number": 11,
"usage_type": "call"
},
... |
1346226818 | import torch.utils.data as data
from PIL import Image
import os
import pickle as dill
import numpy as np
import torch
from torch.utils.data import TensorDataset
class GetDataset():
def __init__(self, data_root, unseen_index, val_split):
with open(os.path.join(data_root, 'af_normal_data_processed.pkl'), 'r... | Neronjust2017/DANN_ECG | data_loader.py | data_loader.py | py | 2,724 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "torch.utils.data",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "pickle.load",
"line_nu... |
72921401315 | from datetime import date
from django.conf import settings
from edc_sync_data_report.classes import ClientCollectSummaryData
from edc_sync_data_report.classes.notification import Notification
from edc_sync_data_report.classes.summary_data import SummaryData
def send_sync_report():
sender = Notification()
se... | botswana-harvard/edc-sync-data-report | edc_sync_data_report/tasks.py | tasks.py | py | 884 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "edc_sync_data_report.classes.notification.Notification",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "edc_sync_data_report.classes.summary_data.SummaryData",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.date.today",
"line_numb... |
5344438377 | from collections import UserDict
from datetime import datetime
import re
import csv
# ************************* CLASSES *************************
class Field ():
def __init__(self, value) -> None:
self.value = value
def __str__(self) -> str:
return str(self.value)
def __repr__(s... | GievskiyIgor/GoIT_lesson_12 | PhoneBook_classes.py | PhoneBook_classes.py | py | 6,683 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "re.match",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 55,
"usage_type": "name"
},
{
"api_name": "datetime.dateti... |
19457690233 | import random, copy
from space_objects import Bullet, RocketBaseAction, Asteroid,Rocket, AsteroidSize
from constants import *
import pygame
import time
import math
from dto import collides, Space_object_DTO, copy_object
from enum import Enum
import tensorflow as tf
import numpy as np
class Agent():
def __init__(... | PremekBasta/Asteroids | agents.py | agents.py | py | 72,666 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "math.pow",
"line_number": 106,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 190,
"usage_type": "call"
},
{
"api_name": "numpy.reshape",
"line_number": 197,
"usage_type": "call"
},
{
"api_name": "dto.copy_object",
"line_num... |
19719510621 | #!/usr/bin/env python3
import sys
from functools import partial
from simplifier import setUp
from common import adbSetValue, adbGetValue, alternator
"""
adb -s __DEVICE__ shell settings put system accelerometer_rotation 0
adb -s __DEVICE__ shell settings get system user_rotation
adb -s __DEVICE__ shell settings put sy... | qbalsdon/talos | python/flip.py | flip.py | py | 1,904 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "common.adbSetValue",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "common.adbGetValue",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "simplifier.setUp",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "sys.argv",
... |
16803284319 | #!/usr/bin/python
import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import odeint
def f(y, t, params):
P, lamb = y # unpack current values of y
r, M, alpha, z0, z1 = params # unpack parameters
derivs = [P, -r*lamb] # list of dy/dt=f functions
return derivs
# Paramete... | oscarram/Optimal-Harvesting | Numerical_Solutions/InitialPythonSimulations/NumericalODE.py | NumericalODE.py | py | 1,381 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.sin",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "numpy.cos",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "numpy.arange",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "scipy.integrate.odeint",
... |
1905685024 | import sys
from pymongo import MongoClient
from datetime import datetime, timedelta
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import psycopg2 as pg2
from psycopg2.errors import UniqueViolation
def run_pipe(print_count=1000):
"""
Converts a mongoDB open on localhost:27017 to a post... | Greenford/tdcj | src/pgpipe.py | pgpipe.py | py | 9,224 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "psycopg2.connect",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "sys.exc_info",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "psycopg2.connect",
... |
4914466088 | from typing import List, Dict
import networkx as nx
def best_route(G: nx.Graph, start_node: int) -> List[int]:
if G is None or start_node not in G.nodes:
return None
for node in G.nodes():
if 'depth' not in G.nodes[node]:
G.nodes[node]['depth'] = 0
if 'full' not in G.nodes[... | andreza-vilar/Teoria-dos-Grafos | EP01/src/Q04.py | Q04.py | py | 1,348 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "networkx.Graph",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "typing.List",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_num... |
20581426977 | # mongoDB使用案例
import pymongo
client = pymongo.MongoClient(host='127.0.0.1', port=27017, username="root", password="123456", authSource="test", authMechanism='SCRAM-SHA-1')
# 获取数据库
db = client['test']
# 获取集合
# collection = db['aaa']
# 或
# collection = db.aaa
for i in db.aaa.find({'by': '菜鸟教程'}):
print("data = %s" ... | qugemingzizhemefeijin/python-study | ylspideraction/chapter04/_005mongodb.py | _005mongodb.py | py | 1,207 | python | zh | code | 1 | github-code | 1 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 4,
"usage_type": "call"
}
] |
15779411139 | # +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #
# Import data provided by Towne et al. and perform Spectral-POD #
# #
# do it in Python and train yourself #
# ... | licia13/project-polimi | projects/SpectralPOD/spod-python/old_py/towne_data2.py | towne_data2.py | py | 4,981 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "matplotlib.use",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "h5py.File",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.get_cmap",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot... |
12600495568 | import shutil
import subprocess
import os, sys
from utils import Platforms, fsl_assert, Stages, ShaderTarget, StageFlags, ShaderBinary, fsl_platform_assert
import tempfile, struct
fsl_basepath = os.path.dirname(__file__)
_config = {
Platforms.DIRECT3D11: ('FSL_COMPILER_FXC', 'fxc.exe'),
Platforms.DIRECT3D12: ... | ConfettiFX/The-Forge | Common_3/Tools/ForgeShadingLanguage/compilers.py | compilers.py | py | 9,468 | python | en | code | 4,045 | github-code | 1 | [
{
"api_name": "os.path.dirname",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "utils.Platforms.DIRECT3D11",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "utils.Plat... |
1058797528 | import mtbot.protocol as p
from hashlib import sha1
from base64 import b64encode
from time import time
# Class for seqnums
# And Packetbuffer later
class Seqnum:
"""docstring for Seqnum.
Managing mt seqnums"""
def __init__(self):
self.seqs = {}
self.next = p.seqnum_initial
def pop(s... | Lejo1/mtmodule | mtbot/botpackage.py | botpackage.py | py | 4,096 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "mtbot.protocol.seqnum_initial",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "mtbot.protocol",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "mtbot.protocol.seqnum_initial",
"line_number": 19,
"usage_type": "attribute"
},
{
... |
25088177569 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jul 2 18:44:36 2020
@author: czhang
"""
# this is to create B0 map from 3D phases of 3D fully sampled images.
## delete h5 variables
import h5py
import numpy as np
import torch
from fastMRI.data import transforms
from training_utils import helpers
fr... | chaopingzhang/qRIM | preprocess/B0mapping.py | B0mapping.py | py | 1,945 | python | en | code | 5 | github-code | 1 | [
{
"api_name": "h5py.File",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "skimage.restoration.unwrap_phase",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.ma.array... |
40797678122 | from cx_Freeze import setup, Executable
exe=Executable(
script="client.py",
)
includefiles=["config.txt"]
includes=[]
excludes=[]
packages=['requests']
setup(
version = "1.1",
description = "No Description",
author = "Name",
name = "App name",
options = {'build_exe': {'excludes':exc... | Ovsienko023/VTerminale | Application-VT/client/setup.py | setup.py | py | 972 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "cx_Freeze.Executable",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "cx_Freeze.setup",
"line_number": 10,
"usage_type": "call"
}
] |
39999918194 | '''Build the vocabulary for the yelp dataset'''
import json
from collections import Counter
# stop words are words that occur very frequently,
# and that don't seem to carry information
# about the quality of the review.
# we decide to keep 'not', for example, as negation is an important info.
# I also keep ! which... | cbernet/maldives | yelp/yelp_vocabulary.py | yelp_vocabulary.py | py | 2,865 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "collections.Counter",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "optparse.OptionParser",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "base.setopts",
... |
24589467623 | import os
import json
g = {
"max-processes": 128,
"output-size": 16,
"compile-time": 5000,
"compile-memory": 256,
"mem-bonus": {
},
"time-bonus": {
},
"enabled": ['.c', '.cpp', '.py'],
}
def loadConfig():
global g
try:
with open(os.path.dirname(__file__) + '/config.... | taoky/OJSandbox | config.py | config.py | py | 761 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "os.path.dirname",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_n... |
32023785821 | import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
from matplotlib import rcParams
from matplotlib import style
import datetime
from os import path
style.use('ggplot')
rcParams.update({'font.size': 9})
fig, ax = plt.subplots(sharex=True, figsize=(8.5, 4.8))
fig_size = plt.rcParams["figure.figsize"]
... | nshahr/Data-Visualization | U.S._Natural_Gas_Exports_and_Re-Exports_by_Country.py | U.S._Natural_Gas_Exports_and_Re-Exports_by_Country.py | py | 1,194 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "matplotlib.style.use",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.style",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "matplotlib.rcParams.update",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplot... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.