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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
70380481467 | import os
import re
import sys
import json
import tempfile
import urllib.parse
import urllib.request
import http.cookiejar
import dotenv
def _read_json(url, params=None):
url = f'{url}?{urllib.parse.urlencode(params)}'
request = urllib.request.Request(url)
response = urllib.request.urlopen(request)
d... | enzo-santos/publicapi-correios | main.py | main.py | py | 3,135 | python | pt | code | 0 | github-code | 6 | [
{
"api_name": "urllib.parse.parse.urlencode",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "urllib.parse.parse",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "urllib.parse",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "url... |
28151900553 | import collections
import matplotlib.pyplot as plt
import numpy as np
import os
import cv2
import time
from DQN_RGB import DQN_RGB
from DQN import DQN
from FifaEnv import FifaEnv
from scipy.stats import wilcoxon
from DynamicMLP import MLP
import scipy.misc
from scipy.misc import imresize
# Initialize Global Parameters... | matheusprandini/FifaFreeKickLearning2019 | Main.py | Main.py | py | 7,635 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "FifaEnv.FifaEnv",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "DQN_RGB.DQN_RGB",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "numpy.random.randint",
... |
34529796403 | import tensorflow as tf
import numpy as np
from collections import namedtuple
from .interpolate_tf import InterpolatorTF, nonzero
InterpolatorsTuple = namedtuple(
"InterpolatorsTuple",
[
"quantiles_to_references_forward",
"quantiles_to_references_backward",
"references_to_quantiles",
... | yandexdataschool/QuantileTransformerTF | quantile_transformer_tf/quantile_transform_tf.py | quantile_transform_tf.py | py | 7,127 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "collections.namedtuple",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "tensorflow.name_scope",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "tensorflow.distributions.Normal",
"line_number": 64,
"usage_type": "call"
},
{
"api_n... |
39129545830 | from __future__ import absolute_import, division, print_function
import os
from subprocess import check_call
import logging
import importlib
import tempfile
import yaml
from datetime import datetime
import numpy as np
import dask
import xarray as xr
import cftime
import esmlab
import data_catalog
#-- settings (m... | NCAR/cmip6_cesm | project.py | project.py | py | 10,694 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.environ",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_n... |
71404988987 | from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from contextlib import contextmanager
import pathlib
import shutup
# shut those annoying warnings
shutup.please()
# configure selenium
chromedriver_location = f"{next(pathlib.Path('.').glob('**/chromedriver'))}" #dynamically find chr... | ihiiro/Intelligence | intel_engine/url_extractor.py | url_extractor.py | py | 1,803 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "shutup.please",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.chrome.options.Options",
"line_number": 12,
"usage_type": "call"
}
] |
16897266155 | # ---
# jupyter:
# jupytext:
# formats: ipynb,py:light
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.13.8
# kernelspec:
# display_name: Python [conda env:root] *
# language: python
# name: conda-root-py
# ---
i... | amvelazquez/iia-analysis | scrape_treaty_db.py | scrape_treaty_db.py | py | 2,671 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "bs4.BeautifulSoup",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "io.BytesIO",
"line_nu... |
21386838378 | # -*- coding: utf-8 -*-
import datetime
from functools import partial
import ipyvuetify as v
from traitlets import (
Unicode, observe, directional_link,
List, Int, Bool, Any, link
)
from sepal_ui.sepalwidgets.sepalwidget import SepalWidget, TYPES
from sepal_ui.frontend.styles import sepal_darker
class... | dfguerrerom/restoration_viewer | component/widget/custom_widgets.py | custom_widgets.py | py | 4,906 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "ipyvuetify.Card",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "traitlets.List",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "traitlets.Any",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "traitlets.Unicode",... |
373981387 | from app import app
from flask import render_template,flash, request, redirect, url_for
from .forms import CalculatorForm, ButtonForm
from app import db, models
import datetime
@app.route('/')
def index():
greeting = "Hello World!!!"
title = "Homepage"
# return redirect(url_for('create_assessment'))
re... | Lanrayy/web-app-development-comp2011-cwk1 | app/views.py | views.py | py | 4,045 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.render_template",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "app.app.route",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "app.app",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "forms.CalculatorForm",
... |
43140645221 | """``atomicmass`` - Return the atomic mass of an atom or molecule.
This is really just a wrapper for
`periodictable
<https://periodictable.readthedocs.io/en/latest/index.html>`_
but returns the mass as an `astropy quantity
<http://docs.astropy.org/en/stable/units/index.html>`_.
"""
import periodictable as pt
import as... | mburger-stsci/nexoclom | nexoclom/atomicdata/atomicmass.py | atomicmass.py | py | 1,498 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "periodictable.elements",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "astropy.units.u",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "astropy.units",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "period... |
35227184392 | import glob
import os
import shutil
from tqdm import tqdm
from sklearn.model_selection import train_test_split
import multiprocessing as mp
from functools import partial
def chunks(lst, n):
"""Yield successive n-sized chunks from lst."""
for i in range(0, len(lst), n):
yield lst[i : i + n]
def loop(... | avacaondata/SpainAI_Hackaton_ComputerVision | split_data_multiprocessing.py | split_data_multiprocessing.py | py | 2,114 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "tqdm.tqdm",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "shutil.copy",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 20,
... |
42831472759 | from django.urls import path
from . import views
urlpatterns = [
path('',views.home,name='home'),
path('<slug:c_slug>/',views.home,name='c_slug'),
path('search',views.search_box,name='search'),
path('<slug:c_slug>/<slug:p_slug>/',views.details,name='details')
] | muhammediyas786/Shopping-cart | ShopApp/urls.py | urls.py | py | 279 | python | en | code | 0 | github-code | 6 | [
{
"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",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
26257817866 |
# Imports
import users
import find_athlete
import sys
import sqlalchemy as sa
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
import uuid
import datetime
# Global variables
task = """ Задание №1:
Напишите модуль users.py, который регистрирует новых пользователей. С... | vsixtynine/sf-sql-task | start.py | start.py | py | 9,483 | python | ru | code | 0 | github-code | 6 | [
{
"api_name": "sqlalchemy.ext.declarative.declarative_base",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.create_engine",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.sessionmaker",
"line_number": 62,
"usage_type": "call... |
33276100451 |
# coding: utf-8
# In[2]:
import hashlib
import json
from datetime import datetime
class Block:
def calculateHash(self):
return hashlib.sha256((self.timestamp+str(self.transaction)+self.previoushash+str(self.nonce))
.encode('utf-8')).hexdigest()
# return hashlib.sh... | cpandya231/Blockchain_Poc | Blockchain_poc_with miner and transactions.py | Blockchain_poc_with miner and transactions.py | py | 3,935 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "hashlib.sha256",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 58,
"usage_type": "name"
},
{
"api_name": "json.dumps",
... |
41460148421 | #Python script to retrieve Top 10 performing Cryptocurrencies, ranked by Market capitalization
#Import relevant modules to query API
import requests, json
#Define variables used to query API
url = 'https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest'
headers = {
'Accept': 'ap... | lilokotze/CMC_assignment | CMC_assignment.py | CMC_assignment.py | py | 2,542 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 33,
"usage_type": "call"
}
] |
71791936828 | from unittest import result
import pyvo as vo
import numpy as np
import pandas as pd
import re
from typing import Optional, Tuple
def simbad_tap():
return vo.dal.TAPService("http://simbad.u-strasbg.fr/simbad/sim-tap")
def clean_str(obj_id: str) -> str:
return ' '.join(obj_id.split())
def fetch_catalog_id(i... | maja-jablonska/blue-stragglers-with-gaia | simbad_download.py | simbad_download.py | py | 5,295 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pyvo.dal.TAPService",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pyvo.dal",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "re.findall",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.nan",
"line_numb... |
3668865617 | from typing import List
class Solution:
def solve(self, board: List[List[str]]) -> None:
"""
Do not return anything, modify board in-place instead.
"""
def dfs(i,j,m,n):
if not (0 <= i < m and 0 <= j < n) or board[i][j] != 'O':
return
board[i... | yingzixu15/leetcode | src/SurroundedRegions.py | SurroundedRegions.py | py | 1,142 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
}
] |
21971682039 | # TESTOS DE CREACIO/REGISTRE
from classes.models import Class
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APITestCase
class ClassRegistrationAPIViewTestCase(APITestCase):
def test_one_bad_file_classes(self):
"""
Test to verify that a post call ... | sergiii24/FitHaus_Backend | app/classes/tests.py | tests.py | py | 746 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rest_framework.test.APITestCase",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.urls.reverse",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "rest_framework.status.HTTP_415_UNSUPPORTED_MEDIA_TYPE",
"line_number": 19,
"usage_type... |
25278816523 | from django.urls import path,re_path
from . import views
urlpatterns = [
path('',views.dummy),
re_path('new_reg/',views.register,name='register'),
re_path('login/',views.login,name='login'),
path('index',views.index,name='index'),
path('about',views.about, name='about'),
path('contact',views.c... | mukhilvinod/E-cart | django_tutorial/products/urls.py | urls.py | py | 408 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.re_path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.re_path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.pat... |
16016777996 | from scarf import app
from core import SiteImage, NoImage
from main import page_not_found, PageData
import core
from StringIO import StringIO
from PIL import Image
from flask import send_file
import logging
import base64
import cStringIO
logger = logging.getLogger(__name__)
""" image resizing is implemented via ngin... | oamike/scarfage | scarf/resize.py | resize.py | py | 1,777 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "StringIO.StringIO",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "flask.send_file",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
... |
16551902324 | import string, random, json, sys, os.path, uuid
sys.path.append(
os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)))
# from models import sesion
# import models.models as database
from sqlalchemy.exc import IntegrityError
from sqlalchemy.sql.functions import func
from sqlalchemy import desc
im... | pabloIO/LIBREria_bo | controllers/libros_ctrl.py | libros_ctrl.py | py | 16,176 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "os.path.path.abspath",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"l... |
3028976536 | '''
Description: Converts Gen I pokemon sprites to text for pokemonBatch
Author: Soda Adlmayer
Date: 2017.02.26
'''
from PIL import Image
#set filepath
filename = r"C:\Users\Rudi\Documents\SODA\BATCH\pokemonBatch\data\other\sprites\bulbasaur1.png"
#open image
im = Image.open(filename)
width, height = im.size... | Pokeconomist/pokemonBatch | assets/sprites/image_processor1.py | image_processor1.py | py | 963 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "PIL.Image.open",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 10,
"usage_type": "name"
}
] |
33087525996 | import pygame
from speedfighter.utils.app_base import AppBase
from speedfighter.utils.file import File
from speedfighter.utils.path import Path
class SpeedSpeaker(AppBase):
"""
スピードスピーカー
"""
def __init__(self):
super().__init__()
pygame.mixer.init()
pygame.mixer.music.set_volu... | curio184/speedfighter-nft | speedfighter/speed_monitor/speed_speaker.py | speed_speaker.py | py | 2,159 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "speedfighter.utils.app_base.AppBase",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "pygame.mixer.init",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pygame.mixer",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name":... |
32988415640 | import numpy as np
from utils.DataProcess import RandomHSV, RandomBlur, RandomResize, RandomFlip, RandomRotate, ResizeOrCropToInputSize, BoxToTensor
import os
import random
import tensorflow as tf
class ImageData():
def __init__(self, input_shape, class_ls, anchor_ls, anchor_mask, reduce_ratio,
hs... | bardenthenry/YoloV3_TF2_Keras | utils/ReadDataFromTFRecord.py | ReadDataFromTFRecord.py | py | 3,841 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "utils.DataProcess.RandomHSV",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "utils.DataProcess.RandomBlur",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "utils.DataProcess.RandomResize",
"line_number": 15,
"usage_type": "call"
},
... |
4970666838 | import csv
import matplotlib.pyplot as plt
from datetime import datetime
file_2 = 'data/sitka_weather_2018_simple.csv'
with open(file_2) as f:
reader = csv.reader(f)
header_row = next(reader)
dates, highs, lows = [], [], []
for x in reader:
high = round(((int(x[5]) - 32) * (5/9)),0)
... | RaulMaya/Data-Visualization | python_programs/downloading data/sitka_temperatures.py | sitka_temperatures.py | py | 1,108 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "csv.reader",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyp... |
9773008235 | import os
import threading
import numpy as np
from scipy.optimize import curve_fit
import matplotlib.pyplot as plt
import pandas as pd
results = {}
sigmas = {}
def gaussian(x, mu, sigma, A):
return A * np.exp(-(x-mu)**2 / (2*sigma**2))
def find_peak(file_path, noise_range, plot=False):
try:
... | mattcarv/RadioCUBE | SingleGaussianFitting.py | SingleGaussianFitting.py | py | 2,424 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.exp",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_numbe... |
16669920694 | from django.contrib.auth import get_user_model
from django.test import TestCase
from ..models import Comment, Follow, Group, Post
User = get_user_model()
class PostModelTest(TestCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.user = User.objects.create_user(username='TestUs... | Vilenor/hw05_final | yatube/posts/tests/test_models.py | test_models.py | py | 2,247 | python | ru | code | 0 | github-code | 6 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.test.TestCase",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "models.Group.objects.create",
"line_number": 15,
"usage_type": "call"
},
{
... |
11623004632 | import tkinter as tk
from tkinter import filedialog, messagebox
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import pandas as pd
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.chrom... | Boo4S/AISearch | main.py | main.py | py | 15,301 | python | fr | code | 0 | github-code | 6 | [
{
"api_name": "tkinter.Frame",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "tkinter.Button",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "tkinter.Button",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "tkinter.Frame",
"line... |
8105270111 | # coding=utf-8
import click
import MeCab
from transformers import BertJapaneseTokenizer, BertForMaskedLM
@click.command()
@click.option('--text', '-t', default='')
def main(text):
tokenizer = BertJapaneseTokenizer.from_pretrained('bert-base-japanese-whole-word-masking')
tokenized_text = tokenizer.tokenize(text... | ys201810/bert_work | src/compare_mecab_bert_wakatigaki.py | compare_mecab_bert_wakatigaki.py | py | 551 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "transformers.BertJapaneseTokenizer.from_pretrained",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "transformers.BertJapaneseTokenizer",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "MeCab.Tagger",
"line_number": 13,
"usage_type": "call... |
30353923791 | from os.path import dirname
import logging
# Enthought library imports.
from traits.api import Bool
from envisage.ui.workbench.api import WorkbenchApplication
from pyface.api import AboutDialog, ImageResource, SplashScreen
# Local imports.
import mayavi.api
from mayavi.preferences.api import preference_manager
IMG_D... | enthought/mayavi | mayavi/plugins/mayavi_workbench_application.py | mayavi_workbench_application.py | py | 4,140 | python | en | code | 1,177 | github-code | 6 | [
{
"api_name": "os.path.dirname",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "mayavi.api.api",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "mayavi.api",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
... |
25632521939 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# __author__ = 'CwT'
from queue import Queue, Empty
import logging
import traceback
from selenium.common.exceptions import TimeoutException
from . import Global
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
class Scheduler(object):
def __init_... | futurelighthouse/crawler_sqlmap | crawler/util/scheduler.py | scheduler.py | py | 2,516 | python | en | code | null | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "queue.Queue",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "selenium.common.exce... |
69809838269 | import tkinter
import tkinter.messagebox
import customtkinter
import requests
import webbrowser
from PIL import Image, ImageTk
import spotify
customtkinter.set_appearance_mode("system") # Modes: "System" (standard), "Dark", "Light"
customtkinter.set_default_color_theme("green") # Themes: "blue" (standard), "green", ... | algebrabender/Spotify-API-Project | gui.py | gui.py | py | 7,464 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "customtkinter.set_appearance_mode",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "customtkinter.set_default_color_theme",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "customtkinter.CTk",
"line_number": 12,
"usage_type": "attribute"
... |
5461309461 | from django.db import models
# Create your models here.
class Category(models.Model):
slug = models.SlugField(max_length=30, primary_key=True)
name = models.CharField(max_length=50)
image = models.ImageField(upload_to='categories', blank=True)
class Meta:
verbose_name = 'Kategorya'
... | izumichiDana/djangoModels | main/models.py | models.py | py | 1,010 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.db.models.Model",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.db.models.SlugField",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "... |
27516277876 | from discord.ext import commands
from databases.database_manager import db
class Hive(commands.Cog):
def __init__(self, bot):
self.bot = bot
self._last_member = None
@commands.command(name='get_map_id', help='<map_name>',
aliases=["get_id","gmi"])
async def get_map_... | tintin10q/hive-discord-bot | commands/get_map_id.py | get_map_id.py | py | 710 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "databases.database_manager.db.translate",
"line_number": 15,
"usage_type": "call"
},
... |
1064969872 | import pygame
from pygame.locals import *
# define constants
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
RED = (255, 0, 0)
GREEN = (0, 255, 0)
BLUE = (0, 0, 255)
CYAN = (0, 255, 255)
VIOLET = (148, 0, 211)
width,height = 600,600
# set up display
pygame.init()
#in case you use fonts:
pygame.font.init... | hackingmath/pygame_sketches | pygame_template.py | pygame_template.py | py | 1,334 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "pygame.init",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pygame.font.init",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pygame.font",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "pygame.font.SysFont",
... |
37429210278 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
name: iGenus邮件系统一处无需登录的任意代码执行
referer: http://www.wooyun.org/bugs/wooyun-2015-0156126
author: Lucifer
description: /home/webmail/igenus/include/login_inc.php base64编码未验证可写入shell
'''
import sys
import requests
class igenus_code_exec_BaseVerify:
def __init__(self, ... | iceyhexman/onlinetools | scanner/plugins/cms/iGenus/igenus_code_exec.py | igenus_code_exec.py | py | 1,113 | python | en | code | 1,626 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 34,
"usage_type": "attribute"
}
] |
16733135761 | import argparse
import logging
import os
import sys
import time
from urllib.parse import urljoin, urlparse, unquote, parse_qs
import requests
import urllib3
from bs4 import BeautifulSoup
from pathvalidate import sanitize_filename
logger = logging.getLogger(__name__)
class BookError(Exception):
def __init__(self... | petrovskydv/parse_library | parse_tululu.py | parse_tululu.py | py | 5,093 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",... |
32452217936 | import csv
import importlib
import logging
import os
import re
import random
from abc import ABC, abstractmethod
from collections import defaultdict
from typing import Dict, List, Union
from typing import Optional
import jsonlines
import pandas as pd
from langtest.utils.custom_types import sample
from .format import ... | BrunoScaglione/langtest | langtest/datahandler/datasource.py | datasource.py | py | 81,422 | python | en | code | null | github-code | 6 | [
{
"api_name": "abc.ABC",
"line_number": 112,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 118,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 123,
"usage_type": "name"
},
{
"api_name": "typing.List",
"l... |
71811415868 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
"""code_info
@Time : 2020 2020/7/13 15:53
@Author : Blanc
@File : selenium_test.py
"""
from selenium import webdriver
browser = webdriver.Chrome()
browser.get('https://space.bilibili.com/1')
name=browser.find_element_by_id('h-name')
print(name.text)
brow... | Flynn-Lu/PythonCode | 2020python实训/Day11/selenium_test.py | selenium_test.py | py | 331 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 10,
"usage_type": "name"
}
] |
24442654174 | import argparse
import logging
import sys
import pandas as pd
import requests
key = ' '
def get_recent_headlines(key: str):
r = requests.get(url=f'https://newsapi.org/v2/top-headlines?country=us&apiKey={key}')
return r.json()
def get_headlines_to_certain_category(key: str, category: str):
r = requests... | novatc/sent-news | news_api.py | news_api.py | py | 1,768 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame.from_dict",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame... |
73787200189 | import DaNN
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from tqdm import tqdm
import argparse
import data_loader
import mmd
import scipy.io
import json
DEVICE = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
LEARNING_RATE = 0.02
MOMEMTUN = 0.05
L2_WEIGHT = 0.003
DRO... | comprehensiveMap/EI328-project | DaNN_/main.py | main.py | py | 5,846 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "torch.device",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "argparse.Argumen... |
36712615798 | from .mail import on_warning_last_data_upd
import threading
from datetime import datetime
class SensorDataSignals:
def __init__(self):
self.date = datetime.now()
self.timer = threading.Timer(10, on_warning_last_data_upd(datetime.now()))
def time_warning(self, sender, **kwargs):
if sel... | novelsk/AtlasDjango | app/atlas/signals.py | signals.py | py | 513 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "datetime.datetime.now",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "threading.Timer",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "mail.on_warning_... |
27579511655 | import os
import shutil
import torch
def make_dirs(args, opts, mode="train"):
splits , features = '', ''
if args.video_sets == 'videos':
splits += 'new_'
if args.input_feature == '2d':
features += 'new_'
splits += 'splits'
features += 'features'
train_list = os.path.join(opts.... | t-koba-96/skill-assessment | src/util.py | util.py | py | 3,287 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 1... |
4488441296 | """
"""
import argparse
import copy
import functools
import itertools
# import operator
import os
from pathlib import Path
import re
import galsim
import joblib
import metadetect
import ngmix
import numpy as np
import pyarrow as pa
import pyarrow.compute as pc
import pyarrow.dataset as ds
import pyarrow.parquet as pq... | LSSTDESC/chromatic-shear-bias | chromatic_shear_bias/generators/stars.py | stars.py | py | 2,290 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "galsim.sed.SED",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "galsim.sed",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "functools.cache",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
... |
73694875709 | '''compute CCS in multi-step experiments
'''
import traceback
import time
import glob
import os
from pathlib import Path
from sys import platform as sys_pf
if sys_pf == 'darwin':
import matplotlib
matplotlib.use("TkAgg")
import matplotlib.pyplot as plt
import seaborn as sns
from utils import *
from shortest_... | PNNL-Comp-Mass-Spec/AutoCCS | multiCCS.py | multiCCS.py | py | 29,722 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "sys.platform",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "matplotlib.use",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
... |
5722675237 | import os
import struct
from lxml import etree
import datetime
# | Character | Byte order | Size | Alignment |
# | --------- | ---------------------- | -------- | --------- |
# | @ | native | native | native |
# | = | native | standard | none ... | HappyKimoto/BinaryToXml | bintoxml.py | bintoxml.py | py | 7,191 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "struct.unpack",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_nu... |
33016130821 | from flask import Flask, flash, json, request, redirect, Response, url_for
from flask_cors import CORS
app = Flask(__name__)
app.config['SESSION_TYPE'] = 'filesystem'
app.config.from_envvar('APP_SETTINGS')
CORS(app)
@app.route('/ping', methods=['GET'])
def ping():
response = app.response_class(
response... | aaronjenkins/flask-api-template | api.py | api.py | py | 478 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 8,
"usage_type": "call"
}
] |
27959312759 | import torch
# Define Net
class TestNet(torch.nn.Module):
def __init__(self):
super(TestNet, self).__init__()
def forward(self, x1, x2):
y1 = torch.add(x1, 10)
y2 = torch.add(x2, 5)
y3 = torch.add(y1, y2)
y4 = torch.add(y3, 10)
return y4
def sample1():
x1... | SAITPublic/PimAiCompiler | examples/runtime/python/ir_net/simple_add.py | simple_add.py | py | 805 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "torch.nn",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.add",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torch.add",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.add",
"line_number": 12,
... |
23386753962 | from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework.status import HTTP_404_NOT_FOUND
from scraper.models import PartsDetails
from scraper.serializers import PartsDetailsSerializer
# Create your views here.
@api_view(['GET'])
def company_parts(request, form... | spsree4u/urparts_scraper | scraper/views.py | views.py | py | 1,537 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "scraper.models.PartsDetails.objects.filter",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "scraper.models.PartsDetails.objects",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "scraper.models.PartsDetails",
"line_number": 27,
"usa... |
7074303331 | #Note: 1)The detection works only on grayscale images. So it is important to convert the color image to grayscale.
# 2) detectMultiScale function is used to detect the faces.
# It takes 3 arguments — the input image, scaleFactor and minNeighbours. scaleFactor specifies how much the image size is reduced with each scale... | amanpanditap/Python_Projects | facedetection/facedetection-image.py | facedetection-image.py | py | 3,295 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "cv2.CascadeClassifier",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.data",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "cv2.CascadeClassifier",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.data",
... |
86625733247 | #! /usr/bin/env python
import os
import sys
import time
import numpy as np
from multiprocess import Pool
sys.path.append(os.path.join(os.environ['REPO_DIR'], 'utilities'))
from utilities2015 import *
from metadata import *
from data_manager import *
from learning_utilities import *
#################################... | mistycheney/MouseBrainAtlas | deprecated/learning/apply_classifiers_v4.py | apply_classifiers_v4.py | py | 2,806 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
43634206373 | # pylint: disable=no-self-use,invalid-name,no-value-for-parameter
from __future__ import division
from __future__ import absolute_import
import torch
from allennlp.common.testing.model_test_case import ModelTestCase
from allennlp.nn.decoding.chu_liu_edmonds import decode_mst
class BiaffineDependencyParserTest(Mode... | plasticityai/magnitude | pymagnitude/third_party/allennlp/tests/models/biaffine_dependency_parser_test.py | biaffine_dependency_parser_test.py | py | 3,576 | python | en | code | 1,607 | github-code | 6 | [
{
"api_name": "allennlp.common.testing.model_test_case.ModelTestCase",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "torch.Tensor",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "torch.LongTensor",
"line_number": 53,
"usage_type": "call"
},
{
... |
12309608299 | from setuptools import find_packages, setup
import os
version = "0.0.1"
readme = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read()
req_file = os.path.join(os.path.dirname(__file__), 'requirements.txt')
requirements = [i.strip() for i in open(req_file).readlines()]
setup_params = dict(
name="pye... | mclovinxie/dialect-pyexcel | setup.py | setup.py | py | 1,222 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_numbe... |
26660179991 | '''Model base module'''
import config
import redis
import collections
import asyncio
import sqlalchemy as sa
from sqlalchemy import MetaData
class Relation(object):
def __init__(self, target_cls, back_populates=None, onupdate="CASCADE",
ondelete="CASCADE", rkey=None, reverse=False):
self.targe... | SproutProject/sptoj-server | model/__init__.py | __init__.py | py | 12,647 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sqlalchemy.Column",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.ForeignKey",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 59,
"usage_type": "attribute"
},
{
"api_name": "sqlalc... |
37158488723 | import pandas as pd
from pandas import Series, DataFrame
import matplotlib.pyplot as plt
from datetime import datetime
eboladata=pd.read_csv('datavis/ebola.csv')
filtered = eboladata[eboladata['value']>0]
filtereddata = filtered[filtered['Indicator'].str.contains('death')]
Guineadata = filtereddata[filtereddata['Coun... | QiliWu/Python-datavis | datavis/ebola comfirmed death.py | ebola comfirmed death.py | py | 1,578 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "datetime.... |
20921242416 | import networkx as nx
from graph_manager.graph_tools import clusters_dict2clusters_list
from graph_manager.plot_tools import *
def louvain(G, resolution=1, eps=0.001):
clusters_dict = maximize(G, resolution, eps)
n = len(clusters_dict)
k = len(set(clusters_dict.values()))
while k < n:
H = aggr... | sharpenb/Multi-Scale-Modularity-Graph-Clustering | Scripts/clustering_algorithms/louvain.py | louvain.py | py | 2,921 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "graph_manager.graph_tools.clusters_dict2clusters_list",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "networkx.Graph",
"line_number": 65,
"usage_type": "call"
}
] |
37009080740 | import os
import pathlib
import requests
from flask import Flask, session, abort, redirect, request, render_template, make_response
from google.oauth2 import id_token
from google_auth_oauthlib.flow import Flow
from pip._vendor import cachecontrol
import google.auth.transport.requests
from static.py.chat import socket... | SeanDaBlack/checkmasters | app.py | app.py | py | 8,145 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "static.py.chat.socketio.init... |
29579806350 | # -*- coding: utf-8 -*-
"""
Created on Fri Dec 7 12:41:01 2018
@author: Akitaka
"""
# 1:ライブラリのインポート--------------------------------
import numpy as np #numpyという行列などを扱うライブラリを利用
import pandas as pd #pandasというデータ分析ライブラリを利用
import matplotlib.pyplot as plt #プロット用のライブラリを利用
from sklearn import cross_validation, ... | nakanishi-akitaka/python2018_backup | 1207/ml25.py | ml25.py | py | 1,632 | python | ja | code | 5 | github-code | 6 | [
{
"api_name": "sklearn.datasets.make_moons",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "sklearn.preprocessing.StandardScaler",
"line_number": 19,
"usage_type": "call"
},
{
... |
9439114675 | import shutil
import os
import random
import argparse
import sys
from xml.dom import minidom
import traceback
parser = argparse.ArgumentParser(description="Choose a random number of individual files from a data repository")
parser.add_argument("-fs", "--files", help="Set the path to the directory with the XML files", ... | fusion-jena/QuestionsMetadataBiodiv | data_repositories/random_file_selector.py | random_file_selector.py | py | 3,800 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "shutil.rmtree",
... |
8273446218 | from django.http import HttpResponse
from django.core.cache import cache
from custom_cache_page.utils import hash_key
class TestCache:
def test_cache_page(self, request_factory, mock_cached_view):
request = request_factory.get('/bo')
mock_cached_view(request)
cached_response = cache.get(ha... | kishan-character/django-custom-cache-page | tests/test_cache.py | test_cache.py | py | 510 | python | en | code | null | github-code | 6 | [
{
"api_name": "django.core.cache.cache.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.core.cache.cache",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "custom_cache_page.utils.hash_key",
"line_number": 10,
"usage_type": "call"
},
{
... |
40176552944 | import os
import sys
import cv2
import PIL
import pprint
import pytesseract
import time
SRC_DIR = os.path.dirname(os.path.realpath(__file__))
sys.path.append(SRC_DIR)
#print(sys.path)
import fetch
import display
import filter
page_seg_mode = 11 # Parse sparse text
def group_names(data):
d2 = dict2list(data)
n... | JohnMcAninley/beer-goggles | goggles/extract.py | extract.py | py | 6,035 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.dirname",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"... |
15896435397 | """
RED NEURONAL CONVOLUCIONAL,
Dataset con fotos de Humanos y Caballos
"""
import tensorflow as tf
from keras.preprocessing.image import ImageDataGenerator # Genera las imagenes
# Preprocesado
# Rescala las imagenes del Train
train_datagen = ImageDataGenerator(rescale = 1./255,
... | karlosmir/ML-Projects | ML/RNC01.py | RNC01.py | py | 2,915 | python | es | code | 0 | github-code | 6 | [
{
"api_name": "keras.preprocessing.image.ImageDataGenerator",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "keras.preprocessing.image.ImageDataGenerator",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.models.Sequential",
"line_number":... |
4369691360 | import pandas as pd
import numpy as np
import tensorflow as tf
import tensorflow_text as text
import pickle
import argparse
from tensorflow.keras.preprocessing.text import Tokenizer
from tensorflow.keras.preprocessing.sequence import pad_sequences
from tensorflow.keras.models import load_model
from sklearn.metrics imp... | chennychenchen99/AutoScorer | models/trained_model_files/calculate_test_performance.py | calculate_test_performance.py | py | 2,875 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_excel",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.preprocessing.sequence.pad_sequences",
"line_number": 36,
"usage_type": "call"
},
{
... |
10220457455 | from typing import List
from nazurin.models import Illust, Image, Ugoira
from nazurin.utils import Request
from nazurin.utils.decorators import network_retry
from nazurin.utils.exceptions import NazurinError
from nazurin.utils.logging import logger
from .base import BaseAPI
class SyndicationAPI(BaseAPI):
"""Pub... | y-young/nazurin | nazurin/sites/twitter/api/syndication.py | syndication.py | py | 2,028 | python | en | code | 239 | github-code | 6 | [
{
"api_name": "base.BaseAPI",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "nazurin.utils.logging.logger.info",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "nazurin.utils.logging.logger",
"line_number": 18,
"usage_type": "name"
},
{
"api_n... |
37342054211 | import pyaml
from github import Github
import requests
import datetime
import time
def open_json(fileUrl):
import json
import requests
if fileUrl[0:4] == "http":
# es URL
try:
pointer = requests.get(fileUrl)
return json.loads(pointer.content.decode('utf-8'))
... | smart-data-models/data-models | utils/10_model.yaml_v13.py | 10_model.yaml_v13.py | py | 15,076 | python | en | code | 94 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": ... |
36562104917 | import sys
from scipy.sparse import csr_matrix
import numpy
import re
from collections import Counter
number = '[0-9]+'
isNumber = re.compile(number)
FREQ_THRESH = 5
def normalize_word(word):
if isNumber.search(word):
return '---$$$---'
else:
return word
def trim_vocab(vocab):
... | mfaruqui/vector-semantics | src/nn/process_parallel_data.py | process_parallel_data.py | py | 3,788 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "re.compile",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_num... |
39045297717 | import copy
import coordinates as cor
import ctypes
import os
import Email_Sender_Machine as esm
import PyGameSource as pgs
import TreeCalc as tc
import pygame, sys
import math
os.system('cls')
PI = math.pi
pygame.init()
os.system('cls')
windowSize = pygame.display.get_desktop_sizes()
print(windowSize)
window = p... | Matin-Modarresi/connect-four | connect four/connect_four.py | connect_four.py | py | 3,851 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.system",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "math.pi",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "pygame.init",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 16,... |
7002248991 | from ...flaskapp.utils.db_utils import conn
from ...common.constants import CURRENT_TERM
from ...flaskapp.utils.utils import previous_term
from ..utils import student_utils as student
def transcript_is_outdated(user_id):
cur.execute("""SELECT term_year, term_month
FROM students_completed_courses scc
... | minupalaniappan/gradfire | daviscoursesearch/flaskapp/service/user.py | user.py | py | 1,113 | python | en | code | 12 | github-code | 6 | [
{
"api_name": "flaskapp.utils.utils.previous_term",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "common.constants.CURRENT_TERM",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "utils.student_utils.set_student_programs",
"line_number": 31,
"usage_typ... |
15598827362 | import torch
from torch import nn
from torch.nn import init
# L2 Norm: solve "feature map" scale inconsistent
class L2Norm(nn.Module):
def __init__(self, n_channels, scale):
super(L2Norm, self).__init__()
self.n_channels = n_channels
self.gamma = scale or None
self.eps = 1e-10
... | AceCoooool/detection-pytorch | ssd/utils_ssd/L2Norm.py | L2Norm.py | py | 752 | python | en | code | 24 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "torch.nn.Parameter",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_n... |
32543172289 | import aioredis
import pytest
from aiorate_limiter import RateLimiterOpts
from aiorate_limiter.storage.redis import RedisRateLimiter, REDIS_SCRIPT_HASH
@pytest.fixture
async def redis():
redis = await aioredis.create_redis("redis://localhost:6379")
yield redis
redis.close()
await redis.wait_closed(... | theruziev/aiorate_limiter | tests/storages/test_redis_rl.py | test_redis_rl.py | py | 1,623 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "aioredis.create_redis",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "aiorate_limiter.RateLimiterOpts",
"line_number": 21,
"usage_type": "call"
},
{
"api_name... |
27022192120 | import cv2
import numpy as np
kernel = np.ones((5,5),np.uint8)
# Take input from webcam
cap = cv2.VideoCapture(0)
while True:
ret, frame = cap.read()
#Guassian blur to reduce noise
frame = cv2.GaussianBlur(frame,(5,5),0)
#bgr to hsv
hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
... | ashwin876/Ball_Tracking_Python | Green_ball_Tracking.py | Green_ball_Tracking.py | py | 2,342 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.ones",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.GaussianBlur",
"lin... |
34181193922 | # -*- coding: utf-8 -*-
"""
Created on Fri May 8 14:11:28 2020
@author: Kollarlab
"""
from Instruments.HDAWG import HDAWG
from Instruments.SGS import RFgen
import numpy
import time
import sys
import scipy
import pylab
import scipy.optimize
from mplcursors import cursor as datacursor
import threading
from userfuncs... | MRitter95/Kollar-Lab | Old_scripts_delete_20220804/Control/DataFigureExample.py | DataFigureExample.py | py | 8,375 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "sys.path",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "numpy.linspace",
"lin... |
5479399707 | """
TODO: Merge or improved with pytree in jax.
"""
from collections import defaultdict
import numpy as np
from functools import wraps
from multiprocessing.shared_memory import SharedMemory
from .array_ops import (
squeeze,
unsqueeze,
zeros_like,
repeat,
tile,
shuffle,
take,
share_memo... | haosulab/ManiSkill2-Learn | maniskill2_learn/utils/data/dict_array.py | dict_array.py | py | 34,803 | python | en | code | 53 | github-code | 6 | [
{
"api_name": "multiprocessing.managers.SharedMemoryManager",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "type_utils.is_dict",
"line_number": 157,
"usage_type": "call"
},
{
"api_name": "type_utils.is_dict",
"line_number": 234,
"usage_type": "call"
},
{
... |
40677398663 | from magma.configuration_controller.request_consumer.request_db_consumer import (
RequestDBConsumer,
)
from magma.db_service.config import TestConfig
from magma.db_service.models import (
DBCbsd,
DBCbsdState,
DBRequest,
DBRequestType,
)
from magma.db_service.session_manager import Session
from magma... | magma/magma | dp/cloud/python/magma/configuration_controller/tests/unit/test_request_consumer.py | test_request_consumer.py | py | 3,787 | python | en | code | 1,605 | github-code | 6 | [
{
"api_name": "magma.db_service.tests.local_db_test_case.LocalDBTestCase",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "magma.configuration_controller.request_consumer.request_db_consumer.RequestDBConsumer",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "m... |
14560619174 | import os
from pathlib import Path
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from astropy.time import Time
from astropy.coordinates import solar_system_ephemeris # , EarthLocation
from astropy.coordinates import get_body_barycentric
solar_system_ephemeris.set('de432s')
def get_planet... | caron14/swingby_challenge | planet_position.py | planet_position.py | py | 3,877 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "astropy.coordinates.solar_system_ephemeris.set",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "astropy.coordinates.solar_system_ephemeris",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "astropy.time.Time",
"line_number": 30,
"usage_t... |
15447622348 | import pyglet
class Tower:
def __init__(self, pos):
super().__init__()
self.pos = pos
class TownHall(Tower):
def __init__(self, pos):
super().__init__(pos)
self.image = pyglet.image.load('./Assets/town hall.png')
self.image.anchor_x = self.image.width // 2
sel... | dungcatcher/siege | towers.py | towers.py | py | 543 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pyglet.image.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pyglet.image",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "pyglet.sprite.Sprite",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pyglet.sprit... |
35764996048 | import os
# import urllib.request
# from types import SimpleNamespace
# from urllib.error import HTTPError
import random
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
# import tabulate
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch... | tianyao-aka/Expresive_K_hop_GNNs | QM9/func_util_V2.py | func_util_V2.py | py | 6,416 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "torch.cat",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "torch.tensor",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "torch.sparse_coo_tensor",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "torch.cat",
"line_... |
5479410467 | import itertools
from copy import deepcopy
from random import shuffle
from .type_utils import is_seq_of
def concat_seq(in_list, dtype):
assert dtype in [list, tuple]
return dtype(itertools.chain(*in_list))
def concat_list(in_list):
return concat_seq(in_list, list)
def concat_tuple(in_list):
return... | haosulab/ManiSkill2-Learn | maniskill2_learn/utils/data/seq_utils.py | seq_utils.py | py | 2,031 | python | en | code | 53 | github-code | 6 | [
{
"api_name": "itertools.chain",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "type_utils.is_seq_of",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "math.split_num",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
... |
71780099388 | from django.contrib.auth.models import AbstractUser
from django.core.validators import RegexValidator
from django.db import models
class User(AbstractUser):
'''Модель пользователя'''
email = models.EmailField(
verbose_name='Электронная почта',
max_length=254,
unique=True,
db_i... | GirzhuNikolay/foodgram-project-react | backend/users/models.py | models.py | py | 1,353 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.contrib.auth.models.AbstractUser",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.db.models.EmailField",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.db.models",
"line_number": 9,
"usage_type": "name"
},
{
... |
11726198344 | import sys
import codecs
import os
import numpy as np
import torch
from torch.autograd import Variable
from .constants import MAX_CHAR_LENGTH, NUM_CHAR_PAD, PAD_CHAR, PAD_POS, PAD_TYPE, ROOT_CHAR, ROOT_POS, ROOT_TYPE, END_CHAR, END_POS, END_TYPE, _START_VOCAB, ROOT, PAD_ID_WORD, PAD_ID_CHAR, PAD_ID_TAG, DIGIT_RE
from... | ganeshjawahar/ELMoLex | dat/nlm_data.py | nlm_data.py | py | 8,163 | python | en | code | 12 | github-code | 6 | [
{
"api_name": "numpy.random.seed",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torch.manual_seed",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "dictionary.Dict... |
39270259657 | import datetime as dt
import re
import time
import requests
import html5lib
from bs4 import BeautifulSoup
import googleapiclient.discovery
import google.auth
def get_calendar_html(year, month):
CALURL = "https://syllabus.naist.jp/schedules/preview_monthly"
text = requests.get(f"{CALURL}/{str(year)}/{str(mont... | Masahiro-Kobayashi-NAIST/NAIST-Class-to-Google-Calander | naist-calendar.py | naist-calendar.py | py | 4,663 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_numb... |
39372786389 | # -*- coding: utf-8 -*-
'''
Server Program used to handle multiple clients in a secure manner using
certificates and SSL/TLS protocol, store data
to the database.
@author: Manish Gupta <manishthaparian.gupta@gmail.com>
'''
# Copyright (C) 2018 Manish Gupta <manishthaparian.gupta@gmail.com>;
# This progr... | manishgupta1208/SP-home | home.py | home.py | py | 8,738 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "queue.Queue",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 62,
"usage_type": "attribute"
},
{
"api_name": "threading.Thread",
"line_number": 116,
"usage_type": "name"
},
{
"api_name": "threading.Thread.... |
20031000434 | import sys
from PIL import Image
Image.MAX_IMAGE_PIXELS = 1000000000
image = Image.open("WAC_TIO2_COMBINED_MAP.png")
width, height = image.size
print("width",width,end=" ")
print("height",height,end=" ")
aspect_ratio = width/height
print("aspect_ratio",aspect_ratio)
if aspect_ratio == 2:
print("aspect ratio alre... | Sven-J-Steinert/DLR_Paper_2023 | maps/preparation/TiO2/old/02_place_in_global.py | 02_place_in_global.py | py | 1,072 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "PIL.Image.MAX_IMAGE_PIXELS",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
... |
38967040281 | # -*- coding: utf-8 -*-
import scrapy
from bs4 import BeautifulSoup
import re
from desk_zol.items import DeskZolItem
class BizhiSpider(scrapy.Spider):
name = 'bizhi'
start_urls = ['http://desk.zol.com.cn/nb/','http://desk.zol.com.cn/pc/']
def parse(self, response):
soup = BeautifulSoup(response... | zaoyubo/desk_zol | desk_zol/spiders/bizhi.py | bizhi.py | py | 1,401 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "scrapy.Spider",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "desk_zol.items.DeskZolItem",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "scrapy... |
29584086251 | # -*- coding: utf-8 -*-
import unicodedata
from datetime import datetime, timedelta
from html2text import html2text
from openerp import models, api, fields
from openerp.exceptions import Warning
class AvancysNotification(models.Model):
_name = 'avancys.notification'
user_id = fields.Many2one('res.users', 'Us... | odoopruebasmp/Odoo_08 | v8_llevatelo/avancys_notification/avancys_notification.py | avancys_notification.py | py | 11,966 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "openerp.models.Model",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "openerp.models",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "openerp.fields.Many2one",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "opener... |
30217414474 | import matplotlib.pyplot as plt
plt.plot([1,2,3],[4,5,4], color = '#21c4ed', linestyle='dashed', marker='o')
# erste Liste die X-Werte, zweite Liste Y-Werte
# color via HEX - Farbe finden über color picker (google)
# allgemeine Infos = https://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.plot
#linestyle = http... | ThePeziBear/MyPythonLibrary | Visualizing_Python/Matplotlib/1_General_Matplotlib_settings.py | 1_General_Matplotlib_settings.py | py | 4,912 | python | de | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.show",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotl... |
26042346056 | from __future__ import annotations
from dataclasses import dataclass
from typing import Any
from pants.bsp.spec.base import BuildTargetIdentifier
# -----------------------------------------------------------------------------------------------
# Compile Request
# See https://build-server-protocol.github.io/docs/spec... | pantsbuild/pants | src/python/pants/bsp/spec/compile.py | compile.py | py | 4,430 | python | en | code | 2,896 | github-code | 6 | [
{
"api_name": "pants.bsp.spec.base.BuildTargetIdentifier",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "pants.bsp.spec.base.BuildTargetIdentifier.from_json_dict",
"line_number": 29,
"usage... |
27920291546 | import os
import time
import numpy as np
import pandas as pd
import logging
import shutil
from pathlib import Path
from deep_squeeze.disk_storing import calculate_compression_ratio
def repeat_n_times(n):
"""
A decorator that repeats a decorated function (in our case the compression pipeline) n times and retu... | MikeXydas/DeepSqueeze | deep_squeeze/experiment.py | experiment.py | py | 5,487 | python | en | code | 10 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.std",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number"... |
72509864189 | from flask import (
Blueprint,
render_template,
request, redirect,
session,
flash,
url_for,
abort,
)
from .models import *
from flask_mail import Message
from flask_login import current_user, login_required
from sqlalchemy.exc import SQLAlchemyError
from Hispanist_flask import mail
from Hisp... | vecherninanika/Hispanist_Flask | Hispanist_flask/my_app/pages.py | pages.py | py | 3,473 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Blueprint",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "flask.ren... |
40696903853 | import argparse
import logging
import sys
def create_parser():
parser = argparse.ArgumentParser(
"Get magma managed configs for the specified service. (mconfig)",
)
parser.add_argument(
"-s", "--service",
required=True,
help="Magma service name",
)
parser.add_argume... | magma/magma | orc8r/gateway/python/scripts/magma_get_config.py | magma_get_config.py | py | 1,967 | python | en | code | 1,605 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "magma.co... |
18476191196 | import tornado.httpserver
import tornado.ioloop
import tornado.web
import json
import webapp
import RF24module
import time
import database
global radioNodi
global dbn
class GetListaNodiSettingHandler(tornado.web.RequestHandler):
def get(self):
#***************************************
#**********... | salviador/LightHub | raspberry/app/AggiungiNodi.py | AggiungiNodi.py | py | 5,476 | python | it | code | 0 | github-code | 6 | [
{
"api_name": "tornado.httpserver.web",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "tornado.httpserver",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "webapp.dbn.Read_Lista_Nodi_return_JSON",
"line_number": 35,
"usage_type": "call"
},
{
... |
42287839856 | import argparse
import os.path
import glob
from snakePipes import __version__
def ListGenomes():
"""
Return a list of all genome yaml files (sans the .yaml suffix)
"""
dName = os.path.dirname(__file__)
genomes = [os.path.basename(f)[:-5] for f in glob.glob(os.path.join(dName, "shared/organisms/*.y... | maxplanck-ie/snakepipes | snakePipes/parserCommon.py | parserCommon.py | py | 12,233 | python | en | code | 355 | github-code | 6 | [
{
"api_name": "os.path.path.dirname",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "os.path.path.basename"... |
26624507906 | from livesettings import *
from django.utils.translation import ugettext_lazy as _
# this is so that the translation utility will pick up the string
gettext = lambda s: s
_strings = (gettext('CreditCard'), gettext('Credit Card'))
PAYMENT_GROUP = ConfigurationGroup('PAYMENT_AUTHORIZENET',
_('Authorize.net Payment ... | dokterbob/satchmo | satchmo/apps/payment/modules/authorizenet/config.py | config.py | py | 4,529 | python | en | code | 30 | github-code | 6 | [
{
"api_name": "django.utils.translation.ugettext_lazy",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.utils.translation.ugettext_lazy",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.utils.translation.ugettext_lazy",
"line_number": 17,
... |
23777756221 | from conformity.fields import Dictionary, UnicodeString, List
import json
instance = Dictionary({
"title": UnicodeString(),
"url": UnicodeString(),
"about_url": UnicodeString(),
"description": UnicodeString(),
"tags": List(UnicodeString()),
}, optional_keys=["description", "tags", "about_url"])
ins... | simonw/datasette-registry | test_registry.py | test_registry.py | py | 451 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "conformity.fields.Dictionary",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "conformity.fields.UnicodeString",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "conformity.fields.UnicodeString",
"line_number": 6,
"usage_type": "call"
},
... |
28029416892 | from django.shortcuts import render,redirect
from django.contrib.auth.decorators import login_required
from django.http.response import JsonResponse
from ..models import Image
import json
from django.template.loader import render_to_string
# Create your views here.
@login_required
def menu_main(request):
print('北'... | mituoka/hobby_management | hobby_management/main_app/views/menu.py | menu.py | py | 2,688 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "models.Image.objects.all",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "models.Image.objects",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "models.Image",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "model... |
75131969148 | # -*- coding: utf-8 -*-
"""https://blog.csdn.net/zwq912318834/article/details/79870432"""
import scrapy
from selenium import webdriver
import time
from scrapy import signals # scrapy 信号相关库
from pydispatch import dispatcher # scrapy最新采用的方案
class LoginBlibliSpider(scrapy.Spider):
name = 'login_bl... | hahahei957/NewProject_Opencv2 | use_of_selenium/use_of_selenium/spiders/login_blibli.py | login_blibli.py | py | 1,782 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "scrapy.Spider",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.ChromeOptions",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 22,
"usage_type": "name"
},
{
"api_name":... |
21056363812 | import torch
import torchvision
from torchvision import models
import torchvision.transforms as transforms
from torchvision.transforms import ToPILImage
import torch.optim as optim
import torch.nn as nn
import torch.nn.functional as F
import matplotlib.pyplot as plt
import numpy as np
import time
from func... | modusV/Machine-Learning-Homeworks | HW3/main.py | main.py | py | 9,042 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "time.perf_counter",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "time.perf_counter",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "functools.wraps",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",... |
12025294058 | from typing import Dict
from numbers import Number
from transformers.trainer_utils import EvalPrediction
from sklearn.metrics import accuracy_score, precision_recall_fscore_support
def compute_sts_metrics(eval_pred: EvalPrediction) -> Dict[str, Number]:
predictions, labels = eval_pred
preds = predictions.arg... | jinmang2/sts-sift | solution/metrics.py | metrics.py | py | 596 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "transformers.trainer_utils.EvalPrediction",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "sklearn.metrics.precision_recall_fscore_support",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.accuracy_score",
"line_number": 13,
... |
42029059098 | import torch
import time
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torchvision
from torchvision import transforms
import os
from Network import FullyConvNet
from Network import train
from PIL import Image
import numpy as np
import argparse
import cv2
from ser... | qLethon/bin_picking_robot | main.py | main.py | py | 8,023 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "settings.ARM_RANGE_HEIGHT",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "settings.ARM_RANGE_WIDTH",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "settings.BASE_X",
"line_number": 24,
"usage_type": "attribute"
},
{
... |
18244671014 | from os import path, mkdir, listdir
import configparser
import utils
def default_config(config):
"""Put here the content of the default configuration file"""
config['vosk'] = {'project_name': 'vosk',
'model_name': '',
'models_url': 'https://alphacephei.com/vosk/mode... | cg-Kdaf/Zacharias | src/private_data.py | private_data.py | py | 4,247 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "utils.project_root",
... |
4459921919 | from . import dataset
import os
import shutil
from tqdm import tqdm
import cv2
import numpy as np
def coco_data(images_path, json_annotation_path):
# list files in dir
if not os.path.exists(images_path):
raise FileExistsError("images path not found")
if not os.path.exists(json_annotation_path):
... | virasad/semantic_segmentation_service | train/utils/datahandler.py | datahandler.py | py | 3,116 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "os.path.exists",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.