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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
75171241702 | from setuptools import setup, find_packages
import sys, os
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.rst')).read()
NEWS = open(os.path.join(here, 'NEWS.txt')).read()
version = '0.1'
install_requires = [
# List your project dependencies here.
# For more detail... | yufongpeng/starplot | setup.py | setup.py | py | 1,336 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.abspath",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_nu... |
14231636802 | #!/usr/bin/env python3
import sys
import mrcfile
args = sys.argv
from IsoNet.util.filter import maxmask,stdmask
import numpy as np
#import cupy as cp
import os
def make_mask_dir(tomo_dir,mask_dir,side = 8, density_percentage=30,std_percentage=1,surface=None):
tomo_list = ["{}/{}".format(tomo_dir,f) for f in os.li... | IsoNet-cryoET/IsoNet | bin/make_mask.py | make_mask.py | py | 3,191 | python | en | code | 49 | github-code | 36 | [
{
"api_name": "sys.argv",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "shutil.rmtree",
"line_number"... |
15593721054 | import copy
import math
import numpy as np
import random as rd
from typing import List
class Layer:
def __init__(self, size: int, next_size: int):
self.size = size
self.neurons = np.zeros((size,))
self.biases = np.zeros((size,))
self.weights = np.zeros((size, next_size))
class Po... | vbalabin/mp_practical | pscripts/neural.py | neural.py | py | 3,323 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.zeros",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": ... |
20474535065 | import torch
import torch.nn as nn
import numpy as np
from dataset_windows import SatelliteSet, flatten_batch_data, standardize_data
from torchvision.models.segmentation.deeplabv3 import DeepLabHead
from torchvision import models
import torch.nn.functional as F
from tqdm import tqdm
import h5py
from PIL import Image
i... | jingyan-li/Vege_Height_Regression | feature_extraction/DeepLabv3_ResNet101.py | DeepLabv3_ResNet101.py | py | 8,660 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.nn.Module",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "torchvision.models.resnet101",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "torchvisio... |
42774121207 | from asyncio.locks import Lock
from typing import Union
import markovify
import asyncio
class InitializationError(Exception):
"""Error thrown when the model is not initialized"""
pass
class MarkovHandler:
"""
Manages the state of the internal markov model
"""
def __init__(self):
se... | anmolw/markov-generator-service | markovhandler.py | markovhandler.py | py | 1,669 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "asyncio.locks.Lock",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "asyncio.get_event_loop",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "markovify.Text",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "asyncio... |
13292259369 | from statistics import mode
from sklearn.feature_extraction import image
import torch
import torch.nn as nn
import numpy as np
import matplotlib.pyplot as plt
import os
import random
import pandas as pd
from utils.Metric import compute_meandice_multilabel
from utils.Visualize import plot_whole_imgs
from utils.Utils im... | SWKoreaBME/brats2020 | UNet_transformer/remove_input.py | remove_input.py | py | 6,135 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "torch.manual_seed",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.cuda.manual_seed",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "torch.cuda.m... |
39445267791 | # -*- coding: utf-8 -*-
#
"""
Utility functions related to input/output.
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from io import open # pylint: disable=redefined-builtin
import os
#import logging
import imp... | VegB/Text_Infilling | texar/utils/utils_io.py | utils_io.py | py | 6,380 | python | en | code | 26 | github-code | 36 | [
{
"api_name": "tensorflow.compat",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "importlib.import_module",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "tensorflow.gfile.GFile",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": ... |
23836096348 | # 1. Реализовать скрипт, в котором должна быть предусмотрена функция расчёта заработной платы сотрудника.
# Используйте в нём формулу: (выработка в часах*ставка в час) + премия. Во время выполнения расчёта для конкретных
# значений необходимо запускать скрипт с параметрами.
from sys import argv
script_name, work_... | AndrewSus/Python_Study-I | lesson-04.py | lesson-04.py | py | 7,609 | python | ru | code | 0 | github-code | 36 | [
{
"api_name": "sys.argv",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "random.randint",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "functools.reduce",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "itertools.count",
"line_n... |
5223935084 | from env import *
# import os
import re
import sys
import argparse
from os.path import join
from tools import *
import logging
from core.api import set_api_logger
from core.chat import ChatBot, Turn, set_chat_logger
import gradio as gr
from prompts.dialogue import *
args: argparse.Namespace = None
bot: ChatBot = None
... | wbbeyourself/SCM4LLMs | dialogue_test.py | dialogue_test.py | py | 11,654 | python | en | code | 20 | github-code | 36 | [
{
"api_name": "argparse.Namespace",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "core.chat.ChatBot",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "core.chat.ChatBot",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "os.path.p... |
31804320199 | # /usr/bin/python3.6
# -*- coding:utf-8 -*-
import collections
class TreeNode(object):
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution(object):
def isCompleteTree(self, root):
"""
:type root: TreeNode
:rtype: bool
... | bobcaoge/my-code | python/leetcode/958_Check_Completeness_of_a_Binary_Tree.py | 958_Check_Completeness_of_a_Binary_Tree.py | py | 852 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "collections.defaultdict",
"line_number": 19,
"usage_type": "call"
}
] |
1794733837 | from flask import Flask, request
from flask import jsonify
app = Flask(__name__)
@app.route('/', methods=['GET','POST'])
def hello():
tipo_de_peticion = request.method
json_de_entrada = request.get_json()
print(tipo_de_peticion)
print(json_de_entrada)
json_de_respuesta = {
"text": "Hola Mu... | JoseAngelChepo/curso-chatbot | app.py | app.py | py | 932 | python | es | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "flask.request.get_js... |
14359223498 | from datasets import load_conll2003_en
from conll_dictorizer import CoNLLDictorizer
from dictionizer import dictionize
from sklearn.feature_extraction import DictVectorizer
from keras.preprocessing.sequence import pad_sequences
from keras import models, layers
from keras.utils import to_categorical
from keras.layers i... | niklashedstrom/EDAN95 | lab4/index_builder.py | index_builder.py | py | 5,607 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "datasets.load_conll2003_en",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "conll_dictorizer.CoNLLDictorizer",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "dictionizer.dictionize",
"line_number": 56,
"usage_type": "call"
},
{
... |
4406266697 | from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
from tweepy import Stream
import os
import py.twitter_credentials
import sys
class TwitterAuthenticator:
def twitter_authenticate(self):
auth = OAuthHandler(py.twitter_credentials.CONSUMER_KEY, py.twitter_credentials.CONSUMER_SECRET)
au... | mukul29/TwiXtract | src/py/tweepy_streamer.py | tweepy_streamer.py | py | 1,911 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "tweepy.OAuthHandler",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "py.twitter_credentials.twitter_credentials",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "py.twitter_credentials",
"line_number": 12,
"usage_type": "name"
},... |
15255951210 | from celery import Celery
import mysql.connector
import pandas as pd
from celery import shared_task
from snippets.models import SnippetHistory
from testproject.settings import DB_CONFIG
from datetime import datetime
app = Celery('tasks', broker='redis://localhost')
@app.task
def add(x, y):
return x + y
@shared_t... | crazy-djactor/amazon_for_test | snippets/tasks.py | tasks.py | py | 1,664 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "celery.Celery",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.ExcelFile",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "mysql.connector.connector.connect",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "mysql... |
28924145111 | from typing import List
class Solution:
def maxProfit(self, prices: List[int]) -> int:
profit = 0
maximum = -1e9
minimum = 1e9
for price in prices:
#Change maximum or minimum.
if price>=maximum : maximum = price
if price<=minimum : minimu... | GuSangmo/BOJ_practice | Leetcode/121.bestTimetoBuyandSellStock.py | 121.bestTimetoBuyandSellStock.py | py | 544 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "typing.List",
"line_number": 3,
"usage_type": "name"
}
] |
37656686792 | import sqlite3
def create_table():
conn = sqlite3.connect('avinogradov.db')
c = conn.cursor()
c.execute('CREATE TABLE IF NOT EXISTS avinogradov(nimi TEXT, vanus INTEGER)')
conn.commit()
conn.close()
def auto_lisamine():
name = input("Sisesta nimi: ")
surname = input("Sisesta... | ArtjomVinogradov/sqlite3 | sqlite3-main/sqlite3-main/sqlite-dll-win64-x64-3410200-20230508T093537Z-001/sqlite-dll-win64-x64-3410200/sqlite-tools-win32-x86-3410200/h3.py | h3.py | py | 3,324 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sqlite3.connect",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
... |
71088718504 | from django.urls import path
from . import views
urlpatterns = [
path('user/', views.UserAPI.as_view()),
path('login/', views.KakaoLogin.as_view()),
path('kakaopay/', views.kakaopay),
path('kakaopay/approval/', views.kakaopay_approval),
path('kakaopay/info/', views.kakaopay_info),
path('kakaopa... | epser93/Narang_Norang | backend/accounts/urls.py | urls.py | py | 413 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
8738194119 | import random
import numpy as np
import pandas as pd
from tqdm import tqdm
from os import mkdir
from os.path import join, exists
from pytorch_transformers import RobertaTokenizer
max_length = 100
tokenizer = RobertaTokenizer.from_pretrained('roberta-base')
SOS_ID = tokenizer.encode('<s>')[0]
EOS_ID = tokenizer.encode(... | yehchunhung/EPIMEED | datasets/encode_os_yubo.py | encode_os_yubo.py | py | 6,874 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "pytorch_transformers.RobertaTokenizer.from_pretrained",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pytorch_transformers.RobertaTokenizer",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "tqdm.tqdm",
"line_number": 19,
"usage_type": ... |
9134097621 | #!/usr/bin/python
import argparse
def find_max_profit(prices):
max_profit = float("-inf") # start with neg. infinity (account for least worse loss)
for p in range(1,len(prices)):
profit = prices[p] - min(prices[:p])
if profit > max_profit:
max_profit = profit
return max_profit
... | Tclack88/Lambda | CS/CS-2-Algorithms/2-algorithms/stock_prices/stock_prices.py | stock_prices.py | py | 772 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 16,
"usage_type": "call"
}
] |
71575293223 | #-*- encoding:utf-8 -*-
#written by: Jiao Zhongxiao
import os
import shutil
import xml.etree.ElementTree as ET
import io
import binascii
import sys
from threading import Thread
from ftplib import FTP
#import subprocess
os.chdir( os.path.split( sys.argv[0] )[0] )
#config------------------------------------------------... | edwardandy/kylinProject | KylinGame/py/towerPublishTool.py | towerPublishTool.py | py | 8,123 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.chdir",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.split",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 13,... |
29101112137 | import numpy
from scipy import stats
speed = [99, 86, 87, 88, 111, 86, 103, 87, 94, 78, 77, 85, 86]
ages = [5, 31, 43, 48, 50, 41, 7, 11, 15, 39, 80, 82, 32, 2, 8, 6, 25, 36, 27, 61, 31]
mean = numpy.mean(speed)
median = numpy.median(speed)
mode = stats.mode(speed)
std = numpy.std(speed)
var = numpy.var(spe... | maxyvisser/Python-projects | ML/ML intro.py | ML intro.py | py | 452 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.mean",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.median",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "scipy.stats.mode",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "scipy.stats",
"line_number"... |
4827725138 | #!/usr/bin/env python3
from pynput import keyboard
from pynput.keyboard import Key, Controller
import pyperclip
import sys
f=''
usekey=''
autoenter=False
def on_press(key):
global usekey
if key == Key.esc:
f.close()
return False # stop listener
if usekey=='':
usekey=key
p... | boba2fett/ShitCollection | python/insFiles/insFilesCLI.py | insFilesCLI.py | py | 1,670 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pynput.keyboard.Key.esc",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "pynput.keyboard.Key",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "pyperclip.copy",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pyper... |
347715655 | from scipy.sparse.linalg import eigs, eigsh
import utils.utils as utils
import sys
import numpy as np
import time
import math
from sklearn import mixture
sys.path.append("..")
from utils.laplacian import calLaplacianMatrix
from sklearn.cluster import KMeans
def run_ES_SCOREplus(W, k, c=0.1):
star... | yz24/RBF-SCORE | rbf-score/ES_SCOREplus.py | ES_SCOREplus.py | py | 1,894 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.path.append",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "time.time",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": ... |
25469063444 | # -*- coding: utf-8 -*-
"""
Created on Thu Oct 4 18:04:51 2018
@author: 우람
"""
# Example 1: Multi-class classification
#
# Classify stocks into deciles on their returns
# Features: past 3, 6, 12 month returns
# y: class label (0, ..., 9) based on the future 1 month return.
import numpy as np
import pandas as pd
... | KWOOR/Python-Algorithm | exercise1.py | exercise1.py | py | 4,384 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.chdir",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "tensorflow.Session",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "tensorflow.global_variables_i... |
24925094334 | import sys
import itertools
import copy
input = sys.stdin.readline
n = int(input())
A = list(map(int, input().strip().split()))
b = list(map(int, input().strip().split()))
B = []
for i in range(4):
for j in range(b[i]):
B.append(i)
B = list(itertools.permutations(B, n-1))
result = []
for i in range(len(B... | pla2n/python_practice | python/backjoon/14888_연산자 끼워넣기.py | 14888_연산자 끼워넣기.py | py | 685 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.stdin",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "itertools.permutations",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "copy.copy",
"line_number": 18,
"usage_type": "call"
}
] |
31530311323 | import cv2
# ^ Must be installed via pip
import os
import re
# ^ Should be there by default idk why it didnt work
import pytesseract
from PIL import Image
def optimize_image_for_ocr(image_path, lang='eng', image_dpi=300, image_format='png', whitelist = None, blacklist = None):
# Load the image
... | WorcestershireSample/FIA-Project | Tesseract/OCRfunc.py | OCRfunc.py | py | 2,641 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "cv2.imread",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "cv2.medianBlur",
... |
33359438698 | import datetime
from typing import Optional
from zoneinfo import ZoneInfo
from fastapi import HTTPException
from passlib import pwd
from sqlalchemy import extract, or_, and_, func, Float, text, desc
from sqlalchemy.orm import aliased
import app.auth as auth
import app.models as models
import app.schemas as schemas
fr... | GabrielAndreata/gestione-backend | app/crud.py | crud.py | py | 37,649 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "app.database.SessionLocal",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "app.models.Plant",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "app.models",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "app.databa... |
259844212 | from c3d3.infrastructure.c3.interfaces.cex_order_history_screener.interface import iCexOrderHistoryScreenerHandler
from c3d3.domain.c3.wrappers.binance.usdtm.wrapper import BinanceUsdtmExchange
from c3d3.core.decorators.to_dataframe.decorator import to_dataframe
import datetime
import time
import requests as r
class... | e183b796621afbf902067460/c3d3-framework | c3d3/infrastructure/c3/handlers/cex_order_history_screener/binance/usdtm/handler.py | handler.py | py | 3,034 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "c3d3.domain.c3.wrappers.binance.usdtm.wrapper.BinanceUsdtmExchange",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "c3d3.infrastructure.c3.interfaces.cex_order_history_screener.interface.iCexOrderHistoryScreenerHandler",
"line_number": 10,
"usage_type": "name"
... |
1946291291 | from collections import deque
def bfs(l,startx,starty,goalx,goaly):
visited = [[0]*l for _ in range(l)]
queue = deque()
queue.append((startx,starty))
visited[startx][starty] = 1
while queue:
nowx, nowy = queue.popleft()
if nowx == goalx and nowy == goaly:
return visited[... | hellokena/2022 | DFS & BFS/re/7562 나이트의 이동.py | 7562 나이트의 이동.py | py | 972 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "collections.deque",
"line_number": 5,
"usage_type": "call"
}
] |
40567581461 | # Initialize an empty dictionary to store the data
import numpy as np
import math
import matplotlib.pyplot as plt
import matplotlib as mpl
mpl.use('TkAgg')
from mpl_toolkits.mplot3d import Axes3D
def projectFull(H, X, Y):
w11, w12, w21, w22, w31, w32, t1, t2, t3 = H
u = (fu * w11 + u0 * w31) * X + (fu * w12 ... | bach05/PanNote | src/auto_calibration_tools/scripts/camera_laser_calibration/readTest.py | readTest.py | py | 4,496 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "matplotlib.use",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 95,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 96,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number"... |
23988113634 | import re
import ast
import json
import tiktoken
from langchain.prompts import PromptTemplate
from ..embeddings.chroma import chroma_openai_cwe_collection, chroma_openai_attack_collection
tokenizer = tiktoken.get_encoding("cl100k_base")
general_cyber_security_prompt = PromptTemplate(
input_variables=["query"],
temp... | yadneshSalvi/cybersec_genai | src/cve_to_attack/cve_to_attack_utils.py | cve_to_attack_utils.py | py | 7,776 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "tiktoken.get_encoding",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "langchain.prompts.PromptTemplate",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "langchain.prompts.PromptTemplate",
"line_number": 18,
"usage_type": "call"
},
{... |
36008270872 | #!/bin/python
# -*- coding: utf-8 -*-
# Created by 顾洋溢
from mqtt_test.mqtt_bussiness.iot_base64 import Base64
import base64
from Crypto.Cipher import AES
import json
import demjson
from mqtt_test.mqtt_bussiness import iot_sha256
class Iot_encry_decry(object):
def __init__(self, msg, AESkey, secretuId):
... | xuxiuke/Android_test | SmartHomeV6Code_TestTeam-InterfaceTest/mqtt_test/mqtt_bussiness/iot_encry_decry.py | iot_encry_decry.py | py | 1,326 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "Crypto.Cipher.AES.MODE_ECB",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "Crypto.Cipher.AES",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "json.loads",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "mqtt_tes... |
73970333864 | from .rl import train_rl_agent
import numpy as np
import os
from os import path
from datetime import datetime
import time
import json
import subprocess
from threading import Lock
from typing import Union, Callable, Optional
from multiprocessing import Process, Pipe
import optuna
def train_rl_agent_worker(pipe, hype... | imoneoi/xrl-script | rl-auto-gpu.py | rl-auto-gpu.py | py | 6,769 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "optuna.TrialPruned",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "rl.train_rl_agent",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "optuna.TrialPruned",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "subproce... |
38293660056 | """
ResBlocks for WGAN-GP.
"""
import torch.nn as nn
import torch.functional as F
from torch_mimicry.modules import resblocks
class GBlock(resblocks.GBlock):
r"""
Residual block for generator.
Modifies original resblock definitions with small changes.
Uses bilinear (rather than nearest) interpolati... | kwotsin/mimicry | torch_mimicry/nets/wgan_gp/wgan_gp_resblocks.py | wgan_gp_resblocks.py | py | 5,220 | python | en | code | 593 | github-code | 36 | [
{
"api_name": "torch_mimicry.modules.resblocks.GBlock",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch_mimicry.modules.resblocks",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 45,
"usage_type": "call"
}... |
36165455796 | # coding=utf-8
from django.utils import timezone
from django.db import models
from tinymce.models import HTMLField
class News(models.Model):
title = models.CharField(u'заголовок', max_length=255)
announce = HTMLField(u'анонс')
content = HTMLField(u'описание', blank=True, null=True)
on_main_page = mod... | lambospeed/ryabina | apps/newsboard/models.py | models.py | py | 1,084 | python | ru | code | 0 | github-code | 36 | [
{
"api_name": "django.db.models.Model",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "... |
36253389052 | import threading
import time
from datetime import timedelta
from typing import Callable
from src.models import Team
from src.score_scraper import ScoreScraper
# Monitors a match and notifies the observer when the score changes
class ScoreChangeMonitor:
def __init__(
self,
score_scraper: ScoreScra... | holstt/celebrating-hue-lights | src/score_monitor.py | score_monitor.py | py | 1,755 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "src.score_scraper.ScoreScraper",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "datetime.timedelta",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.Callable",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "src... |
12638712949 | import numpy as np
from collections import OrderedDict
from dataset.mnist import load_mnist
def numerical_gradient(f, x):
h = 1e-4 # 0.0001
grad = np.zeros_like(x)
it = np.nditer(x, flags=['multi_index'], op_flags=['readwrite'])
while not it.finished:
idx = it.multi_index
tmp_val = x[... | wk1219/Data-Science | AI/Back-Propagation/Back-propagation.py | Back-propagation.py | py | 4,461 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "numpy.zeros_like",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.nditer",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.max",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": ... |
11952058238 | from pymongo.errors import DuplicateKeyError
import requests,os,sys,inspect,uuid
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir+"/../dao/")
sys.path.insert(0,parentdir)
from hashVTDAO import createHashVTDAO, getHashVTDAO
parentdir = os.pa... | Gershpenst/PA-EDR-LIKE | service/hashVTService.py | hashVTService.py | py | 1,801 | python | fr | code | 0 | github-code | 36 | [
{
"api_name": "os.path.dirname",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "inspect.getfile",
"line... |
34885776973 | # %%
from enum import Enum
from typing import List, AnyStr, Callable, Sequence, Union
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from transformers.pipelines.base import Pipeline
import tweepy as tw
import plotly.express as px
import os
import json
from transformers import (AutoModelForSequen... | talk2sunil83/BERTLearnings | twitter_sentimant_analysis.py | twitter_sentimant_analysis.py | py | 6,031 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "os.environ",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"lin... |
4192973907 | import sqlite3
from flask import Flask, render_template,request
from flask_paginate import Pagination, get_page_parameter
app = Flask(__name__)
@app.route('/')
def index():
page = request.args.get(get_page_parameter(), type=int, default=1)
per_page = 8
offset = (page - 1) * per_page
conn = sqlite3.co... | grace-lliu/CS551P-assignment | index.py | index.py | py | 1,361 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.request.args.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.request.args",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "flask.request... |
24059635257 | from flask import session
# Dictionary uniter
def MagerDicts(dict1, dict2):
if isinstance(dict1, list) and isinstance(dict2, list):
return dict1 + dict2
elif isinstance(dict1, dict) and isinstance(dict2, dict):
return dict(list(dict1.items()) + list(dict2.items()))
return False
# Cart ite... | Jean029/DataBaseProyect | frontend_model/cartModel.py | cartModel.py | py | 1,528 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.session",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "flask.session",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "flask.session",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "flask.session",
"line_n... |
15380008623 | import sqlalchemy as sql
from sqlalchemy.sql.expression import func
from datetime import datetime
import _pickle as cPickle
import logging
logging.basicConfig(filename='overlaps.log', level=logging.DEBUG,
format='%(asctime)s %(levelname)s %(name)s %(message)s')
logger=logging.getLogger(__name__)
c... | KiranGershenfeld/VisualizingTwitchCommunities | AtlasGeneration/Python/CalculateOverlaps.py | CalculateOverlaps.py | py | 7,918 | python | en | code | 338 | github-code | 36 | [
{
"api_name": "logging.basicConfig",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.crea... |
36913924087 | import struct
from dh import create_dh_key, calculate_dh_secret
from .xor import XOR
from enum import Enum
import hmac
import hashlib
# part 2 - start
from CA import Certificate_Authority
# part 2 - end
# Add messages
class Message(bytes, Enum):
LIST = bytes("LIST", "ascii")
AUTH = bytes("AUTH", "ascii"... | Sahil123445/SecureChat | SecureChat Project/Code/lib/comms.py | comms.py | py | 6,218 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "enum.Enum",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "dh.create_dh_key",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "dh.calculate_dh_secret",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "xor.XOR.new",
"... |
7946314672 |
import csv;
from datetime import datetime;
from urllib.request import urlopen;
from bs4 import BeautifulSoup;
import os
os.chmod("D:\program\python", 0o777);
def convertString(string):
x,y = string.split(",");
string = x + "." + y;
return float(string);
quote_page = "https://www.avanza.se/... | brjj/Avanza | avanza.py | avanza.py | py | 889 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.chmod",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "urllib.request.urlopen",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"li... |
4029209236 | import pandas as pd
from bs4 import BeautifulSoup
import requests
x = input('ievadi loterijas nosaukumu(eurojackpot;viking-lotto;superbingo;latloto;keno;loto5;joker;joker7) \n')
y = []
i = 1
if x =='loto5':
web = 'https://www.latloto.lv/lv/rezultati/loto5'
source = requests.get(web).text
... | kakaoenjoyer/-odien_paveiksies | sodien_paveiksies.py | sodien_paveiksies.py | py | 1,175 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"... |
18036337899 | from utils.cs_parser import CsharpParser
from utils.html import HtmlMaker
import argparse
import os
def main(filename, destination):
with open(filename, 'rt') as file:
lines = file.readlines()
csparser = CsharpParser()
oop_result = csparser.parse_file(lines)
name = filename.split(os... | eyeless12/2html | converter.py | converter.py | py | 934 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "utils.cs_parser.CsharpParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.sep",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "utils.html.HtmlMaker",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "argpars... |
32472626332 | import colorama
from colorama import Fore, Back, Style
import re
import analyze
colorama.init(autoreset=True)
#Input is list of word objects. Prints all words, unknown words being marked red.
def mark_unknown_words_red(words):
for word in words:
if word.known is False:
print(Back.RED + word.w... | estakaad/Pronto | pronto/display.py | display.py | py | 4,765 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "colorama.init",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "colorama.Back.RED",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "colorama.Back",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "analyze.get_synonym... |
27784230868 | import yaml
# save_load将yaml数据流准成python对象
# save_dump将python对象转换成yanl格式
def get_data():
with open('yaml01.yaml', encoding='utf-8') as f:
datas = yaml.safe_load(f)
return datas
def get_yaml():
aa = {'language': ['ruby', 'python', 'java'], 'websites': {'yaml': 'YAML', 'python': 'PYTHON'}}
... | BrandonLau-liuyifei/TestByPython | python_base/test_framework_foundation/yamldemo/getdata.py | getdata.py | py | 440 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "yaml.safe_load",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "yaml.safe_dump",
"line_number": 14,
"usage_type": "call"
}
] |
12601628610 | from typing import List
class Solution:
def deleteAndEarn(self, nums: List[int]) -> int:
calculation = [n for n in range(0, max(nums)+1)]
arr_size = len(calculation)
for i in range(0,arr_size):
calculation[i] = 0
for n in nums:
calculation[n] += n
... | goldy1992/algorithms | delete_and_earn/delete.py | delete.py | py | 523 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "typing.List",
"line_number": 6,
"usage_type": "name"
}
] |
35851739766 | from __future__ import print_function
from future import standard_library
standard_library.install_aliases()
import configparser
import sys
from paste.script import command
import http.cookiejar, urllib.request, urllib.error, urllib.parse
class PackCommand(command.Command):
max_args = 2
min_args = 1
usa... | wyldebeast-wunderliebe/w20e.pycms | w20e/pycms/pack.py | pack.py | py | 1,538 | python | en | code | 11 | github-code | 36 | [
{
"api_name": "future.standard_library.install_aliases",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "future.standard_library",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "paste.script.command.Command",
"line_number": 10,
"usage_type": "attribute"... |
73433072104 | #!/usr/bin/env python3
"""
sklearn_pack.py: Do Model training with large sparse matrix with sklearn
"""
__author__ = "Yanshi Luo"
__license__ = "GPL"
__email__ = "yluo82@wisc.edu"
import pandas as pd
def random_forest(finalX_train, finalY_train, finalX_test, n_parallel=1, write_csv=False, write_filename='rf_pref.c... | yanshil/STAT628_GM2_Yelp | code/Yanshi/sklearn_pack.py | sklearn_pack.py | py | 1,351 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sklearn.ensemble.RandomForestClassifier",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sklearn.tree.DecisionTreeClassifier",
"line_number": 31,
"usage_type": "call"
... |
940338792 | import json
input_path_labor = "/input/labor/input.json"
input_path_divorce = "/input/divorce/input.json"
input_path_loan = "/input/loan/input.json"
output_path_labor = "/output/labor/output.json"
output_path_divorce = "/output/divorce/output.json"
output_path_loan = "/output/loan/output.json"
def predict(input_path... | china-ai-law-challenge/CAIL2019 | 要素识别/python_sample/main.py | main.py | py | 999 | python | en | code | 331 | github-code | 36 | [
{
"api_name": "json.loads",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 21,
"usage_type": "call"
}
] |
33221925828 | import logging
from sqlalchemy import case, create_engine, select
from . import schema
from .. import client
from ..common import Results, date_range
from ..constants import MARKS, PERIODS
logger = logging.getLogger(__name__)
class Store:
def __init__(self, bind=None):
if bind is None:
sel... | dwayne/playwhe | playwhe/cli/store.py | store.py | py | 3,488 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.create_engine",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "constants.MARKS.values",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "con... |
24793623369 | import open3d as o3d
import random
import csv
import numpy as np
import torch
import torch.utils.data as torchdata
from torchvision import transforms
import torchaudio
import librosa
from . import point_transforms as ptransforms
class BaseDataset(torchdata.Dataset):
def __init__(self, list_sample, opt, max_sampl... | francesclluis/point-cloud-source-separation | dataset/base.py | base.py | py | 6,285 | python | en | code | 8 | github-code | 36 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torch.utils.data",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "random.seed",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "csv.reader... |
17253375732 | import os
import traceback
from datetime import datetime, timedelta
import pytz
import config
from manage_transactions import get_first_transaction_timestamp, get_transaction_data
from util import logging
# structure /terra-data/raw/stats_daily_transaction/<type>/<token>.csv
STORE_DAILY_TRANSACTIONS_DIRECTORY = '/te... | joergkiesewetter/terra-analytics | calculate_daily_transaction_data.py | calculate_daily_transaction_data.py | py | 10,541 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "util.logging.get_custom_logger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "util.logging",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "config.LOG_LEVEL",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.... |
2672903172 | from django.forms import ModelForm
from .models import Ticket, Comment
from django import forms
from datetime import date
from dateutil.relativedelta import relativedelta
from bootstrap_datepicker_plus import DatePickerInput
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth import get_use... | d120/pyticket | ticket/forms.py | forms.py | py | 3,129 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "datetime.date.today",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "dateutil.relativedelta.relativedelta",
"line_number": 18,
"usage_type": "call"
},
{
"api_name":... |
30524149041 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Author: HuHao <huhao1@cmcm.com>
Date: '2018/7/21'
Info:
"""
import os,traceback,time,socket,multiprocessing
from threading import Thread
def countdown(n):
while n>0:
print('T-minus',n)
n -=1
time.sleep(2)
def start():
# 创建一个线程,target 为目标函数,args 为入参,默... | happy-place/data-base | api-test/py-test/Part3_Python_CookBook/test_thread.py | test_thread.py | py | 2,251 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "time.sleep",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number"... |
34337388292 | import cv2
import time
def cam(i):
bs = cv2.createBackgroundSubtractorKNN(detectShadows = True)
camera = cv2.VideoCapture(i)
while True:
ret, frame = camera.read()
fgmask = bs.apply(frame)
# img = frame
th = cv2.threshold(fgmask.copy(), 244, 255, cv2.THRESH_BINARY)[1]
th = cv2.erode(th, cv2.getStructuri... | 0x024/MS | Ubuntu/cam.py | cam.py | py | 968 | python | en | code | 23 | github-code | 36 | [
{
"api_name": "cv2.createBackgroundSubtractorKNN",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.threshold",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.TH... |
30330479959 | # !/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2021/3/26 1:57 下午
# @Author : wangHua
# @File : ProductAddConsumer.py
# @Software: PyCharm
from app.consumers import BaseConsumer
from utils import Logger, Http
from app.proxies import get_proxy_engine
from app.exceptions import NotFoundException, CrawlErrorEx... | whale-fall-wh/producer-consumer | app/consumers/ProductAddConsumer.py | ProductAddConsumer.py | py | 2,913 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "app.consumers.BaseConsumer",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "app.consumers.BaseConsumer.__init__",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "app.consumers.BaseConsumer",
"line_number": 41,
"usage_type": "name"
},
... |
37384049849 | import logging
from scrapy.linkextractors import LinkExtractor
from scrapy.spiders import CrawlSpider, Rule
from ..items import BbcNewsItem
from readability import Document
import html2text
from datetime import datetime
from goose3 import Goose
class BbcSpider(CrawlSpider):
name = 'bbc'
start_urls = ['https:/... | ahmad-haggag/bbc-news-scraper | scraper/scraper/spiders/bbc.py | bbc.py | py | 2,514 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "scrapy.spiders.CrawlSpider",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "scrapy.spiders.Rule",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "scrapy.linkextractors.LinkExtractor",
"line_number": 16,
"usage_type": "call"
},
{
... |
70562634984 | import sys
from collections import deque
input = sys.stdin.readline
M, N, H = map(int, input().rstrip().split())
box = [[list(map(int, input().rstrip().split())) for _ in range(N)] for _ in range(H)]
visited = [[[False for _ in range(M)] for _ in range(N)] for _ in range(H)]
tomato = []
check = 0
for h in range(H):... | zsmalla/algorithm-jistudy-season1 | src/chapter3/3_DFS와BFS(2)/7569_python_임지수.py | 7569_python_임지수.py | py | 1,089 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.stdin",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 22,
"usage_type": "call"
}
] |
2882981479 | import requests
import json
urlApiProductos = "http://localhost:8085/colaboradores"
# Petición get
response = requests.get(urlApiProductos)
print(response)
print(response.status_code)
print(response.encoding)
print(response.headers)
print(response.text)
producto = json.loads(response.text)
print(producto)
print(js... | ariasDev/semillero | Python/Curso Python/python/api.py | api.py | py | 842 | python | es | code | 0 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": ... |
74872050985 | import io
import os
# Imports the Google Cloud client library
from google.cloud import speech
from google.cloud.speech import enums
from google.cloud.speech import types
credential_path = "C:/Users/nickj/OneDrive/Documents/Capstone/voice.json"
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = credential_path
# Instanti... | refridgerators/raspicode | voice.py | voice.py | py | 1,005 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "google.cloud.speech.SpeechClient",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "google.cloud.speech",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "... |
15979499427 | import logging
class LoggingConfig:
"""
Configure and use logs with logging for repository use.
"""
@staticmethod
def configureLog(level=logging.INFO, filename="run.log"):
"""
Configure the logging settings.
Args:
level (int, optional): The logging level (DEBU... | nemacdonald/otis | src/utils/logger.py | logger.py | py | 929 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.INFO",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "logging.basicConfig",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 35,
"usage_type": "call"
}
] |
11562594754 | from django.contrib import admin
from django.urls import path
from interview.views import createInterview, showInterviews, uploadResume
urlpatterns = [
path('admin/', admin.site.urls),
path('', createInterview),
path('create', createInterview),
path('interviews', showInterviews),
path('interviews/<... | strikeraryu/scaler_interview | scaler_interview/urls.py | urls.py | py | 441 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "dja... |
74029485864 | import re
from datetime import datetime
def format_date(date):
"""Format the date to datetime string"""
month, day, year = date.split("/")
return datetime(int(year), int(month), int(day)).strftime(
"%Y-%m-%dT%H:%M:%S%Z"
)
def get_ajax_identifier(page_text):
"""Extract from raw HTML the A... | guicrespo/farascraper | farascraper/farascraper/spiders/utils.py | utils.py | py | 504 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "datetime.datetime",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 16,
"usage_type": "call"
}
] |
73921571944 | import torch
import numpy as np
def inference(network, image, checkpoint_path):
"""
Network inference function
Args:
network: Network object to make the inference
image: Numpy array of the image to infer on
checkpoint_path: Path to the weights to use for the inference
Returns... | ValentinFigue/Images-Restoration | Network/inference.py | inference.py | py | 1,037 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.load",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.transpose",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "torch.FloatTensor",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "torch.no_grad",
"lin... |
29158312367 |
import sys
from layers import WEIGHT_DECAY_KEY
sys.path.append('/gan_segmentation/models/discriminators')
import largeFOV, smallFOV, stanford_background_dataset_discriminator
sys.path.append('/gan_segmentation/models/generators')
import fcn32, unet, deeplab_v3
import tensorflow as tf
import numpy as np
from utils impo... | ChangqingHui/Semantic-Segmentation-with-Adversarial-Networks | updater.py | updater.py | py | 14,171 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "sys.path.append",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_numbe... |
24945678151 | # -*- coding: utf-8 -*-
# ____ __ __ ___ _ _ _
# |_ /___ / _|/ _|/ __| (_)___ _ _| |_
# / // -_) _| _| (__| | / -_) ' \ _|
# /___\___|_| |_| \___|_|_\___|_||_\__|
#
"""Zeff unstructured temporal data."""
__author__ = """Lance Finn Helsten <lanhel@zeff.ai>"""
__copyright__ = """Copyright © 2019, Zif... | zeff-ai/ZeffClient | src/zeff/record/unstructuredtemporaldata.py | unstructuredtemporaldata.py | py | 2,133 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "unstructureddata.UnstructuredData",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 53,
"usage_type": "attribute"
},
{
"api_name": "datetime.time",
"line_number": 53,
"usage_type": "attribute"
},
{
"api_nam... |
3756817154 | import jpype as jp
from monostrategy import Monostrategy
class Kmeans(Monostrategy):
def __init__(self,arff_string,weights,nb_seeds,nb_steps):
if not jp.isThreadAttachedToJVM():
jp.attachThreadToJVM()
Monostrategy.__init__(self,arff_string,weights)
self.nb_seeds = int(n... | Alshak/jcl | jcl/methods/kmeans.py | kmeans.py | py | 847 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "monostrategy.Monostrategy",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "jpype.isThreadAttachedToJVM",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "jpype.attachThreadToJVM",
"line_number": 7,
"usage_type": "call"
},
{
"api_na... |
477494635 | #coding=utf-8
#__author__ = 'zgs'
import socket
import logging
import struct
import com_config
class Connection():
def __init__(self, host='127.0.0.1', port=1000):
if host == '127.0.0.1' and port == 1000:
self.host = com_config.access_host
self.port = com_config.access_port
... | Oreobird/face_id | src/test/common/connection.py | connection.py | py | 2,483 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "com_config.access_host",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "com_config.access_port",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "socket.socket",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": ... |
73571223143 | import config
import regex
from models.candidate import Candidate
def fuzzy_search(pattern, string, error_max):
"""Find approximately matching pattern in string
Args:
pattern (string): regex pattern
string (string): where search is performed
error_max (int)
Returns:
error... | TemryL/EyeDocScanner_API | reader_scripts/search.py | search.py | py | 6,576 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "regex.search",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "regex.BESTMATCH",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "config.ERROR_MAX",
"line_number": 54,
"usage_type": "attribute"
},
{
"api_name": "models.candid... |
2446313714 | import unittest
from scripts.experiment import ExperimentalMicData
class ExperimentalMicDataTestCase(unittest.TestCase):
def setUp(self):
head = '/home/akhil/Sound-Source-Localization/data/'
self.sample_filename = "".join([head, 'CMU_ARCTIC/cmu_us_bdl_arctic/wav/',
... | akhilvasvani/Sound-Source-Localization | test/unit/test_experiment.py | test_experiment.py | py | 2,693 | python | en | code | 27 | github-code | 36 | [
{
"api_name": "unittest.TestCase",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "scripts.experiment.ExperimentalMicData",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "scripts.experiment.ExperimentalMicData",
"line_number": 28,
"usage_type": "c... |
25460961095 | '''import pandas as pd
garden_data = pd.read_csv("gardenAll.csv", encoding='euc-kr')
plant = "청옥"
data2 = garden_data[garden_data['name'] == "청옥"]
print(data2['temp(°C)'])
print(data2['hd(%)'])
print(data2['light(Lux)'])
print(data2['water'])
temp1 = data2['temp(°C)']
if float(temp1) >= 5:
for i in range(5):
... | Yoonseungwook/dailylog | aa.py | aa.py | py | 1,601 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "RPi.GPIO.setwarnings",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "RPi.GPIO",
"line... |
4078678340 | """Figure 1: teaser figure"""
import argparse
import os
import sys
from os.path import join
SCRIPT_DIR = os.path.realpath(os.path.dirname(__file__))
sys.path.append(join(SCRIPT_DIR, '..'))
from common import *
import configs
import tqdm
from constants import OUTPUT_DIR
fig_name = 'teaser'
fig_dir = join(FIGURE_DIR... | rgl-epfl/differentiable-sdf-rendering | figures/teaser/teaser.py | teaser.py | py | 1,970 | python | en | code | 810 | github-code | 36 | [
{
"api_name": "os.path.realpath",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"lin... |
14366833514 | from flask import Flask, Response
import json
import pickle
import pmdarima
from datetime import datetime
import pandas as pd
def predecir(period):
pred_temp = pickle.load( open('./modelo_temperatura.p', 'rb') )
pred_hum = pickle.load( open('./modelo_humedad.p', 'rb') )
prediccion_temp = pred_temp.predict... | fer227/API_WeatherPredictor | apiV1/apiV1.py | apiV1.py | py | 1,349 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pickle.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
... |
36829592590 | # mne.python.loading.data
import os
import numpy as np
import mne
# 1. Loading data
# mne-python库支持直接读取各种格式的数据文件,支持众多EEG数据采集设备
# 主要包括设置数据文件夹,原始数据读取到文件句柄,通过句柄传递给变量
sample_data_folder = mne.datasets.sample.data_path() # 数据文件夹
sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample', ... | oca-john/EEG.DeepLearning-xi | Python(EEG)/mne.python.loading.data--.py | mne.python.loading.data--.py | py | 2,168 | python | zh | code | 1 | github-code | 36 | [
{
"api_name": "mne.datasets.sample.data_path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "mne.datasets",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path"... |
39207374957 | # --- carolin schieferstein & jose c. garcia alanis
# --- utf-8
# --- Python 3.7 / mne 0.20
#
# --- EEG prepossessing - dpx-r40 [WIP]
# --- version march 2020 [WIP]
import mne
import re
import glob
import os
from mne import pick_types, Epochs, combine_evoked
import pandas as pd
import numpy as np
output_dir = '/Volu... | CarolinSchieferstein/Master-DPX-EEG | python_scripts/07_export_epochs.py | 07_export_epochs.py | py | 8,133 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "glob.glob",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "os.path.split",
"line_number"... |
13962392009 | from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.http import Http404
from django.shortcuts import render, redirect, get_object_or_404
from django.utils.translation import gettext as _
from django.views.decorators.cache import never_cache
from account.templatetag... | helfertool/helfertool | src/registration/views/event.py | event.py | py | 10,145 | python | en | code | 52 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.get_object_or_404",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "models.Event",
"line_number": 40,
"usage_type": "argument"
},
{
"api_name": ... |
71249204904 | __author__ = 'zfh'
import os
import utils
import matplotlib.pyplot as plt
artistList=set()
dir=os.path.join(utils.allResultPath,'bestanalysis')
files = os.listdir(dir)
for file in files:
with open(os.path.join(dir,file),'r') as csvfile:
while True:
line=csvfile.readline().strip('\n')
... | ifenghao/tianchi_contest | test/plotresults.py | plotresults.py | py | 1,360 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.join",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "utils.allResultPath",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"lin... |
72242724903 | import requests
import re
from airports.serializers import AirportSerializer, RunwaySerializer, AirportCommSerializer
from airports.models import Airport, Runway, AirportComm
from datetime import datetime, timedelta, timezone
class FlightPlanAPIClient(object):
"""
API Client class used to construct requests t... | bfolks2/django-aviation | api/flightplan_client.py | flightplan_client.py | py | 9,259 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "airports.models.AirportComm.CTAF",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "airports.models.AirportComm",
"line_number": 41,
"usage_type": "name"
},
{
"api_name": "airports.models.AirportComm.ATIS",
"line_number": 42,
"usage_type": "at... |
23411926390 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('compras', '0181_auto_20160908_2139'),
]
operations = [
migrations.Remo... | pmmrpy/SIGB | compras/migrations/0182_auto_20160909_1149.py | 0182_auto_20160909_1149.py | py | 1,387 | python | es | code | 0 | github-code | 36 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.RemoveField",
"line_number": 16,
"usage_type": "call"
},
... |
20136022872 | from abc import ABC, abstractmethod
from dataclasses import dataclass
from typing import ByteString, Callable, Generic, Tuple, TypeVar
from network import UDPLink
import torch
import numpy as np
# import aestream
T = TypeVar("T")
class Observation():
def __init__(self, tof, bat, imu, uwb):
self.tof = ... | jpromerob/MockUpBot | durin/sensor.py | sensor.py | py | 1,470 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "typing.TypeVar",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "abc.ABC",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "typing.Generic",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_... |
10742295231 | import xml.etree.ElementTree as et
def import_monster(name):
tree = et.parse("stats/monster_manual.xml")
root = tree.getroot()
if (root.tag != "mm"):
print ("Monster manual not found!\n")
return None
# Iterate through entries in monster manual
for monster in root:
for child in monster:
if (child.tag ==... | MontyKhan/DnD_Scripts | monster_manual.py | monster_manual.py | py | 451 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "xml.etree.ElementTree.parse",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 4,
"usage_type": "name"
}
] |
28040851490 | # import dependencies
from os.path import join
import pandas as pd
# import functions
from eir_functions import scrape_all, to_binary, to_csv, binary_to_csvs, clean_metadata, clean_measurements, clean_csvs, to_individuals
# bring in config values
from sys import path
path.insert(0, "..")
from config import eir_raw_so... | seneubauer/qc-modernization | eir_conversion/extract_eir_info.py | extract_eir_info.py | py | 3,365 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.path.insert",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "eir_functions.clean_csvs",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "config.eir_cleaned_... |
6704842108 | import os, sys
import asyncio
import aiohttp # pip install aiohttp
import aiofiles # pip install aiofiles
def download_files_from_report(file_name):
if sys.version_info[0] == 3 and sys.version_info[1] >= 8 and sys.platform.startswith('win'):
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopP... | NurlanTanatar/download_mangas | get_files.py | get_files.py | py | 1,228 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.version_info",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "sys.platform.startswith",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.platform",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "asyncio.... |
14521290687 | #imports contab package
from crontab import CronTab
#creates the cron job of Detect-IP.py script to run every hour
cron = CronTab(user="root")
detectIPjob = cron.new(command="python3 Detect-IP.py")
detectIPjob.hour.every(1)
cron.write()
#creates the cron job of Backup.py to run every Friday
cron = CronTab(user="root")
... | Splixxy/Cron-Job | Main.py | Main.py | py | 403 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "crontab.CronTab",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "crontab.CronTab",
"line_number": 9,
"usage_type": "call"
}
] |
3845969200 | # С5.6. Итоговое практическое задание
# Телеграм-бот: Конвертор валют
# Студент: Кулагин Станислав
# Поток: FWP_123
import requests
import json
from config import keys, HEADERS
class APIException(Exception):
pass
class CryptoConvertor:
@staticmethod
def get_price(quote: str, base: str, amount: str):
... | kulstas/Skillfactory | С5.6._Telegram-bot/extensions.py | extensions.py | py | 1,359 | python | ru | code | 0 | github-code | 36 | [
{
"api_name": "config.keys",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "config.keys",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "config.HEADERS",
"line_numbe... |
36784973558 | from collections import defaultdict
from nltk import ngrams
import pickle
class SentsFromCorpus():
def __init__(self, path):
self.path = path
def __iter__(self):
with open(self.path) as f:
for ln in f:
if ln == '\n':
continue
... | adamlek/swedish-lexical-blends | ngrams.py | ngrams.py | py | 1,633 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "collections.defaultdict",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "nltk.ngrams",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "pickle.dump",
"li... |
10166527789 | import os
from datetime import datetime
import tensorflow as tf
import numpy as np
import json
from sklearn.model_selection import train_test_split
DATA_IN_PATH ='./data_in/'
DATA_OUT_PATH = './data_out/'
FILE_DIR_PATH = DATA_IN_PATH
INPUT_TRAIN_DATA_FILE_NAME = 'nsmc_train_input.npy'
LABEL_TRAIN_DATA_FILE_NAME = 'ns... | minkyujoo/TCL_NLP | TCL_NLP/textclassifier_modeling.py | textclassifier_modeling.py | py | 3,951 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.load",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_sp... |
5057340753 | #!/usr/bin/python3
import logging
import logging.handlers
import speedtest
import thingspeak
import traceback
import json
import os
rootLogger = logging.getLogger('')
rootLogger.setLevel(logging.INFO)
def joinPathToScriptDirectory(path):
return os.path.join(os.path.dirname(os.path.abspath(__file__)), path)
def ... | barakwei/speedtestReporter | speedtestReporter.py | speedtestReporter.py | py | 1,783 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_... |
28064994078 | from math import prod
from torch import zeros
from torch.nn import Module, Sequential, Conv1d, ReLU, Linear
class SimpleFFDQN(Module):
def __init__(self, obs_len, n_actions):
super().__init__()
self.fc_val = Sequential(
Linear(obs_len, 512),
ReLU(),
Linear(512... | Daggerfall-is-the-best-TES-game/reinforcement-learning | Chapter10/lib/models.py | models.py | py | 1,624 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "torch.nn.Module",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.nn.Linear",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.nn.ReLU",
... |
9829642790 | from collections import deque
PAID_COMMAND = "Paid"
END_COMMAND = "End"
q = deque()
while True:
command = input()
if command == PAID_COMMAND:
while q:
print(q.popleft())
elif command == END_COMMAND:
print(f"{len(q)} people remaining.")
break
else:
q.append(... | skafev/Python_advanced | 01First_week/03Supermarket.py | 03Supermarket.py | py | 329 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "collections.deque",
"line_number": 6,
"usage_type": "call"
}
] |
40574898325 | import pytest
from game.radio.tacan import (
OutOfTacanChannelsError,
TacanBand,
TacanChannel,
TacanRegistry,
TacanUsage,
)
ALL_VALID_X_TR = [1, *range(31, 46 + 1), *range(64, 126 + 1)]
ALL_VALID_X_A2A = [*range(37, 63 + 1), *range(100, 126 + 1)]
def test_allocate_first_few_channels() -> None:
... | dcs-liberation/dcs_liberation | tests/test_tacan.py | test_tacan.py | py | 3,689 | python | en | code | 647 | github-code | 36 | [
{
"api_name": "game.radio.tacan.TacanRegistry",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "game.radio.tacan.TacanBand.X",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "game.radio.tacan.TacanBand",
"line_number": 17,
"usage_type": "name"
}... |
17094646997 | """ Cheddargetter models used in framework."""
from collections import namedtuple
from hashlib import md5
import requests
try:
from urllib import urlencode
except ImportError:
from urllib.parse import urlencode
from . import six
from .settings import settings
from .client import Client
from .utils import nam... | pavlov99/mouse | mouse/models.py | models.py | py | 3,132 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "collections.namedtuple",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "utils.namedtuple_as_dict",
"line_number": 37,
"usage_type": "argument"
},
{
"api_name": "client.Client",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "set... |
43471654353 | from fastapi import APIRouter, Query, Depends, status
from fastapi.responses import JSONResponse
from fastapi.encoders import jsonable_encoder
from pydantic.error_wrappers import ValidationError
from online_inference.model_load import get_model, make_prediction
from online_inference import schema_utils
from online_inf... | made-mlops-2022/mlops_LisinFedor | src/online_inference/testing_router.py | testing_router.py | py | 2,361 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "fastapi.Query",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "online_inference.schema_utils.Sex.keys",
"line_number": 22,
"usage_type": "call"
},
{
"api_name":... |
19862950052 | from cvxopt import matrix, solvers
import numpy as np
import cvxopt
'''
问题描述:
minimize xQx+px
subject Gx <= h
Ax = b
注:Q=[[2, .5], [.5, 1]],即xQx=2x1^2+x^2+x1*x2
'''
Q = 2*matrix(np.array([[2, .5], [.5, 1]])) # 一定要乘以2
p = matrix([1.0, 1.0])
G = matrix([[-1.0, 0.0], [0.0, -1.0]])
h = matrix([0.0, 0.0])
A = mat... | 08zhangyi/multi-factor-gm-wind-joinquant | 掘金多因子开发测试/算法编写模板/CVXOPT/cvx_opt示例.py | cvx_opt示例.py | py | 449 | python | en | code | 180 | github-code | 36 | [
{
"api_name": "cvxopt.matrix",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cvxopt.matrix",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cvxopt.matrix",
"line_num... |
16155570690 | import requests
from lxml import etree as et
import multiprocessing
import google.cloud.bigquery as bq
import os
import traceback
def position(arg):
l = arg
if l == 0:
pos = 1
return (pos)
else:
return (l + 1)
def foc_cum_call(url):
try:
return_list... | siva60/DataStructures | cumulative.py | cumulative.py | py | 5,114 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "lxml.etree.fromstring",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "multiprocessing.Pool",
... |
32824298169 | speed = 3
game_state = "alive"
sythe = "standard scythe"
import pygame
import time
import sys
import random
money = 0
kills = 0
randX = random.randint(0,1626)
randY = random.randint(0,846)
pygame.init()
#This is where we set up the window that displays our game. The resolution is set here
screen = pygame.display.set_m... | GamesCreatorsClub/GCC-games-online | games/henrys-game/Main-platformer coppy.py | Main-platformer coppy.py | py | 11,324 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "random.randint",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pygame.init",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
... |
72594874024 | from django.urls import path
from .views import *
app_name = 'usermanagement'
urlpatterns = [
path('', login, name='login'),
path('dashboard', dashboard, name='dashboard'),
path('validate', login_validate, name='login_validate'),
path('logout/', logout, name='logout'),
] | kazimdrafiq/appraisal | usermanagement/urls.py | urls.py | py | 289 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"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",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.