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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4822398457 | # can only handle matrices of powers of 2 e.g 1*1 or 2*2, 4*4
# there is a trick with divide and conquer: you dont actually have to divide the problem space into "actual" smaller spaces,
# pointers (lo or hi) or even N(length of the array) could be passed around
def matrix_multiplication (matrixA, matrixB):
def i... | tundeOlagunju/dsa-learnings | divide-and-conquer.py | divide-and-conquer.py | py | 4,371 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "itertools.chain.from_iterable",
"line_number": 91,
"usage_type": "call"
},
{
"api_name": "itertools.chain",
"line_number": 91,
"usage_type": "name"
}
] |
14907515023 | # -*- coding=utf-8 -*-
from pyspark.sql import SparkSession
from pyspark.sql.types import *
from pyspark.sql.functions import lit
import json
#for RDD map funcation
def f(x):
line = x[1].split('\n')
# result = ['0','0',0.0,'0'] #用于指定顺序存放结果
# index = [200,200,200,200] #用于判断hbase每条记录,是否存在4个完整的索取值
# for ... | wujy189/daily_operation_script | renliyou_bigdata/main.py | main.py | py | 4,517 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "json.loads",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 31,
... |
3886864876 | """
Class BroGldXml reads XML with Groundwater Level Data from BRO XML
file and also accepts result from a REST request.
"""
import os
import warnings
from pandas import Series,DataFrame
import pandas as pd
#import xml.etree.ElementTree as ET
from lxml.etree import _Element, _ElementTree
import lxml.etree as ET
clas... | tdmeij/Acequia | acequia/read/brogldxml.py | brogldxml.py | py | 9,442 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.path.isfile",
"line_number": 146,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 146,
"usage_type": "attribute"
},
{
"api_name": "lxml.etree.parse",
"line_number": 148,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"lin... |
5237449138 | """
Testing model integrations.
"""
from ddt import ddt, data, idata
from flaskserv.socialnet import db
from flaskserv.socialnet.constants import PERMISSIONS
from flaskserv.socialnet.data.create_db import *
from flaskserv.socialnet.models import Tribe, User, PermissionsGroup
from flaskserv.socialnet.tests.test_base... | amovfx/artemiss | flaskserv/socialnet/tests/test_models.py | test_models.py | py | 6,496 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flaskserv.socialnet.tests.test_base.TestBaseCase",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "flaskserv.socialnet.models.User",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "flaskserv.socialnet.models.Tribe.query.all",
"line_number": ... |
72763444532 | from history.models import GDUser
from django.core.management.base import BaseCommand, CommandError
from django.db.models import Q
class Command(BaseCommand):
help = 'Revalidates user cache'
def handle(self, *args, **options):
users = GDUser.objects.all().prefetch_related('gduserrecord_set')
user_count = users... | Cvolton/GDHistory | history/management/commands/revalidate_cache_user.py | revalidate_cache_user.py | py | 505 | python | en | code | 17 | github-code | 21 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "history.models.GDUser.objects.all",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "history.models.GDUser.objects",
"line_number": 10,
"usage_type":... |
22999018798 | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
import torch
from torch import nn
from torch import optim
from torch.nn import functional as F
import numpy as np
from learner import Learner
from copy import deepcopy
from aRUBattack import aRUB
import advertorchMeta.attacks as attacks
from autoat... | youuijin/ARML_server | metaTrain.py | metaTrain.py | py | 10,474 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "torch.nn.Module",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "learner.Learner",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "torch.optim.Adam",
... |
42249616439 | #!/usr/bin/env python3
#-*- coding: utf-8 -*-
import torch
from torchvision import datasets
import torchvision.transforms as transforms
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import numpy as np
from VOCdownloader import VOCDownLoader as VOC
from typing import Dict
def imshow(img):
... | churry-lee/pytorch_tutorial | src/VOC_detection/VOC_read.py | VOC_read.py | py | 2,373 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.transpose",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "torch.rand... |
10406405278 | import cv2
import numpy as np
import util
import imutils.object_detection as imutils
import csv
from operator import itemgetter
NEW_DIMENSIONS = 32
def get_new_dimensions(image):
print('Calculating new dimensions to fit model')
# Get new image shape
try:
height, width = image.shape
except V... | Adilius/OCR-python | app/text_detection.py | text_detection.py | py | 4,725 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "cv2.dnn.readNet",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "cv2.dnn",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "cv2.dnn.blobFromImage",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "cv2.dnn",
"lin... |
71026217012 | from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth import login, authenticate
from django.shortcuts import render, redirect, get_object_or_404
from django.shortcuts import render, redirect
from .forms import LostItemForm, FoundItemForm
from django.shortcuts import render
from .models ... | beypursulthan/LostAndfoundWebApp | LostAndFoundWebApp/admin_module/views.py | views.py | py | 3,337 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "models.LostItem.objects.all",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "models.LostItem.objects",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "models.LostItem",
"line_number": 11,
"usage_type": "name"
},
{
"api_name... |
15515019157 | #!/usr/bin/python3
'''FileStorage class module'''
import json
from utils.clsPath import classLocations
class FileStorage:
'''
File Storage serializes instances to a JSON file and
deserializes JSON file to instances
Methods:
all: returns the dictionary __objects
new: sets in __objects ... | AbdoyassrR1/AirBnB_clone | models/engine/file_storage.py | file_storage.py | py | 2,610 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "json.dump",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "utils.clsPath.classLocations",
"line_number": 61,
"usage_type": "name"
},
{
"api_name": "json.decoder",
"... |
32053693474 | import requests
from collections import namedtuple
from typing import Generator
BASE_URL = "https://www.hackerrank.com/"
LOGIN = f"{BASE_URL}auth/login"
SUBMISSIONS = f"{BASE_URL}rest/contests/master/submissions/"
CHALLENGES = f"{BASE_URL}rest/contests/master/challenges/"
SESSION_COOKIE = "_hrank_session"
CSRF_MARKER ... | graffic/katas | hackerrank/sync/api.py | api.py | py | 3,262 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.namedtuple",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "requests.Session",
"line_number": 62,
"usage_type": "attribute"
},
{
"api_name": "t... |
23108811147 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Oct 13 13:12:29 2019
@author: gladro
"""
import funds
import time
import pandas as pd
import datetime
import numpy as np
#from pandas import DataFrame
import urllib, os, glob
#from bs4 import BeautifulSoup as bs
from multiprocessing import Pool
import... | billy31/Simple_Funds_ | fund_search.py | fund_search.py | py | 6,199 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "funds.get_fund_da... |
4957735047 | # -*- coding: utf-8 -*-
# Standard imports
from typing import (
Any,
Literal,
Optional,
Type,
TypedDict)
LiteralFalse = Literal[False]
LiteralPlatform = Literal['L', 'W', 'M', 'U']
LiteralExceptionType = Literal['ERROR', 'WARNING', 'INFO', 'DEBUG']
TypedDictEncrypterDatabaseSecret: Type = TypedD... | VoidTwo/Encrypter | encrypter/custom_types.py | custom_types.py | py | 898 | python | es | code | 0 | github-code | 21 | [
{
"api_name": "typing.Literal",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.Literal",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "typing.Literal",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "typing.Type",
"line_... |
34605750187 | import os
from typing import Tuple
import logging
import numpy as np
import torch
import torch.nn as nn
import torchvision.transforms as T
from torch.nn import functional as F
import torchvision.models as models
from torch.cuda.amp import GradScaler, autocast
from torch.utils.tensorboard import SummaryWriter
from torc... | Ludwig-Graef/OCT_Feature_Extractor | fundus_extractor/models/.ipynb_checkpoints/simclr-checkpoint.py | simclr-checkpoint.py | py | 9,901 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torch.no_grad",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 41,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_nu... |
27960998357 | # -*- coding: utf-8 -*-
from datetime import datetime
from typing import Any, List, Optional
from recc_database.database.query_builder import BuildResult, UpdateBuilder
from recc_database.variables.database import (
TABLE_GROUP_MEMBER,
TABLE_PROJECT,
TABLE_PROJECT_MEMBER,
)
INSERT_PROJECT = f"""
INSERT I... | bogonets/recc-database | recc_database/database/query/project.py | project.py | py | 2,138 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "recc_database.variables.database.TABLE_PROJECT",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "recc_database.variables.database.TABLE_PROJECT",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "recc_database.variables.database.TABLE_PROJECT",
... |
25257018332 | import psycopg2
from model.db import Db
class DbControl:
def __init__(self):
self.db = Db()
self.db.conn = psycopg2.connect(host=self.db.host, database=self.db.database, user=self.db.user, password=self.db.password)
self.db.cursor = self.db.conn.cursor()
def insertFace(self, face):
... | rafaelsouzak2b/tcc_reconhecimento_facial | API/control/dbControl.py | dbControl.py | py | 992 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "model.db.Db",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "psycopg2.connect",
"line_number": 9,
"usage_type": "call"
}
] |
18825820045 | from django.db import models
class Products(models.Model):
NON_CATEGORY = 'Не указано'
HOME = 'HM'
CLOTHES = 'CLTHS'
SCHOOL = 'SCHL'
DACHA = 'DCH'
KIDS_FOR = 'KDSFR'
EDUCATION = 'DCTN'
CATOGORIES_CHOISES = [
(NON_CATEGORY,'Без категории'),
(HOME,'Для дома'),
(CLO... | Gleb4ik2001/olx_copy | apps/main/models.py | models.py | py | 1,378 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.db.models.Model",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": ... |
45843327494 | from django.db import models
from mongoengine.document import Document
from mongoengine.fields import DictField, StringField, ReferenceField, IntField, DateTimeField, ListField, ObjectIdField
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType as DjangoContentType
from... | snormore/django-mongoreversion | mongoreversion/models.py | models.py | py | 10,267 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "mongoengine.document.Document",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "mongoengine.document.Document",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "mongoengine.fields.StringField",
"line_number": 44,
"usage_type": "call"
},
... |
7367434260 | from django import forms
from betterforms.multiform import MultiModelForm
from .models import User
import logging
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Fieldset, ButtonHolder, Submit, Div
from ckeditor.widgets import CKEditorWidget
from model_utils import Choices
logger = lo... | 2019politicalsisterhood/2019Candidates | political_sisterhood/users/forms.py | forms.py | py | 2,833 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "model_utils.Choices",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.forms.Form",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "django.fo... |
33046876272 | from fastapi import FastAPI
import uvicorn
import pydantic
app = FastAPI()
class Item(pydantic.BaseModel):
id: int
name: str
price: float
description: str = "new item"
@app.get('/')
async def index(item_id: int = 0):
return {"status": "ok"}
@app.post('/items')
async def create_item(item: Ite... | AntonLazutin/fastapi_crud | main.py | main.py | py | 664 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "uvicorn.run",
"line_number": 33,
"usage_type": "call"
}
] |
24243200290 | from django.conf import settings
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.core.mail import send_mail
from django.shortcuts import render, HttpResponseRedirect
from coffeehouse.verify_request import verify_request
from products.models import Product
# C... | FatimasCoding2020/coffeehouse | contact/views.py | views.py | py | 1,662 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "products.models",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "products.models.Product.objects.all",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "products.models.Product.objects",
"line_number": 19,
"usage_type": "attribute"
},
... |
1008844631 | import logging
from django.urls import include, path
from . import flows
log = logging.getLogger(__name__)
log.info("execute hire.urls.py")
flow = flows.HireFlow()
urls = flow.urls
log.info("finished")
log.info(f"urls: {urls}")
app_name = "hire"
urlpatterns = [
path("hireflow/", include((urls, "hireflow")... | Festorah/Workflow-Engine | adilo/hire/urls.py | urls.py | py | 348 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "django.urls.include",
"line_number": 22,
"usage_type": "call"
}
] |
38500937433 | # ENVSCI 203 hillslope_model.py
# my interpretation of the feedback model used in ENV203 assignment 2
# implemented in python instead of Excel to make it easier for excessive
# temporal analysis (50+ years)
#
# requires matplotlib and dependencies "pip install matplotlib"
# gets slightly different results from Excel.... | sophiekolston/public-miscellaneous | env203/hillslope_model.py | hillslope_model.py | py | 4,842 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "time.time",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 88,
"usage_type": "call"
},
{
"api_name": "matplotlib.... |
33398400174 | import numpy as np
import scipy.signal as signal
import matplotlib.pyplot as plt
from scipy.io import wavfile
from scipy.optimize import lsq_linear
fs, x = wavfile.read('x2_U017.wav') # Read x2_U017.wav
# Get the size of the audio vector
lx = len(x)
fs, y = wavfile.read('y2_U017.wav') # Read y2_U017.wav
# Plot th... | Luis123Arturo/Laboratorio-de--omunicaiones-4 | Proyecto final/Problema 2-20230418T031111Z-001/Problema 2/problema2.py | problema2.py | py | 3,786 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "scipy.io.wavfile.read",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "scipy.io.wavfile",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "scipy.io.wavfile.read",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "scipy.io.w... |
10253793592 | import tkinter as tk
from tensorflow.keras.preprocessing.sequence import pad_sequences
from tensorflow.keras.layers import Embedding, LSTM, Dense, Dropout, Bidirectional
from tensorflow.keras.preprocessing.text import Tokenizer
from tensorflow.keras.models import Sequential
from tensorflow.keras import regularizers
fro... | LeNguyenGiaBao/Predict_Next_Word | GUI_RNN.py | GUI_RNN.py | py | 3,725 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "tensorflow.keras.preprocessing.text.Tokenizer",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.models.Sequential",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.layers.Embedding",
"line_number": 19,
"... |
34344852381 | import math
import copy
from copy import deepcopy
from datetime import datetime, timedelta
from chomp import logger, cache, config
from chomp.helpers import reverse_inclusive_range
from chomp.shift_collection import ShiftCollection
class Decompose:
"""Class for decomposing demand into shifts"""
def __init__... | Staffjoy/chomp-decomposition | chomp/decompose.py | decompose.py | py | 11,359 | python | en | code | 40 | github-code | 21 | [
{
"api_name": "copy.copy",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "chomp.logger.debug",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "chomp.logger",
"line_number": 62,
"usage_type": "name"
},
{
"api_name": "chomp.logger.debug",
"l... |
32302141783 | # Write your code here
import pandas as pd
import re
import sqlite3
import csv
import json
from lxml import etree
file_name = input('Input file name\n')
def clean_cell(cell_value):
number = r'\d'
corrected_value = ''
for letter in cell_value:
if re.match(number, letter):
corrected_val... | carlosferian/convoy_shipping | convoy.py | convoy.py | py | 7,307 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "re.match",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pandas.read_excel",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_numbe... |
6620168317 | """
Deep dream
https://www.tensorflow.org/tutorials/generative/deepdream?hl=ko
"""
import tensorflow as tf
import numpy as np
import PIL.Image
import time
import functools
import IPython.display as display
import matplotlib.pyplot as plt
import matplotlib as mpl
import tensorflow_hub as hub
from tensorflow.k... | kimyk0120/kaggle_proj | exam/tf_ex_2_deepdream.py | tf_ex_2_deepdream.py | py | 5,029 | python | ko | code | 0 | github-code | 21 | [
{
"api_name": "tensorflow.keras.utils.get_file",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image.Image.open",
"line_number": 26,
"usage_type": "call"
},
{
"api_na... |
6750434340 | import sys
import numpy as np
import cvxpy as cvx
from tqdm import tqdm, trange
from sklearn.decomposition import PCA
DATA_DIR = sys.argv[1]
READ_MATR_FROM_DISK = True
WRITE_MATR_TO_DISK = False
READ_MATQ_FROM_DISK = True
WRITE_MATQ_TO_DISK = False
READ_MATS_FROM_DISK = True
WRITE_MATS_TO_DISK = False
READ_VECA_F... | NamanRastogi/Human-Body-Reconstruction | HBR_learn.py | HBR_learn.py | py | 25,264 | python | en | code | 10 | github-code | 21 | [
{
"api_name": "sys.argv",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 98,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 109,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number"... |
4411221190 | """
A program to dump load json file
"""
import json
def write_username():
"""
A function to dump username in a json file
"""
username = input("What is your name? ")
file_path = 'username.json'
with open(file_path, 'w') as f:
json.dump(username, f)
return username
def load_userna... | Taofiq-Bakare/Python_Crash_Course | ch10_files_and_exceptions/store_json_file.py | store_json_file.py | py | 916 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "json.dump",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 25,
"usage_type": "call"
}
] |
5768000704 | #!/usr/bin/python3
"""this module defines the class: BaseModel
"""
from uuid import uuid4
from datetime import datetime
import models
class BaseModel:
"""This is the class BaseModel
"""
def __init__(self, *args, **kwargs):
"""Initiliaze an instance:
Args:
id (str): assign with an ... | RyuzakiiL23/AirBnB_clone | models/base_model.py | base_model.py | py | 2,085 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "uuid.uuid4",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.... |
73034813493 | # -*- coding: utf-8 -*-
#
# MNE documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 11 10:45:48 2010.
#
# This file is execfile()d with the current directory set to its containing
# dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All c... | LiuFang816/SALSTM_py_data | python/mne-tools_mne-python/mne-python-master/doc/conf.py | conf.py | py | 11,958 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "os.path.dirname",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_num... |
72678474294 | from matplotlib import pyplot as plt
import numpy as np
from numpy import ogrid
from csvconverter import *
def plot_readings(ax,ay,az,gx,gy,gz, timeSeconds=None, filename=""):
if timeSeconds!=None:
transparency = 0.8
plt.subplot(2,1,1)
timeArrayA = range(len(ax)) #np.array(range(len(ax))).... | VivianhNguyen/bachelorthesis | IMU only/plotting.py | plotting.py | py | 4,390 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "matplotlib.pyplot.subplot",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "numpy.divide",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.multiply... |
21114751984 | from unittest.mock import patch
import pytest
from app import create_app
from myapp.todo.src.infrastructure.repos.todo_repository import FakeTodoRepository
class TestTodoCreator:
@pytest.fixture
def todo_repo(self):
with patch.object(FakeTodoRepository, 'save') as mock:
yield mock
@... | jjponz/todolist_flask | myapp/todo/tests/infrastructure/rest/test_create_course_controller.py | test_create_course_controller.py | py | 1,176 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "unittest.mock.patch.object",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "myapp.todo.src.infrastructure.repos.todo_repository.FakeTodoRepository",
"line_number": 12,
"usage_type": "argument"
},
{
"api_name": "unittest.mock.patch",
"line_number": 12... |
9120130575 | import re
import warnings
from datetime import datetime
from functools import partial
import numpy as np
import pandas as pd
from ..core import indexing
from ..core.common import contains_cftime_datetimes
from ..core.formatting import first_n_items, format_timestamp, last_item
from ..core.variable import Variable
fro... | timothyyu/ml_monorepo | xarray/xarray/coding/times.py | times.py | py | 16,949 | python | en | code | 59 | github-code | 21 | [
{
"api_name": "re.match",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "core.indexing.ImplicitToExplicitIndexingAdapter",
"line_number": 87,
"usage_type": "call"
},
{
"api_name": "core.indexing",
"line_number": 87,
"usage_type": "name"
},
{
"api_name":... |
42040996268 | from __future__ import annotations
import copy
from pathlib import Path
import os
import sys
from typing import Optional, Any
from ruamel.yaml import YAML
__all__ = ["Main", "Config", "Empty", "merge", "init"]
# Empty is meant to be used as a singleton, so EmptyType is *not* in __all__
class EmptyType:
def __cop... | lykoss/lykos | src/config.py | config.py | py | 23,617 | python | en | code | 123 | github-code | 21 | [
{
"api_name": "pathlib.Path",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_... |
33898796583 | from typing import Any, Dict, List, Type, TypeVar
import attr
T = TypeVar("T", bound="EventBridgeResource")
@attr.s(auto_attribs=True)
class EventBridgeResource:
r"""Represents an Amazon EventBridge destination.
Attributes:
name (str): The name of the partner event source associated with the destin... | milyord/sp-api | sp/notifications/models/event_bridge_resource.py | event_bridge_resource.py | py | 2,130 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "typing.TypeVar",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "typing.Dict",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "attr.ib",
"line_number": 23,... |
74494960052 | """
Code is adapted from https://github.com/micco00x/py-pascalpart
Usage examples:
python prepare_pascal_part_v3.py --data-dir ~/data/pascal_part/ --name name
"""
import argparse
import copy
import json
import glob
import os
import random
from itertools import chain, combinations
import numpy as np
import PIL
from tq... | chawins/adv-part-model | prepare_part_imagenet.py | prepare_part_imagenet.py | py | 10,504 | python | en | code | 20 | github-code | 21 | [
{
"api_name": "itertools.chain.from_iterable",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "itertools.chain",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "itertools.combinations",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "... |
7303159497 | import re
import os
import pickle
import numpy as np
import matplotlib.pyplot as plt
from scipy.io import loadmat
from scipy.signal import butter, filtfilt
from scipy.optimize import curve_fit
class CleanFiber:
def __init__(self, mat_filename, mat_pathname, threshold=.25, pad=300.,
make_plot=Fal... | yw5aj/YoshiRecordingData | cleandata/convert.py | convert.py | py | 15,621 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "re.findall",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "scipy.io.loadmat",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "scipy.signal.butter",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"l... |
32594676510 | import base64
import io
from PIL import Image
from odoo.tools.float_utils import float_round
from .test_actions_data import ActionsDataCaseBase
def fake_colored_image(color="#4169E1", size=(800, 500)):
with io.BytesIO() as img_file:
Image.new("RGB", size, color).save(img_file, "JPEG")
img_file.... | nguyenductamlhp/servermns | addons/wms/shopfloor/tests/test_actions_data_detail.py | test_actions_data_detail.py | py | 12,786 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "io.BytesIO",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "PIL.Image.new",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "base64.b64encode",
"line_numbe... |
20050036361 | # Name: Chi Ho Leung
# PID:6106288
#
# Reference: https://gist.github.com/MxShift/df19afcf0322ec7300b27f9d3b1e13fa
# Added audio/mp3, 'video/mp4 mime type extension.
from http.server import BaseHTTPRequestHandler, HTTPServer
import time
from os import path
hostName = "localhost"
hostPort = 8080
DIR_PATH ... | gvghk1/my_webserver | my_webserver.py | my_webserver.py | py | 3,124 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.path.abspath",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "http.server.BaseHTTPRequestHa... |
42262009358 | """
The Monty Hall Problem
In the first chapter, Allen B. Downey introduces the Monty Hall problem:
Monty shows you three closed doors and tells you that there is a prize
behind each door: one prize is a car, the other two are less valuable
prizes like peanut butter and fake fingernails. The prizes are arranged
at... | tiroger/monte-carlo-demo | monty_hall.py | monty_hall.py | py | 3,727 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "random.choice",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style.use",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style",
"line_number": 79,
"usage_type": "attribute"
},
{
"api_name":... |
71002286774 | # -*- coding: utf-8 -*-
import json
import time
from django.http import HttpResponseRedirect, HttpResponse
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.db.models import F
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models ... | chengdg/weizoom-panda | product/category.py | category.py | py | 2,432 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "core.resource.Resource",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "core.resource",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "core.resource",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "json.loads",
... |
36381475761 | import datetime
file = open('data/welcom.txt')
for line in file:
print(line)
file.close()
file = open('data/welcom.txt')
while True:
line = file.readline()
if not line:
break
print(line)
file.close()
#
# try:
# file.write(‘hello world’)
# finally:
# file.close()
with open('data/welcom.t... | python-core-13-09-22/lessons_python-core-13-09-22 | lesson10/lesson10.py | lesson10.py | py | 518 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "datetime.datetime.now",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 24,
"usage_type": "attribute"
}
] |
37688129636 | import os
import re
import shutil
import tempfile
import pandas as pd
# nipype import
from nipype.interfaces.base import (
File,
InputMultiPath,
OutputMultiPath,
traits,
)
from nipype.interfaces.spm.base import ImageFileSPM
# populse_mia imports
from populse_mia.data_manager.data_history_inspect impo... | populse/mia_processes | mia_processes/bricks/tools/tools.py | tools.py | py | 57,953 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "populse_mia.user_interface.pipeline_manager.process_mia.ProcessMIA",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "nipype.interfaces.base.traits.List",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "nipype.interfaces.base.traits",
"line_n... |
70945938292 | import os
from qtpy.QtWidgets import QPushButton
import numpy as np
import logging
from hyperctui import DataType
from hyperctui.utilities.file_utilities import list_tof_dirs, make_folder, move_list_files_to_folder
from hyperctui.utilities.table import TableHandler
from hyperctui.pre_processing_monitor.get import Get... | ornlneutronimaging/HyperCTui | src/hyperctui/pre_autonomous_monitor/event_handler.py | event_handler.py | py | 11,579 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "hyperctui.DataType.ob",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "hyperctui.DataType",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "logging.info",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "hyperctui.... |
41328323805 | '''
Created on 26 Mar 2021
@author: ethancollopy
'''
import numpy as np
import matplotlib.pyplot as plt
def coin_toss_all_heads(num_coins, num_samples):
" Toss coins and find probability they are heads"
rng = np.random.default_rng()
vals = rng.binomial(num_coins, 0.5, num_samples)
fig = plt.hist(va... | scienceMiner/pythonCovid19Charts | python.datascience.views/src/monteCarlo/CoinToss.py | CoinToss.py | py | 541 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "numpy.random.default_rng",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.hist",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "mat... |
15280031608 | # Chain class: holds pipeline of components.
#
# Author: Just van den Broecke
#
from .factory import factory
from .packet import Packet
from .util import Util
from .splitter import Splitter
from .merger import Merger
log = Util.get_log('chain')
class Chain:
"""
Holder for single invokable pipeline of compon... | geopython/stetl | stetl/chain.py | chain.py | py | 5,930 | python | en | code | 81 | github-code | 21 | [
{
"api_name": "util.Util.get_log",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "util.Util",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "factory.factory.create_obj",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "factory.factor... |
15638546649 | import speech_recognition as spr
import googletrans
from googletrans import Translator
from gtts import gTTS
import os
#Dictionary of the Lanuages Available
Dict = googletrans.LANGUAGES
print("You can choose from the following Lanuages for you translation:\n")
print(" Code\t: Language")
for key in Dict:
... | anantgarg30/Language-Translator-using-Speech-Recognition | lang_translator_code.py | lang_translator_code.py | py | 2,132 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "googletrans.LANGUAGES",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "speech_recognition.Recognizer",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "speech_recognition.Recognizer",
"line_number": 22,
"usage_type": "call"
},
{
... |
35721890456 | from genNormalDist import create_dataset
from en_heat import en_heat
from pca import pca_plot
# create_dataset(N, cov1, cov2, mean1=[1,1], mean2=[1,1])
# en_heat(n_samples, ep, t, D)
D = create_dataset(100, [[0.1, 0], [0, 2]], [[0.9, 0.2], [0.2, 0.3]])
en_heat(D.shape[0], 0.2, 1, D)
pca_plot(D, D.shape[0])
D1 = crea... | matszmat/IC-cefet | Técnicas Espectrais para Agrupamento Múltiplo/src/main.py | main.py | py | 947 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "genNormalDist.create_dataset",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "en_heat.en_heat",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pca.pca_plot",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "genNormalDist... |
17302158320 | import argparse
import collections
import time
import gym
import numpy as np
from utils import env_window
UP_ARROW_KEY_CODES = 273, 65362
DOWN_ARROW_KEY_CODES = 274, 65364
LEFT_ARROW_KEY_CODES = 276, 65361
RIGHT_ARROW_KEY_CODES = 275, 65363
DEFAULT_KEY_MAP = {
(): 0,
(ord('1'),): 1,
(ord('2'),): 2,
... | elliotwaite/rl | algos/keyboard_agent.py | keyboard_agent.py | py | 8,296 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.concatenate",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 81,
"usage_type": "call"
},
{
"api_name": "gym.spaces",
"line_n... |
2257975549 | """
-------------------------------------------------
File Name: 1.9-Queue-2
Description :
Author : gaox
date: 7/28/18
-------------------------------------------------
Change Activity:
7/28/18:
-------------------------------------------------
"""
__author__ = 'gaox... | zhejianggaoxiao/Python-Daily-Practice | 3-PyProcessAndThread/1-Process/1.9-Queue-2.py | 1.9-Queue-2.py | py | 961 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "time.sleep",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "random.random",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "random.random",
"line_number"... |
28833540114 | __author__ = 'TexasLonghorns'
import praw
from TopCommenter import TopCommenter
r = praw.Reddit(user_agent='Testing My First Reddit Bot by /u/HelioOne v.01')
submissions = r.get_subreddit('Longhornnation').get_hot(limit=5)
user_name = "HelioOne"
user = r.get_redditor(user_name)
thing_limit = 1000
# cast an item as a ... | JonSobocinski/RedditBot | Reddit.py | Reddit.py | py | 1,751 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "praw.Reddit",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "TopCommenter.TopCommenter",
"line_number": 35,
"usage_type": "call"
}
] |
40548993142 | from pathlib import PosixPath, WindowsPath
from common.utils.environment import is_windows_os
if is_windows_os():
import win32api
import win32security
import common.utils.windows_permissions as windows_permissions
else:
import os
import stat
def assert_windows_permissions(path: WindowsPath):
... | guardicore/monkey | monkey/tests/monkey_island/utils.py | utils.py | py | 1,500 | python | en | code | 6,367 | github-code | 21 | [
{
"api_name": "common.utils.environment.is_windows_os",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pathlib.WindowsPath",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "common.utils.windows_permissions.ACCESS_PERMISSIONS_FULL_CONTROL",
"line_number": 2... |
14112256794 | import numpy as np
import pandas as pd
import networkx as nx
from tqdm.notebook import tqdm
import matplotlib.pyplot as plt
from itertools import product
from joblib import Parallel, delayed
from scipy.sparse import csr_matrix
def group(original_list, n):
'''Groups original_list into a list of lists, where each li... | rybakj/page_networks | src/randomwalks.py | randomwalks.py | py | 19,668 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "networkx.info",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "networkx.spring_layout",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "matplot... |
29867078553 | # hello/views.py
from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.urls import reverse
from .models import Utilizador
from .forms import Utilizador_Form
def layout_page_view(request):
form = Utilizador_Form(request.POST or None)
context = {'form': form,
... | DrAlexWild/Premium_Minds_Web_Challenge | webdev/views.py | views.py | py | 1,001 | python | pt | code | 0 | github-code | 21 | [
{
"api_name": "forms.Utilizador_Form",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "models.Utilizador.objects.all",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "models.Utilizador.objects",
"line_number": 12,
"usage_type": "attribute"
},
{
... |
75312215093 | from flask import Flask, render_template, request, redirect, session
app = Flask(__name__)
app.secret_key = 'keep it secret, keep it safe'
@app.route('/', methods=['GET', 'POST'])
def index():
""" Renders the counter display page
Returns: the rendered page
"""
counter = 1
if request.method == 'POST':
... | gfhuertac/coding_dojo_python | flask_fundamentals/counter/counter.py | counter.py | py | 973 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "flask.request.form... |
71361222453 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import os
import sys
import bottle
from bottle.ext.mongo import MongoPlugin
import pymongo
class RedisTest(unittest.TestCase):
def setUp(self):
self.app = bottle.Bottle(catchall=False)
plugin = MongoPlugin(uri="mongodb://127.0.0.1",
... | bottlepy/bottle-mongo | test.py | test.py | py | 2,224 | python | en | code | 29 | github-code | 21 | [
{
"api_name": "unittest.TestCase",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "bottle.Bottle",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "bottle.ext.mongo.MongoPlugin",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pym... |
71193015733 | import os
import pygame
import math
import tkinter
import tkinter.filedialog
import tkinter.messagebox
pygame.init()
def touched(x1, weight1, x2, weight2, y1, height1, y2, height2):
if (x1 <= x2 and x2 <= (x1 + weight1)
and y1 <= y2 and y2 <= (y1 + height1)) \
or (x1 <= (x2 + wei... | EgorPy/printer_image_program | main.py | main.py | py | 15,494 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "pygame.init",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.font.Font",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "pygame.font",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "pygame.font.SysFont",
... |
39053127103 |
import socket, json, base64, sys
class Listener:
def __init__(self, ip , port):
listener = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
listener.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
listener.bind((ip, port))
listener.listen(0)
print("\n[+] Waiting for incoming co... | Springerstine/Listener | listener.py | listener.py | py | 1,877 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "socket.socket",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_STREAM",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "socket.SOL_SOC... |
34279584913 | import asyncio
from play import play
from jsonStream import readJson, writeJson
# Se connecter au serveur du championnat et demande d'inscription
async def inscription(Host_Ip, Port_Ip, request):
'''
:param Host_Ip: adresse Ip du serveur du championnat
:param Port_Ip: port distant
:param request: mess... | mehdiatigui/othello-IA | connexion.py | connexion.py | py | 1,433 | python | fr | code | 0 | github-code | 21 | [
{
"api_name": "asyncio.open_connection",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "jsonStream.writeJson",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "jsonStream.readJson",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "asyn... |
6542566 | from flask import Flask, request
from function import *
from datetime import *
from database import *
import requests
import pandas as pd
from twilio.twiml.messaging_response import MessagingResponse
app = Flask(__name__)
question_number = 0
correct_answer = 0
ongoing_session = False
ongoing_quiz = False... | chiragbhatt3/quiz_bot | application.py | application.py | py | 22,333 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "flask.request.values.get... |
30622933584 | # -*- coding: utf-8 -*-
from django.urls import path
from . import views
app_name = 'pchallan_app'
urlpatterns = [
path(r'add/', views.pchallan_add, name='add_page'),
path(r'add_pchallan/', views.add_pchallan, name='add_pchallan'),
path(r'add_bill/', views.add_bill, name='add_bill'),
path(r'filter_dat... | Himanshu-goel86121/pk-accounts | pchallan/urls.py | urls.py | py | 1,202 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
6982121266 | import os
import glob
import json
import subprocess
import time
# must be absolute path; assuming running in Git Bash on Windows
# make sure to run after `make clean`
base_path = 'D:/Libraries Type-D/Documents/SCHOOL/UT Austin/Spring 2022/CS 330E Elements of Software Engineering (TA)/Projects/cs330e-diplomacy-grading-... | peter1357908/cs330e-diplomacy-grading-script | DiplomacyVetting.py | DiplomacyVetting.py | py | 12,620 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.chdir",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 52,
... |
9425278886 | import os
import sys
import time
import datetime
import pymlir
pymlir.set_mem_mode("value_mem")
import tools.run_calibration
import numpy as np
import copy
import logging
from utils.mlir_parser import *
from calibration.mix_precision import MixQuantModel
from calibration.mix_precision import MixPrecSearcher
from calibr... | sophgo/tpu-mlir | python/calibration/sensitive_layer.py | sensitive_layer.py | py | 16,797 | python | en | code | 366 | github-code | 21 | [
{
"api_name": "pymlir.set_mem_mode",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "calibration.kld_calibrator.CalibrationTable",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pymlir.module",
"line_number": 27,
"usage_type": "call"
},
{
"api_... |
42450306583 | #app.py
from flask import Flask, request #import main Flask class and request object
import base64, os.path, random
app = Flask(__name__) #create the Flask app
@app.route('/converter', methods=['POST']) #GET requests will be blocked
def encode_decode():
data = request.get_json()
action_type = data['Type']
... | ZedBel/image-to-base64 | post.py | post.py | py | 1,520 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.request.get_json",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.request",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "base64.encodestring",... |
16681368367 | from dataclasses import dataclass
import pickle
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import DataLoader
import numpy as np
from transformers import (
AdamW,
get_linear_schedule_with_warmup,
BertTokenizer,
HfArgumentParser,
)
from tqdm import tqdm
impor... | BigBinnie/D4_baseline | models/transformer/train.py | train.py | py | 9,420 | python | en | code | 10 | github-code | 21 | [
{
"api_name": "sys.path.append",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
43108433911 | from wtforms import Form, TextField, TextAreaField, validators, StringField, SubmitField
from flask import Flask, render_template, flash, request
import uuid
app = Flask(__name__)
app.config.from_object(__name__)
app.config['SECRET_KEY'] = '1234'
class ReusableForm(Form):
value = StringField('Value:', validator... | JannikNieb/table | table_input.py | table_input.py | py | 1,048 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "wtforms.Form",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "wtforms.StringField",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "wtforms.validators.requir... |
74242670452 | import boto3
# Get the service resource.
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table('users')
response = table.get_item(
Key={
'username': 'janedoe',
'last_name': 'Doe'
}
)
ritem = response['Item']
for key, value in ritem.iteritems():
print (str(key) + ": " + str(value)... | brodrig/boto | aws_dynamo_get_item.py | aws_dynamo_get_item.py | py | 323 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "boto3.resource",
"line_number": 4,
"usage_type": "call"
}
] |
36200565017 | import json
from models import Author, Quote
import connect_db
#db.createCollection("Author")
def seed_a():
with open('authors.json') as f:
file_content = f.read()
templates = json.loads(file_content)
for i in templates:
Author(fullname = i['fullname'],
bor... | GkiriChen/PyWeb_HW_8 | add_in_db.py | add_in_db.py | py | 828 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "json.loads",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "models.Author",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "models.Quote",
"line_number":... |
41700560539 | import random
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
class Point:
def __init__(self):
self.x = random.randint(0, 100)
self.y = random.randint(0, 100)
self.z = random.randint(0, 100)
points_x = []
points_y = []
points_z = []
points = Point()
for i in... | hampet1/linear_conversion | main.py | main.py | py | 1,587 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "random.randint",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"... |
7996202852 | import sys
if sys.version_info >= (3, 10):
from importlib import resources
else:
import importlib_resources as resources
from Base.tests import ConfigTestCase
from Papers.models import Paper
from Mark.models import MarkingTaskPriority, MarkingTask
from Mark.services import marking_priority
from Mark.services ... | plomgrading/plom | plom_server/Mark/tests/test_marking_priority_setting.py | test_marking_priority_setting.py | py | 5,095 | python | en | code | 10 | github-code | 21 | [
{
"api_name": "sys.version_info",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "Base.tests.ConfigTestCase",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "importlib_resources.files",
"line_number": 21,
"usage_type": "call"
},
{
"api_name... |
73029409333 | import cvxpy.settings as s
from cvxpy.error import SolverError
import cvxpy.lin_ops.lin_utils as lu
import cvxpy.utilities.performance_utils as pu
from cvxpy.constraints.constraint import Constraint
import numpy as np
import scipy.sparse as sp
class SDP(Constraint):
"""
A semi-definite cone constraint:
... | LiuFang816/SALSTM_py_data | python/cvxgrp_cvxpy/cvxpy-master/cvxpy/constraints/semidefinite.py | semidefinite.py | py | 4,406 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "cvxpy.constraints.constraint.Constraint",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "cvxpy.settings.CVXOPT",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "cvxpy.settings",
"line_number": 45,
"usage_type": "name"
},
{
... |
23186366623 | """
Module for Tracive GPS tracker communication.
Provides the methods:
* :func: `IFTTT_trigger`
* :class: `Tractive`
"""
import requests, json, time, platform
from typing import Optional, Dict, Union
from pathlib import Path
import pandas as pd
try:
from .user_env import user_environ
from .encryption impor... | drrobotk/PyTractive | PyTractive/tractive.py | tractive.py | py | 13,382 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "requests.Session",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "user_env.user_environ",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "user_env.user_en... |
14843589782 | import cv2
import numpy as np
cap = cv2.VideoCapture(0)
while(1):
# Take each frame
_, frame = cap.read()
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
#b1 = cv2.GaussianBlur(gray, (11, 11), 0)
b1 = cv2.bilateralFilter(gray, 7,41,41)
b2 = cv2.bilateralFilter(frame, 7,41,41)
b2 = cv2.cvtColor(b... | gusriobr/pydetector | tracking/lab/camaeracontours.py | camaeracontours.py | py | 623 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "cv2.bilateralFil... |
16902255020 | from datetime import date
class AgeCalculator: # CapWords
def calculate_age(self, dob) -> int: # underscore seperated
today = date.today()
return today.year - dob.year
class Employee:
def __init__(self, name, age) -> None:
self.name = name
self.age = age
de... | aniruddhha/python-training-43be6296c438424db50d31dd91e5191e | week-2/day-1/builtin_classes.py | builtin_classes.py | py | 619 | python | en | code | 12 | github-code | 21 | [
{
"api_name": "datetime.date.today",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 7,
"usage_type": "name"
}
] |
43553281986 | import pytest
from apps.alerts.grafana_alerting_sync_manager.grafana_alerting_sync import GrafanaAlertingSyncManager
@pytest.mark.django_db
def test_find_name_of_contact_point_grafana_datasource(make_organization, make_alert_receive_channel):
organization = make_organization()
alert_receive_channel = make_al... | shantanualsi/oncall | engine/apps/alerts/tests/test_grafana_alerting_sync.py | test_grafana_alerting_sync.py | py | 840 | python | en | code | null | github-code | 21 | [
{
"api_name": "apps.alerts.grafana_alerting_sync_manager.grafana_alerting_sync.GrafanaAlertingSyncManager",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 6,
"usage_type": "attribute"
}
] |
3474506611 | import sys
import urllib.request
import json
if __name__ == '__main__':
page_name="sejongbamboo"
app_id="174720823286694"
app_secret="88c7a1323cbe3ebb2d470c24c0d75cab"
access_token=app_id+"|"+app_secret
base="http://graph.facebook.com/v2.11"
node="/"+page_name
parameters="/?access_token=%s"%... | seongjin571/BigData_source | python_source/facebook/numerisID요청.py | numerisID요청.py | py | 694 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "urllib.request.request.Request",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "urllib.request",
"line_number": 13,
"usage_type": "name"
},
{
"api_nam... |
33896956623 | from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from ..types import UNSET, Unset
T = TypeVar("T", bound="Price")
@attr.s(auto_attribs=True)
class Price:
r"""The price attribute of the item.
Attributes:
amount (Union[Unset, float]): The amount.
currency_code (Union[Unse... | milyord/sp-api | sp/catalog_items_v0/models/price.py | price.py | py | 1,836 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "typing.TypeVar",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "typing.Union",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "types.Unset",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "types.UNSET",
"line_number... |
24240951450 | import os, sys
import logging
from flask import Flask, request, abort, jsonify
from flask_sqlalchemy import SQLAlchemy
from flask_cors import CORS
from werkzeug.exceptions import HTTPException
from sqlalchemy.sql.expression import func
from models import setup_db, Question, Category
from sqlalchemy.sql.expression imp... | andreqts/UDACITY-Full-Stack-exercises | projects/02_trivia_api/worked_code/backend/flaskr/__init__.py | __init__.py | py | 9,031 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "models.setup_db",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "logging.basic... |
15424885412 | import socket
import sys
import select
from paramiko.py3compat import u
import termios
import tty
def posix_shell(chan):
oldtty = termios.tcgetattr(sys.stdin)
try:
tty.setraw(sys.stdin.fileno())
tty.setcbreak(sys.stdin.fileno())
chan.settimeout(0.0)
while True:
r,... | grnet/BMCManager | bmcmanager/interactive/__init__.py | __init__.py | py | 962 | python | en | code | 8 | github-code | 21 | [
{
"api_name": "termios.tcgetattr",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "tty.setraw",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.stdin.fileno",
"l... |
30831386888 | from unittest.mock import patch
from collections import namedtuple
from memini.core import terminal
def test_ask_yes_no(capsys):
with patch('builtins.input') as mock_input:
mock_input.return_value = 'YES'
answer = terminal.ask_yes_no('Will you do it?')
assert answer
mock_input.ass... | nicolashainaux/memini | tests/test_core_02_terminal.py | test_core_02_terminal.py | py | 3,245 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "unittest.mock.patch",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "memini.core.terminal.ask_yes_no",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "memini.core.terminal",
"line_number": 10,
"usage_type": "name"
},
{
"api_name"... |
23340438980 | import os
import pandas as pd
from itertools import product
opts = snakemake.config['plotting']
scenarios = snakemake.config['scenario'].copy()
plot_dir = snakemake.params.plot_dir
param = snakemake.wildcards.param
param_values = scenarios.pop(snakemake.wildcards.param)
cost_df = (pd.read_csv(snakemake.input.costs2,... | PyPSA/pypsa-za | scripts/plot_comparisons.py | plot_comparisons.py | py | 1,198 | python | en | code | 12 | github-code | 21 | [
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "itertools.product",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_nu... |
15491430722 | import numpy as np
import pickle as pkl
import pandas as pd
import matplotlib.pyplot as plt
#processing imports
from scipy.interpolate import interp1d
from scipy.fft import fft, fftfreq
#ML imports
from sklearn.ensemble import RandomForestClassifier
from sklearn import svm
from sklearn import metrics
from sklearn... | RCHI-Lab/Wearable_Scratch_Intensity | final_code/Intensity_model_training.py | Intensity_model_training.py | py | 4,075 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "sys.path.append",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_pickle",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"l... |
37933081122 |
from brian2 import *
from inputs import *
import os
import time
import numpy
# BrianLogger.suppress_hierarchy('brian2.codegen')
# BrianLogger.suppress_name('resolution_conflict')
# BrianLogger.suppress_hierarchy('brian2')
# passive
Cm = 1e-6 * farad * cm**-2
Ri = 100 * ohm * cm
g_l = 1e-4 * siemens * cm**-2 # Som... | ModelDBRepository/244700 | corr_HH.py | corr_HH.py | py | 17,241 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "time.strftime",
"line_number": 207,
"usage_type": "call"
},
{
"api_name": "time.localtime",
"line_number": 207,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 209,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_nu... |
7363646744 | from lxml import etree
import requests
url = "https://movie.douban.com/chart"
headers = {
"User-Agent":"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36"
}
res = requests.get(url, headers=headers)
html_str = res.content.decode()
html = etree.HT... | KronosOceanus/python | 课堂爬虫/doubanChart.py | doubanChart.py | py | 983 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "lxml.etree.HTML",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"line_number": 10,
"usage_type": "name"
}
] |
70593846772 | #!/usr/bin/python3
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
"""Training and Validation On Segmentation Task."""
""" Modified by Kaichun Mo to run experiments on PartNet """
import os
import sys
import math
import random
import argparse
import importl... | daerduoCarey/partnet_seg_exps | exps/sem_seg_pointcnn/train_val_seg.py | train_val_seg.py | py | 14,857 | python | en | code | 67 | github-code | 21 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
... |
28007949524 | import csv
import math
import matplotlib.pyplot as plt
from matplotlib import path
from matplotlib.patches import Circle, Wedge, Polygon
from matplotlib.collections import PatchCollection
import numpy as np
import os
import xarray as xr
from sif_utils import plot_histogram, lat_long_to_index
DATA_DIR = "/mnt/beegfs/b... | joshuafan/Vegetation_SIF_Downscaling_CSSUNet | old_files_2/create_irregular_oco2_eval_dataset.py | create_irregular_oco2_eval_dataset.py | py | 12,499 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 1... |
35719340332 |
# coding: utf-8
# ## LSTM之keras实现
# In[1]:
import numpy as np
np.random.seed(2017) #为了复现
from __future__ import print_function
from keras.datasets import mnist
from keras.utils import np_utils
from keras.models import Sequential
from keras.layers import LSTM, Activation, Dense
from keras.optimizers import Adam
(X... | lytforgood/DeepLearning | 04RNN/keras_LSTM.py | keras_LSTM.py | py | 1,583 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "numpy.random.seed",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "keras.datasets.mnist.load_data",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "kera... |
28351992543 | from yahooquery import Ticker
import pandas as pd
def fetch(df, debug=True):
'''
Takes the dataframe 'df' and adds a column to it with stock price in that interval.
If there already existed a previous such column, it is renamed to 'prev_price' with replacement.
It also adds in any dividends, (maybe balance sheet ... | 7Elev3n/SGX-Bot-Tracker | Manager/Updater.py | Updater.py | py | 4,445 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.DataFrame.from_dict",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "yahooquery.Ticker",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pa... |
16731563678 |
print("ok3")
import argparse
import torch
import torch.backends.cudnn as cudnn
import numpy as np
import PIL.Image as pil_image
from models import FSRCNN
from utils import convert_ycbcr_to_rgb, preprocess, calc_psnr
import time
# device : cpu
# fsrcnn dur time: 7.64
# pre_process dur time: 1.252
# fsrcnn dur ti... | fighting332/fsrcnn_python | test.py | test.py | py | 3,334 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "torch.backends.cudnn.benchmark",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "torch.backends.cudnn",
"line_number": 41,
"usage_type": "name"
},
{
"... |
12691869538 | from darksky import forecast
from datetime import datetime as dt
from secrets import API_KEY
lat = -23.496111
lon = -46.619722
key = API_KEY
SP = key, lat, lon
days = list(range(1,31))
data = []
for day in days:
t = dt(2018, 1, day, 12).isoformat()
sp_forecast = forecast(*SP, time=t)
historic_temperatu... | vitorhirata/data-analysis-tests | previsao-do-tempo/teste1.py | teste1.py | py | 1,087 | python | pt | code | 1 | github-code | 21 | [
{
"api_name": "secrets.API_KEY",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "datetime.datetime",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "darksky.forecast",
"line_number": 16,
"usage_type": "call"
}
] |
70800269494 | #!/usr/bin/env python
import itertools
import argparse
import math
def read_file(filename):
f = open(filename)
# data = itertools.ifilter(predicate, f)
data = f.readlines()
f.close()
return data
def compare_values(data, keyword, ref_values, tolerance=0.0, kw_col=0, val_col=None):
keyword = ke... | filippi-claudia/champ | tools/compare_value.py | compare_value.py | py | 2,139 | python | en | code | 14 | github-code | 21 | [
{
"api_name": "math.sqrt",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 33,
"usage_type": "call"
}
] |
38839818345 | from crypt import methods
import mysql.connector
from flask import Flask, request, Response
import json
import logging
from flask_mysqldb import MySQL
from redis import Redis
from rq import Queue
from crypt import methods
import unicodedata
from flask import Flask, request
import time
from redis import Redis
from rq im... | Emily980512/Assignment-2 | app/app.py | app.py | py | 5,028 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "redis.Redis",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "rq.Queue",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "mysql.connector",
"line_number":... |
28393717134 | from collections import UserDict
from typing import Any, Dict, Generic, List, Tuple, TypeVar, Union, overload
import numpy as np
import pandas as pd
from typing_extensions import TypeVarTuple, Unpack
K = TypeVar("K")
KT = TypeVarTuple("KT")
VT = TypeVar("VT")
class MIDict(UserDict, Generic[K, Unpack[KT], VT]): # t... | ppeetteerrs/py-opinion | opinion/midict.py | midict.py | py | 2,608 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "typing.TypeVar",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "typing_extensions.TypeVarTuple",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "typing.TypeVar",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "collection... |
37872795445 | # -*- coding: utf-8
from serializers import LastCallSerializer, UserLittleSerializer, SynopsisSerializer
from rest_framework import viewsets, filters
from models import LastCall, Synopsis
from rest_framework.decorators import list_route
from rest_framework.response import Response
from rest_framework.decorators import ... | AlexanderAvramchuk/edem | tv_crm/views.py | views.py | py | 8,590 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "account.models.CustomUser.objects.all",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "account.models.CustomUser.objects",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "account.models.CustomUser",
"line_number": 15,
"usage_type":... |
2373699348 | import numpy as np
import torch
import torch.nn.functional as F
import cv2
from scipy.optimize import minimize
from .utils import Rodrigues
def refine_pose(R: np.ndarray, t: np.ndarray, query_img, renderer, obj_idx, K_crop, obj_, model, keys_verts,
interpolation='bilinear', n_samples_denom=4096, meth... | rasmushaugaard/surfemb | surfemb/pose_refine.py | pose_refine.py | py | 3,294 | python | en | code | 69 | github-code | 21 | [
{
"api_name": "numpy.ndarray",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.from_numpy",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "torch.from_numpy",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "torch.cat",
... |
11582034722 | import pandas as pd
from google.cloud import bigquery
def cusdis(df, n_rows=2):
"""Custom display"""
display(df.head(n_rows))
print(df.shape)
def show(df, rows=False, columns=False, cells=False):
params = []
if rows:
params = params + ['max_rows', None]
if columns:
params = params + ['max_columns', None]
... | FMirauda/falabella_codes | utils (1).py | utils (1).py | py | 621 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.option_context",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "google.cloud.bigquery.Client",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "google.cloud.bigquery",
"line_number": 25,
"usage_type": "name"
}
] |
17291414635 | import os.path as osp
import json
import cv2
import copy
from loguru import logger
from tqdm import trange
import dgl
import torch
from torchvision import transforms as T
from torch.utils.data import Dataset
import torch.nn.functional as F
class BaseGraphDataset(Dataset):
"""Class for Graph Dataset."""
def ... | chengche6230/ReST | src/datasets/dataset.py | dataset.py | py | 13,840 | python | en | code | 91 | github-code | 21 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "json.load",
"line_n... |
32462608353 | from flask import session
import sqlite3
from threading import RLock
from subprocess import Popen, PIPE, STDOUT
from settings import *
from databank.memory import Cell
from databank.timing import timing
import sqlite3
import os
import re
import hashlib
import time
# Printing function
def _print_monitor(s, end='\n'):
... | databank-anon/databank | src/databank/monitor.py | monitor.py | py | 11,153 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "hashlib.sha256",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 136,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 136,
"usage_type": "attribute"
},
{
"api_name": "subprocess.Popen",
"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.