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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
38210137228 | from django.test import TestCase
from unittest.mock import patch
from trades.models import Currency, Trade
class TradeModelTest(TestCase):
@classmethod
def setUpTestData(cls):
cls.unique_id = 'TR1234567'
cls.sell_currency = Currency.objects.create(name='USD')
cls.buy_currency = Curre... | pgrubacc/trading_app | api/trades/tests/test_models.py | test_models.py | py | 1,052 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.test.TestCase",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "trades.models.Currency.objects.create",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "trades.models.Currency.objects",
"line_number": 12,
"usage_type": "attribute"
... |
34478795181 | #!/usr/bin/env python3
import csv
import sys
import re
import os
import glob
from typing import Dict, List, Tuple
from wisselwerking.history import Enrollment, EnrollmentCollection, read_history, rename_dept
from wisselwerking.settings import \
capacity_file, \
output_file, \
ASSIGNED_CHOICE, \
CAPACIT... | UUDigitalHumanitieslab/wisselwerking | magic.py | magic.py | py | 11,777 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sys.argv",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "typing.List",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_numbe... |
40920987365 | """Tests standard tap features using the built-in SDK tests library."""
import json
from pathlib import Path
import jsonschema
import pytest
from singer_sdk.testing import get_standard_tap_tests
from tap_atinternet.tap import TapATInternet
with open(Path(__file__).parents[2] / ".secrets/config.gn.json") as f:
S... | GendarmerieNationale/tap-atinternet | tap_atinternet/tests/test_core.py | test_core.py | py | 2,158 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pathlib.Path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 15... |
33269938730 | from django.shortcuts import render
from django.views.decorators.csrf import csrf_exempt
import json
# import datetime
from datetime import datetime
from .models import Departments,Roles
from str2bool import str2bool
from django.http import JsonResponse
import ast
from django.core.paginator import Paginator
# Create y... | jintu-thomas/Political | statusapp/views.py | views.py | py | 11,537 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "json.loads",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "ast.literal_eval",... |
4016328655 | from rest_framework.exceptions import NotAcceptable
class NumberTranslationService:
MAX_LIMIT_ERROR = 'Número fora do limite válido'
ZERO = 'zero'
CEM = 'cem'
UNITS = {
'1': 'um',
'2': 'dois',
'3': 'três',
'4': 'quatro',
'5': 'cinco',
'6': 'seis',
... | caioaraujo/numbers_in_pt | numbertranslation/services.py | services.py | py | 5,480 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "rest_framework.exceptions.NotAcceptable",
"line_number": 102,
"usage_type": "call"
}
] |
73443595520 | #!/usr/bin/python3
import sys
import math
import numpy as np
from pca import pca
from gaussian import gaussian
if len(sys.argv)!=7:
print('Usage: %s <trdata> <trlabels> <ks> <ds> <%%trper> <%%dvper>' % sys.argv[0]);
sys.exit(1);
X= np.load(sys.argv[1])['X'];
xl=np.load(sys.argv[2])['xl'];
ks=np.fromstring(sys.ar... | nsauvil/ETSINF-3 | PER/gaussian-pca-exp.py | gaussian-pca-exp.py | py | 1,221 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sys.argv",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 1... |
21648528096 | from datetime import datetime, timedelta
import shippo
from tests.helper import create_mock_international_transaction, ShippoTestCase, DUMMY_PICKUP, shippo_vcr
class PickupTests(ShippoTestCase):
request_client = shippo.http_client.RequestsClient
@shippo_vcr.use_cassette(cassette_library_dir="tests/fixtures/... | prosehair/modern-shippo-python-client | tests/test_pickup.py | test_pickup.py | py | 1,066 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "tests.helper.ShippoTestCase",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "shippo.http_client",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "tests.helper.create_mock_international_transaction",
"line_number": 12,
"usage_type": "... |
22579284283 | import os
from pydantic import BaseSettings
class Settings(BaseSettings):
"""Provisioner settings."""
EVENTING_HOST: str
CREATE_EVENT_TRIGGER_ENDPOINT: str = "event-triggers"
class Config:
"""Meta config."""
env_file = (
os.environ.get("MAVIS_CONFIG") # check if the pa... | Henry-Li-PNTL/crd-example | src/provisioner/config.py | config.py | py | 546 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "pydantic.BaseSettings",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "os.environ.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
... |
74910976958 | from typing import Mapping
import sympy
import sympy.parsing.sympy_parser
class SingularityDetectionException(Exception):
"""
Thrown in case an error occurs while detecting singularities.
"""
pass
class SingularityDetection:
r"""Singularity detection for generated propagator matrix.
Some o... | nest/ode-toolbox | odetoolbox/singularity_detection.py | singularity_detection.py | py | 5,792 | python | en | code | 14 | github-code | 97 | [
{
"api_name": "sympy.Matrix",
"line_number": 69,
"usage_type": "attribute"
},
{
"api_name": "typing.Mapping",
"line_number": 69,
"usage_type": "name"
},
{
"api_name": "sympy.flatten",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "sympy.simplify",
"... |
74159950399 | import gym
from gym import error, spaces, utils
from gym.utils import seeding
import numpy as np
import pandas as pd
import torch
class BatteryEnv(gym.Env):
def __init__(self, df, Eess=1, SOCmax=1, SOCmin=0, nu=0.9, PowStBy=0):
self.df = df
self.Eess = Eess #MWh
self.SOC = SOCmin #a percen... | dheekshitakumar/meng-thesis-work | EnergyArbitrage/battery_env.py | battery_env.py | py | 5,095 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "gym.Env",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "gym.spaces.Discrete",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "gym.spaces",
"line_nu... |
32022246829 | #!/usr/bin/python2.7
from __future__ import print_function
import Tkinter
import tkFileDialog
from collections import OrderedDict
from time import asctime
import sys
class GUIParameter(object):
def __init__(
self,
name,
widget_type,
info=None,
default=None
):
... | swillems/swath_on_histones | Skyline_transition_filter/gui.py | gui.py | py | 6,162 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sys.stderr",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "sys.stdout",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "Tkinter.Tk",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
... |
12081596983 | import numpy as np
import matplotlib.pyplot as plt
from DPendulum import Pendulum
def s1(y):
"""Transform onto s1"""
s1_y = []
for val in y:
v = val % (2*np.pi)
if v > np.pi:
v = v - 2*np.pi
s1_y.append(v)
return s1_y
def pi_jumps(y):
"""Return list of places w... | Zhuoyue-Huang/M2R_DP | DPendulum/projections_and_poincare.py | projections_and_poincare.py | py | 3,342 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.pi",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "numpy.pi",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "numpy.pi",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "numpy.pi",
"line_number"... |
28632268518 | import pickle
import datetime
import game
from sklearn.neural_network import MLPRegressor
from sklearn.model_selection import train_test_split
import matplotlib.pyplot as plt
#
# rate a board with scikit-learn.neural_net
#
#
class HitBoardEvaluator:
def __init__(self, color):
if color == game.Game.white:
... | SprachRolf/AlphaGammonPy | board_evaluator.py | board_evaluator.py | py | 4,129 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "game.Game",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "pickle.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number... |
41915165681 | """ Implementation of Ghostnet """
from collections import namedtuple
import tensorflow as tf
# from GhostNetModule import ConvBlock
from models.decmodel_components.GhostNetModule import GhostModule as MyConv
from models.decmodel_components.GhostNetModule import MyDepthConv as DepthConv
from dec.dec_config import... | YUHAN666/TensorFlow_OCR | models/decmodel_components/ghostnet.py | ghostnet.py | py | 8,116 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "tensorflow.contrib.layers.variance_scaling_initializer",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tensorflow.contrib",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "collections.namedtuple",
"line_number": 13,
"usage_type": ... |
18800073731 | from flask import Flask, render_template, request
from flask_restful import Resource, Api, reqparse
import pandas as pd
import requests as req
import random
import string
app = Flask(__name__)
api = Api(app)
@app.route('/login', methods=['GET', 'POST'])
def login_required():
if request.method == 'PO... | kabilasudhannc/SimpleApiServer | main.py | main.py | py | 4,914 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask_restful.Api",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "flask.request",... |
31754866217 | from GPano import *
import GPano
import csv,itertools
import pandas as pd
import multiprocessing as mp
import database_ops as db_ops
def downloadImg(lon,lat,saved_path):
gpano = GPano.GPano()
degrees = [90,270]
# saved_path = "J:\Research\Trees\west_trees"
data = gpano.getPanoJsonfrmLonat(lon, lat)
... | gladcolor/StreetView | TreeShooting.py | TreeShooting.py | py | 3,718 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "GPano.GPano",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Pool",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Mana... |
73338564800 | from models.transactions import Transaction
from models.category import Category
import pdb
from models.merchant import Merchant
from models.category import Category
from models.profile import Profile
import repositories.merchant_repository as merchant_repository
import repositories.category_repository as category_rep... | CodeCharlieCode/Manage-Your-Monies | console.py | console.py | py | 1,573 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "repositories.merchant_repository.delete_all",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "repositories.merchant_repository",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "repositories.category_repository.delete_all",
"line_number": 13,... |
26320264594 | from math import pi, sin, cos
from opentrons.util.linal import solve, add_z, apply_transform, solve_attitude
from numpy.linalg import inv
import numpy as np
def test_solve() -> None:
theta = pi / 3.0 # 60 deg
scale = 2.0
expected = [
(cos(0), sin(0)),
(cos(pi / 2), sin(pi / 2)),
... | Opentrons/opentrons | api/tests/opentrons/util/test_linal.py | test_linal.py | py | 1,694 | python | en | code | 363 | github-code | 97 | [
{
"api_name": "math.pi",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "math.cos",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "math.sin",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "math.cos",
"line_number": 13,
"usage... |
7696254070 | #!/usr/bin/env python3
"""Discord app."""
import asyncio
import curses
import os
import subprocess
import discord
import requests
import theme as thm
import ui as UI
class Client(discord.Client):
"""Wrapper around discord.Client class."""
def __init__(self, callback, theme):
super(Client, self).__i... | Zeroji/DiscordZ | discordz.py | discordz.py | py | 5,813 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "discord.Client",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "asyncio.get_event_loop",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "subprocess.Popen",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "curses.in... |
73973345917 | # -*- coding: utf-8 -*-
"""
Created on Thu Dec 08 01:44:04 2016
@author: Ben
"""
try:
from mpi4py import MPI
comm = MPI.COMM_WORLD
nprocs = comm.size
myrank = comm.rank
except ImportError:
print('MPI not found')
myrank = 0
nprocs = 1
import src
import pdb
import num... | bennosski/keldysh | test/G0_test.py | G0_test.py | py | 7,541 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "mpi4py.MPI.COMM_WORLD",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "mpi4py.MPI",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "time.time",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.count_nonzero",... |
30078885926 | import scipy.io, os, random, sys
import numpy as np
import pandas as pd
import torch
import torchvision.datasets
import torchvision.transforms as transforms
import torch.nn.functional as F
from skimage.transform import resize
class Data_Loader:
def __init__(self):
return
def load_dataset(self, dat... | gwyong/umich | GEOTADAM/data_loader.py | data_loader.py | py | 4,524 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "numpy.array",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "os.mkdir",
"line_number":... |
13197809704 | from django import forms
from yt_app.models import Tournament, Place, Game, Team, Match
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
class AddTournamentForm(forms.Form):
name = forms.CharField()
description = forms.CharField()
place = forms.ModelChoiceFiel... | DawidHennig/your-tournament | project/yt_app/forms.py | forms.py | py | 1,860 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.forms.Form",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.forms.CharField",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.forms"... |
13537524478 | import logging
from ssl import SSLError
import requests
from models.company_analytic_response import CompanyAnalyticResponse
from models.enums.analytic_result_type_enum import AnalyticResultType
from agents.validators.site.base.validator_site_simple_base import ValidatorSiteSimpleBase
class ValidatorSSL(ValidatorSi... | AntonioMellies/magneton | agents/validators/site/validator_ssl.py | validator_ssl.py | py | 1,293 | python | en | code | 9 | github-code | 97 | [
{
"api_name": "agents.validators.site.base.validator_site_simple_base.ValidatorSiteSimpleBase",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "models.company_analytic_response.CompanyAnalyticResponse",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "logging.i... |
8025706400 | import itertools
import numpy as np
import mxnet as mx
from mxnet.test_utils import *
curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
sys.path.insert(0, os.path.join(curr_path, '../unittest'))
from common import with_seed
# * GroupAdaGrad
class PyGroupAdaGrad(mx.optimizer.Optimizer):
"... | mlcommons/training_results_v0.7 | Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/tests/python/unittest/test_contrib_optimizer.py | test_contrib_optimizer.py | py | 9,041 | python | en | code | 58 | github-code | 97 | [
{
"api_name": "mxnet.optimizer",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "mxnet.nd.zeros",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "mxnet.nd",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "mxnet.nd.clip",
... |
72529857918 | # re package to use regular expressions
import re
# pypdf to extract data from pdf
import pypdf
# tempfile to create temporary files
import tempfile
incidents = []
fp = tempfile.TemporaryFile()
# extractincidents function to extract incidents
def extractincidents(data):
#print("***Extraction Started***")
fp.write(d... | moraakhila/cs5293sp23-project0 | project0/extractdata.py | extractdata.py | py | 2,499 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "tempfile.TemporaryFile",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pypdf.PdfReader",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 55,
"usage_type": "call"
}
] |
454147267 | # This part for library
from bs4 import BeautifulSoup
import requests
import re
import csv
from itertools import zip_longest
from selenium import webdriver
import urllib.request
import base64
import itertools
from automobilewebscrapper.models import Marque, VoitureNeuf, VendeurPro, VoitureOccasion, Concessionnaires
p... | Hajer-Jaziri/BackEnd_Server | api/BackGroundAutoMobile.py | BackGroundAutoMobile.py | py | 13,531 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"... |
43087580659 | import openai
import json
from sqlalchemy import *
# Common pricol
from conversation import conversation_Victoria
from config import *
openai.api_key = openai_api
chat_json = json.dumps(conversation_Victoria, ensure_ascii=False)
query_exec1 = f"""
create or replace procedure update_chat_info(in p_username varchar, in... | Mixaled/TG_Game | test/test.py | test.py | py | 2,046 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "openai.api_key",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "json.dumps",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "conversation.conversation_Victoria",
"line_number": 10,
"usage_type": "argument"
},
{
"api_name": "... |
44253937801 | """
Title : Keywords Generator
About : Simple program to find how much times a word repeat a webpage.
Author : Satheesh Kumar D
Date : 07-05-2017
Organisation : LICO TECH
"""
import requests
from bs4 import BeautifulSoup
import operator
def start(url):
word_list = []
er... | satheesh1997/py-wordfrequencychecker | frequency.py | frequency.py | py | 1,303 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "operator.itemgetter",
"line_number": 49,
"usage_type": "call"
}
] |
35577896855 | def search_website():
from selenium import webdriver
from selenium.webdriver.common.by import By
import time
driver = webdriver.Chrome()
driver.get("https://www.wikipedia.org/")
element = driver.find_element(By.ID, 'searchInput')
element.send_keys("Selenium Software")
element.submit()... | priyankt68/selenium-python-recipes | search_wikipedia.py | search_wikipedia.py | py | 408 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.common.by.By.ID",
"line_number": 10,
"usage_type": "attribute"
},
{
... |
40919462141 | """Add expected file source and handling options.
Revision ID: 29c521f4449c
Revises: 2ad667bb4592
Create Date: 2013-04-03 22:13:32.034983
"""
# revision identifiers, used by Alembic.
revision = '29c521f4449c'
down_revision = '2ad667bb4592'
from alembic import op
import sqlalchemy as sa
output_type_type = sa.Enum(u... | ucsb-cs/submit | submit/migrations/versions/29c521f4449c_add_expected_file_so.py | 29c521f4449c_add_expected_file_so.py | py | 1,663 | python | en | code | 9 | github-code | 97 | [
{
"api_name": "sqlalchemy.Enum",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Enum",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "alembic.op.get_bind",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "alembic.op",
... |
36149373992 | from collections import deque
from collections import defaultdict
def solution(tickets):
def init_graph():
graph = defaultdict(list)
for key, value in tickets:
graph[key].append(value)
return graph
def dfs():
q = deque(['ICN'])
path = [] # 가려고 하는 경로... | cyan9212/Programmers | DFS&BFS/여행경로.py | 여행경로.py | py | 811 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "collections.defaultdict",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 13,
"usage_type": "call"
}
] |
5308354523 | import functools
import requests
from flask import Flask, request, Blueprint
from faker import Faker
import random
import string
import csv
import pandas as pd
hm1 = Blueprint('main', __name__, url_prefix='/main')
@hm1.route("/requirements/")
def file():
res = ''
with open('/Users/stas/PycharmProjects/homewo... | StasFQ/homework_2 | flaskr/bp1.py | bp1.py | py | 1,461 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Blueprint",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "faker.Faker",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "flask.request.args.get",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "flask.request.args... |
70250733118 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
unittests for iams.utils.arangodb
"""
# pylint: disable=missing-function-docstring,missing-class-docstring,protected-access
import unittest
from random import choices
from random import shuffle
from iams.utils.arangodb import Arango
from iams.proto.framework_pb2 imp... | glomium/industrial-ams | iams/tests/tests_utils_arangodb.py | tests_utils_arangodb.py | py | 6,185 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "arango.ArangoClient",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "random.choices",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "iams.proto.framework_pb2.Node",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "iams... |
23466206830 | from minargon.hardwaredb import HWSelector, hardwaredb_route
from werkzeug.exceptions import HTTPException
import itertools
from . import validate_columns, wherestr, to_column, to_display
db_name = "icarus_crt_hw"
feb_table = "febs"
feb_columns = ["feb_id", "mac_address"]
orm_table = "orms"
orm_columns = ["orms_id", ... | SBNSoftware/sbndaq-minargon | minargon/hardwaredb/icarus/crt.py | crt.py | py | 2,734 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "werkzeug.exceptions.HTTPException",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "minargon.hardwaredb.HWSelector",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "minargon.hardwaredb.hardwaredb_route",
"line_number": 21,
"usage_type": ... |
6842972616 | import pyspark
from pyspark.sql import SparkSession
from pyspark.sql.functions import explode, col, struct, lit, array
from pyspark.sql.types import *
spark = SparkSession.builder \
.master("yarn") \
.appName("BIKE_ROAD") \
.getOrCreate()
# 자전거도로 코드명 리스트
list = [ '19000002', '19000005', '19000006', '19000... | hanna-joo/PJT_SeoulBike | 02_data_process/to_mongo/BIKE_ROAD.py | BIKE_ROAD.py | py | 1,965 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pyspark.sql.SparkSession.builder.master",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pyspark.sql.SparkSession",
"line_number": 6,
"usage_type": "n... |
15329094061 | from django.urls import path
from rest_framework.urlpatterns import format_suffix_patterns
from chat import views
urlpatterns = [
path('', views.MessageView.as_view()),
path('<int:pk>/', views.SingleMessage.as_view()),
path(r'ParticipantView/', views.ParticipantView.as_view()),
path(r'ParticipantView/<... | Omutanyi/PataShamba | patashambaBackend/chat/urls.py | urls.py | py | 648 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "chat.views.MessageView.as_view",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "chat.views.MessageView",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name... |
36423468814 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
The tornado.testing Async stuff packaged as fixtures for use with py.test
Originally from https://gist.github.com/robcowie/7843633; modified for the
instaseis server.
"""
from collections import OrderedDict
import inspect
import os
import pytest
import re
import respon... | martapien/instaseis_hybrid | instaseis/tests/tornado_testing_fixtures.py | tornado_testing_fixtures.py | py | 12,473 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "os.path.join",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line... |
43440799137 | import pandas as pd
from sklearn import svm
# Importing dataset
test_raw = pd.read_csv("dataset_final.csv")
print(test_raw.head())
# Manipulating the dataset
test_raw['Identification'] = test_raw['Identification'].astype('category')
test_raw['Identification'] = test_raw['Identification'].cat.codes
test_raw['Source'... | shantanusavant/network-covert-channels | machine_learning_svm.py | machine_learning_svm.py | py | 2,429 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sklearn.svm.SVC",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "sklearn.svm",
"line_number": 54,
"usage_type": "name"
}
] |
34873350969 | import numpy as np
import scipy
from scipy import signal
import matplotlib.pyplot as plt
from PIL import Image
def energy_image(image, mask, mean=None, std=None):
"""
This function computes the energy image using the laplacian kernel.
:param std: std width in pixels of the path
:param mean: Mean colum... | MikhailKulyabin/CV-projects | Seam Carving/seam_carving.py | seam_carving.py | py | 12,812 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "numpy.round",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.ceil",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.round",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.ceil",
"line_number": 22... |
20419921790 | import logging
import pytest
from tellus.sources import (
Sourcer,
Source,
DuplicateSourceException,
STATUS_COMPLETED,
STATUS_NOT_RUN,
STATUS_FAILED,
)
from tellus.tell import InvalidAliasException
from tellus.tellus_utils import now_string
from test.tells_test import create_test_teller
SRC_T... | aquanauts/tellus | test/sources_test.py | sources_test.py | py | 5,468 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "tellus.sources.Source",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "tellus.tellus_utils.now_string",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "tes... |
12794955393 | import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
#1.畫出 cos 圖檔,並儲存
x = np.arange(0,360)
y = np.cos(x*np.pi/180)
# plt.plot(x,y)
# plt.savefig("filename.png",dpi = 300 , format = "png")
#2.給定散點圖顏色
n = 1024
X = np.random.normal(0,1,n)
Y = np.random.normal(0,1,n)
T = np.arctan2(Y,X)
plt.scatter(X,Y... | jacky87410/python-ai | D21.py | D21.py | py | 420 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.arange",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.normal",
"line_num... |
32257654117 | from selenium.webdriver.common.by import By
# Talk with us button
TALK_WITH_US_BTN = (By.XPATH,"//nav/div/div/button")
# First name input field
FIRST_NAME_INPUT = (By.XPATH,"//form/div[1]/div/div[1]/input")
# Last name input field
LAST_NAME_INPUT = (By.XPATH, "//form/div[2]/div/div[1]/input")
# Email input field
EM... | maurolaurenzi/proper-challenge | second_case/pages/locators.py | locators.py | py | 1,001 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "selenium.webdriver.common.by.By.XPATH",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.common.by.By",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.common.by.By.XPATH",
"line_number": 7,
"usage... |
26847084955 | from peewee import Model, CharField, SqliteDatabase
# Define SQLite database
db = SqliteDatabase('users.db')
# Define User model
class User(Model):
first_name = CharField()
last_name = CharField()
class Meta:
database = db
# Define custom logic to generate initials
def generate_initials(... | benjamincham/database_interactions | ActiveRecord_example.py | ActiveRecord_example.py | py | 699 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "peewee.SqliteDatabase",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "peewee.Model",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "peewee.CharField",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "peewee.CharField",
... |
30028338084 | import pygame
son = {
"volume": {
"volume": 0.5,
"volume_up": pygame.K_KP_PLUS,
"volume_down": pygame.K_KP_MINUS,
},
"background": {
"opening_theme": "son/background/opening_theme.wav",
"character_select": "son/background/character_select.wav",
"ending_theme": "son/background/ending_theme.wav",
},
... | SebastienDS/Street-Fighter | son.py | son.py | py | 754 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pygame.K_KP_PLUS",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pygame.K_KP_MINUS",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pygame.mixer.music.set_volume",
"line_number": 34,
"usage_type": "call"
},
{
"api_name... |
29786711576 | import os
import json
from flask import Flask, render_template, url_for, flash, \
redirect, session, request
from forms import RegistrationForm, LoginForm, PostForm
from flask_pymongo import PyMongo, pymongo
from bson.objectid import ObjectId
import math
if os.path.exists('env.py'):
import env
# Installation ... | fudge88/MS3project | app.py | app.py | py | 11,767 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.path.exists",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "flask.Flask",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_numb... |
23553575423 | """!@brief Lab 2, Problem 3 of the 2020/2021 Reinforcement Learning lecture at KTH.
@file Problem 3 multiprocessing training file.
@author Martin Schuck, Damian Valle
@date 18.12.2020
"""
from multiprocessing import Process, TimeoutError, Queue, Manager
import queue
import time
import os
import sys
import... | DamianValle/RL2020 | lab2/problem3/multi_training.py | multi_training.py | py | 9,251 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "numpy.copy",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.convolve",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.zeros_like",
"line_num... |
32433386466 | import glob
from PIL import Image
from chainer.dataset import DatasetMixin
import numpy as np
from . import image
from . import patches
from . import permutations
class PatchDataset(DatasetMixin):
def __init__(
self,
path_glob,
mean,
over_sample=1,
drop_patch=False,
... | ejlb/jigsaw-cnn | jigsaw/dataset.py | dataset.py | py | 1,872 | python | en | code | 9 | github-code | 97 | [
{
"api_name": "chainer.dataset.DatasetMixin",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "glob.glob",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
... |
30112298371 | from copy import deepcopy
from unittest.mock import patch
from django.core.exceptions import ValidationError
from django.db.transaction import atomic
from django.test import TestCase
from django.test.testcases import TransactionTestCase
from netjsonconfig import OpenWrt
from swapper import load_model
from openwisp_us... | openwisp/openwisp-controller | openwisp_controller/config/tests/test_config.py | test_config.py | py | 34,701 | python | en | code | 505 | github-code | 97 | [
{
"api_name": "swapper.load_model",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "swapper.load_model",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "swapper.load_model",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "swapper.load... |
2784367872 | from kivy.properties import ObjectProperty
from kivymd.uix.screen import MDScreen
from DbOperator import DbOperator
from ListItemWithCheckbox import ListItemWithCheckbox
from RightCheckbox import RightCheckbox
from Notification import Notification
basket = []
class CustomerOrderBasket(MDScreen):
container = Obj... | Joseph-Lila/CourseWork | CustomerOrderBasket.py | CustomerOrderBasket.py | py | 1,853 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "kivymd.uix.screen.MDScreen",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "kivy.properties.ObjectProperty",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "Notification.Notification",
"line_number": 15,
"usage_type": "call"
},
{
... |
20876917741 | from pytube import YouTube
import moviepy.editor
import requests
from bs4 import BeautifulSoup
import os
import time
url=input("Enter the url of youtube video: ")
yt=YouTube(url)
youtube=yt.streams.first() #filter(only_audio=True)
#print(youtube[2])
print("\n--Warning--: The folder should be empty or ... | Bhavyashah11/AudioBook-Download | audiobook.py | audiobook.py | py | 956 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pytube.YouTube",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.rename",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "moviepy.editor.editor.VideoFileCli... |
4554627202 | import requests, json
import config
import websocket
import time
BASE_URL = 'https://paper-api.alpaca.markets'
ACCOUNT_URL = '{}/v2/account'.format(BASE_URL)
ORDER_URL = '{}/v2/orders'.format(BASE_URL)
CLOCK_URL = '{}/v2/clock'.format(BASE_URL)
def last_quote():
last_quote_url = "{}/symbol=MSFT".format(QUOTE_U... | mukhul/bot | main.py | main.py | py | 1,975 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "config.HEADERS",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "requests.post",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "config.HEADERS",
"... |
7179833252 | import Celeb.data_loader
from models.ECNet import EmbeddingCapsNet
import argparse
import torch
import os
import ProcessingTools as pt
import json
import Celeb.evaluate
import random
import ProcessingTools.torch_tools as tt
import numpy as np
import cv2
def visualize_mAP(args):
with open(args.configs, 'r') as f:
... | vcl-seoultech/SirNet | evaluate/visualize_mAP.py | visualize_mAP.py | py | 4,413 | python | en | code | 12 | github-code | 97 | [
{
"api_name": "json.load",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "ProcessingTools.create_folder",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "models.ECNet.EmbeddingCapsNet",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": ... |
9602479451 | import os
import matplotlib.pylab as plt
def calc_number_of_files_per_category(path):
dirs = [dict(path=os.path.join(path, d)) for d in os.listdir(path) if
(not d.startswith('.')) and os.path.isdir(os.path.join(path, d))]
# min_number_of_files = 10000
for dir_obj in dirs:
amount_of_fil... | lahavmaayan/on-the-face | src/hist_of_data.py | hist_of_data.py | py | 1,323 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.path.join",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": ... |
6180067816 | import pygame
import os
import Objects
from ScreenEngine import GameSurface, ProgressBar, InfoWindow, HelpWindow, ScreenHandle, MiniMap
import Logic
import Service
from Settings import Settings
SCREEN_DIM = (800, 600)
KEYBOARD_CONTROL = True
if not KEYBOARD_CONTROL:
import numpy as np
class Game:
def __init... | CrazyEzh/KnightInDungeon | Main.py | Main.py | py | 5,496 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pygame.init",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "pygame.displa... |
41945573439 | from time import time
from typing import Optional
import torch
import torch.distributed as dist
from chatgpt.experience_maker import Experience
from .base import Callback
def get_world_size() -> int:
if dist.is_initialized():
return dist.get_world_size()
return 1
def print_rank_0(*args, **kwargs) ... | airobotlab/KoChatGPT | colossalai_ChatGPT_230319/chatgpt/trainer/callbacks/performance_evaluator.py | performance_evaluator.py | py | 5,407 | python | en | code | 280 | github-code | 97 | [
{
"api_name": "torch.distributed.is_initialized",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.distributed",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "torch.distributed.get_world_size",
"line_number": 13,
"usage_type": "call"
},
{
... |
14743672011 | from modules.paths import PathManager
from modules.dataframe import DataframeManager
from modules.workbook import WorkbookManager
from modules.logics import get_cleared_channel
import pandas as pd
import numpy as np
def main() -> None:
file_path = PathManager.open_file_dialog_solo()
if not file_... | garazaliyaa/BMP-Automation-Hub | national.py | national.py | py | 12,355 | python | ru | code | null | github-code | 97 | [
{
"api_name": "modules.paths.PathManager.open_file_dialog_solo",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "modules.paths.PathManager",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "modules.dataframe.DataframeManager.import_dataframe",
"line_number"... |
41028694967 | from django.db import models
from django.contrib.auth.models import AbstractUser
class User(AbstractUser):
first_name = models.CharField(max_length=25)
last_name = models.CharField(max_length=25)
email = models.EmailField(unique=True)
class Client(models.Model):
first_name = models.CharField(max_len... | Kraynn/P8-EpicEvents | crm/models.py | models.py | py | 1,674 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.contrib.auth.models.AbstractUser",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.db.models",
"line_number": 6,
"usage_type": "name"
},
{
"... |
2971632134 | # noinspection PyPackageRequirements
from flask import Flask, render_template, request
from yoti_python_sdk import Client
from settings import (
YOTI_APPLICATION_ID,
YOTI_CLIENT_SDK_ID,
YOTI_SCENARIO_ID,
YOTI_KEY_FILE_PATH,
)
app = Flask(__name__)
@app.route('/')
def index():
return render_tem... | arthur-fox/Voti | server/app.py | app.py | py | 865 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "settings.YOTI_APPLICATION_ID",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "settin... |
73327809919 | import pandas as pd
from sqlalchemy import create_engine
import pandas.io.sql as psql
pd.set_option('display.width', 640)
#### Create common variables ####
engine = create_engine('postgresql://postgres:postgres@localhost:5432/msc')
gsi_legend = {'low coverage': (0, 0.188), 'medium coverage': (0.1881, 0.277), 'high cove... | duccioa/London_density | 03_Python/0026_classification.py | 0026_classification.py | py | 2,621 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pandas.set_option",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.create_engine",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.io.sql.execute",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas... |
29247302046 | from turtle import title
import Facade.Devices.cpu as cpu
import os
import time
import rich
import emoji
from Facade.Devices.RAM import RAM
from Facade.Devices.OS import OS
from rich.console import Console
from uniplot import plot
console = Console()
class Facade:
def __init__(self, mode):
if len(mode) > ... | PinkR1ver/Jude-python | Facade/facade.py | facade.py | py | 4,432 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "rich.console.Console",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "emoji.emojize",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "Facade.Devices.cpu.CPU",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "Facade.Devi... |
14939969422 | # __author__ = 'benji'
from __future__ import print_function
import numpy as np
# fix random seed for reproducibility
seed = 7
np.random.seed(seed)
import pandas as pd
import matplotlib.pyplot as plt
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten... | benjisympa/challenge_sf | ex3.py | ex3.py | py | 3,866 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.random.seed",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "keras.datasets.mnist.load_data",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "kera... |
13429383785 | import argparse
import os
from jenesis.config import Config
def run(args: argparse.Namespace):
project_path = os.getcwd()
# check that we are actually running the command from the project root
if not os.path.exists(os.path.join(project_path, "jenesis.toml")):
# pylint: disable=all
print... | fetchai/jenesis | src/jenesis/cmd/add/profile.py | profile.py | py | 754 | python | en | code | 6 | github-code | 97 | [
{
"api_name": "argparse.Namespace",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_nu... |
25083281539 | #!/usr/bin/python3
import json
import requests
import sys
def export_tasks_to_json(user_id):
"""
Export tasks for a given user to a JSON file.
Args:
user_id (str): The user's ID for whom tasks will be exported.
Returns:
None
"""
base_url = "https://jsonplaceholder.typicode.... | azizios011/holbertonschool-back-end | api/2-export_to_JSON.py | 2-export_to_JSON.py | py | 1,440 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 52,... |
8187423779 | # RUN AS: python processMouseData-PV.py [FILENAME]
# NOTE: Things were done to make this data less messy via this script
import matplotlib.path as mplPath
import numpy as np
import json
import dateutil.parser
import time
import sys
import os.path
import random
# Bounding box for info x,y,width,height
i... | arpachuilo/cpv-visualizations | data/processMouseData-CPV.py | processMouseData-CPV.py | py | 4,871 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "matplotlib.path.Path",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "matplotlib.path",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line... |
44296606543 | import cv2
import numpy as np
from . import gridlines
def find_in_check(im, clf):
# crop bottom right of image where signature lies, according to our prior knowledge
print('\tlooking at bottom-right of the check...')
h, w = im.shape
im = im[int(h / 2):int(h), int(w / 2):int(w)]
# Thresholding to... | saifkhichi96/authentica-desktop | src/core/segment.py | segment.py | py | 4,563 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "cv2.adaptiveThreshold",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.ADAPTIVE_THRESH_GAUSSIAN_C",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "cv2.THRESH_BINARY_INV",
"line_number": 15,
"usage_type": "attribute"
},
{
... |
6377320089 | import datetime
from dateutil.relativedelta import relativedelta
from datetime import date,datetime, timedelta
# today = date.today()
# first = today.replace(day=1)
# last_month = first -relativedelta(months=6)
# print(last_month)
# today = date.today()
# first = today.replace(day=1)
# last_month = first -relativedel... | saijusunny/Cash_management-2-3 | tester.py | tester.py | py | 1,149 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "datetime.date.today",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "dateutil.relativedelta.relativedelta",
"line_number": 29,
"usage_type": "call"
},
{
"api_name":... |
74207200958 | import os
from flask import Flask, jsonify, render_template, request
from flask_socketio import SocketIO, emit
import json
app = Flask(__name__)
app.config["SECRET_KEY"] = os.getenv("SECRET_KEY")
socketio = SocketIO(app)
socketio.init_app(app, cors_allowed_origins="*")
list_of_chats = []
list_of_rooms = []
rooms = [... | Beccall/Chat-Website | application.py | application.py | py | 2,191 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask_socketio.SocketIO",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
... |
69885065918 | #!/usr/bin/python
import sys
import math
from bitarray import bitarray
error = 0.01
a = bitarray()
def bloom_filter(stream, n):
array_size = int(math.ceil(-int(n)*math.log(error)/float(pow(math.log(2),2))))
hash_num = int(round(array_size*math.log(2)/float(n)))
res = []
a = bitarray(array_size)
... | yangdiangzb/exc | exc2/assign2/task7/mapper.py | mapper.py | py | 1,182 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "bitarray.bitarray",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "math.ceil",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "math.log",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "math.log",
"line_number": 13,... |
6242279400 | from bs4 import BeautifulSoup
import pandas as pd
import matplotlib.pyplot as plt
import requests
all_data = []
for page in range(1,5):
url = f'https://www.rottentomatoes.com/browse/movies_in_theaters/?page={page}'
webpage = requests.get(url)
soup = BeautifulSoup(webpage.content, 'html.parser')
... | namangathani/KJSCE_Internship | rotten_scrape.py | rotten_scrape.py | py | 2,075 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 10,
"usage_type": "call"
}
] |
7113737176 | import joblib
def lambda_handler(event, context):
# Load the model from disk
model = joblib.load('/var/task/model.pkl')
# Run the model on the input data
data = event['data'] # or however you want to retrieve the input data
output = model.predict(data)
# Return the output
return {... | ciaranSHZhou/Rust-and-Cloud-Computing | Project4-Cloud-based_Big_Data_Systems_Project/predict.py | predict.py | py | 429 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "joblib.load",
"line_number": 5,
"usage_type": "call"
}
] |
1659243090 | import scrapy
from pyquery import PyQuery as pq
import json
from ..items import HongheItem
import re
import requests
class HhSpider(scrapy.Spider):
name = 'hh'
def start_requests(self):
url = 'http://tuku.hh.cn/list1/15-16'
yield scrapy.Request(url, callback=self.get_id_one_class)
def get... | jy28smy/spider | 红河网图片/honghe/spiders/hh.py | hh.py | py | 2,560 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "scrapy.Spider",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "scrapy.Request",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "items.HongheItem",
"l... |
35447682031 | import pprint
from typing import Dict
from pydantic import BaseModel, Field
from github import GithubException, BadCredentialsException, UnknownObjectException
class InputSchema(BaseModel):
owner: str = Field(
description='Username of the GitHub user. Eg: "johnwick"',
title='Owner'
)
repos... | unskript/Awesome-CloudOps-Automation | Github/legos/github_get_pull_request/github_get_pull_request.py | github_get_pull_request.py | py | 2,199 | python | en | code | 258 | github-code | 97 | [
{
"api_name": "pydantic.BaseModel",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "pydantic.Field",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pydantic.Field",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pydantic.Field",
"... |
31303000051 | import warnings; warnings.filterwarnings("ignore")
import time
start_time = time.time()
import pandas as pd
import os
from sklearn import pipeline, grid_search
from sklearn.ensemble import RandomForestRegressor
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.pipeline import FeatureUnion
from skl... | Misfyre/Competitions | Home_Depot/First_Attempt/RF_Model.py | RF_Model.py | py | 3,860 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 1,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.mean_squared_error",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sk... |
37217411509 | import matplotlib.pyplot as plt
import torch
import torch.nn as nn
from utils import *
if torch.cuda.is_available():
device = torch.device('cuda')
else:
device = torch.device('cpu')
print('Using PyTorch version:', torch.__version__, ' Device:', device)
from LSTM_rewrite import mylstm
hidden_size=128
rnn=my... | KIDSSCC/DeepLearning | RNN/train.py | train.py | py | 3,407 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.device",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.device",
... |
73532137279 |
from pprint import pprint
names = [
['first', 'First'],
['Second', 'second'],
['Tree', 'tree', 'treeee'],
]
numbers = [2, 22, 444,55,666]
import itertools
# print(list(ite1rtools.product(*names)))
# print(list(itertools.combinations([names[0][0], names[1][0], names[2][0]], 3)))
def generate():
f... | fortunto2/blockchain_com_password | generat.py | generat.py | py | 1,196 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "itertools.permutations",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "pprint.pprint",
"line_number": 45,
"usage_type": "call"
}
] |
70767310399 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cmdb', '0005_server_productname'),
]
operations = [
migrations.AddField(
model_name='server',
name='... | zhaobin022/oms | cmdb/migrations/0006_server_manufacturer.py | 0006_server_manufacturer.py | py | 455 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AddField",
"line_number": 14,
"usage_type": "call"
},
{
... |
11252197266 | # -*- coding: utf-8 -*-
import pygame
def main():
pygame.init()#初始化pygame,为使用硬件做准备
screen = pygame.display.set_mode([640,480])#相当于生成画布,像素点原点在左上角,右向0-640为x轴,下向0-480为y轴
running = True
while running:
screen.fill([255,255,255]) #设置填充颜色,三个数字分别代表红、绿、蓝色分量 0-255,都是255——白色
pygame.draw.circle(screen,[255,0,0],[100,100],... | guoylyy/uband-python-s2 | homeworks/A10119/homework2/pygame1.py | pygame1.py | py | 1,204 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "pygame.init",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pygame.draw.circ... |
27572811935 | from django.urls import path
from .views import RegisterView, UserView # , LogoutView, login_view#user,
from rest_framework_simplejwt import views as jwt_viwes
app_name = 'accounts'
urlpatterns = [
# with simple jwt auth
path('api/login/', jwt_viwes.TokenObtainPairView.as_view(), name='login'),
path('api... | MohamedElsmahy/Bit-Task | accounts/urls.py | urls.py | py | 685 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "rest_framework_simplejwt.views.TokenObtainPairView.as_view",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "rest_framework_simplejwt.views.TokenObtainPairView",
"line_number":... |
29190085710 | import discord
import os
import json
from discord.ext import commands, tasks
from discord_components import DiscordComponents, ComponentsBot, Button, component, interaction
intents = discord.Intents.default()
intents.typing = True
intents.presences = True
intents.members = True
client = ComponentsBot(command_prefix =... | NastyHub/middleman-bot | mm.py | mm.py | py | 27,961 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "discord.Intents.default",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "discord.Intents",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "discord_components.ComponentsBot",
"line_number": 12,
"usage_type": "call"
},
{
"api_n... |
32101071900 | ##########################################################################################
# PLC CONNECTION WITH SNAP 7 #
##########################################################################################
# import libraries
import snap7
from sna... | brunopdoliveira/PLCs7_Snap7 | PLC_Connection_Snap7.py | PLC_Connection_Snap7.py | py | 1,353 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "snap7.client.Client",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "snap7.client",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "snap7.util.get_real",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "snap7.util"... |
40196750679 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django_markdown.models
class Migration(migrations.Migration):
dependencies = [
('blog', '0003_auto_20170711_1514'),
]
operations = [
migrations.CreateModel(
name='... | MiopeCiclope/blog | blog/migrations/0004_mymodel.py | 0004_mymodel.py | py | 567 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.CreateModel",
"line_number": 15,
"usage_type": "call"
},
... |
31471407460 | import time
from datetime import datetime
import threading
import requests
from dotenv.main import load_dotenv
import os
import argparse
parser=argparse.ArgumentParser()
parser.add_argument("-p", "--path", help="Log file path to monitor.", required=True)
parser.add_argument("-mt", "--max_time", help="Max time in sec... | edwinnm/log_analyzer | main.py | main.py | py | 1,912 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "dotenv.main.load_dotenv",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "datetime.d... |
4460988383 | from rouge import Rouge as R
from prettytable import PrettyTable
class Rouge:
def __init__(self, evaluated_sentences, reference_sentences):
rouge = R()
eval_sents = None
ref_sents = None
if type(evaluated_sentences) is list:
eval_sents = ' '.join(evaluated_sentences)
... | mikelkl/news_summarization | newssum/evaluation/rouge.py | rouge.py | py | 1,893 | python | en | code | 13 | github-code | 97 | [
{
"api_name": "rouge.Rouge",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "rouge.get_scores",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "prettytable.PrettyTable",
"line_number": 61,
"usage_type": "call"
}
] |
24110281642 | from datetime import datetime as dt
import pandas as pd
from contextlib import contextmanager
import requests as re
from bs4 import BeautifulSoup
import time
from pathlib import Path
@contextmanager
def nested_break():
'''
Custom exception to break out of nested loops.
'''
class NestedBreakException(E... | harplife/TIL | Data Science/USD_KRW_Exchange_Crawl.py | USD_KRW_Exchange_Crawl.py | py | 3,892 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "contextlib.contextmanager",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "pandas.to_da... |
33448119028 | from django.urls import path
from .views import (
home,
single_product,
product_info_2,
product_info,
blog,
about_us,
wishlist,
contact,
shoppingcart,
posts,
delete,
update,
delete_wishlist,
user_profile,
user_edit_page,
checkout
)
urlpatterns = [
pat... | jamshid2322/Online-Shop | apps/products/urls.py | urls.py | py | 1,207 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.urls.path",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "views.home",
"line_number": 22,
"usage_type": "argument"
},
{
"api_name": "django.urls.path",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "views.single_product... |
2918241101 | import os
import codecs
import six
import numpy as np
# pylint: disable=no-member
def load_data_numpy(input_dir, prefix):
train_data = np.load(
os.path.join(input_dir, prefix + "train.npy"),
encoding="latin1",
allow_pickle=True,
).tolist()
dev_data = np.load(
os.path.join(... | asyml/texar | examples/transformer/utils/data_utils.py | data_utils.py | py | 3,413 | python | en | code | 2,369 | github-code | 97 | [
{
"api_name": "numpy.load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "numpy.load",
"line_number": ... |
70974750400 | from __future__ import unicode_literals
from jsonfield import JSONField
import pytz
from django.db import models
from django.utils import timezone
from django.utils.encoding import python_2_unicode_compatible
from health_monitor import utils
@python_2_unicode_compatible
class Health(models.Model):
uid = models.... | gracenote/django-health-monitor | health_monitor/models.py | models.py | py | 9,601 | python | en | code | 8 | github-code | 97 | [
{
"api_name": "django.db.models.Model",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "django.db.models.IntegerField",
"line_number": 14,
"usage_type": "call"
},
{
"api_na... |
38857249008 | # -*- test-case-name: foolscap.test.test_banana -*-
from __future__ import print_function
from twisted.internet import defer
from twisted.python import log
from foolscap.slicers.list import ListSlicer
from foolscap.slicers.tuple import TupleUnslicer
from foolscap.slicer import BaseUnslicer
from foolscap.tokens import ... | warner/foolscap | src/foolscap/slicers/set.py | set.py | py | 6,803 | python | en | code | 50 | github-code | 97 | [
{
"api_name": "foolscap.slicers.list.ListSlicer",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "foolscap.slicer.BaseUnslicer",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "foolscap.constraint.Any",
"line_number": 41,
"usage_type": "argument"
},
... |
7716781427 | from setuptools import setup, find_packages
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(name='brain-pred-toolbox',
version='2.3.2',
long_description=long_descriptio... | sahahn/BPt | setup.py | setup.py | py | 1,595 | python | en | code | 10 | github-code | 97 | [
{
"api_name": "os.path.abspath",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number"... |
42641737407 | #!/usr/bin/env python
# −*− coding: UTF−8 −*−
from __future__ import division
import numpy.testing as npt
import pytest
import numpy as np
from bspline.knots import Knots, get_basis_knots
@pytest.fixture
def knots():
return Knots(np.array([0.,0,1,1]), degree=2)
def test_intervals(knots):
intervals = list(k... | olivierverdier/bsplinelab | tests/test_knots.py | test_knots.py | py | 2,708 | python | en | code | 13 | github-code | 97 | [
{
"api_name": "bspline.knots.Knots",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "bspline.knots.Kno... |
30851268348 | from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from six.moves import xrange
from tensorforce.core import Agent
from tensorforce.core.memories import ReplayMemory
class MemoryAgent(Agent):
default_config = dict(
batch_size=32,
memory_... | Kismuz/tensorforce | tensorforce/core/memory_agent.py | memory_agent.py | py | 1,470 | python | en | code | null | github-code | 97 | [
{
"api_name": "tensorforce.core.Agent",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "tensorforce.core.memories.ReplayMemory",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "six.moves.xrange",
"line_number": 40,
"usage_type": "call"
}
] |
12371159256 | # Keithley_2230.py driver for Keithley 2230 power supply
#
# Sam Hile <samhile@gmail.com>
# Daniel Widmann <>
# Gabriele de Boo <ggdeboo@gmail.com>
#
# This program 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 Foundati... | ggdeboo/QTLab | qtlab_013/instrument_plugins/Keithley_2230.py | Keithley_2230.py | py | 7,732 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "instrument.Instrument",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "logging.info",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "instrument.Instrument.__init__",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "ins... |
715860005 | from django.core.exceptions import ValidationError
from django.utils.translation import gettext_lazy as _
from applications.enums import AdditionalInfoUserReason
def validate_additional_info_user_reasons(
input_reasons_list, allow_empty_list=True
) -> None:
"""
Validate input_reasons_list as a list of un... | City-of-Helsinki/yjdh | backend/kesaseteli/applications/api/v1/validators.py | validators.py | py | 1,892 | python | en | code | 7 | github-code | 97 | [
{
"api_name": "django.core.exceptions.ValidationError",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "django.utils.translation.gettext_lazy",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "django.core.exceptions.ValidationError",
"line_number": 25,
... |
27517266127 | import asyncio
import json
import re
from datetime import datetime, timedelta
from typing import Union
import discord
from discord.ext.commands import command
class Moderation:
def __init__(self, bot):
self.bot = bot
self.log_chan = bot.get_channel(413010299776532490)
self.spamguard_black... | doron-goldstein/02-bot | cogs/moderation.py | moderation.py | py | 21,500 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "discord.Embed",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "datetime.dateti... |
31481914601 | from django.conf import settings
from django.db import models
from django.contrib import admin
from django.urls import include, path, re_path
from drf_yasg import openapi
from drf_yasg.views import get_schema_view
from rest_framework import permissions
from attachments.views import media_view
if settings.DEBUG:
do... | ChanMo/django-simple-attachments | demo/backend/backend/urls.py | urls.py | py | 1,172 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "django.conf.settings.DEBUG",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "rest_framework.permissions.IsAuthenticated",
"line_number": 13,
"usage_type": "attri... |
9744282796 | import sys, os
sys.path.insert(1, os.path.split(os.path.split(sys.path[0])[0])[0])
import pickle as pkl
import numpy as np
from sklearn import preprocessing
from sklearn.utils import shuffle
from classes.neural_net import NeuralNetwork
def unpickle(file):
fo = open(file, 'rb')
dict = pkl.load(fo, encoding='la... | amsukdu/SimplePythonCNN | example/cifar-10-batches-py/main.py | main.py | py | 2,997 | python | en | code | 31 | github-code | 97 | [
{
"api_name": "sys.path.insert",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "os.path.split",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
74996659200 | import atexit
from functools import partial
import os
from subprocess import check_call
from setuptools import setup
from setuptools.command.install import install
package_name = 'pbcmd'
def _post_install(inst=None):
print('~~~ post-install ~~~')
if inst is not None:
install_aliases = os.path.join(... | osrf/mbari_wec_utils | pbcmd/setup.py | setup.py | py | 1,388 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "subprocess.check_call",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "setuptools.command.in... |
3996484475 | import zmq
context = zmq.Context()
socket = context.socket(zmq.REQ)
socket.connect("tcp://127.0.0.1:5555")
for request in range(10):
print("sending request %s" % request)
socket.send(b"hello")
message = socket.recv()
print("Recevied reply %s [ %s ]" % (request, message)) | dixeris/codeserver | req-rep-basic-client.py | req-rep-basic-client.py | py | 291 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "zmq.Context",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "zmq.REQ",
"line_number": 4,
"usage_type": "attribute"
}
] |
38667485682 | import copy
from operator import index
import numpy as np
import pandas as pd
from sklearn.preprocessing import StandardScaler
from process_data import *
# from input_process import *
import json
import os
import torch
from models.brits import BRITSModel as BRITS
from models.brits_i import BRITSModel as BRITS_I
import ... | rafid009/my_brits | test.py | test.py | py | 9,952 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "os.path.exists",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
... |
40179055826 | from telegram.ext import Updater, CallbackContext, CommandHandler, MessageHandler, Filters, Handler
from telegram.ext.dispatcher import run_async, DispatcherHandlerStop, Dispatcher
from telegram import Update, User, Message, ParseMode
from telegram.error import BadRequest
import requests_html
import requests
import jso... | raagn08/Shipping-Info-Telegram-Bot | shippingBot.py | shippingBot.py | py | 6,949 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "telegram.ext.Updater",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "telegram.U... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.