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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
72009816958 | #!/usr/bin/python3
"""Alta3 APIs and HTML"""
## best practice says don't use commas in imports
# use a single line for each import
from flask import Flask
from flask import redirect
from flask import url_for
from flask import request
from flask import render_template
from flask_limiter import Limiter
from flask_limite... | kmangub/mycode | flask_challenge/trivia.py | trivia.py | py | 1,829 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask_limiter.Limiter",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "flask_limiter.util.get_remote_address",
"line_number": 20,
"usage_type": "name"
},
{
"api_name"... |
643203151 | from django.shortcuts import render
from django import http
from django.utils import timezone
from django.views import View
from django.core.paginator import Paginator, EmptyPage
from contents.utils import get_categories
from goods.models import GoodsCategory, SKU, GoodsVisitCount
from .utils import get_breadcrumb
fro... | zhanghc666/work_admin | meiduo_mall/meiduo_mall/apps/goods/views.py | views.py | py | 9,726 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.views.View",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "goods.models.GoodsCategory.objects.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "goods.models.GoodsCategory.objects",
"line_number": 20,
"usage_type": "attribute... |
5501531487 | import urwid
import urwid.curses_display
import argparse
import pyfiglet
from importSettings import settings
import time
import generalFunctions
import drawingTools
import ChessGame
parser = argparse.ArgumentParser(description="Fancy sjakk")
# parser.add_argument("--dahlspath", metavar="dahlspath", type=str, default="... | sigurdo/fancySjakk | menu.py | menu.py | py | 4,492 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "urwid.WidgetWrap",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "pyfiglet.Figlet",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "drawing... |
5400139971 | import pyramid_jsonapi.workflow as wf
import sqlalchemy
from pyramid.httpexceptions import (
HTTPInternalServerError,
HTTPBadRequest,
HTTPForbidden,
HTTPConflict,
HTTPFailedDependency,
)
from sqlalchemy.orm.interfaces import (
ONETOMANY,
MANYTOMANY,
MANYTOONE,
)
from . import stages
d... | colinhiggs/pyramid-jsonapi | pyramid_jsonapi/workflow/loop/relationships_delete.py | relationships_delete.py | py | 1,703 | python | en | code | 26 | github-code | 97 | [
{
"api_name": "sqlalchemy.orm.interfaces.MANYTOONE",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "pyramid.httpexceptions.HTTPForbidden",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pyramid.httpexceptions.HTTPConflict",
"line_number": 26,
"usage_... |
74939702720 | from setuptools import setup, find_packages
with open("requirements.txt") as f:
install_requires = f.read().strip().split("\n")
# get version from __version__ variable in indiamart_connect/__init__.py
from indiamart_connect import __version__ as version
setup(
name="indiamart_connect",
version=version,
descripti... | nesscale-com/IndiaMART_Connect | setup.py | setup.py | py | 534 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "setuptools.setup",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "indiamart_connect.__version__",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "setuptools.find_packages",
"line_number": 15,
"usage_type": "call"
}
] |
29829084405 | from datetime import timedelta
import fractions
import json
from typing import Counter
import xml.etree.ElementTree as ET
import pdb
tree = ET.parse('gymnopdie.musicxml')
root = tree.getroot()
beats_per_measure = int(root.find('part/measure/attributes/time/beats').text)
music = []
seconds_per_beat = fractions.Frac... | pedro-walter/musicxml-to-json | parse.py | parse.py | py | 1,607 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "xml.etree.ElementTree.parse",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "fractions.Fraction",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "ty... |
255611769 | import sys
from datetime import datetime
from typing import Optional
import discord
from discord.ext import commands
from sqlalchemy.exc import DBAPIError
from sweeperbot.db import models
class Verify(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command()
@commands.has_permi... | glanyx/segachan | sweeperbot/cogs/clubbot/verify.py | verify.py | py | 9,690 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "di... |
74012921917 | # -*- coding: utf-8 -*-
import scrapy
from Chandao.items import ChandaoItem
class BuglistSpider(scrapy.Spider):
name = 'Buglist'
#allowed_domains = ['http://192.168.2.27/']
#start_urls = ['http://192.168.2.27/user-login-Lw==.html']
start_urls = ['http://192.168.2.27/zentao/bug-browse-21.html']
de... | lynn8570/scrapytest | Chandao/Chandao/spiders/Buglist.py | Buglist.py | py | 1,862 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "scrapy.Spider",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "scrapy.FormRequest.from_response",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "scrapy.FormRequest",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_na... |
7425500110 | import pandas as pd
import os
import matplotlib.pyplot as plt
plt.style.use('seaborn-deep')
plt.rcParams['font.size'] = 30
plt.rcParams['axes.labelsize'] = 30
plt.rcParams['legend.fontsize'] = 30
# plt.rcParams['legend.labelspacing'] = 0.02
# plt.rcParams['figure.figsize'] = (11, 9)
RESULT_ROOT = "../../results"
EXP_... | zxxia/RL-CC | src/plot_scripts/plot_paper_simulation.py | plot_paper_simulation.py | py | 6,303 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "matplotlib.pyplot.style.use",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 4,
"usage_type": "name"
},
{
"api_name"... |
74467312958 | import os
import time
from dataclasses import dataclass
print("SPD Lab 04")
# zmienne poczatkowe
@dataclass
class Zadanie:
r: float
p: float
q: float
id: int
rozpoczecie: float = 0
zakonczenie:float = 0
l_zadania=[]
liczba_zadan=0
S=[] #wektor rozpoczecia wykonywanych zadan
... | arturkowalczyk300/SPDLab | lab4/lab04.py | lab04.py | py | 7,761 | python | pl | code | 0 | github-code | 97 | [
{
"api_name": "dataclasses.dataclass",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "os.listdir",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_nu... |
17577990509 | # state.py
import reflex as rx
import os
from dotenv import load_dotenv
from langchain.prompts import PromptTemplate, FewShotPromptTemplate
from langchain.memory import ConversationBufferMemory
from ibm_watson_machine_learning.foundation_models import Model
from ibm_watson_machine_learning.metanames import GenTextPar... | OctoConsulting/hello_reflex | app/app/state.py | state.py | py | 3,777 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "reflex.State",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "reflex.UploadFile",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "reflex.get_asset_path",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "dotenv... |
26842918178 | import os, sys, argparse, time, math
import torch
import torch.nn as nn
from dataset.cifar import CIFAR10Instance, CIFAR100Instance
from helper.pretrain import init
from util import TwoCropTransform, TwoCropTransformWithBase
from util import save_model, AverageMeter, BYOL
from models import model_dict
from optimizer... | siihwanpark/TemporaryCodes | byol.py | byol.py | py | 9,884 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 112,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 112,
"usage_type": "attribute"
},
{
"api_name": "os.path.isdir",
... |
5129671184 | """
proof of concept, get all bios in parallel using asyncio
"""
import asyncio
import time
import httpx
BASE_URL = "https://hn.algolia.com/api/v1/users"
async def get_bio(username: str, client: httpx.AsyncClient) -> str:
"""
get_bio async wrapper allowing bios to be fetched in parallel.
"""
respo... | morenoh149/hacker_news_comment_bios | httpx_list_concurrent.py | httpx_list_concurrent.py | py | 1,646 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "httpx.AsyncClient",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "time.time",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "httpx.AsyncClient",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "asyncio.gather",
... |
11087386394 | import mysql.connector
from mysql.connector import Error
from flask import Flask, render_template,request
def read(data):
try:
connection = mysql.connector.connect(host='localhost',
database='first',
... | Ashish8897/reports1 | First/webApp/webApp/__init__.py | __init__.py | py | 1,610 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "mysql.connector.connector.connect",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "mysql.connector.connector",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "mysql.connector",
"line_number": 12,
"usage_type": "name"
},
{
"... |
11144793684 | import json
import os
from os import path
import threading
import webbrowser
from urllib import request
import platform
from shutil import copyfile
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import pyqtSlot
from PyQt5.QtWidgets import QFileDialog
from PyQt5.Qt import QApplication
import OnionSwitch_... | Ned84/OnionSwitch | OnionSwitch_GUI/OnionSwitch_GUI.py | OnionSwitch_GUI.py | py | 85,511 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "PyQt5.QtGui.QFont",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtGui",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "OnionSwitch_Functions.Functions",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "Py... |
43642635259 | import sys
from collections import deque
N = int(sys.stdin.readline())
graph = []
for _ in range(N):
row = list(map(int, sys.stdin.readline().strip().split()))
row = [0 if r == 0 else "X" for r in row]
graph.append(row)
print(graph)
"""
[0, 0][0, 1][0, 2]
[1, 0][1, 1][1, 2]
[2, 0][2, 1][2, 2]
position... | JYC11/data-structures-and-algos | baekjun/movingPipes.py | movingPipes.py | py | 4,399 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sys.stdin.readline",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "sys.stdin.readline",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"li... |
71438028798 | import datetime as dt
import numba as nb
import numpy as np
from randomgen import Xoroshiro128
x = Xoroshiro128()
f = x.ctypes.next_uint32
s = x.ctypes.state
@nb.jit(nopython=True)
def bounded_uint(lb: int, ub: int, state: int) -> int:
mask = delta = ub - lb
mask |= mask >> 1
mask |= mask >> 2
mask... | bashtage/randomgen | randomgen/examples/numba/extending.py | extending.py | py | 1,876 | python | en | code | 90 | github-code | 97 | [
{
"api_name": "randomgen.Xoroshiro128",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numba.jit",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.empty",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.uint32",
"line_... |
5377592346 | import xml.etree.ElementTree as ET
from collections import defaultdict
import time
from datetime import datetime
# Creating dictionaries to store buy and sell order books
buy_order_books = defaultdict(list)
sell_order_books = defaultdict(list)
# To process the AddOrder condtition
def process_add_order(add_order):
... | arishabh30/orderBookProcessing | orders.py | orders.py | py | 4,028 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "collections.defaultdict",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree.parse",
"line_number": 94,
"usage_type": "call"
},
{
"api_nam... |
39262147759 | # File : transformer.py
# Author : Zhengkun Tian
# Email : zhengkun.tian@outlook.com
import logging
import torch
import torch.nn as nn
from alqalign.am.module.block.ffn import PositionwiseFeedForward
from alqalign.am.module.block.attention import MultiHeadedSelfAttention, MultiHeadedSelfAttentionWithRelPos
logger ... | xinjli/alqalign | alqalign/am/module/block/transformer.py | transformer.py | py | 3,270 | python | en | code | 65 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "alqalign.am.module.bl... |
31194977638 | from django.contrib import admin
from . import models
# register Parent User Model
@admin.register(models.ParentUser)
class ParentUserAdmin(admin.ModelAdmin):
list_display = ['first_name', 'city', 'state']
list_per_page = 10
# Register Child User Model
@admin.register(models.ChildUser)
class ChildUserAdmin(a... | omar115/coding_test | api/admin.py | admin.py | py | 419 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.register",
"line_number": 5,
"usage_type": "call"
},
{
... |
4940413551 | # Checkout Views
# The following function and class have been adapted from
# GitHub. 2019. django-ecommerce/ at master · justdjango/django-ecommerce. [online]
# Available at: <https://github.com/justdjango/django-ecommerce/blob/master/core/>
# [Accessed 25 March 2022]
from django import template
from ..models import... | mase2020/project | madrasa/templatetags/cart_count_template_tags.py | cart_count_template_tags.py | py | 580 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.template.Library",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "models.Order.objects.filter",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "m... |
230229010 | from gensim.scripts.glove2word2vec import glove2word2vec
import argparse
def main():
parser = argparse.ArgumentParser(
description='Converts a embedding txt file in glove format to vec txt format.')
parser.add_argument('src', type=str, help='input embedding file in glove txt format')
parser.add_ar... | maxidl/lightning-spine | scripts/convert_glove2vec.py | convert_glove2vec.py | py | 514 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "gensim.scripts.glove2word2vec.glove2word2vec",
"line_number": 11,
"usage_type": "call"
}
] |
70027183678 | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from mock import MagicMock
import re
import unittest
from sorno_grepchunks import GrepChunksApp
class AppTest(unittest.TestCase):
def setUp(self):
self.arg... | hermantai/sorno-py-scripts | scripts/tests/test_sorno_grepchunks.py | test_sorno_grepchunks.py | py | 1,749 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "unittest.TestCase",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "mock.MagicMock",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "sorno_grepchunks.GrepChunksApp",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "... |
70795493759 | from utils import utils
import os
import numpy as np
from keras.layers import Embedding, Conv1D, MaxPooling1D, Dense, LSTM, Dropout, Bidirectional
from keras.models import Sequential
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
def GloVe_classification(train, v... | FedericoAndreoli/TextClassifier | methods/GloVe_classification.py | GloVe_classification.py | py | 3,487 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "utils.utils.labels_for_NN",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "utils.utils",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.path",
"lin... |
17448870552 | from owslib.wfs import WebFeatureService
from dataclasses import dataclass
import geopandas as gpd
import networkx as nx
@dataclass
class KRW():
url: str = r"https://geoservices.rijkswaterstaat.nl/apps/geoserver/kaderrichtlijn_water/ows?service=WFS"
version: str = "2.0.0"
wfs: WebFeatureService = None
... | d2hydro/lhm-ribasim | src/lhm/rws_krw.py | rws_krw.py | py | 2,259 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "owslib.wfs.WebFeatureService",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "owslib.wfs.WebFeatureService",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "geopandas.read_file",
"line_number": 26,
"usage_type": "call"
},
{
"api... |
41120292237 | # Initiate browser, query word, get network flow with specific name, get its GET Request URL, download the file with the words name in it.
# load in required packages
from selenium.webdriver.chrome.service import Service as ChromeService
from webdriver_manager.chrome import ChromeDriverManager
from selenium import we... | LevFRFR/RussianMP3 | Word2MP3.py | Word2MP3.py | py | 4,053 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "json.loads",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "os.remove",
"line_number": 49,
... |
26315037924 | from opentrons import protocol_api
import math
metadata = {
'protocolName': 'Opentrons Logo',
'author': 'Opentrons <protocols@opentrons.com>',
'source': 'Protocol Library',
'apiLevel': '2.10'
}
def run(ctx: protocol_api.ProtocolContext):
[_pip_model, _pip_mount, _dp_type, _dye_type] = get_val... | Opentrons/Protocols | protocols/Opentrons_Logo/Opentrons_Logo.ot2.apiv2.py | Opentrons_Logo.ot2.apiv2.py | py | 2,436 | python | en | code | 53 | github-code | 97 | [
{
"api_name": "opentrons.protocol_api.ProtocolContext",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "opentrons.protocol_api",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "math.ceil",
"line_number": 65,
"usage_type": "call"
}
] |
14751717846 | import pandas as pd
import sqlite3
import numpy as np
import requests
import time
import io
from datetime import date
from datetime import timedelta
#
# def dataframe_difference(df1, df2, which=None):
# """Find rows which are different between two DataFrames."""
# comparison_df = df1.merge(
# ... | Rithsek99/ngem_OUDSA5900 | python_scripts/csv_dbconverter.py | csv_dbconverter.py | py | 3,008 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sqlite3.connect",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pandas.read_sql_query",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "datetime.date.today",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "datetime.da... |
15221270744 | from django import forms
from .models import *
from django.contrib.auth.models import User
import HealthNet.formvalid as formvalid
class FilterSortForm(forms.ModelForm):
keywords = forms.CharField(widget=forms.TextInput(attrs={'class': "toolbar_searchbar", 'placeholder': "Keywords..."}), required=False)
... | jkiggins/healthnet | HealthNet/emr/forms.py | forms.py | py | 8,106 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.forms.CharField",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.f... |
10256512676 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
def distribution():
##testing_results = pd.read_csv('https://raw.githubusercontent.com/dsfsi/covid19za/master/data/covid19za_timeline_testing.csv')
confirmed_results = pd.read_csv('https://raw.githubusercontent.com/dsf... | mbonokennedy/coronasa | notebooks/Analyse_Trial.py | Analyse_Trial.py | py | 5,928 | python | en | code | null | github-code | 97 | [
{
"api_name": "pandas.read_csv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.notnull",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pandas.notnull",
"l... |
13459729673 | import cv2
import argparse
# Construct the argument parser and parse the arguments
arg_desc = '''\
use -v to specify video name
'''
parser = argparse.ArgumentParser(formatter_class = argparse.RawDescriptionHelpFormatter,
description= arg_desc)
parser.add_argum... | graySquirrel/courtPlusByteTrack | getfpsNframecount.py | getfpsNframecount.py | py | 877 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "argparse.RawDescriptionHelpFormatter",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 24,
"usage_type": "call"
},
{
"... |
28911450135 | import requests
from typing import List
import pandas
import re
import csv
from urlextract import URLExtract
from urllib.request import urlopen
from selenium import webdriver
from django.core.management.base import BaseCommand
from bs4 import BeautifulSoup
class Command(BaseCommand):
help='load data'
def handl... | Lina238/WebScrapper | scrape_results.py | scrape_results.py | py | 4,060 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "urlextract.URLExtract",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_na... |
72131093758 | """
Example Usage of Dynamic Queries
--------------------------------
query = FacebookUser.query.filter(age(age=(20,30)))
query = FacebookUser.query.filter(and_(age(age=(20,30)),sex('m')))
query = FacebookUser.query.filter(and_(age(age=(20,30)),sex('m'),currentcity('evanston')))
query = FacebookUser.query.filter(zipcod... | nualpaca/socialanalyzer | socialanalyzer/queries.py | queries.py | py | 8,168 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sqlalchemy.or_",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.or_",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.and_",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.and_",
"... |
20430673634 | import cv2
import pickle #нужен для того, чтобы сохранить позиции парковочных мест
try: # если файл такой есть, то забираем его данные в posList, если же такого файла нет, то создаем новый posList.
# это нужно для того, чтобы при каждом новом запуске сразу же загружались прошлая версия выделений.
with open('Ca... | Zirael137/ParkingSpaces | ParkingSpacePicker.py | ParkingSpacePicker.py | py | 1,768 | python | ru | code | 0 | github-code | 97 | [
{
"api_name": "pickle.load",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.EVENT_LBUTTONDOWN",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "cv2.EVENT_RBUTTONDOWN",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "pick... |
24530427366 | import requests
from bs4 import BeautifulSoup
ticker=input('Provide the company ticker ')
#to find individual CIK number for future parsing
URL='https://www.sec.gov/cgi-bin/browse-edgar?CIK='+ticker+'&owner=exclude&action=getcompany&Find=Search'
page=requests.get(URL)
soup=BeautifulSoup(page.content,'html.parser')
res... | rcbeneduce/buddyfinancialadvisor | CIK.py | CIK.py | py | 529 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 8,
"usage_type": "call"
}
] |
70312344319 | from fastapi import APIRouter
from config.db import engine
from models.tables import usuarios
from schemas.Users import UserRegister
from config.cryptography import f
newUser = APIRouter()
@newUser.post('/register')
def registrarUsuario(user:UserRegister):
conexion = engine.connect()
nuevoUsuario = {"nombre":... | AbrahamXTS/Bagan | Third increment/Project/Backend/routes/handleFormRegister.py | handleFormRegister.py | py | 887 | python | es | code | 1 | github-code | 97 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "schemas.Users.UserRegister",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "config.db.engine.connect",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "... |
31548637318 | import numpy as np
import scipy.stats as st
import matplotlib.pyplot as plt
import os
class result:
def __init__(self, filename):
self.filename = filename
fname = filename.split('_')
self.tests = []
c = 0
print(filename)
with open('perf_data/'+filename) as f:
... | aulospl/ARM-Benchmarks | data/extract_perf.py | extract_perf.py | py | 8,458 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.listdir",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "numpy.std",
"line_number": 81,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.bar",
"line_number": 85,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"l... |
73952039357 | from re import findall
from requests import get
URL = 'https://api.genderize.io?name='
def pegar_primeiroNome(nome): return findall('\w*', nome)[0]
def pegar_sexo(nome):
cn = get(URL + pegar_primeiroNome(nome))
sexo = cn.json() if(cn.status_code == 200) else 'NAO RECONHECIDO'
return sexo
if __name__ ==... | greghonox/UNITTEST | EX 1/main.py | main.py | py | 376 | python | pt | code | 0 | github-code | 97 | [
{
"api_name": "re.findall",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
}
] |
33086381244 | from reportlab.lib.pagesizes import letter,QRCode
from reportlab.lib import colors
from reportlab.platypus import Frame, PageTemplate,Image
from reportlab.lib.units import cm,mm
from reportlab.platypus import (Table, TableStyle, BaseDocTemplate)
from reportlab.platypus.flowables import TopPadder
def create_pdf():
... | soiqualang/reportlab_qrcode | old/qrcdode_pdf_v3_table_ok.py | qrcdode_pdf_v3_table_ok.py | py | 1,913 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "reportlab.platypus.Image",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "reportlab.lib.units.mm",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "reportlab.lib.units.mm",
"line_number": 12,
"usage_type": "name"
},
{
"api_name":... |
11556258774 |
from os import path
import pandas as pd
import plotly.express as px
import constant as cst
import functions as fun
import seaborn as sns
import matplotlib.pylab as plt
(PT_DTA, PT_PLT, FN_RSP) = (cst.PT_DTA, cst.PT_PLT, cst.FN_RSP)
(PLYRS, TRK_SET) = (cst.PLYRS, set(cst.TRACKS))
######################################... | Chipdelmal/mk8dPalooza | treemap.py | treemap.py | py | 2,240 | python | de | code | 0 | github-code | 97 | [
{
"api_name": "constant.PT_DTA",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "constant.PT_PLT",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "constant.FN_RSP",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "consta... |
28309352846 | import logging
from pathlib import Path
from time import sleep
from typing import List, Optional
from tomtom_api import config, log
from tomtom_api.client import TomtomClient
from tomtom_api.priority_queue.models.database import PriorityQueueDB
from tomtom_api.priority_queue.models.queue import QueueItem
from tomtom_a... | macq/tomtom-api | src/tomtom_api/priority_queue/models/daemon.py | daemon.py | py | 4,122 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "tomtom_api.config.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "tomtom_api.config",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "tomtom_api.utils.daemon.Daemon",
"line_number": 19,
"usage_type": "name"
},
{
"api_... |
28607754510 | from aiaccel.scheduler.algorithm.abstract_scheduling_algorithm import \
AbstractSchedulingAlgorithm
from pathlib import Path
from typing import List, Optional
import random
class RamsomSampling(AbstractSchedulingAlgorithm):
def select_hp(
self,
hp_ready: List[Path], # A list of path of ready... | tkokada/aiaccel-dev | aiaccel/scheduler/algorithm/schdule_sampling.py | schdule_sampling.py | py | 897 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "aiaccel.scheduler.algorithm.abstract_scheduling_algorithm.AbstractSchedulingAlgorithm",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 11,
"usage... |
13429426825 | import graphlib as gl
import os
from concurrent.futures import ThreadPoolExecutor
from concurrent.futures import TimeoutError as ConcurrentTimeoutError
from typing import Dict, List, Optional, Set, Union
from cosmpy.aerial.client import LedgerClient
from cosmpy.aerial.contract import LedgerContract
from cosmpy.aerial.... | fetchai/jenesis | src/jenesis/contracts/deploy.py | deploy.py | py | 10,329 | python | en | code | 6 | github-code | 97 | [
{
"api_name": "typing.Union",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number":... |
71298268160 | # 220825 24444 알고리즘 수업 - 너비 우선 탐색 1
from collections import deque
import sys
input = sys.stdin.readline
# bfs 함수 선언
def bfs(V, E, R):
global cnt
# 방문 표시 후 큐에 삽입
visited[R] = cnt
q.append(R)
# 큐가 빌 때까지
while q:
# 큐에서 꺼낸 곳부터
u = q.popleft()
# 미방문 인접노드 탐색
f... | Bluuubery/Problem_Solving | 백준/Silver/24444. 알고리즘 수업 - 너비 우선 탐색 1/알고리즘 수업 - 너비 우선 탐색 1.py | 알고리즘 수업 - 너비 우선 탐색 1.py | py | 1,089 | python | ko | code | 2 | github-code | 97 | [
{
"api_name": "sys.stdin",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 47,
"usage_type": "call"
}
] |
35898227485 | # -*- coding: utf-8 -*-
"""
Created on Mon May 3 20:48:34 2021
@author: camke
"""
import numpy as np
from sklearn import datasets
# Perceptron Class
class Perceptron():
def __init__(self, eta = 0.05, n_iter = 1000, random_state = 1):
self.eta = eta
self.n_iter = n_iter
sel... | camkeeley/MachineLearningClasswork | PerceptronClassifier.py | PerceptronClassifier.py | py | 3,333 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "numpy.random.RandomState",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "numpy.dot",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.where",
... |
31045088195 | import os
import io
import glob
from flask import Flask, render_template, request, jsonify
from werkzeug.utils import secure_filename
from langchain.embeddings.openai import OpenAIEmbeddings
from langchain.vectorstores import Chroma
from langchain.llms import OpenAI
from langchain.chains import ChatVectorDBChain
from ... | gyasis/Research_Assistant | research_standalone.py | research_standalone.py | py | 4,459 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.environ",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_numbe... |
38701253166 | from django.shortcuts import render, redirect, get_object_or_404
from django.contrib.auth.decorators import login_required
from pins.models import Pin
from pins.forms import SaveToBoard
from .models import Board
from .forms import CreateBoardForm, EditBoardForm
@login_required
def create_board(request):
if reque... | zareisajad/pinterest-clone-django | boards/views.py | views.py | py | 2,327 | python | en | code | 12 | github-code | 97 | [
{
"api_name": "forms.CreateBoardForm",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.decorators.login_required",
"line_number": 10,
"usage_type": "name"
... |
34435712178 | # from https://github.com/mcordts/cityscapesScripts/blob/master/cityscapesscripts/helpers/labels.py
from __future__ import print_function, absolute_import, division
from collections import namedtuple
import numpy as np
import tensorflow as tf
#--------------------------------------------------------------------------... | rachthree/fast_scnn | fast_scnn/utils/labels.py | labels.py | py | 8,929 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "collections.namedtuple",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.copy",
"line_number": 111,
"usage_type": "call"
},
{
"api_name": "numpy.unique",
"line_number": 112,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"l... |
10931718788 | #!/usr/bin/env python
import time
from datetime import datetime as dt
from datetime import datetime, timedelta
from satmod import get_remotefiles
satpath_ftp_014_001 = ('/Core/'
+ 'WAVE_GLO_WAV_L3_SWH_NRT_OBSERVATIONS_014_001/'
+ 'dataset-wav-alti-l3-swh-rt-global-s3a/'
... | annemo1976/IWVS | download.py | download.py | py | 903 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "datetime.datetime.now",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "datetime.datetime",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.ti... |
31438164447 | from django.contrib import admin
from .models import Subscription, Category, UtmSource
from django.contrib.admin import SimpleListFilter
from decimal import Decimal
@admin.register(UtmSource)
class UtmSourceAdmin(admin.ModelAdmin):
list_display = ('name', 'comment')
autocomplete_fields = ('referral_codes',)
... | hossamelneily/nexchange | ico/admin.py | admin.py | py | 3,443 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.register",
"line_number": 7,
"usage_type": "call"
},
{
... |
26335863861 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Create the data for the LSTM.
"""
import os
import sys
import argparse
import numpy as np
import h5py
import itertools
from collections import defaultdict
import pickle
import sys
import re
import codecs
from itertools import izip
class Indexer:
def __init__(self,... | michaelfarrell76/End-To-End-Generative-Dialogue | src/preprocess.py | preprocess.py | py | 29,063 | python | en | code | 139 | github-code | 97 | [
{
"api_name": "collections.defaultdict",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "itertools.izip",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 107,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
... |
5342278027 | #!/usr/bin/python3.7
# -*- coding: utf-8 -*-
# Written by: Karim shoair - D4Vinci ( QrlJacker-Framework )
from core import utils,Settings,Cli,db,browser
from core.color import *
from core.module_utils import *
import importlib,traceback,os
global global_options, module_keywords, cli_keywords
module_help = end+G+"""
Mo... | OWASP/QRLJacking | QRLJacker/core/module.py | module.py | py | 6,930 | python | en | code | 1,261 | github-code | 97 | [
{
"api_name": "core.db.index_modules",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "core.db",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "importlib.import_module",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "core.utils.pyth... |
17408041688 | import datetime
import pandas as pd
import streamlit as st
from PIL import Image
import time
import pickle
#from olist_asil_son_model import ml_pipeline,pipeline_hazirlik,data_pipeline,read_data
#import olist_asil_son_model as model
import Scripts.ml_pipeline as ml
st.set_page_config(page_title="OLIST", page_icon="... | mustafayaylali/streamlit_olist | page_olist.py | page_olist.py | py | 4,043 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "streamlit.set_page_config",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "streamlit.audio",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
... |
17938601231 | from bs4 import BeautifulSoup
import requests
import json
from tqdm import tqdm
import sqlite3
import os
from datetime import datetime
import matplotlib. dates as mdates
import matplotlib. pyplot as plt
from matplotlib.pyplot import figure
import matplotlib.ticker as ticker
import re
class Alarm:
OK = '\033[92m' #... | thisiszy/NetEaseMusic-Analyzer | neteasemusic.py | neteasemusic.py | py | 6,920 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.session",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "json.loads",
"lin... |
8548795769 | import configuration_factory
from neuron_network import neuronal_model
import pickle
from typing import Iterable
import sklearn.metrics as skm
import dash
import numpy as np
import plotly.graph_objects as go
import torch
from dash import dcc,callback_context
from dash import html
from dash.dependencies impor... | moriafrid/analysis_groger_cells | general_evaluation.py | general_evaluation.py | py | 5,469 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "dash.Dash",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "dash.html.Div",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "dash.html",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "dash.dcc.Slider",
"line_number"... |
16616562988 | import iso8601
import logging
from datetime import datetime
from decimal import Decimal
from trytond.model import fields
from trytond.pool import Pool, PoolMeta
from trytond.transaction import Transaction
from trytond.pyson import Eval, Equal
from trytond.modules.account_payment_gateway.tools import unaccent
PAYPAL_ME... | NaN-tic/trytond-account_payment_gateway_paypal | gateway.py | gateway.py | py | 10,318 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "trytond.pool.PoolMeta",
"line_number": 54,
"usage_type": "name"
},
{
"api_name": "trytond.model.fields.Selection",
"line_number": 58,
"usage_type": "call"
},
{
"api_name":... |
36579104101 | from discord.ext import commands
import random
import discord
from random import randint
from random import choice as randchoice
import re
from cogs.utils.dataIO import dataIO
from .utils.dataIO import fileIO
class Engine:
"""leavin you in the dust!"""
def __init__(self, bot):
self.bot = bot
s... | hellomelody312/catpuccino | cogs/engine.py | engine.py | py | 6,455 | python | vi | code | 0 | github-code | 97 | [
{
"api_name": "cogs.utils.dataIO.dataIO.load_json",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cogs.utils.dataIO.dataIO",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "discord.Embed",
"line_number": 23,
"usage_type": "call"
},
{
"api_nam... |
70703377919 | import numpy as np
from scipy.ndimage.filters import convolve
from utils import get_file_location
# data load
with open(get_file_location(day=17)) as f:
data = f.read().splitlines()
def iterate(input_grid, neighbour_positions):
input_grid_padded = np.pad(input_grid, 1)
neighbours = convolve(
inpu... | jackcballinger/advent_20 | python_files/day_17.py | day_17.py | py | 1,984 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "utils.get_file_location",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.pad",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "scipy.ndimage.filters.convolve",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy... |
42884049835 | from functools import partial
from transformers.configuration_utils import PretrainedConfig
from transformers.models.gpt2.configuration_gpt2 import GPT2Config
from transformers.models.t5.configuration_t5 import T5Config
from transformers.models.t5.modeling_t5 import T5ForConditionalGeneration
from transformers.models.g... | rtcpproject/RTCP | backbones/GPT2_gen_prompt/prefix_tuning.py | prefix_tuning.py | py | 10,795 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "torch.nn.Module",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "transformers.models.gpt2.configuration_gpt2.GPT2Config",
"line_number": 51,
"usage_type": "argument"
},
... |
16439795068 | import logging as log
import os
import sys
import argparse
import csv
from tqdm import tqdm
try:
from lxml import etree
log.debug("running with lxml.etree")
except ImportError:
try:
# Python 2.5
import xml.etree.cElementTree as etree
log.debug("running with cElementTree on Pytho... | MUSC-TBIC/lexicon-tools | convert_COVID-19_SignSym_lexicon.py | convert_COVID-19_SignSym_lexicon.py | py | 5,714 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "logging.debug",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.debug",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "logging.debug",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "logging.debug",
"line_n... |
42340113049 | import pandas as pd
import matplotlib.pyplot as plt
date_time = ["2021-01-01", "2021-01-02", "2021-01-03"]
date_time = pd.to_datetime(date_time)
data = [1, 2, 3]
DF = pd.DataFrame()
DF['value'] = data
DF = DF.set_index(date_time)
plt.plot(DF)
plt.gcf().autofmt_xdate()
plt.show()
| bhens14/COVIDMetric | plottest.py | plottest.py | py | 282 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pandas.to_datetime",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "matplotlib.p... |
22111845624 | """
https://leetcode.com/problems/distribute-coins-in-binary-tree/
if there is one coin on a node, it would make no sense to move it to another and get a re-suppliment
that is just shift the load...
so the problem is for a zero coin node to reach to a >1 coin node... the cumulitive smallest sum
but there is also d... | kangxie-colorado/leetcode-and-notes | previous_run/282.979.distributeCoinsInBinTree.py | 282.979.distributeCoinsInBinTree.py | py | 1,355 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "typing.Optional",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "utils.TreeNode",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "utils.TreeNode",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "utils.TreeNode",
"l... |
71529434238 | from __future__ import division, print_function, unicode_literals
import argparse
import json
import logging
import os.path
import re
import sys
import textwrap
# Program information
progname = 'Chanarch'
version = '0.1.2'
version_string = ''.join([progname, ' ', version])
copyright = 'Copyright (C) 2014 diatomic.ge'... | diatomic-ge/chanarch | chanarch.py | chanarch.py | py | 13,704 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "textwrap.dedent",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.version_info",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "os.path.path.expanduser",
"line_number": 128,
"usage_type": "call"
},
{
"api_name": "os.pat... |
23540561121 | import glob
import gzip
import json
import uuid
import argparse
def parseOptions():
parser = argparse.ArgumentParser(
description="parse the data dictionaries of unharmonized dbGaP studies"
)
parser.add_argument("-d", help="directory of dbGaP study", required=True)
parser.add_argument("-p", he... | uc-cdis/dbgap-pfb | parseFiles.py | parseFiles.py | py | 9,882 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_n... |
29101095088 | import time
import grpc
from concurrent import futures
import addcomment_pb2, addcomment_pb2_grpc
import comment
class addcommentservice(addcomment_pb2_grpc.addcommentServicer):
def add(self, request, ctx):
message = comment.addcomment(request.token, request.news_id, request. content)
retu... | QHX1998/SE-project-part | 评论区接口/addcomment_server.py | addcomment_server.py | py | 793 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "addcomment_pb2_grpc.addcommentServicer",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "comment.addcomment",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "grpc.server",
"line_number": 13,
"usage_type": "call"
},
{
"api_name... |
34914265792 | from typing import TYPE_CHECKING, List, Union
from selenium.webdriver import Chrome, Firefox
from selenium.webdriver.common.by import By
from selenium.webdriver.remote.webdriver import WebElement
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.wait import WebDriverWait
... | LinOTP/LinOTP | linotp/tests/integration/linotp_selenium_helper/self_service_angular.py | self_service_angular.py | py | 2,949 | python | en | code | 484 | github-code | 97 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "selenium.... |
20656238255 | import math
import plotly.express as px
import numpy as np
import pandas as pd
df = pd.read_csv('normals.csv')
print(df)
print('df')
print(df['vals'].size)
print(df['vals'].dtype)
print(df['vals'].min())
print(df['vals'].max())
print(df['vals'].mean())
print(df['vals'].var())
fig = px.histogram(
df,
x='vals',... | jra/deeplearning | c1-NeuralNetworksAndDeepLearning/w3/01-PlanarDataClassificationWithOneHiddenLayer/chart_normals.py | chart_normals.py | py | 1,472 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pandas.read_csv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "plotly.express.histogram",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "plotly.express",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "numpy.random.d... |
38681567792 | # -*- coding: utf-8 -*-
"""DialogManager class, responsible for managing the dialog system."""
from multiprocessing import Lock
from seeingllama2.main.large_language_models import connectors
# from seeingllama2.main.interpreter import interpreter
MANAGER_DATA_LOCK = Lock()
# manager_data = {
# # Request ID: ..... | Vincent-Stragier/c-bot | src/seeingllama2/main/dialog_manager.py | dialog_manager.py | py | 2,772 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "multiprocessing.Lock",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "seeingllama2.main.large_language_models.connectors.GenericConnector",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "seeingllama2.main.large_language_models.connectors",
... |
41113610275 | import magicgui
import napari
import numpy as np
def get_ray_coordinates(shape, start_point, end_point):
length = np.linalg.norm(end_point - start_point)
length_int = np.round(length).astype(int)
coords = np.linspace(start_point, end_point, length_int + 1, endpoint=True)
clipped_coords = np.clip(np.ro... | jni/zarpaint | src/zarpaint/_add_3d_points.py | _add_3d_points.py | py | 3,456 | python | en | code | 12 | github-code | 97 | [
{
"api_name": "numpy.linalg.norm",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "numpy.round",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"li... |
10232421008 | from __future__ import division
import argparse
import os
import sys
from multiprocessing import Pool
import multiprocessing as multi
import time
import matplotlib.animation as animation
import matplotlib.pyplot as plt
import numpy as np
from collections import deque
from cave import DQNCave
from dqn_agent import DQN... | yukiB/keras-dqn-cave | test.py | test.py | py | 3,552 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "matplotlib.pyplot.axis",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.array",
... |
32911496275 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Step by step script to compile a dataset to train and test a statistical
classifier. Example for specific case:
SPECIES: Scinax hayii
SITE: BETANIA
Created on 2019-02-04
Latest modif on 2020-02-08
@author: julloa@humboldt.org.co
"""
import pandas as pd
impo... | PEM-Humboldt/soundclim | 1_compile_dataset.py | 1_compile_dataset.py | py | 3,049 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "maad.sound.load",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "maad.sound",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "maad.sound.spectrogram",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "maad.sound",
"l... |
18814408738 | from bson import ObjectId
from pydantic import BaseModel
from db.mongodb import get_database
class CommentResponse(BaseModel):
id: str
text: str
user_id: str
post_id: str
class CommentBase(BaseModel):
text: str
user_id: str
post_id: str
@classmethod
async def find_by_id(cls, _id... | zero-shubham/friteup-graphql-api | friteup/models/comment.py | comment.py | py | 2,375 | python | en | code | 12 | github-code | 97 | [
{
"api_name": "pydantic.BaseModel",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "db.mongodb",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "db.mongodb.get_databa... |
40055003780 | """Implements a VAE to learn a latent parameter generating the weak label."""
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import DataLoader, Dataset
from tqdm import trange
from flippers._typing import ListLike, MatrixLike
from flippers.models._base import _... | liamtoran/flippers | examples/Experiments/_vae.py | _vae.py | py | 8,729 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "torch.manual_seed",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "flippers.models._base... |
20214669332 | from sqlalchemy import Column, Integer, String, Float, Date, ForeignKey
from sqlalchemy.orm import relationship
from main.db.base_class import Base
class FinancialRecord(Base):
__tablename__ = "financial_record"
id = Column(Integer, primary_key=True, index=True)
segment = Column(String, index=True)
co... | emingenc/financial_app | main/models/financial_record.py | financial_record.py | py | 2,904 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "main.db.base_class.Base",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integer",
"line_number": 8,
"usage_type": "argument"
},
{
"api_name": "sqlalch... |
27345501558 | '''
Created on Apr 25, 2021
@author: mballance
'''
import cocotb
import pybfms
from fwnoc_bfms.fwnoc_channel_bfm import FwNocChannelBFM, FwNocPacket
@cocotb.test()
async def entry(dut):
await pybfms.init()
print("Hello")
h_bfm = FwNocChannelBFM(
pybfms.find_bfm(".*u_hi_bfm"),
pybfms.f... | Featherweight-IP/fwnoc | verilog/dv/common/python/fwnoc_tests/router/smoke.py | smoke.py | py | 544 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pybfms.init",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "fwnoc_bfms.fwnoc_channel_bfm.FwNocChannelBFM",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pybfms.find_bfm",
"line_number": 16,
"usage_type": "call"
},
{
"api_name... |
9094634349 | import torch
from ...interfaces import SamplerInterface
from ..denoisers import MaskedCompVisDenoiser, MaskedCompVisVDenoiser
from ..utils import latent_to_images, to_d, linear_multistep_coeff, get_ancestral_step
class KSampler(SamplerInterface):
def __init__(self, schedule, **schedule_args):
self.schedule = sche... | Mwni/diffusionkit | diffusionkit/modules/samplers/sampler_k.py | sampler_k.py | py | 6,344 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "interfaces.SamplerInterface",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "denoisers.MaskedCompVisVDenoiser",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "denoisers.MaskedCompVisDenoiser",
"line_number": 18,
"usage_type": "call"
}... |
6479324890 | from Crypto.Cipher import AES
from Crypto.Random import get_random_bytes
from Crypto.Util.strxor import strxor
blockLen = AES.block_size
def pad(information,blockLen):
info_len = len(information)
pad = b"\x00" * (blockLen - (info_len % blockLen))
return (information + pad)
def CBC(info, cipher_key, iv):
ogLen = ... | salitog/block_ciphers | task1.py | task1.py | py | 1,803 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "Crypto.Cipher.AES.block_size",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "Crypto.Cipher.AES",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "Crypto.Cipher.AES.MODE_CBC",
"line_number": 15,
"usage_type": "attribute"
},
{
... |
5384909149 | from qcaudit.context import Context
from qcaudit.app import Application
from qcaudit.env_config import *
import logging
from flask import jsonify, make_response, current_app, g, request, send_from_directory
from flask_restful import Resource
from qcaudit.domain.doctor.doctor_repository import DoctorRepository
from qcau... | zycer/qqq | qcaudit/controller/__init__.py | __init__.py | py | 1,618 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "qcaudit.app.Application",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "qcaudit.context.Context",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "qcaudit.domain.doctor.doctor_repository.DoctorRepository",
"line_number": 17,
"usage_type... |
31438643267 | from rest_framework import serializers
from core.serializers import NestedAddressSerializer,\
NestedReadOnlyAddressSerializer, NestedPairSerializer, \
TransactionSerializer, SimplePairSerializer
from referrals.serializers import ReferralCodeSerializer
from ticker.serializers import RateSerializer
from orders.m... | hossamelneily/nexchange | orders/serializers/instant.py | instant.py | py | 8,719 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "orders.models.Order",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "base.BaseOrderSerializer",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "orders.models.Order",
"line_number": 51,
"usage_type": "argument"
},
{
"api_name": "... |
20615331382 | from bs4 import BeautifulSoup
import requests
import os
headers = {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET',
'Access-Control-Allow-Headers': 'Content-Type',
'Access-Control-Max-Age': '3600',
'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:52.0) Gecko/2010... | WGlaser/SchittsCreekScriptSearcher | SCSGetter.py | SCSGetter.py | py | 1,271 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"... |
21524952184 | from api.models import Garbage, Category
from rest_framework import serializers
class CategorySerializer(serializers.ModelSerializer):
class Meta:
model = Category
fields = "__all__"
class GarbageSerializer(serializers.HyperlinkedModelSerializer):
category = CategorySerializer()
class Meta... | luckylu/garbage_sorting | api/serializers.py | serializers.py | py | 527 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "api.models.Category",
"line_number": 6,
"usage_type": "name"
}... |
71605821758 | import smtplib
from email.mime.text import MIMEText
import weather
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
forecast = weather.get_weather_forecast()
msg = MIMEMultipart()
my_email = "MY EMAIL"
pwd = "PWD"
msg['Subject'] = 'BUENOS DIAS'
body = """
CLASSES TODAY
http://chatura... | danilito19/automate | my_email_secure.py | my_email_secure.py | py | 603 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "weather.get_weather_forecast",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "email.MIMEMultipart.MIMEMultipart",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "email.MIMEText.MIMEText",
"line_number": 20,
"usage_type": "call"
},
{
... |
26212218051 | import datetime
from django.contrib.auth.mixins import LoginRequiredMixin
from django.shortcuts import render, redirect
# Create your views here.
from django.views import View
from racemate.forms import CreateGroupForm
from racemate.models import RunningGroup, MyUser, Message, PastTraining
class RunningGroupView(L... | przemyslawkulak/Racemate-aplikacja-biegowa | group/views.py | views.py | py | 6,646 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "django.contrib.auth.mixins.LoginRequiredMixin",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "django.views.View",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "racemate.models.RunningGroup.objects.get",
"line_number": 18,
"usage_type... |
14426235913 | from __future__ import print_function
import sys, itertools
def combs(string, num):
return sorted([ ''.join(sorted(x)) for x in itertools.combinations_with_replacement(string, num)])
def main():
string, num = sys.stdin.read().strip().split()
for line in combs(string, int(num)):
print(line)
if __n... | shanesatterfield/hacker-rank | Python/Python/Itertools/Combinations_With_Replacement/__main__.py | __main__.py | py | 352 | python | en | code | 102 | github-code | 97 | [
{
"api_name": "itertools.combinations_with_replacement",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.stdin.read",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 8,
"usage_type": "attribute"
}
] |
70335035839 | import logging
import os
from logging import config as logging_config
from dynaconf import settings
LOG_FORMAT = "[%(asctime)s] %(levelname)s [%(name)s:%(lineno)s] %(message)s"
LOGFILE = os.path.join(settings.PROJECT_ROOT + "/logs/{{ cookiecutter.project_slug }}.log")
ERROR_LOGFILE = os.path.join(settings.PROJECT_ROO... | asandeep/py3-grpc-cookie | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/__init__.py | __init__.py | py | 3,449 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "os.path.join",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "dynaconf.settings.PROJECT_ROOT",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "dynaconf.s... |
14940270736 | import datetime
import re
class MaintenanceInfo:
def __init__(self, unom, address, coordinates, work_description, last_work_date):
self.unom = unom
self.address = address
self.coordinates = coordinates
self.work_description = work_description
self.last_work_date = last_work... | klorman/WorkForecastingService | src/house_maintenance_algorithm.py | house_maintenance_algorithm.py | py | 3,923 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "re.search",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 34,
... |
71872032638 | from pathlib import Path
import numpy as np
import torch
import torchvision.utils as vutils
from addict import Dict
from PIL import Image
from torch.nn.functional import interpolate, sigmoid
from climategan.data import decode_segmap_merged_labels
from climategan.tutils import (
all_texts_to_tensors,
decode_bu... | cc-ai/climategan | climategan/logger.py | logger.py | py | 16,266 | python | en | code | 65 | github-code | 97 | [
{
"api_name": "addict.Dict",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "addict.Dict",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "climategan.data.decode_segmap_merged_labels",
"line_number": 89,
"usage_type": "call"
},
{
"api_name": "c... |
24267334638 | import os
import sys
import argparse
class MyWC():
def count_lines(self, data):
print(data.count('\n'), end=' ')
def count_words(self, data):
print(len(data.split(None)), end=' ')
def count_bytes(self, data):
print(len(data.encode('utf-8')), end=' ')
def counter(self, data, a... | quantocosta/wc.py | wc.py | wc.py | py | 1,780 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "sys.stdin",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "os.path.isfile"... |
22475068260 | #!/usr/bin/env python
"""
A very simple OAuth2 AS
"""
import json
import logging
import re
import sys
import traceback
from authn_setup import authn_setup
from aatest import as_unicode
from cherrypy.wsgiserver.ssl_builtin import BuiltinSSLAdapter
from oic.extension.provider import Provider
from oic.extension.provider ... | ozwillo/pyoidc-ozwillo | oauth_example/as/as.py | as.py | py | 11,488 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.packages.urllib3.disable_warnings",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "requests.packages.urllib3",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 37,
"usage_type": "call"
},
{... |
30929135699 | from inspect import isgenerator
import json
from uuid import UUID
from fluiddb.cache.cache import BaseCache, CacheResult
from fluiddb.cache.factory import CachingAPIFactory
from fluiddb.data.user import User, Role
from fluiddb.model.user import getUser, UserAPI
def cachingGetUser(username):
"""Get a L{User} for ... | fluidinfo/fluiddb | fluiddb/cache/user.py | user.py | py | 3,701 | python | en | code | 7 | github-code | 97 | [
{
"api_name": "fluiddb.model.user.getUser",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "fluiddb.model.user.UserAPI",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "fluiddb.cache.factory.CachingAPIFactory",
"line_number": 39,
"usage_type": "call"
... |
82319322 | import modules.pumpingsystem as ps
import numpy as np
schedule = np.array([[70, 70, 70],
[75, 75, 75]])
pump_system = ps.PumpSystem('D1')
pump_system.add_level(ps.PumpingLevel('0', 1000000, 0, 15, 0, schedule, 0, 20))
pump_system.perform_simulation('1-factor', save=True)
| taljaards/Dam-simulation | simulations/Verification/Part 2/simulation_D1.py | simulation_D1.py | py | 296 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.array",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "modules.pumpingsystem.PumpSystem",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "modules.pumpingsystem",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "modul... |
74667322239 | from flask import Flask, request
from flask_restful import Resource, Api, reqparse
from flask_jwt import JWT, jwt_required
from security import authenticate, identity
app = Flask(__name__)
app.secret_key = "evgen"
api = Api(app)
jwt = JWT(app, authenticate, identity)
items = [
{
"name":"MyItem",
... | BestPracticeSchool/BPS-BaseDevelopment_1_2019 | Test/app.py | app.py | py | 1,864 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask_restful.Api",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask_jwt.JWT",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "security.authenticate",
... |
21818676027 | import traceback
import inspect
import json
import simplejson
import importlib.util
import sys
import random
try:
arg=json.loads(simplejson.dumps(args[0], use_decimal=True))
DEBUG = plpy.execute('SELECT is_debug()')[0]['is_debug']
assert isinstance(arg, dict),'Проверь формат JSON'
assert 'parts' in arg,'Нужен па... | trendy-automation/opc_bhx | py3dbp/process_packing.py | process_packing.py | py | 4,285 | python | ru | code | 0 | github-code | 97 | [
{
"api_name": "json.loads",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "simplejson.dumps",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_numb... |
74326046397 | import matplotlib.pyplot as plt
import numpy as np
from numpy.testing import assert_allclose
from compart.marks import Ellipse
def test_points_on_circumference():
radius = 2
n_points = 100
circ = Ellipse(center=np.zeros(2), width=radius, height=radius)
points = circ.gen_points(n=n_points, fuzz=0)
... | ColCarroll/compart | test/test_circle.py | test_circle.py | py | 574 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "compart.marks.Ellipse",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.testing.assert_allclose",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy... |
7033911470 | from typing import Dict, NamedTuple
from enum import Enum
import sip
from PyQt5.QtWidgets import QDialogButtonBox, QScrollArea
from ..widget import SEToolsWidget
class AnalysisSection(Enum):
"""Groupings of analysis tabs"""
Analysis = 1
Components = 2
General = 3
Labeling = 4
Other = 5
... | SELinuxProject/setools | setoolsgui/apol/analysistab.py | analysistab.py | py | 3,581 | python | en | code | 146 | github-code | 97 | [
{
"api_name": "enum.Enum",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "sip.wrappertype",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "widget.SEToolsWidget",
... |
25651344987 | import math
import traci
import json
class SumoObject(object):
def __init__(self, SumoID):
self.ID = str(SumoID) # VehicleID
try:
self.height = traci.vehicle.getHeight(self.ID)
self.ObjType = traci.vehicle.getTypeID(self.ID)
self.Route = traci.vehicle.getRout... | hatfield-c/avl | Python-AVL_Deprecated/SUMO_vehicle.py | SUMO_vehicle.py | py | 4,841 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "traci.vehicle.getHeight",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "traci.vehicle",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "traci.vehicle.getTypeID",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tr... |
7976124325 | """Test the entire low-resolution correction process at low-resolution.
Compare mass
fractions corrected by IsoCor to theoretical isotopologues distributions
(with algebraic equations provided in the code for manual check).
"""
import numpy as np
import pytest
import isocor as hrcor
# Tests the entire correction pr... | MetaSys-LISBP/IsoCor | isocor/tests/test_correction_process_LowRes.py | test_correction_process_LowRes.py | py | 4,860 | python | en | code | 21 | github-code | 97 | [
{
"api_name": "isocor.LowResMetaboliteCorrector",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "numpy.testing.assert_allclose",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "numpy.testing",
"line_number": 80,
"usage_type": "attribute"
},
{
... |
44235828686 | # based on
# https://stackoverflow.com/questions/27863832/calling-python-2-script-from-python-3
# https://github.com/pytest-dev/execnet/issues/26
#
# This is used to call python functions with another python version
#
# Use in the following way for example
# bridge = Bridge(version="2.7", module="my_module", path="..... | inosms/version_bridge | version_bridge/__init__.py | __init__.py | py | 3,215 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "execnet.makegateway",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "sys.stdout.write",
... |
35002815292 | # Tensorflow Version: 1.5.0
import os
import sys
import argparse
import csv
from random import Random
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
from utils import *
from visualization import *
np.random.seed(12345)
tf.set_random_seed(12345)
parser = argparse.ArgumentParser(... | tohinz/Bidirectional-InfoGAN | code/evaluate_model.py | evaluate_model.py | py | 23,112 | python | en | code | 7 | github-code | 97 | [
{
"api_name": "tensorflow.set_random_seed",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.... |
30303659633 | import xml.etree.ElementTree as ET
file_name = "./map.osm"
tree = ET.parse(file_name)
root = tree.getroot()
file_name = file_name.replace('.xml', '.txt')
f=open(file_name, "w")
for node in root.iter('node'):
ident = node.attrib['id']
lat = node.attrib['lat']
lon = node.attrib['lon']
f.write("{} {} {}\... | edsonribeiro13/Mapa | MAPA AED II/xml_to_points.py | xml_to_points.py | py | 355 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "xml.etree.ElementTree.parse",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 5,
"usage_type": "name"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.