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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
71712982823 | import requests
from behave import *
from hamcrest import *
@when('Make a get request')
def make_get_request_to_api(context):
context.resp= requests.get("https://reqres.in/api/users?page=2")
assert_that(context.resp.status_code, equal_to(200))
@then('Check if users list is returned')
def check_user_list(cont... | HarshDevSingh/docker_python_bdd | features/steps/rest_api.py | rest_api.py | py | 631 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
}
] |
7737385160 | # -*- coding=utf8
import web, random, string
from StringIO import StringIO
from PIL import Image, ImageDraw, ImageFont, ImageFilter
#生成验证码的位数
vcodeLength = 4
#生成验证码图片的尺寸
vcodeSize = (60, 25)
#背景颜色, 默认白色
vcodeBgcolor = (238, 238, 238)
#字体颜色, 蓝色
vcodeFontcolor = (0, 0, 255)
#干扰线, 红色
vcodeLinecolor = (255, 0, 0)
#是否要加干扰线... | kungfucode-rex/jlgjg-admin | server/web/controller/Index_C.py | Index_C.py | py | 2,315 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "string.letters",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "random.sample",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "web.config",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "random.randint",
... |
10180408027 | #!/usr/bin/python3
'''
Core Flask App
'''
from flask import Flask, jsonify, make_response
from models import storage
from api.v1.views import app_views
from os import getenv
app = Flask(__name__)
app.register_blueprint(app_views)
app.url_map.strict_slashes = False
@app.teardown_appcontext
def closeStorage(ob):
'... | jamesAlhassan/AirBnB_clone_v3 | api/v1/app.py | app.py | py | 746 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "api.v1.views.app_views",
"line_number": 11,
"usage_type": "argument"
},
{
"api_name": "models.storage.close",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "models.st... |
70077277545 | from path import Path
import sys, os
def rec(fname):
os.system('alsamixer')
os.system('sox -t alsa default "{fname}"'.format_map(vars()))
print('playback command: ~$ aplay {fname}'.format_map(vars()))
def initialize():
path = os.path.join(os.getcwd(), 'wavs')
os.path.exists(path) or os.mkdir(path)... | chris-hamberg/system_utils | alsa_record.py | alsa_record.py | py | 1,013 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.system",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"... |
43111990750 | import aws_cdk as cdk
from constructs import Construct
from aws_cdk import (aws_apigateway as apigateway,
aws_lambda as lambda_,
aws_dynamodb)
class TasksService(Construct):
def __init__(self, scope: Construct, id: str):
super().__init__(scope, id)
task_ta... | basv98/api-dynamodb | tasks/tasks_service.py | tasks_service.py | py | 1,208 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "constructs.Construct",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "constructs.Construct",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "aws_cdk.aws_dynamodb.Table",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "aw... |
37821183076 | import tensorflow as tf
import numpy as np
from tensorflow.python.ops.signal import window_ops
from scipy import stats
import decimal, math
import os, sys
import librosa
import soundfile as sf
import functools
import matplotlib.pyplot as plt
from matplotlib import style
from scipy.special import exp1
import math
class... | golfbears/DeepXi | bak/multiphase.py | multiphase.py | py | 18,079 | python | en | code | null | github-code | 36 | [
{
"api_name": "functools.partial",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "tensorflow.python.ops.signal.window_ops.hamming_window",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.python.ops.signal.window_ops",
"line_number": 28,
... |
21420497711 | import torch
import torch.nn as nn
import torch.nn.functional as F
## Defining the network
Hidden_layer = 64
Conv_kernel = 3
Conv_kerenl_time = 3
Padd_space = 1
Padd_time = 1
drop_out_level = 0.15
Bias = True
class Net(nn.Module):
def __init__(self):
super(Net,self).__init__()
#down layer 1
... | HMS-CardiacMR/DRAPR | InLineIntegration/network_arch.py | network_arch.py | py | 6,361 | python | en | code | 15 | github-code | 36 | [
{
"api_name": "torch.nn.Module",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"lin... |
74062226345 | import argparse
from fauxcaml import build
def create_parser():
ap = argparse.ArgumentParser(
prog="fauxcamlc",
description="Compiles an OCaml source file to an x86-64 executable.",
epilog="project homepage: https://github.com/eignnx/fauxcaml",
)
ap.add_argument(
"source_... | eignnx/fauxcaml | fauxcaml/__main__.py | __main__.py | py | 757 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "fauxcaml.build.compile_from_source_file",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "fauxcaml.build",
"line_number": 35,
"usage_type": "name"
}
] |
18252831721 | from typing import List
class Solution:
def reconstructQueue(self, people: List[List[int]]) -> List[List[int]]:
res = []
people.sort(key = lambda x : (-x[0], x[1]))
for a in people:
res.insert(a[1], a)
return res
solution = Solution()
people = [[7,0],[4,4],[7,1],[5,0],... | hujienan/Jet-Algorithm | leetcode/406. Queue Reconstruction by Height/index.py | index.py | py | 465 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
}
] |
38380439299 | import matplotlib.pyplot as plt
import numpy as np
import netCDF4
def plot( file,ofile=None):
nc = netCDF4.Dataset( file )
fn = file.rpartition("/")[-1]
label = fn.split("_")[0]
var = nc.variables[label]
long_name = var.long_name
units = var.units
if len(var.shape) > 2:
print ( var.dimensions )
v... | cp4cds/cmip6_range_check_old | scripts/plot2.py | plot2.py | py | 1,090 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "netCDF4.Dataset",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "numpy.meshg... |
7683932011 | # ----------------------------------------------------------------------------------------
# prepare environment (boilerplate)
# import the required packages using their usual aliases
import dash
from dash import dcc, html, Input, Output, State
import dash_bootstrap_components as dbc
import plotly.graph_objects as go
... | khurchla/sustain-our-soil-for-our-food-prod | app.py | app.py | py | 29,394 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "os.environ.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
... |
4593625107 | import cv2
import json
import numpy as np
import matplotlib.pyplot as plt
from itertools import count
def put_speed_on_video(mp4_path, pred_text_path, act_text_path):
pred_speed_list = np.around(np.loadtxt(pred_text_path), decimals=1)
act_speed_list = np.around(np.loadtxt(act_text_path), decimals=1)[1:]
vi... | antoninodimaggio/Voof | demo_utils.py | demo_utils.py | py | 2,797 | python | en | code | 65 | github-code | 36 | [
{
"api_name": "numpy.around",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.around",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number... |
40962236742 | #!/usr/bin/env python
# _*_ coding:utf-8 _*_
import json
from flask import Flask,request
from base.base import *
app = Flask(__name__)
@app.before_request
def before_request():
if request.method == 'POST' and request.form.get("name"):
name=request.form.get("name")
if existfile(name):
... | 1185714392/moviesearch | app.py | app.py | py | 1,710 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "flask.request.form... |
29572532106 | """ Notes
-Need to have opencv built with gstreamer support
print(cv2.getBuildInformation())
-Set Xavier to max power:
(do do manually or providing sudo password as script arg -p PASSWORD)
sudo nvpmodel -m 0
sudo jetson_clocks
-JTOP - helpful activity monitor
sudo apt-get install python3-pip -y
sudo python3 -m pip i... | LiellPlane/DJI_UE4_poc | Source/lumotag/mobilenet_inference_tidied.py | mobilenet_inference_tidied.py | py | 10,889 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "time.perf_counter",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "time.perf_counter",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "contextlib.contextmanager",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "jetson_... |
30467610617 | import collections
class Solution:
def accountsMerge(self, accounts: List[List[str]]) -> List[List[str]]:
node_to_neighbor = {}
# build graph
for account in accounts:
name = account[0]
for i in range(1, len(account)):
cur_email = account[i]
... | dundunmao/LeetCode2019 | 721. Accounts Merge.py | 721. Accounts Merge.py | py | 2,068 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "collections.deque",
"line_number": 43,
"usage_type": "call"
}
] |
11784656842 | from aiogram import Dispatcher
from aiogram.types import Message
from database.database import GAME_USERS
from lexicon.lexicon_ru import LEXICON_RU
async def send_reverse_answer(message: Message):
if message.from_user.id not in GAME_USERS:
await message.reply('\n'.join([message.text[::-1], LEXICON_RU['sm... | faralost/ichiraku-telegram-bot | handlers/other_handlers.py | other_handlers.py | py | 662 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "aiogram.types.Message",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "database.database.GAME_USERS",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "lexicon.lexicon_ru.LEXICON_RU",
"line_number": 10,
"usage_type": "name"
},
{
"ap... |
5547127979 | """
Voting 12/04/2022.
1. Refund previous depositor' spending to finance multisig 0x48F300bD3C52c7dA6aAbDE4B683dEB27d38B9ABb
with 254.684812629886507249 stETH.
2. Fund depositor bot multisig 0x5181d5D56Af4f823b96FE05f062D7a09761a5a53 with 130 stETH.
Vote passed & executed on Apr-15-2022 05:34:30 PM +UTC, block #14... | lidofinance/scripts | archive/scripts/vote_2022_04_12.py | vote_2022_04_12.py | py | 2,423 | python | en | code | 14 | github-code | 36 | [
{
"api_name": "typing.Dict",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "utils.evm_script.encode_call_script",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "utils.finance.make_steth_payout",
"line_number": 36,
"usage_type": "call"
},
{
"a... |
43046784986 | from datetime import datetime
from discord.ext import commands
import discord
from discordbot.errors import ErrorMessage
class UserInfo(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.color = 0xffffff
@commands.command(
brief="Erhalte Benutzerinfos",
description="... | AlexeiSur/bot12345 | discordbot/botcmds/userinfo.py | userinfo.py | py | 2,397 | python | de | code | 0 | github-code | 36 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "discord.User",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "da... |
9475668450 | """API related fixtures."""
from contextlib import contextmanager
from typing import Any, Callable, ContextManager, Generator
from uuid import uuid4
import pytest
import respx
from fastapi.testclient import TestClient
from httpx import Request, Response
from python_scaffold import api, settings
@pytest.fixture(scop... | IronicUsername/python-scaffold | python-scaffold/tests/test_python_scaffold/fixtures/api.py | api.py | py | 2,931 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "fastapi.testclient.TestClient",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "python_scaffold.api.app",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "python_scaffold.api",
"line_number": 20,
"usage_type": "name"
},
{
"ap... |
19033663462 | """OS identification method using netflows -- User-Agent
This module contains implementation of UserAgent class which is a method for OS
identification using User-Agent technique.
"""
import structlog
class UserAgent:
"""UserAgent OS identification technique
This class provides an interface for performing OS... | CSIRT-MU/CRUSOE | crusoe_observe/OS-parser-component/osrest/method/useragent.py | useragent.py | py | 4,053 | python | en | code | 9 | github-code | 36 | [
{
"api_name": "structlog.get_logger",
"line_number": 70,
"usage_type": "call"
}
] |
33512505076 | # -*- coding: utf8 -*-
from collective.contact.core.behaviors import IRelatedOrganizations
from collective.contact.core.testing import INTEGRATION
from ecreall.helpers.testing.base import BaseTest
from z3c.relationfield.relation import RelationValue
from zope.component import getUtility
from zope.interface import also... | collective/collective.contact.core | src/collective/contact/core/tests/test_related.py | test_related.py | py | 1,764 | python | en | code | 6 | github-code | 36 | [
{
"api_name": "unittest.TestCase",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "ecreall.helpers.testing.base.BaseTest",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "collective.contact.core.testing.INTEGRATION",
"line_number": 17,
"usage_type... |
27281502055 | """project URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... | mikha1lov/headway | project/urls.py | urls.py | py | 1,515 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.conf.urls.url",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 23,
"usage_type": "name"
},
{
"api_name... |
24835307446 | import aiologger
from aiologger.handlers.streams import AsyncStreamHandler
from aiologger.handlers.files import AsyncFileHandler
import logging
class MyFormatter(logging.Formatter):
def format(self, record):
return f"{record.created} - {record.name} - {record.levelname} - {record.msg}"
def setup_async_l... | bucin98/fast_api_coin_price | app/get_logger.py | get_logger.py | py | 830 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.Formatter",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "aiologger.Logger.with_default_handlers",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "aiologger.Logger",
"line_number": 13,
"usage_type": "attribute"
},
{
... |
26804643066 | # -*- coding: utf-8 -*-
import pymysql
import itertools
if __name__ == "__main__":
pre_deal()
#search all of the entities from db and remove duplicated entries.
def pre_deal():
db = pymysql.connect("localhost", "root", "302485", "imdb", charset='utf8')
cursor = db.cursor()
search_sql = """sea... | LYunCoder/imdb_analysis | subgraph_wikidata/construct_relations.py | construct_relations.py | py | 2,079 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pymysql.connect",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "itertools.groupby",
"line_number": 29,
"usage_type": "call"
}
] |
19027441425 | from django.db import models
class SocialNetwork(models.Model):
"""Social Network model definitions"""
DEFAULT_SOCIALNETWORKS = (
(0, 'FaceBook'),
(1, 'Instagram'),
(2, 'Linkedin'),
(3, 'Twitter'),
(4, 'YouTube'),
)
title = models.CharField(
verbose_na... | ag-castro/brazil-ongs-mapping | ressonantes/core/models/social_network.py | social_network.py | py | 762 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "django.db.models.Model",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": ... |
19565250442 | from django.db import models
from users.models import User
from .validators import validate_year
class Category(models.Model):
name = models.CharField(max_length=256)
slug = models.SlugField(max_length=50, unique=True)
def __str__(self):
return self.name
class Meta:
ordering = ('nam... | Daniil-lev/infra_sp2 | api_yamdb/reviews/models.py | models.py | py | 2,321 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "django.db.models.Model",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "... |
23728224660 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from StyleFrame import StyleFrame, utils
# read excel file to usable numpy arrays
def load_multispectral_data(excel_file):
df = pd.read_excel(excel_file, 'Multispectral Image')
nir = df[0:20].iloc[:, 1:].to_numpy()
red = df[22:42].ilo... | maxvanschendel/Geomatics | GEO1001/assignment_5.py | assignment_5.py | py | 5,084 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.read_excel",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "StyleFrame.StyleFrame.read_excel",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "StyleFrame.StyleFrame",
"line_number": 18,
"usage_type": "name"
},
{
"api_name"... |
21301309349 | from celery.decorators import task
from tracker import celery_app
from api.models import User, Tracker
from core_listing_scraper import get_current_listings, make_dict
from mailgun_email_api.mailgun_email_api import send_confirmation_message, send_email_for_new_or_updated_listings
@task(name='create_tracker')
def cre... | brianleungwh/tracker | api/tasks.py | tasks.py | py | 2,626 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "api.models.User.objects.get_or_create",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "api.models.User.objects",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "api.models.User",
"line_number": 10,
"usage_type": "name"
},
{
... |
29976190660 | #!/usr/bin/env python3
import numpy as np
import matplotlib.pyplot as pl
from numba import autojit
import time
import sys
@autojit
def stochastic(t, eta, amplitude, frequency):
"""
Create time series of stochastic oscillations for a given damping rate
(eta), amplitude and frequency. From De Ridder et al. ... | jsk389/Stochastic-Simulations | Oscillations/oscillations.py | oscillations.py | py | 3,024 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "numpy.sqrt",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.round",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.random.randn",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_nu... |
23458756442 | import logging
import os.path
import schedule
import time
import threading
import requests
import ip_provider
SERVER_ADDRESS = "http://{}:8080".format(os.getenv("KIOSK_SERVER", "localhost"))
CONNECTOR_SERVICE_ADDRESS = "/kiosksConnector"
AUTHENTICATION_HEADER_KEY = "Authentication"
SERVICE_CALL_INTERVAL_IN_SECONDS =... | z13z/Kiosks | kiosk-worker/alive.py | alive.py | py | 1,645 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.getenv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "schedule.every",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "schedule.run_pending",
"lin... |
11399653224 |
"""
Fits, etc. to extracted spectra
"""
import os
import time
import warnings
import numpy as np
import scipy.ndimage as nd
from scipy.optimize import nnls
import matplotlib.pyplot as plt
from matplotlib.ticker import MultipleLocator
from matplotlib.gridspec import GridSpec
import astropy.io.fits as pyfits
from g... | gbrammer/msaexp | msaexp/spectrum.py | spectrum.py | py | 68,700 | python | en | code | 17 | github-code | 36 | [
{
"api_name": "grizli.utils.set_warnings",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "grizli.utils",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "numpy.exp",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"... |
30321707707 | from unittest.mock import patch
import unittest
import os
import uuid
from datetime import datetime
import cmr.util.common as com
# ******************************************************************************
class TestSearch(unittest.TestCase):
"""Test suit for Search API"""
# **************************... | nasa/eo-metadata-tools | CMR/python/test/cmr/util/test_common.py | test_common.py | py | 6,735 | python | en | code | 25 | github-code | 36 | [
{
"api_name": "unittest.TestCase",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "cmr.util.common.conj",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "cmr.util.common",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "cmr.util.... |
9044071393 | """Sensor platform for Ambrogio Robot."""
from __future__ import annotations
from homeassistant.core import HomeAssistant
from homeassistant.const import (
ATTR_LOCATION,
ATTR_LATITUDE,
ATTR_LONGITUDE,
)
from homeassistant.components.device_tracker import SOURCE_TYPE_GPS
from homeassistant.components.devic... | sHedC/homeassistant-ambrogio | custom_components/ambrogio_robot/device_tracker.py | device_tracker.py | py | 2,892 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "homeassistant.helpers.entity.EntityDescription",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "homeassistant.core.HomeAssistant",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "homeassistant.config_entries.ConfigEntry",
"line_number": 33,... |
37349410877 | """Test all electron density for right interpretation of coreholes"""
import pytest
from ase.build import molecule
from ase.units import Bohr
from gpaw import GPAW, PoissonSolver
from gpaw.mixer import Mixer
from gpaw.test import gen
@pytest.mark.later
def test_aed_with_corehole_li():
"""Compare number of electro... | f-fathurrahman/ffr-learns-gpaw | my_gpaw/test/corehole/test_li2.py | test_li2.py | py | 1,336 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "gpaw.test.gen",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "ase.build.molecule",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "gpaw.GPAW",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "gpaw.mixer.Mixer",
"li... |
70003678825 | from discord.ext import commands
import logging, traceback, discord
from collections import Counter
import datetime
import asyncio, aioredis
import os, sys, time
import random
from multiprocessing import Queue
from queue import Empty as EmptyQueue
import json
import hashlib
import config
import rethinkdb as r
import ... | harumaki4649/nekobot | shardedBot.py | shardedBot.py | py | 12,244 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.Formatter",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "logging.Formatter.__init__",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "logging.Formatter",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name... |
24706362299 | import pygame
from Snake import Snake
from Segment import Segment
class Player(Snake):
def __init__(self,x,y,w,h,filePath, winDims):
super().__init__(x,y,w,h,filePath)
self.winDims = winDims
def update(self,orbs,snakes):
self.calculateDirection()
return super().updat... | MCK144/Slither.io | Player.py | Player.py | py | 777 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "Snake.Snake",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "pygame.mouse.get_pos",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pygame.mouse",
"line_number": 15,
"usage_type": "attribute"
}
] |
29144047296 | #!/usr/bin/python3
import numpy as np
from scipy.io import loadmat
from func import displayData, nnCostFunction, sigmoidGradient, randInitializeWeights,\
checkNNGradients, fmin_nn, fmin_nn1, predict
import matplotlib.pyplot as plt
def main():
# Setup the parameters you will use for this exercise
input_... | rossihwang/Coursera_ML_homework_with_python | week5/ex4.py | ex4.py | py | 3,839 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "scipy.io.loadmat",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.random.permutation",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "func.disp... |
40186857847 | # import community
import numpy as np
import networkx as nx
import matplotlib as mpl
from matplotlib.pyplot import imshow
from matplotlib import pyplot as plt
import matplotlib.image as mpimg
import pygraphviz
from networkx.drawing.nx_agraph import write_dot, graphviz_layout
import random
import pydoc
from ds import Mc... | afshinbigboy/itmt | src/test.py | test.py | py | 1,675 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.path.append",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.rc",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "datasets.synthetic.genera... |
74572928422 | from flask import Flask,render_template
from os import path
from flask_misaka import markdown,Misaka
from LocalStorageBackend import folderlist
##### this is the Template jinja stuff for the webpage
app = Flask(__name__, template_folder="views")
### need this line for the Misaka markdown rendering
Misaka(app,fenced_co... | gabrielmccoll/Simple-Terraform-Registry | LocalStorageGUI.py | LocalStorageGUI.py | py | 2,087 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask_misaka.Misaka",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "LocalStorageBackend.folderlist",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask.re... |
24527321437 | import shutil
import tempfile
from ..models import Post, User, Comment
from django.conf import settings
from django.test import Client, TestCase, override_settings
from django.urls import reverse
from django.core.files.uploadedfile import SimpleUploadedFile
TEMP_MEDIA_ROOT = tempfile.mkdtemp(dir=settings.BASE_DIR)
... | Gabrie1002/hw05_final | yatube/posts/tests/test_forms.py | test_forms.py | py | 3,092 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "tempfile.mkdtemp",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.BASE_DIR",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 11,
"usage_type": "name"
},
{
"api_name... |
22524801892 | from .extentions import (
login_manager,
db,
moment,
bootstrap,
avatarTeam,
avatarUser,
coverPost,
imgTeam,
coverUser,
commonImage,
ckeditor,
nav,
mail
)
from flask_uploads import patch_request_class, configure_uploads
from .config import config
from ... | Honglin-Li/TravelPlatform | app/__init__.py | __init__.py | py | 6,069 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "config.config",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "config.config",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "extentions.db.init_app",
... |
37229157121 | import pygame
from player import *
from blocks import *
from pyganim import *
# window
WIN_WIDTH = 800 # Ширина создаваемого окна
WIN_HEIGHT = 640 # Высота
DISPLAY = (WIN_WIDTH, WIN_HEIGHT) # Группируем ширину и высоту в одну переменную
BACKGROUND_COLOR = (0, 64, 0)
NAME = "Battle of one"
ANIMATION_DELAY = 0.1 # ск... | Cruciano/Totsuka-Blade | game.py | game.py | py | 3,608 | python | ru | code | 0 | github-code | 36 | [
{
"api_name": "pygame.init",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "pygame.displa... |
29701799964 | import os
import pandas as pd
import pandas.util.testing as pdt
import pytest
import six
@pytest.fixture
def sj_out_tab(tmpdir):
s = """chr1 76 299 1 2 1 0 1 39
chr1 201 299 1 1 1 0 1 10
chr1 201 249 1 1 0 0 1 ... | YeoLab/outrigger | outrigger/tests/io/test_star.py | test_star.py | py | 2,952 | python | en | code | 60 | github-code | 36 | [
{
"api_name": "pandas.read_table",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "six.StringIO",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "outrigger.io.star.r... |
35753678574 | import xlsxwriter
workbook = xlsxwriter.Workbook("1.xlsx")
mySheet = workbook.add_worksheet()
mySheet.write("A1", "t_value")
mySheet.write("B1", "y1_value")
mySheet.write("C1", "y2_value")
t = 0
t1 = 0
y2 = 0
t1_value = []
y1_value = []
y2_value = []
while int(t) != 2:
t += 0.1
y1 = (5 * t) + ((2 * t) ** 2... | toni7891/magshimimHW_10grade | selfProjects/physics/phisycaProg1.py | phisycaProg1.py | py | 893 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "xlsxwriter.Workbook",
"line_number": 3,
"usage_type": "call"
}
] |
12829538864 | import json
class Participant:
# custom classes must be converted to dictionary or list to be serializable
def __init__(
self,
points=0,
total_points=0,
problems_solved=0,
easy=0,
medium=0,
hard=0,
won=0,
first=0,
) -> None:
... | misslame/BroncoderBot | participant_data_handling/participant.py | participant.py | py | 3,927 | python | en | code | 9 | github-code | 36 | [
{
"api_name": "json.dumps",
"line_number": 28,
"usage_type": "call"
}
] |
37218399811 | from os import getenv
from minio import Minio
def get_s3_client():
endpoint = "{host}:{port}".format(
host = getenv("MINIO_HOST", "127.0.0.1"),
port = getenv("MINIO_PORT", "9000")
)
access_key = getenv("MINIO_ACCESS_KEY", "minioadmin")
secret_key = getenv("MINIO_SECRET_KEY",... | parledoct/qbestdocks | src/common/resources/s3.py | s3.py | py | 441 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.getenv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 10,
"us... |
185118540 | # -*- coding: utf-8 -*-
"""
Created on Wed Mar 10 13:55:54 2021
@author: 44797
"""
from collections import Counter
import collections
class Solution:
def frequencySort(self, nums):
nums_count = collections.OrderedDict(sorted(Counter(nums).items(), key=lambda x: x[0], reverse=True))
outpu... | sicsempatyrannis/Hackarank-Leetcode | Frequency sort.py | Frequency sort.py | py | 642 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "collections.OrderedDict",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 11,
"usage_type": "call"
}
] |
31422423491 | from __future__ import barry_as_FLUFL, print_function, division
__version__ = '0.1'
__author__ = 'Maryam Najafian'
"""
* Implementing Part of Speech (POS) tagging
* Using RNN in Tensorflow
structure: Embedding --> GRU --> Dense
* INPUTs are one hot encoded words and OUTPUTs are tags
* Measure F1-score and accur... | MaryamNajafian/Tea_Maryam_NLP | Code/pos_tf.py | pos_tf.py | py | 8,941 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.path.append",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
72749247463 | import json
import gamestate
from enum import Enum
from typing import List, Dict
import city
import items
import time
from main_menu import GAME_WIDTH, dotted_line, empty_line, print_in_the_middle, print_left_indented, write_over, \
go_up_and_clear, yes_no_selection, clear_screen, informScreen
from narration impor... | farbill/capricornus | gameaction.py | gameaction.py | py | 10,119 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "gamestate.GameState",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "gamestate.GameState",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "city.District",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "... |
28212815026 | from django.shortcuts import get_object_or_404, render, redirect
from core.models import Item
from django.contrib.auth import login, logout, authenticate
from django.contrib.auth.models import User
import api.views as api
from core.forms import ItemCreateForm, UserCreateForm, UserLoginForm, UserUpdateForm
from django.c... | HomayoonAlimohammadi/divar | divar-clone/core/views.py | views.py | py | 7,084 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "core.models.Item.objects.all",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "core.models.Item.objects",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "core.models.Item",
"line_number": 11,
"usage_type": "name"
},
{
"api_n... |
8290193445 | from lxml import etree as ET
def parse_params_xmlfile(params_xml_file):
parameter = dict()
tree = ET.parse(params_xml_file)
root = tree.getroot()
global_parameter = root.find('global')
parameter['rpn_nms_thresh'] = float(global_parameter.find('rpn_nms_thresh').text)
parameter['rpn_f... | PauliKarl/shipdet | shipdet/datasets/parse.py | parse.py | py | 2,919 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "lxml.etree.parse",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "lxml.etree.parse",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"line_num... |
22340501918 | import os
import json
import requests
import sys
import readline
# Constants
URL = "https://api.perplexity.ai/chat/completions"
HEADERS = {
"accept": "text/event-stream",
"content-type": "application/json",
"authorization": f"Bearer {os.getenv('PERPLEXITY_API_KEY')}"
}
def get_input(prompt):
try:
... | piercecohen1/pplx-api-streaming | pplxchat.py | pplxchat.py | py | 2,331 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.getenv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "sys.stdout.write",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_numbe... |
73685012263 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.preprocessing import StandardScaler,PolynomialFeatures
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelEncoder, Binarizer
from sklearn import linear_model
from sk... | smittal1995/Upvote-count | lasso.py | lasso.py | py | 2,390 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.Binarizer",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.LabelEncoder",
"line_number": 20,
"usage_type": "call"
},
{
... |
34084783842 | from pathlib import Path
from brownie import Strategy, accounts, config, network, project, web3
from brownie.network.gas.strategies import GasNowStrategy
from brownie.network import gas_price
from eth_utils import is_checksum_address
API_VERSION = config["dependencies"][0].split("@")[-1]
Vault = project.load(
Pa... | akshaynexus/BoringDAOStrats | scripts/deploy.py | deploy.py | py | 2,398 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "brownie.config",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "brownie.project.load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "brownie.project",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "pathlib.Path.home"... |
34023322627 | import PIL.Image
import os
def resize_image(image_path, new_width, new_height):
"""Resizes an image without changing its dimensions.
Args:
image_path: The path to the image file.
new_width: The new width of the image.
new_height: The new height of the image.
Returns:
The resized ... | dev5h/ete21 | resize_thumbnails.py | resize_thumbnails.py | py | 1,264 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "PIL.Image.Image.open",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "PIL.Image.Image",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "PIL.Image.Image",... |
74918582185 | # -*- coding: utf-8 -*-
import datetime
from dateutil import rrule
from odoo import models, fields, api, _
from odoo.exceptions import UserError
class Loan(models.Model):
_name = "hr.loan"
_description = 'Employee Loans'
@api.model
def _default_currency(self):
return self.env.user.company_i... | lawrence24/ndms-1 | ibas_payroll/models/models.py | models.py | py | 15,973 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "odoo.models.Model",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "odoo.models",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "odoo.api.model",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "odoo.api",
... |
9601977492 | from pydub import AudioSegment
import glob
from PIL import Image, ImageDraw
import os
import multiprocessing
import tqdm
import json
import numpy as np
in_path = '/Volumes/AGENTCASHEW/sound-effects-output/'
def process_clip(wave_file_name):
print(wave_file_name)
if os.path.isdir(wave_file_name+'/waveform'):
... | thisismattmiller/sound-effect-bot | build_waveform_frames.py | build_waveform_frames.py | py | 2,125 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.isdir",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pydub.AudioSegment.from_file",
... |
756466471 | import argparse
import time
from utils import load_weights, read_mnist, preprocessing_data
from sklearn.metrics import classification_report
from my_svm import MySvm
def parse_args():
path_to_x_test = 'samples/t10k-images-idx3-ubyte.gz'
path_to_y_test = 'samples/t10k-labels-idx1-ubyte.gz'
path_to_model =... | albellov/mrg_mlcourse_module1 | predict.py | predict.py | py | 1,990 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "utils.read_mnist",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "utils.preprocessing_data",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "uti... |
20306864607 | #!/usr/bin/python
'''
Filename: distance.py
Contributors: Todd Boone II, Jackson Brietzke, Jonah Woods, Andrew Zolintakis, Frank Longo, Peter Awori
Description: Enables the CanCan application to retrieve distance
information from Google's Distance Matrix API.
Modules
Imported: requests
difflib
creatin... | toddbooneii/cancan | distance.py | distance.py | py | 6,739 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "creating_materials.create_locations_df",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "requests.exceptions",
"line_number": 65,
"usage_type": "attribute"
},
{
"api_... |
42246125387 | """
Module with class that wraps OpenCV based detectors and descriptors.
Allows performing Non-Maximum suppression based on keypoints response, top-response keypoints filtering,
descriptors normalization.
"""
from typing import Union, Iterable, Tuple, Optional
import cv2
import numpy as np
from scipy.spatial import K... | ucuapps/OpenGlue | models/features/opencv/base.py | base.py | py | 6,977 | python | en | code | 304 | github-code | 36 | [
{
"api_name": "cv2.Feature2D",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "typing.Optional",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "numpy.ndarray",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "numpy.float32",... |
32882318710 | # -*- coding: utf-8 -*-
"""
Created on Sun Jun 28 21:01:17 2020
@author: Hemakshi Pandey
"""
# NLP with BAG OF MODEL using SUPPORT VECTOR MACHINE
## Importing the libraries
import numpy as np
#NumPy is a python library used for working with arrays.
import pandas as pd
#They are used in Python to deal with da... | hemakshi1234/NCRB_Automatic-IPC-Section-classification | flask_NLP_predict_train.py | flask_NLP_predict_train.py | py | 4,502 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "nltk.download",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "nltk.download",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "nltk.WordNetLemmatizer",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "nltk.download",
... |
16748045789 | import os
import pickle
from pathlib import Path
import numpy as np
import pandas as pd
import sklearn
import xgboost as xgb
class CapacityPredictionModel:
def __init__(self, classes=None, hyper_params=None):
"""set default hyper-parameters"""
if hyper_params is None:
self.hyper_param... | AlexisMignon/openstf | openstf/model/capacity/model.py | model.py | py | 2,790 | python | en | code | null | github-code | 36 | [
{
"api_name": "xgboost.XGBClassifier",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.argmin",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame"... |
10410217579 | import json
import random
from pykafka import KafkaClient
from datetime import datetime
import time
from faker import Faker
CONS_KAFKA_TOPIC = "test-demand3"
CONS_KAFKA_SERVER = "localhost:9092"
#creating instances of Kafka variables
kafka_client = KafkaClient(CONS_KAFKA_SERVER)
kafka_topic = kafka_client.topics[CO... | ayushmanadhikari/kafka-basics | pykafka-dir/demand_supply.py | demand_supply.py | py | 2,341 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pykafka.KafkaClient",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "faker.Faker",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_n... |
9200352322 | import torch
print("\n---First example---")
x = torch.ones(2, 2, requires_grad=True)
y = x + 2
z = y * y * 3
out = z.mean()
out.backward()
print("x.grad:", x.grad)
# # ----- ----- ----- -----
# # alternative: comment previous backward() and x.grad references
# print("x.grad alternative:", torch.autogr... | antonio-f/pytorch_backward_function | backward_examples.py | backward_examples.py | py | 2,586 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.ones",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "torch.ones",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "torch.zeros",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "torch.randn",
"line_number": 28,... |
769211687 | import glob
from music21 import converter, instrument, note, chord
def get_notes():
""" Get all the notes and chords from the midi files in the ./midi_songs directory """
notes = []
for file in glob.glob("rammstein/*.mid*"):
midi = converter.parse(file)
print("Parsing %s" % file... | tanelxen/riff-composer | get_notes.py | get_notes.py | py | 1,486 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "glob.glob",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "music21.converter.parse",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "music21.converter",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "music21.instrument.p... |
6035629289 | import cv2
import numpy as np
from math import exp, pow
FILENAME = "testbaby"
SIZE = 200
OBJCOLOR, BKGCOLOR = (0, 0, 255), (0, 255, 0)
SOURCE, SINK = -2, -1
def read_cuts(filename, image):
with open(filename, "r") as f:
lines = f.readlines()
mf = int(lines[0])
idx = 0
for char in... | 2022tgoel/6.854-Final-Project | cut_renderer.py | cut_renderer.py | py | 1,292 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "cv2.imread",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "cv2.IMREAD_GRAYSCALE",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "cv2.resize",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"lin... |
74230073703 | import asyncio
import os
from agconnect.common_server import AGCClient
from agconnect.common_server import CredentialParser
from agconnect.cloud_function import AGConnectFunction
AGCClient.initialize("real_cli",
credential=CredentialParser.to_credential(
(os.path.join(os.... | AppGalleryConnect/agc-server-demos-python | cloudfunction/main.py | main.py | py | 1,075 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "agconnect.common_server.AGCClient.initialize",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "agconnect.common_server.AGCClient",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "agconnect.common_server.CredentialParser.to_credential",
"line_n... |
20319120410 | import flask
import flask_redis
import flask_socketio
import time
import threading
import json
redis_store = flask_redis.FlaskRedis()
socketio = flask_socketio.SocketIO()
def get_data_for_hashtag(tag):
return redis_store.lrange(tag, 0, 1000)
def broadcast_thread():
while True:
# sleeping for 50ms
... | thelinerocks/lineweb | app.py | app.py | py | 1,855 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask_redis.FlaskRedis",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask_socketio.SocketIO",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "time.sleep",
... |
72447111784 | from base64 import b64decode
import invoicegen.settings
import settings.helper
from django.contrib.auth.decorators import login_required, permission_required
from django.core.files.base import ContentFile
from django.http import JsonResponse
from django.views import View
from django.shortcuts import *
from django.util... | jlmdegoede/Invoicegen | agreements/views.py | views.py | py | 9,931 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "tables.AgreementTable",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "django_tables2.RequestConfig",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.decorators.login_required",
"line_number": 20,
"usage_type": "name... |
2252814008 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2020/01/22 10:18
# @Author : zc
# @File : get_htmlText.py
import requests
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.common.by import By
from PIL import Image
# 重定向爬虫h4
url = "http://www.itest.info/courses"
soup ... | Owen-ET/project_Buger_2 | Python爬虫/get_htmlText.py | get_htmlText.py | py | 2,735 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "bs4.BeautifulSoup",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "requests.get",
"... |
33329719512 | #!/bin/env python
import json
import helpers
if __name__ == '__main__':
root_dir = helpers.root_dir()
path = "%s/sources/counties.geojson" % root_dir
print("loading %s" % path)
file = open(path, 'rb')
geojson = json.load(file)
data = {}
for feature in geojson["features"]:
props = feature["properties"]
... | knightmirnj/acluedtool | counties.py | counties.py | py | 524 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "helpers.root_dir",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 28,
"usage_type": "call"
}
] |
23443224445 | from .utils import display_table, read_sold, str_to_date
def show_sold(start_date, end_date):
start_date, end_date = str_to_date(start_date), str_to_date(end_date)
header, data = read_sold()
sold_in_this_time = []
for row in data:
sold_date = str_to_date(row[-1])
if start_date <= sold_date <= end_date:
so... | sndr157/Inventory | modules/sold.py | sold.py | py | 459 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "utils.str_to_date",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "utils.read_sold",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "utils.str_to_date",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "utils.display_table"... |
32676816163 | import requests
import sys
import urllib3
from requests_toolbelt.utils import dump
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
proxies = {'http': 'http://127.0.0.1:8080', 'https': 'http://127.0.0.1:8080'}
def exploit_sqli(url, payload):
path = 'filter?category='
r = requests.get(url + ... | marcomania/Web-Security-Academy-Series | sql-injection/lab-01/sqli-lab-01.py | sqli-lab-01.py | py | 934 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "urllib3.disable_warnings",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "urllib3.exceptions",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "requests_... |
70516415785 | import os
import os.path
import sys
from pyspark import SparkContext
from pyspark.mllib.recommendation import ALS
from numpy import array
if __name__ == "__main__":
data_file = '/spark/data/als.data'
if len(sys.argv) == 1:
print >> sys.stderr, "Usage: filtering.py <master>"
exit(-1)
else:
... | jhorey/ferry | ferry/data/dockerfiles/spark/filtering.py | filtering.py | py | 1,072 | python | en | code | 253 | github-code | 36 | [
{
"api_name": "sys.argv",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "sys.stderr",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pyspark.SparkContext",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"li... |
15636919766 | import pybullet as p
import time
import pybullet_data
import math
import numpy as np
physicsClient = p.connect(p.GUI)#or p.DIRECT for non-graphical version
p.setAdditionalSearchPath(pybullet_data.getDataPath()) #optionally
p.setGravity(0,0,-10)
planeId = p.loadURDF("plane.urdf")
startPos = [0, 0, 1.4054411813121799... | cencencendi/excabot | coba.py | coba.py | py | 1,438 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pybullet.connect",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pybullet.GUI",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pybullet.setAdditionalSearchPath",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pybu... |
70415685225 | import sys
from io import StringIO
from unittest import mock, TestCase
from unittest.mock import call, patch
from bs4 import BeautifulSoup
import ffq.ffq as ffq
from tests.mixins import TestMixin
from ffq.main import main
from ffq import __version__
class TestFfq(TestMixin, TestCase):
def test_validate_accessio... | pachterlab/ffq | tests/test_ffq.py | test_ffq.py | py | 28,319 | python | en | code | 494 | github-code | 36 | [
{
"api_name": "tests.mixins.TestMixin",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "unittest.TestCase",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "ffq.ffq.validate_accessions",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "... |
28981509521 | import json
import traceback
from tendrl.commons.utils import log_utils as logger
from tendrl.monitoring_integration.grafana import constants
from tendrl.monitoring_integration.grafana import dashboard_utils
from tendrl.monitoring_integration.grafana import datasource
from tendrl.monitoring_integration.grafana import ... | Tendrl/monitoring-integration | tendrl/monitoring_integration/grafana/dashboard.py | dashboard.py | py | 3,810 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "tendrl.monitoring_integration.grafana.utils.get_credentials",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "tendrl.monitoring_integration.grafana.utils",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "tendrl.monitoring_integration.grafana.gra... |
24517536 | from itertools import count
import sys
def input(): return sys.stdin.readline().rstrip()
n = int(input())
nums = list(map(int, input().split()))
q = int(input())
lNums = list(map(int, input().split()))
mx = max(max(nums), max(lNums))
dp = [0] * (mx+1)
for a in nums:
dp[a] += 1
for i in range(2, mx+1):
for j ... | kmgyu/baekJoonPractice | Arena solvedAC/2023 arena 1/g.py | g.py | py | 567 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.stdin.readline",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "itertools.count",
"line_number": 16,
"usage_type": "call"
}
] |
25994684161 | import discord
from discord.ext import commands
import asyncio
import random
import datetime
import traceback
import os, sys
class Game(commands.Cog, name='一息ゲームコマンド'):
def __init__(self, bot):
self.bot = bot
@commands.command()
async def mine(self, ctx):
""" 14x14のマインスイーパを生成するぞ! ""... | hirosuke-pi/DiscordBot | progracat/mods/game/main.py | main.py | py | 5,289 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "random.randint",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "asy... |
23211155458 | from math import fabs
from os.path import split
from re import sub
from utils.tools import addWordsToJieba, splitSentence
import ujson
import os
from utils.config import DATASET
import jieba
from io import BytesIO, StringIO
attraction_db_path = "attraction_db.json"
hotel_db_path = "hotel_db.json"
metro_db_path = "metr... | LOST0LOSER/End-To-End-Dialog-System | utils/DataBase.py | DataBase.py | py | 9,837 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.join",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "utils.config.DATASET",
"line_number": 42,
"usage_type": "argument"
},
{
"api_name": "os.path",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"l... |
12741468324 | from telegram import ReplyKeyboardMarkup, ReplyKeyboardRemove, ParseMode
from telegram.ext import ConversationHandler
import random
def anketa_random_start(update, context):
update.message.reply_text(
f'Вы выбрали случайный фильм. Нажмите на кнопку "Получить фильм" и подождите немного, пока его под... | bezrezen/kino_bot | anketa_random.py | anketa_random.py | py | 2,846 | python | ru | code | 1 | github-code | 36 | [
{
"api_name": "telegram.ReplyKeyboardMarkup",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "telegram.ReplyKeyboardMarkup",
"line_number": 25,
"usage_type": "call"
},
{
"api_name"... |
10513629088 | #import getopt
import sys
#import ast
import json
import formatingDataSetProximity as formating
import enumerateTrackersProximity as et
import distancesProximity as distances
import visualisationProximity as vis
from datetime import datetime
from time import gmtime, strftime
import pandas as pd
def main():
# intimate... | Teamwork-Analytics/obs-rules | server/routes/localisation/ProximityLocalisation.py | ProximityLocalisation.py | py | 10,895 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "json.loads",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 26,... |
40107696527 | import numpy as np
import cv2 as cv
flower2 = "../mysamples/flower2.jpg"
# flower2 = "/home/mmni/projects/opencv-python/mysamples/flower2.jpg"
img = cv.imread(flower2)
someflowers = img[2000:2200, 2300:2500]
# someflowers = img[200:400, 600:800]
img[100:300, 200:400] = someflowers
cv.imshow("flowers", img)
cv.imshow... | ekim197711/opencv-python | core/part-of-image.py | part-of-image.py | py | 400 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "cv2.imread",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line_number": 14,
... |
36374178276 | from ibm_watson import TextToSpeechV1
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
from playsound import playsound
import json
from watson_developer_cloud import VisualRecognitionV3
import json
import ibm_boto3
from ibm_botocore.client import Config, ClientError
visual_recognition = Visual... | Ansari369/IoT-projects | taskapp.py | taskapp.py | py | 3,478 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "watson_developer_cloud.VisualRecognitionV3",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "ibm_cloud_sdk_core.authenticators.IAMAuthenticator",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "ibm_watson.TextToSpeechV1",
"line_number": 16,
... |
6811791128 | #!/usr/bin/env python3
from random import random
from z3 import *
import numpy as np
import time
from math import *
from statistics import *
from random_lib import *
from matplotlib import pyplot as plt
from matplotlib.patches import Rectangle
from collections import defaultdict
import heapq
import faulthandler
faul... | Luckykantnayak/uav-project-2 | lucky_smt_v5.py | lucky_smt_v5.py | py | 38,555 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "faulthandler.enable",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sys.setrecursionlimit",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.array",
... |
14919660857 | #!/usr/bin/env python
# Brocapi RQ Worker
__copyright__ = """
Copyright 2017 FireEye, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-... | fireeye/brocapi | brocapi/brocapi_worker.py | brocapi_worker.py | py | 3,053 | python | en | code | 27 | github-code | 36 | [
{
"api_name": "logging.info",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "logging.debug",
"line_number":... |
72166992744 | import datetime
def get_period(start_day: str, n_days: int) -> list:
''' get the list of string dates from <start_date> <n_days> backwards '''
datelst = [datetime.datetime.strptime(start_day, '%Y-%m-%d') - datetime.timedelta(days=x) for x in range(n_days)]
datelst = [x.strftime('%Y-%m-%d') for x in datels... | qCircuit/unos_scripts | datetime.py | datetime.py | py | 1,675 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "datetime.timedelta",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "dat... |
4778228979 | from pathlib import Path
import re
import subprocess
import numpy as np
import pytest
from transformer_engine.paddle.fp8 import is_fp8_available
test_root = Path(__file__).resolve().parent
is_fp8_supported, reason = is_fp8_available()
@pytest.mark.skipif(not is_fp8_supported, reason=reason)
@pytest.mark.parametriz... | NVIDIA/TransformerEngine | tests/paddle/test_recompute.py | test_recompute.py | py | 1,707 | python | en | code | 1,056 | github-code | 36 | [
{
"api_name": "pathlib.Path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "transformer_engine.paddle.fp8.is_fp8_available",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "subprocess.check_output",
"line_number": 32,
"usage_type": "call"
},
{
... |
30488234848 | from eth_abi.codec import (
ABICodec,
)
from eth_utils import (
add_0x_prefix,
apply_to_return_value,
from_wei,
is_address,
is_checksum_address,
keccak as eth_utils_keccak,
remove_0x_prefix,
to_bytes,
to_checksum_address,
to_int,
to_text,
to_wei,
)
from hexbytes impor... | MLY0813/FlashSwapForCofixAndUni | FlashSwapForCofixAndUni/venv/lib/python3.9/site-packages/web3/main.py | main.py | py | 7,774 | python | en | code | 70 | github-code | 36 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 106,
"usage_type": "name"
},
{
"api_name": "web3.eth.Eth",
"line_number": 112,
"usage_type": "name"
},
{
"api_name": "web3.net.Net",
"line_number": 113,
"usage_type": "name"
},
{
"api_name": "web3.version.Versio... |
8436779783 | # Given an array of positive numbers and a positive number ‘k,’ find the maximum sum of any contiguous subarray of size ‘k’.
def find_max_sum(arr, k):
sum = 0
max_sum = 0
for i in range(len(arr)):
sum += arr[i]
if i > k-1:
sum -= arr[i-k]
max_sum = max(max_sum, sum)
... | kashyapa/coding-problems | april19th/sliding-window/sliding_window.py | sliding_window.py | py | 5,992 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "collections.Counter",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 108,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 109,
"usage_type": "call"
},
{
"api_name": "collect... |
8438985423 | from django.shortcuts import render, get_object_or_404
from django.views import View
from proyectofinal.models import Jedi
from proyectofinal.forms import Buscar, JediForm
from django.urls import reverse_lazy
from django.views.generic import DetailView, ListView, CreateView, DeleteView, UpdateView
#Create your views h... | matiaslopez9411/proyecto-final | proyectofinal/views.py | views.py | py | 4,289 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.shortcuts.render",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "proyectofinal.models.Jedi.objects.all",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "proyectofinal.models.Jedi.objects",
"line_number": 16,
"usage_type": "attri... |
73819276905 | import sys
import argparse
from pathlib import Path
base_dir = Path(__file__).resolve().parents[1]
sys.path.append(str(base_dir))
from utils import txt2iob
from transformers import BertJapaneseTokenizer
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Train BERT')
parser.add_argument('... | ujiuji1259/NER | BERT/iob_for_bert.py | iob_for_bert.py | py | 1,010 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pathlib.Path",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
... |
21014356290 | # -*- coding:utf-8 -*-
# This file is part of Pyoro (A Python fan game).
#
# Metawars is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later... | RedbeanGit/Pyoro | src/gui/image_transformer.py | image_transformer.py | py | 5,427 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "pygame.transform.scale",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "pygame.transform",
"line_number": 47,
"usage_type": "attribute"
},
{
"api_name": "pygame.transform.flip",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "py... |
70563793064 | import os
import pickle
import numpy as np
# Modified from smplx code for FLAME
import torch
import torch.nn as nn
import torch.nn.functional as F
from pytorch3d.transforms import rotation_6d_to_matrix, matrix_to_rotation_6d
from skimage.io import imread
from loguru import logger
from flame.lbs import lbs
I = matrix... | Zielon/metrical-tracker | flame/FLAME.py | FLAME.py | py | 14,729 | python | en | code | 188 | github-code | 36 | [
{
"api_name": "pytorch3d.transforms.matrix_to_rotation_6d",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.eye",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.float32",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name"... |
32920662032 | # -*- coding: utf-8 -*-
import copy
from typing import List
from flowlauncher import FlowLauncher
from plugin.templates import *
from plugin.devtoys import *
class Main(FlowLauncher):
messages_queue = []
def sendNormalMess(self, title: str, subtitle: str):
message = copy.deepcopy(RESULT_TEMPLATE)
... | umi-uyura/Flow.Launcher.Plugin.DevToysLauncher | plugin/ui.py | ui.py | py | 1,462 | python | en | code | 5 | github-code | 36 | [
{
"api_name": "flowlauncher.FlowLauncher",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "copy.deepcopy",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "copy.deepcopy",
... |
30993271589 | from django.urls import path
from myproject.apps.board import views
urlpatterns = [
# path('boards/', views.boards, name='all_boards'),
path('boards/', views.BoardsView.as_view(), name='all_boards'),
# topic
path('board/<int:pk>/topics', views.topics, name='all_topics'),
path('board/<int:pk>/topics... | SunA0/django_learn | myproject/apps/board/urls.py | urls.py | py | 811 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "myproject.apps.board.views.BoardsView.as_view",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "myproject.apps.board.views.BoardsView",
"line_number": 6,
"usage_type": "att... |
73412902183 | from flask import Flask, jsonify, redirect
import feedparser
app = Flask(__name__)
# Function grabs the rss feed headlines (titles) and returns them as a list
def getHeadlines( rss_url ):
headlines = []
feed = feedparser.parse( rss_url )
for newsitem in feed['items']:
headlines.append(newsit... | daffaadevvv/StudyGit | newsfeederapi.py | newsfeederapi.py | py | 2,102 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "feedparser.parse",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.redirect",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_... |
28295137025 | from mmsystem import Goldbeter_1995
from ssystem import SSystem
from sigmoidal import Sigmoidal
import matplotlib.pyplot as plt
import numpy as np
mm_model = Goldbeter_1995()
steps = 50
delta = 0.01
#states, velocities = mm_model.run(state=initial_state, velocity=initial_velocity, delta=0.1, steps=3)
#for i in range(... | warut-vijit/modelsel | main.py | main.py | py | 1,856 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "mmsystem.Goldbeter_1995",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "ssystem.SSystem",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.array",
... |
18795434468 | import networkx as nx
import matplotlib.pyplot as plt
import plotly.express as px
import webbrowser
import folium
from graph import *
from node import *
def isNodeValid(nodeName, graph):
# Check if node is on the graph
for n in graph.nodeList:
if nodeName == n.name:
return True
return F... | febryanarota/Tucil-3-IF2122 | src/aStar.py | aStar.py | py | 3,930 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "graph.nodeList",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "graph.nodeList",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "networkx.Graph",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "graph.nodeList... |
8309674493 | from bson import ObjectId
# noinspection PyProtectedMember
from motor.motor_asyncio import AsyncIOMotorCollection
from task_tracker_backend.dataclasses import UserData
from task_tracker_backend.task_factory import TaskFactory
class User:
def __init__(
self, users_collection: AsyncIOMotorCollection, t... | smthngslv/task-tracker-backend | task_tracker_backend/user.py | user.py | py | 1,031 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "motor.motor_asyncio.AsyncIOMotorCollection",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "bson.ObjectId",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "bson.ObjectId",
"line_number": 18,
"usage_type": "name"
},
{
"api_name":... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.