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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
14816787756 | """web URL Configuration"""
from django.conf.urls import include,url
from django.contrib import admin
from . import views
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^$', views.index, name='index'),
url(r'^pdx/(?P<pk>\w{0,50})/$', views.pdx, name="pdx"),
url(r'^search/', views.search, name="... | jmason-ebi/pdx | web/urls.py | urls.py | py | 442 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": ... |
36649336174 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 11 10:56:48 2020
@author: alexanderfalk
"""
import itertools
import time
import sys
class ThreeOPT:
def __init__(self, computed_solution, time_limit=60):
self.solution = computed_solution
self.time_limit = time_limit
def... | AlexanderFalk/2020_Project01_CS_HA | src/threeopt.py | threeopt.py | py | 2,076 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "time.time",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "sys.stdout.write",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "itertools.combinations",
... |
39922767694 | # THIS FILE IS SAFE TO EDIT. It will not be overwritten when rerunning go-raml.
from flask import jsonify, request
import sqlite3
def books_postHandler():
connection = sqlite3.connect("BookStore")
cursor=connection.cursor()
inputs = request.get_json()
cursor.execute("CREATE TABLE IF NOT EXISTS BookSt... | BolaNasr/BookStore-API | server/handlers/books_postHandler.py | books_postHandler.py | py | 608 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sqlite3.connect",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.request.get_json",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.request",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "flask.jsonify",
... |
9460034812 | """
Запуск класса с датасетами твитов и генома ВИЧ
"""
import Hyperbolic
import numpy as np
import Levenshtein as Lev
import pandas as pd
from grad_descent import MSE
import draw
"""
ТВИТЫ
"""
positive = np.array(pd.read_csv(
r'twitter_data/positive.csv', sep=';', usecols=[3], names=['text']))
negative = np.arra... | DanilShishkin/Hyperbolic | actual/main.py | main.py | py | 2,184 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_n... |
32592778621 | import geoip2.database
"""
Requirements:
geoip2
use this page to download the db:
https://dev.maxmind.com/geoip/geolite2-free-geolocation-data?lang=en
"""
# This creates a Reader object. You should use the same object
# across multiple requests as creation of it is expensive.
with geoip2.database.Reader('... | steriospydev/tutools | Functions/get_ip_location.py | get_ip_location.py | py | 927 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "geoip2.database.database.Reader",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "geoip2.database.database",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "geoip2.database",
"line_number": 10,
"usage_type": "name"
}
] |
26889693373 | import cv2
import numpy as np
import matplotlib.pyplot as plt
def viz2(img, regions, rooms, all_ctrs):
all_ctrs_img = np.zeros((img.shape[0], img.shape[1], 3), np.uint8)
cv2.drawContours(all_ctrs_img, all_ctrs, -1, (0, 255, 0), 3)
filtered_ctrs_img = np.zeros((img.shape[0], img.shape[1], 3), np.uint8)
... | jmou/quarks-knit | viz2.py | viz2.py | py | 736 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.zeros",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "cv2.drawContours",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_nu... |
10506264622 | """
a very simple MNIST classifier
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import sys
from tensorflow.examples.tutorials.mnist import input_data
import tensorflow as tf
FLAGS = None
def main(_):
#import data
mnist = input_d... | RuanYB/tensorflow | mnist.py | mnist.py | py | 1,897 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tensorflow.examples.tutorials.mnist.input_data.read_data_sets",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "tensorflow.examples.tutorials.mnist.input_data",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "tensorflow.placeholder",
"line_n... |
14070127148 | import math
import numpy as np
from scipy.special import expit
class LogReg():
def __init__(self, lambda_1=0.0, lambda_2=1.0, gd_type='full',
tolerance=1e-4, max_iter=1000, w0=None, alpha=1e-3):
"""
lambda_1: L1 regularization param
lambda_2: L2 regularization param
... | idStep/hse_ml | logreg.py | logreg.py | py | 2,793 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.ones",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.norm",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"lin... |
39220567289 | from sklearn.preprocessing import StandardScaler
file_name2 = 'data2.csv'
df = pd.read_csv(file_name2)
df['race_date'] = pd.to_datetime(df['race_date']).dt.date
# 情報不足行を削除
df = df.dropna(subset=['past_time_sec1', 'past_time_sec2', 'past_time_sec3',
'past_time_sec4', 'past_time_sec5']).reset_index... | keisukee/horse_racing | normalize_3.py | normalize_3.py | py | 2,492 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "sklearn.preprocessing.StandardScaler",
"line_number": 49,
"usage_type": "call"
}
] |
651508757 | from . learningTasks import RandomForest
import os
import luigi
import numpy as np
import logging
# import the proper nifty version
try:
import nifty.graph.rag as nrag
except ImportError:
try:
import nifty_with_cplex.graph.rag as nrag
except ImportError:
import nifty_with_gurobi.graph.rag ... | constantinpape/mc_luigi | mc_luigi/defectRandomForests.py | defectRandomForests.py | py | 4,204 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "tools.config_logger",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "luigi.Task",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "luigi.Parameter... |
31360177466 | #Long Short-Term Memory
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from keras.models import Sequential
from keras.layers import Dense, Dropout, LSTM
from sklearn.preprocessing import MinMaxScaler
from sklearn.metrics import mean_squared_error
dataset_train = pd.read_csv('files/Salestrain.cs... | francinehahn/ai-and-machine-learning | detectingAnomalies/LSTM.py | LSTM.py | py | 4,027 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "matplotlib.p... |
11753378103 | import urllib3
import requests
from bs4 import BeautifulSoup
from csv import writer
import csv
import pandas as pd
url = 'https://www.mubawab.tn/fr/cc/immobilier-a-louer-all:o:i:sc:houses-for-rent:p:' + str(1)
page = requests.get(url)
soup = BeautifulSoup(page.content, 'html.parser')
lists = soup.find_all('li', clas... | sofienne-chouiekh/Scraping_data_estate_location | test.py | test.py | py | 1,091 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 11,
"usage_type": "call"
}
] |
28322769353 | from django.urls import path, include
from . import views
app_name = 'api'
employment = [
path('', views.EmploymentListEmployee.as_view(), name='list'),
]
employee = [
path('<int:pk>/employment/', include((employment, 'employment'))),
]
urlpatterns = [
path('employee/', include((employee, 'employee'))... | crowmurk/mallenom | mallenom/api/urls.py | urls.py | py | 325 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.urls.include",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.urls.path... |
34118032788 | # Going to be extremely similar to the staff groups file
from __future__ import print_function
import os.path
import json
from typing import get_type_hints
from google.auth.transport.requests import Request
from google.oauth2.credentials import Credentials
from google_auth_oauthlib.flow import InstalledAppFlow
from... | Philip-Greyson/D118-Google-Groups-Licensing | doStudentGroups.pyw | doStudentGroups.pyw | pyw | 16,072 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.environ.get",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_... |
5675740119 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
import os, re, collections, getpass, functools, click, six, logging, json, threading
import dash
from dash import dcc
from dash import html
import dash_bootstrap_components as dbc
from dash.dependencies i... | meghanstell/SNOWIE | megalodon/web/apps/launch.py | launch.py | py | 9,144 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "click.Context",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "six.string_types",
"line_number": 55,
"usage_type": "attribute"
},
{
"api_name": "dash.html.Div",... |
73883744829 | import os
_, filename = os.path.split('/a/b/c/t.txt')
print(filename)
metro_areas = [
('Tokyo', 'JP', 36.933, (35.689722, 139.691667)),
('Delhi NCR', 'IN', 21.935, (28.613889, 77.208889)),
('Mexico City', 'MX', 20.142, (19.433333, -99.133333)),
('New York-Newark', 'US', 20.104, (40.808611, -74.020386... | yubo-yue/yubo-python | fluentpython/ch02.py | ch02.py | py | 857 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.split",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "collections.namedtuple",
"line_number": 23,
"usage_type": "call"
}
] |
728222177 | import string
# Initializing Variables
num_sentences = 0
num_words = 0
the_num_sentences = 0
frequency_the = 0
# Task 0
with open('war_and_peace.txt', 'r') as f: # opening and reading file
for line in f:
line = line.rstrip() # removing the space on right side
num_sentences += lin... | ruchitakatkar04/CNS-project-1 | project1.py | project1.py | py | 2,634 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "string.punctuation",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "re.findall",
"line_number": 78,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "itertools.isli... |
36734211163 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
@author: Pramod Bharadwaj Chandrashekar, Li Liu
@email: pchandrashe3@wisc.edu, liliu@asu.edu
"""
import numpy as np
from sklearn.cluster import KMeans
import scipy.stats as stats
def get_cdf_pval(data):
""" Function for guassian mixture of dat and computing pval... | liliulab/DeepCORE | DeepCORE_attention_util.py | DeepCORE_attention_util.py | py | 1,744 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.mean",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.std",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sklearn.cluster.KMeans",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.reshape",
"line... |
31141179192 | import transformers
import torch
def shape(structure):
try:
return structure.shape
except AttributeError:
return (f"list[{len(structure)}]", *shape(structure[0]))
short_prompt = """To be or not to"""
long_prompt = """It was the best of times, it was the worst"""
if __name__ == "__main... | jjjmillist/ttc-workbench | scripts/23-05-18@13:50:44.py | 23-05-18@13:50:44.py | py | 2,176 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "transformers.AutoTokenizer.from_pretrained",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "transformers.AutoTokenizer",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "transformers.AutoModelForCausalLM.from_pretrained",
"line_number":... |
18804693997 | import copy
from typing import Dict, Optional, TypeVar
from pymilvus.exceptions import CollectionNotExistException, ExceptionsMessage
from pymilvus.settings import Config
Index = TypeVar("Index")
Collection = TypeVar("Collection")
class Index:
def __init__(
self,
collection: Collection,
... | milvus-io/pymilvus | pymilvus/orm/index.py | index.py | py | 4,921 | python | en | code | 744 | github-code | 6 | [
{
"api_name": "typing.TypeVar",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "typing.TypeVar",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "typing.Dict",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "collection.Collection",
"... |
3709323219 | import pandas as pd
import numpy as np
from cloudservice import get_documenttask, download_doc
from cloudservice import get_doctag, create_doctag, delete_doctag
from cloudservice import create_doctagrel, delete_doctagrel
from cloudservice import change_step
from cloudservice import get_docs_byid, fill_docinfo
from clou... | pengyang486868/PY-read-Document | analysislocal.py | analysislocal.py | py | 8,022 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cloudservice.get_documenttask",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "config.n_for_project_in_loop",
"line_number": 30,
"usage_type": "attribute"
},
{
"... |
16832434416 | # 图形画布
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
import matplotlib # 导入图表模块
import matplotlib.pyplot as plt # 导入绘图模块
class PlotCanvas(FigureCanvas):
def __init__(self, parent=None, width=0, height=0, dpi=100):
# 避免中文乱码
matplotlib.rcParams['font.sa... | yunmi02/MyProject | 11/源程序/ticket _analysis/chart.py | chart.py | py | 1,900 | python | zh | code | 1 | github-code | 6 | [
{
"api_name": "matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 12,
"usage_type": "attr... |
27834268107 | #! /usr/bin/python3
import numpy as np
from matplotlib import pyplot as plt
# Simple Euler forward
# Input variables
Q = 10.
b = [20.]
S = 1E-2
D = 2E-2
h_b = 4
intermittency = 1
# Constants
phi = 3.97
g = 9.805
rho_s = 2700.
rho = 1000.
tau_star_crit = 0.0495
# Derived variables
a1 = 1. / h_b
a2 = S**0.7 / ( 2.9 ... | MNiMORPH/OTTAR | examples/standalone-widening-intuitive/transport-limited-width.py | transport-limited-width.py | py | 1,398 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
4817137896 | import cv2
import os
import numpy as np
import imutils
def open_picture(image):
"""We open picture"""
img = cv2.imread(image)
return img
def show_picture(name, image, mode, destroy):
cv2.imshow(name, image)
cv2.waitKey(mode)
if mode == 1:
time.sleep(0.2)
... | LeGrosLezard/qu-est-ce-qu-il-y-a-dans-une-salle-a-manger- | program/training/crop_object.py | crop_object.py | py | 1,965 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.imread",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cv2.destroyAllWindows",
"line_n... |
42602524063 | #!/usr/bin/env python
import numpy as np
from subprocess import call
from ase.io import read
def argparse():
import argparse
parser = argparse.ArgumentParser(description = """
This code will give you the (Total/Partial) Raidial Distribution Function.
Return npy file.
""")
# Positional arguments... | hitergelei/tools | ase_rdf.py | ase_rdf.py | py | 14,474 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "asap3.analysis.rdf.RadialDistributionFunction",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "numpy.unique",
"line_number": 62,
"usage_type": "call"
},
{
... |
31014617376 | import numpy as np
import os
import matplotlib.pyplot as plt
import sys
import NeuralTrainerCustoms as ntc
import AdaMod as am
import keras
from keras import backend as K
from keras.models import Sequential, Model
from keras.layers import Input, Layer, Dense, Activation, Embedding, LSTM, Bidirectional, Lambda, conca... | fspring/NeuralArgMining | NeuralModel.py | NeuralModel.py | py | 13,844 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "NeuralTrainerCustoms.Losses",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 143,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
... |
71578033787 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Simple check list from AllenNLP repo:
https://github.com/allenai/allennlp/blob/master/setup.py
To create the package for pypi.
1. Change the version in __init__.py, setup.py as well as docs/source/conf.py.
2. Commit these changes with the message: "Release: VERSION... | langfield/asta | setup.py | setup.py | py | 2,854 | python | en | code | 14 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 61,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "setuptools.setup",
"lin... |
9582892535 | import os
from pathlib import Path
def get_last_n_files_in_dir(dir_path, n, recurse=False, *args, **kwargs):
method_str = "rglob" if recurse else "glob"
p = Path(dir_path)
fluid_glob = getattr(p, method_str)
l = [(i, i.stat().st_mtime) for i in fluid_glob("*.*")]
l.sort(key=lambda x: x[0], **kwar... | royassis/djangoRestML | myapi/helpers.py | helpers.py | py | 536 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pathlib.Path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.remove",
"line_number": 20,
"usage_type": "call"
}
] |
72532713149 | from pathlib import Path
from .code_description import CodeDescriptionParams, CodeDescriptionXLSXDocument
from .dataset_description import (
DatasetDescriptionParams,
DatasetDescriptionXLSXDocument,
)
from .manifest import ManifestXLSXDocument
def write_xlsx_files(
base_path: Path,
dataset_descriptio... | ITISFoundation/osparc-simcore | services/web/server/src/simcore_service_webserver/exporter/_formatter/xlsx/writer.py | writer.py | py | 892 | python | en | code | 35 | github-code | 6 | [
{
"api_name": "pathlib.Path",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "dataset_description.DatasetDescriptionParams",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "code_description.CodeDescriptionParams",
"line_number": 14,
"usage_type": "name... |
26255854051 | from MainA1 import Mainfun
from unigramIndex import Linkedlist
import string
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords
from nltk.stem import WordNetLemmatizer
import pickle
class QueryProcess:
def __init__(self):
'''Attribute for each Query processing results... | prashant18360/Information-Retrieval-Assignment-1 | Qprocessing.py | Qprocessing.py | py | 10,931 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "string.punctuation",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "nltk.tokenize.word_tokenize",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 32,
"usage_type": "call"
},
{
"a... |
31546382074 | from functools import reduce
def main():
# one liner functions
culc_sum = lambda number_list: sum(number_list)
check_palindrome = lambda number: str(number) == str(number)[::-1]
factorial = lambda number: reduce((lambda a, b: a * b), range(1, number + 1))
# check functions
print(culc_sum([1, ... | lidorelias3/Lidor_Elias_Answers | python/One Liners/OneLiners.py | OneLiners.py | py | 437 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "functools.reduce",
"line_number": 8,
"usage_type": "call"
}
] |
16705170564 | from django.shortcuts import render, redirect
from .models import Todo
from .forms import TodoForm
def tasks_list(request):
todos = Todo.objects.all()
context = {'todos': todos}
return render(request, 'tasks_list.html', context)
def add_todo(request):
if request.method == 'POST':
form = Todo... | Chikitonik/DI_Bootcamp | Week_12_PY/Day2/exercises_xp/todo_project/todo_list/todos/views.py | views.py | py | 622 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "models.Todo.objects.all",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "models.Todo.objects",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "models.Todo",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.shor... |
44999838 | import networkx as nx
import numpy as np
# from GPy.kern import Kern
from functools import reduce
from itertools import product
import copy
# class Ours(Kern):
# def __init__(self, input_dim, G, scale=1., variance = 1,
# active_dims=None, name='ours', K_matrix = None, kern = "linear",
# ... | MichelangeloConserva/CutFunctionKernel | interleaving/our_kernel.py | our_kernel.py | py | 8,950 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "networkx.cut_size",
"line_number": 102,
"usage_type": "call"
},
{
"api_name": "functools.reduce",
"line_number": 113,
"usage_type": "call"
},
{
"api_name": "functools.reduce",
"line_number": 114,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
... |
3901695878 | from parse import parse
import pygame
from pygame.locals import *
from cube import Cube
from const import *
from pygame.math import Vector3
from utils import *
from drawable_chunk import DrawableChunk
from hero import Hero
from level import *
class Level(pygame.sprite.Sprite):
def __init__(self):
super(... | odrevet/isometric-map | level.py | level.py | py | 5,207 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.sprite",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.load",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "pygame.math.Ve... |
14177896732 | """Reads parameters of received http request"""
import http.client as http_client
import logging
from typing import Optional
import azure.functions as func
from .custom_error import DownloadBlobError
log = logging.getLogger(name="log." + __name__)
def main(req: func.HttpRequest, params_list: Optional[list] = None)... | wieczorekgrzegorz/ksef-krportal-communication | modules/download_blob/modules/read_params.py | read_params.py | py | 1,531 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "azure.functions.HttpRequest",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "azure.functions",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "ty... |
33247661764 | import sys
from pathlib import Path
import cv2
import imutils
import numpy as np
FILE = Path(__file__).resolve()
ROOT = FILE.parents[1]
if str(ROOT) not in sys.path:
sys.path.append(str(ROOT))
code_dir_path = ROOT.joinpath("Code")
data_dir_path = ROOT.joinpath("Data")
class BlurTool:
def __init__(self):
... | Beau-Yang/CapstoneProject | Code/blur_tool_version.py | blur_tool_version.py | py | 6,194 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pathlib.Path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number... |
18995573707 | import os
os.environ["KMP_DUPLICATE_LIB_OK"] = "TRUE"
from paddleocr import PaddleOCR,draw_ocr
# Paddleocr supports Chinese, English, French, German, Korean and Japanese.
# You can set the parameter `lang` as `ch`, `en`, `fr`, `german`, `korean`, `japan`
# to switch the language model in order.
ocr = PaddleOCR(use_ang... | tota1Noob/autoBookmarkGen4PDF | moduleTryouts/ocrTest.py | ocrTest.py | py | 983 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.environ",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "paddleocr.PaddleOCR",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"lin... |
73955138107 | from tkinter import *
from PIL import Image, ImageDraw
from src.Model import Model
b1 = "up"
xold, yold = None, None
image1, drawimg = None, None
model = Model()
def create_lines(canv):
canv.create_line(30, 0, 30, 140, smooth=TRUE, fill="red", width="1")
canv.create_line(110, 0, 110, 140, smooth=TRUE, fill="r... | Freyb/LegoAI-homework | src/Gui.py | Gui.py | py | 2,185 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "src.Model.Model",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "PIL.Image.new",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "PIL.ImageDraw.Draw",
"line... |
33043283636 | import base64
import os
from django.conf import settings
from django.contrib import messages
from django.contrib.auth import login, logout
from django.contrib.auth.decorators import login_required
from django.contrib.auth.forms import AuthenticationForm, UserCreationForm
from django.core.files.base import ContentFile
... | Vleyked/django-template | dinosaur_app/dinosaurs/views.py | views.py | py | 6,837 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.contrib.auth.forms.UserCreationForm",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "django.contrib.messages.success",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "django.contrib.messages",
"line_number": 24,
"usage_type": "na... |
38714648302 | from rest_framework import serializers
from .models import Animal
import serializer_company
class AnimalSerializer(serializers.HyperlinkedModelSerializer):
company = serializer_company.CompanySerializer()
class Meta:
model = Animal
fields = [
'id',
'name',
... | pohara9720/lma-python | lma/api/serializer_animal.py | serializer_animal.py | py | 591 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rest_framework.serializers.HyperlinkedModelSerializer",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "serializer_company.CompanySerializer",
"line_number": 7,
... |
31126427233 | from gpiozero import DigitalInputDevice
import time
class EncoderCounter(object):
def __init__(self,pin_number,side):
self.side = side
self.test_mode = False
self.pulse_count = 0
self.device = DigitalInputDevice(pin=pin_number)
self.device.pin.when_changed = self.count_pulses
self.previous = ... | gregorianrants/legobot-7 | Encoder.py | Encoder.py | py | 1,404 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "gpiozero.DigitalInputDevice",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 19,
"usage_type": "call"
}
] |
19475609630 | from django.apps import AppConfig
from django.conf import settings
import os
import joblib
class SentimentConfig(AppConfig):
name = 'sentiment'
path = os.path.join(settings.MODELS, 'models.p')
path_emosi = os.path.join(settings.MODELS, 'models_emotion.p')
path_general = os.path.join(settings.MODELS, ... | kholiqcode/skripsi | sentiment/apps.py | apps.py | py | 927 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.apps.AppConfig",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings.M... |
16970226908 | from setuptools import setup
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open("README.md") as f:
long_description = f.read()
version = {}
with open(path.join(here, "emv", "__init__.py")) as fp:
exec(fp.read(), version)
setup(
name="emv",
version=versi... | russss/python-emv | setup.py | setup.py | py | 1,114 | python | en | code | 100 | github-code | 6 | [
{
"api_name": "os.path.abspath",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "codecs.open",
"line_number":... |
40411376601 | #!/usr/bin/env python3
"""
Name: locator_led_status.py
Description: NXAPI: display locator-led status for chassis, modules, fans
Example output:
% ./locator_led_status.py --vault hashicorp --devices cvd_bgw_1 --module 1,2 --fan 1,2
ip hostname status locator-led
192.168.11.110 cvd-1111-bgw ... | allenrobel/nxapi-netbox | scripts/locator_led_status.py | locator_led_status.py | py | 5,240 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "nxapi_netbox.args.args_cookie.ArgsCookie",
"line_number": 48,
"usage_type": "name"
},
{
"api_name": "nxapi_netbox.args.args_nxapi_tools.ArgsNxapiTools",
"line_number": 48,
"... |
21569497560 | #!/usr/bin/env python
""" Script to:
Extract 3D images from a 4D image and then extract one selected slice
from each of these 3D images and combine them as a gif.
"""
# Author: Bishesh Khanal <bishesh.khanal@inria.fr>
# Asclepios INRIA Sophia Antipolis
import subprocess
import sys
import argparse as ag
import ... | Inria-Asclepios/simul-atrophy | scripts/extractSliceVideoFrom4d.py | extractSliceVideoFrom4d.py | py | 4,284 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "bish_utils.print_and_execute",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "bish_utils.print_and_execute",
"line_number": 71,
"usage_type": "call"
},
{
... |
22329982080 | import imp
import discord
from discord.ext import commands
import json
import os
from os import listdir
from os.path import isfile, join
from datetime import datetime
import subprocess
from discordLevelingSystem import DiscordLevelingSystem
import aiosqlite
def micsid(ctx):
return ctx.author.id == 481377376475938... | micfun123/Simplex_bot | cogs/micsid.py | micsid.py | py | 9,632 | python | en | code | 24 | github-code | 6 | [
{
"api_name": "datetime.datetime.now",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "os.listdir",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "discord.ext.comman... |
8201488763 | from flask import render_template, redirect, url_for
from flask_login import login_user, logout_user, current_user
from . import home
from ..models import User, Account, Role, Course
from ..forms import LoginForm, RegisterForm
from sha_training_app import db
import datetime
@home.route('/')
def homepage():
course... | ScottishHD/training_site | sha_training_app/_home/views.py | views.py | py | 2,385 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "models.Course.query.limit",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "models.Course.query",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "models.Course",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "flas... |
24133449429 | #!/usr/bin/env python
import argparse
import csv
import logging
import math
import sys
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from pylab import rcParams
def plot_bar(data_fh, target, xlabel, ylabel, zlabel, title, x_label, y_label, x_order, y_order, fig_width, fig... | supernifty/plotme | plotme/bar.py | bar.py | py | 7,407 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.use",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "matplotlib.style.use",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "matplotlib.style",
... |
44083406715 | # -*- coding: utf-8 -*-
## Add uid to data gathered from qMp nodes in GuifiSants
## http://dsg.ac.upc.edu/qmpsu/index.php
## meshmon-format.py
## (c) Llorenç Cerdà-Alabern, May 2020.
## debug: import pdb; pdb.set_trace()
import json
cache = {}
graph = []
tabs = {}
def find_node_by_address(d, k, v):
"""
find ... | llorenc/meshmon-parser | meshmon-format.py | meshmon-format.py | py | 4,474 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.dumps",
"line_number": 143,
"usage_type": "call"
}
] |
19108144876 | import colors
import info
from icon_path import icon_path
from tooltip import Tooltip
from scan_media_window import ScanMediaWindow
from ingest_window import IngestWindow
from open_window import OpenWindow
from info_window import InfoWindow
try:
import tkinter
except ImportError:
import Tkinter as tkinter
clas... | NPS-DEEP/SectorScope | python/menu_view.py | menu_view.py | py | 4,423 | python | en | code | 11 | github-code | 6 | [
{
"api_name": "Tkinter.Frame",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "Tkinter.Frame",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "colors.BACKGROUND",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "Tkinter.TOP",
... |
71765759867 | """
REPSVM Agresores v3, esquemas de pydantic
"""
from pydantic import BaseModel
from lib.schemas_base import OneBaseOut
class RepsvmAgresorOut(BaseModel):
"""Esquema para entregar agresores"""
id: int | None
distrito_id: int | None
distrito_clave: str | None
distrito_nombre: str | None
dist... | PJECZ/pjecz-plataforma-web-api-new | plataforma_web/v3/repsvm_agresores/schemas.py | schemas.py | py | 824 | python | es | code | 0 | github-code | 6 | [
{
"api_name": "pydantic.BaseModel",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "lib.schemas_base.OneBaseOut",
"line_number": 34,
"usage_type": "name"
}
] |
7047537895 | # import cv2
#
# videoCapture = cv2.VideoCapture("/home/haoyu/yuhao_video/a827.avi")
#
#
# # fps = videoCapture.get()
# # size = (int(videoCapture.get(cv2.cv.CV_CAP_PROP_FRAME_WIDTH)),
# # int(videoCapture.get(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT)))
# #
#
# # videoWriter = cv2.VideoWriter('./data/video_plane.avi',)
... | ylltest/myscripts-github | traffic_lights/new_pil_pd.py | new_pil_pd.py | py | 6,966 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.repeat",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "numpy.shape",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "numpy.argmax",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number":... |
9304520532 | from rest_framework.generics import GenericAPIView
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.permissions import BasePermission
from rest_framework import status
from game.serializers import GameSerializer, TileSerializer, NextMoveSerializer
from game.mode... | earlyche/gomoku | backend/game/views.py | views.py | py | 4,210 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rest_framework.permissions.BasePermission",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "game.serializers.TileSerializer",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "game.serializers",
"line_number": 22,
"usage_type": "name"
},... |
1826616432 | import cv2
import matplotlib.pyplot as plt
import numpy as np
from skimage.measure import label
from skimage.io import imread, imshow
def read_image(url):
imagem = cv2.cvtColor(imread(url), cv2.COLOR_RGB2HSV)
return imagem
def apply_mask(imagem):
x = imagem.shape[0]
y = imagem.shape[1]
mask = np.... | EricaFer/Nudity-Detection | utils/preprocessing.py | preprocessing.py | py | 1,487 | python | pt | code | 0 | github-code | 6 | [
{
"api_name": "cv2.cvtColor",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "skimage.io.imread",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_RGB2HSV",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
... |
43449602370 | #!/usr/bin/env python3
import re
import json
import urllib.request
import pymysql.cursors
def ipToCountry(ip):
url = 'http://api.ipstack.com/' + ip + '?access_key=dfe38edcd4541577119d91e7053a584a'
data = urllib.request.urlopen(url).read().decode("utf-8")
json_data = json.loads(data)
if not json_data['country_name... | VadimAspirin/usml | back/log_mapper.py | log_mapper.py | py | 9,005 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "urllib.request.request.urlopen",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "urllib.request",
"line_number": 10,
"usage_type": "name"
},
{
"api_nam... |
29572346979 | from __future__ import annotations
from typing import TYPE_CHECKING, Any, Literal
from transformers import AutoTokenizer
from partial_tagger.data.collators import TransformerCollator
from partial_tagger.encoders.transformer import (
TransformerModelEncoderFactory,
TransformerModelWithHeadEncoderFactory,
)
fr... | yasufumy/pytorch-partial-tagger | src/partial_tagger/utils.py | utils.py | py | 1,230 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "typing.Literal",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "partial_tagger.encoder... |
70205052348 | import os
import argparse
import sys
import warnings
from pathlib import Path
warnings.filterwarnings('ignore')
import torch
import torchvision as tv
import pytorch_lightning as pl
import webdataset as wds
from resnet_sagemaker.models import ResNet
from resnet_sagemaker.callbacks import PlSageMakerLogger, ProfilerCall... | johnbensnyder/resnet-sagemaker | pytorch/train.py | train.py | py | 4,937 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get"... |
11946226959 | import sys, os, urllib.request, urllib.error, urllib.parse, logging, pwd
import subprocess, site, cgi, datetime, threading, copy, json
import uuid, time, re
from html import escape # ***MUST COME before `from lxml import html`!***
from collections import defaultdict, OrderedDict
from lxml import html
from lxml.html im... | jcomeauictx/pyturn | myturn.py | myturn.py | py | 32,136 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.basicConfig",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "logging.INFO",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "threading.Loc... |
6742136861 | import numpy as np
import cv2
cap = cv2.VideoCapture(0)
faceCascade = cv2.CascadeClassifier("face.xml")
while(True):
# Capture frame-by-frame
ret, frame = cap.read()
# Our operations on the frame come here
gray = frame
# find face
# Detect faces in the image
faces = faceCascade.detectMu... | khanab85/FaceDetectors | start.py | start.py | py | 866 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.CascadeClassifier",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.CASCADE_SCALE_IMAGE",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "cv2... |
111612310 | import json
f = open('dados.json')
Dados = json.load(f)
Dados = [x for x in Dados if x['valor'] > 0]
menor = float("inf")
#menor faturamento diário
for x in Dados:
atual = x['valor']
if(menor > atual):
menor = atual
print('O menor valor de faturamento ocorrido em um dia do mês foi de ', menor)
#maior fatu... | CaioPyro/Target_Sistemas | Faturamento/main.py | main.py | py | 890 | python | pt | code | 0 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 5,
"usage_type": "call"
}
] |
73966289468 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import requests
import json
#药监总局地址:http://scxk.nmpa.gov.cn:81/xk/
if __name__ == "__main__":
url = 'http://scxk.nmpa.gov.cn:81/xk/itownet/portalAction.do?method=getXkzsList'
user_agent = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chro... | xjuun/Note | Python/爬虫/code/request基础/06.requests之药监总局相关数据爬取.py | 06.requests之药监总局相关数据爬取.py | py | 1,414 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.post",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 41,
"usage_type": "call"
}
] |
39556012979 | # -*- coding: utf-8 -*-
"""
Created on Sun Aug 12 10:37:33 2018
@author: Gerardo Cervantes
"""
import xml.etree.cElementTree as ET
from src.coordinates import Coordinates
from src.hotkeys import Hotkeys
class SharedPreferences():
COORDINATES_TAG = 'coordinates'
SPLIT_TAG = 'split_key'
RESET_TAG = '... | gcervantes8/Star-Classifier-For-Mario-64 | src/shared_preferences.py | shared_preferences.py | py | 3,050 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "xml.etree.cElementTree.Element",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "xml.etree.cElementTree",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "xml.etree.cElementTree.SubElement",
"line_number": 28,
"usage_type": "call"
},
... |
36721611160 | import torch
from torch import nn
from modules import ConvSC, Inception
# stride를 만들어내는 모듈..
def stride_generator(N, reverse=False):
strides = [1, 2]*10
if reverse: return list(reversed(strides[:N]))
else: return strides[:N]
# N_S개 만큼 Stride를 생성한 후, ConvSC 생성해서
# 총 N_S의 깊이를 가진 Encoder 모듈 생성.
class Encoder... | J-PARK11/Video_Prediction_using_SimVP | model.py | model.py | py | 4,304 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"lin... |
20538043919 | """
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list.
You may assume the two numbers do not contain any leading zero, except the number 0 itse... | Amit258012/100daysofcode | Day14/add_two_numbers_linked_list.py | add_two_numbers_linked_list.py | py | 1,871 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.Optional",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 24,
"usage_type": "name"
}
] |
42442738126 | from django.shortcuts import render
from .models import Twit,Company
import datetime
from django.contrib.auth.mixins import LoginRequiredMixin
from django.views import View
from django.http import HttpResponse,HttpResponseRedirect,Http404
import jdatetime
from django.db.models import Q # new
import datetime
# Create y... | mhsharifi96/sursiz_ir | backend/bors/views.py | views.py | py | 5,221 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "datetime.timedelta",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "jdatetime.date.fromgregorian",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "jd... |
14870918627 | import logging
def initLogging():
# Use simple logging in this file
# See whether I can seperate logging from this program and my library
logging.basicConfig(filename='test_logging.log',level=logging.DEBUG,
format='%(asctime)s %(message)s', datefmt='%Y%m%d-%H%M%S')
logger = logging.getLogger('... | qiuwch/tenon | test/test_logging.py | test_logging.py | py | 934 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "logging.basicConfig",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.path.append... |
20493833703 | import json
d1 = {
'Pessoa 1': {
'nome:': 'Luiz Augusto',
'idade:': 25,
},
'Pessoa 2': {
'nome:': 'Adriano Santos',
'idade:': 30,
},
}
print()
print(d1,'\n')
d1_json = json.dumps(d1, indent=True)
with open('arquivo.json', 'w+') as file:
file.write(d1_json)
print(... | Adriano1976/Curso-de-Python | Secao03-Programacao-Procedural/Aula087-Arquivos-Criar-ler-escrever-e-apagar/main.py | main.py | py | 329 | python | pt | code | 0 | github-code | 6 | [
{
"api_name": "json.dumps",
"line_number": 17,
"usage_type": "call"
}
] |
18405151031 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 12 17:56:03 2020
@author: mints
"""
import logging
import itertools
import joblib
import warnings
import numpy as np
from astropy.utils.exceptions import AstropyUserWarning
from pandas.core.common import SettingWithCopyWarning
from semiphore_public.... | minzastro/semiphore_public | fit/complete_fit.py | complete_fit.py | py | 7,837 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "astropy.utils.exceptions.AstropyUserWarning",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "warnings.filterwarnings",
"line_number": 18,
"usage_type": "call"
}... |
71969151547 | from django.contrib import admin
from django.urls import path, re_path
from . import views
urlpatterns = [
path('',views.index,name="words-index"), #index homePage
path('words/',views.index,name="words-index"),#index homePage
path('random/',views.get_random,name="random"), #Random word
path('words/<str... | gystr/words | words/urls.py | urls.py | py | 1,067 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
26038693036 | from __future__ import annotations
import logging
import os
import re
import textwrap
from collections import defaultdict
from dataclasses import dataclass
from pants.backend.codegen.protobuf.protoc import Protoc
from pants.backend.codegen.protobuf.target_types import (
AllProtobufTargets,
ProtobufGrpcToggleF... | pantsbuild/pants | src/python/pants/backend/codegen/protobuf/go/rules.py | rules.py | py | 25,015 | python | en | code | 2,896 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 93,
"usage_type": "call"
},
{
"api_name": "pants.backend.go.util_rules.build_pkg_target.GoCodegenBuildRequest",
"line_number": 96,
"usage_type": "name"
},
{
"api_name": "pants.backend.codegen.protobuf.target_types.ProtobufSourceFi... |
33850641451 | # 第 0002 题:生成的200个激活码保存在mysql关系型数据库中
import random, string
import pymysql
def get_string(num, length=10):
codes = []
chars = string.ascii_uppercase + string.digits
for i in range(num):
one_code = random.sample(chars, length)
codes.append(''.join(one_code))
return codes
def save_code_mysql():
try:
conn =... | akenYu/learnpy | showme/02/savemysql.py | savemysql.py | py | 1,070 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "string.ascii_uppercase",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "string.digits",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "random.sample",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pymysql.co... |
35374859965 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 8 22:42:38 2022
@author: sanggupark
"""
import numpy as np
import traci
from dataclasses import dataclass
import math
from shapely.geometry import LineString, Point
from SimpleMath import create_vehicle_shape
@dataclass(init = True)
class Object... | sanggu-park/blaft_simulation | Sensing.py | Sensing.py | py | 3,640 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "dataclasses.dataclass",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.radians",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "shapely.geometry.Point",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "math.sin",... |
71674830588 | import genanki
import functools
import os
TRUE_FALSE_MODEL_ID = 1803127777
@functools.lru_cache()
def load_true_false_model():
data = {}
for fname in ['fields.json', 'templates.yaml', 'cards.css']:
path = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
'true_false_model',
fnam... | kerrickstaley/anatomyquestions | note.py | note.py | py | 1,414 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number"... |
70167475709 | #!/usr/bin/env python
from setuptools import setup, Extension
import os
from os import popen
from os.path import dirname, join
class lazy_cythonize(list):
def __init__(self, callback):
self._list = None
self.callback = callback
def c_list(self):
if self._list is None:
sel... | bogdanbabych/paralex4cfields | tests/cwb-python/setup.py | setup.py | py | 2,041 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.environ",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "os.popen",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_... |
3990110801 | from functions import *
from create_directory import *
from Crypto.Cipher import AES
import os
import shutil
import time
home = user_home()
if os.path.exists(home + "DataShareSecure") == False:
print("\nNous vous prions de lire le fichier \"Readme.txt\" et de suivre ces consignes.\n")
sys.exit()
print("BIEN... | Su1M01/DataShareSecure | Receiver.py | Receiver.py | py | 3,616 | python | fr | code | 0 | github-code | 6 | [
{
"api_name": "os.path.exists",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.chdir",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": ... |
26061079286 | import nltk
from nltk.tokenize import *
import numpy as np
#--------------------------------------------------------
alphabet = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
punctuation = ['?',',','!','.',':',';']
char_count= [0] * len(alphabet)
punctuation_... | andresOchoaHernandez/AuthorshipRecognition | PythonPrototype/extract_features.py | extract_features.py | py | 4,777 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.set_printoptions",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "nltk.pos_tag",
"line_number": 129,
"usage_type": "call"
}
] |
71842718268 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable #autograd oops
import torch.optim as optim
# core code of TRADES
# shhhhhh where does the author use l2-norm?????
def squared_l2_norm(x):
flattened = x.view(x.unsqueeze(0).shape[0], -1)
return (flattened ** ... | yaoyugua/TRADES | TRADES-master/trades.py | trades.py | py | 4,661 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.KLDivLoss",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "torch.randn",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "torch.enable_grad",
"line... |
25066459905 | from django.contrib.auth import mixins
from oauth2_provider.contrib.rest_framework import (
OAuth2Authentication as BaseOAuth2Authentication,
)
from purplship.server.core.authentication import (
JWTAuthentication,
TokenAuthentication,
get_request_org,
)
class OAuth2Authentication(BaseOAuth2Authentica... | danh91/purplship | insiders/server/iam/purplship/server/iam/authentication.py | authentication.py | py | 1,109 | python | en | code | null | github-code | 6 | [
{
"api_name": "oauth2_provider.contrib.rest_framework.OAuth2Authentication",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "purplship.server.core.authentication.get_request_org",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.mixins.Acces... |
45897381316 | import os
from PIL import Image
class ImageUpscaler:
def __init__(self, image_path, scale_factor):
self.image_path = image_path
self.scale_factor = scale_factor
def upscale_image(self, image_file):
# Open the image
image = Image.open(image_file)
# Calculate the new di... | huju-tub/visual-cryptography-generator | classes/image_upscaler.py | image_upscaler.py | py | 1,598 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "PIL.Image.open",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "PIL.Image.BICUBIC",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image",
"line... |
8469582185 | from calculations import get_standings, get_current_track_data
from utils import get_player_name, get_telegram_name
from plots import timedelta_to_string
def info_about_current_weeks_ladder_changes(old_data, new_data):
new_data = get_current_track_data(new_data)
new_data = new_data[new_data["Origin"] == "Play... | Excidion/trackmania_nations_challenge_bot | messages.py | messages.py | py | 2,399 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "calculations.get_current_track_data",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "calculations.get_standings",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "calculations.get_standings",
"line_number": 13,
"usage_type": "call"
},
... |
30357818911 | from pyface.qt import QtCore, QtGui, is_qt4
from pyface.image_resource import ImageResource
from pyface.timer.api import do_later
from pyface.ui_traits import Image
from traits.api import (
Any,
Bool,
Button,
Dict,
Event,
List,
HasTraits,
Instance,
Int,
Property,
Str,
cac... | enthought/traitsui | traitsui/qt/table_editor.py | table_editor.py | py | 49,857 | python | en | code | 290 | github-code | 6 | [
{
"api_name": "pyface.qt.is_qt4",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "editor.Editor",
"line_number": 57,
"usage_type": "name"
},
{
"api_name": "traitsui.editors.table_editor.BaseTableEditor",
"line_number": 57,
"usage_type": "name"
},
{
"api_... |
17270713471 | import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import make_regression
from mpl_toolkits import mplot3d
# Training phase/ Training the LR model/ Find optimal weights
def fit(X, y):
"""
X: Feature matrix: (n_samples, n_features)
y: y_true: (n_samples,1)
Returns: weights
wei... | princeyyadav/CB-DS-LV-May21 | DS/S13-linear-regression/viz.py | viz.py | py | 1,905 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.ones",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.concatenate",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.inv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"lin... |
485113359 | import pytest
from graph_pkg.edit_cost.edit_cost_proteins_tu import EditCostProteinsTU
from graph_pkg.graph.label.label_node_proteins_tu import LabelNodeProteinsTU
from graph_pkg.graph.node import Node
@pytest.mark.parametrize('coord1, e_cost, expected',
[
((1,),... | CheshireCat12/graph_project | tests/unit_edit_cost/test_edit_cost_proteins_tu.py | test_edit_cost_proteins_tu.py | py | 2,168 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "graph_pkg.graph.node.Node",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "graph_pkg.graph.label.label_node_proteins_tu.LabelNodeProteinsTU",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "graph_pkg.edit_cost.edit_cost_proteins_tu.EditCostProt... |
27016970830 | from otree.api import (
models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer,
Currency as c, currency_range
)
from django.utils.translation import ugettext_lazy as _
from GameFeb19_intro.models import add_currency, add_tokens, TRNSL_ERR_MSG, translated_languages
import csv
import random
aut... | TatianaMayskaya/oTree | GameFeb19_questions_cognitive/models.py | models.py | py | 4,609 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "otree.api.BaseConstants",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "csv.DictReader",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "otree.api.BaseSubsession",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "GameF... |
9963863734 | import numpy as np
import scipy.sparse as sp
import torch
import time
import random
from utils.tool import read_data, write_dic, dictionary, normalize, sparse_mx_to_torch_sparse_tensor
def encoding_test(test_graph_path, test_fact_path, train_dataset = "fb237_v1"):
"""load test-graph and test-facts, and ... | shuwen-liu-ox/INDIGO | utils/utils_test_pattern.py | utils_test_pattern.py | py | 9,170 | python | en | code | 22 | github-code | 6 | [
{
"api_name": "time.time",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "utils.tool.read_data",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "utils.tool.read_data",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "utils.tool.dictio... |
43077970864 | from typing import Any, Callable, Dict, Optional, Type, Union
from fugue.execution.execution_engine import ExecutionEngine, SQLEngine
from fugue.execution.native_execution_engine import NativeExecutionEngine
from triad.utils.convert import to_instance
from triad import assert_or_throw, ParamDict
class _ExecutionEngi... | ofili/Wrangle-and-Analyze-Data | venv/Lib/site-packages/fugue/execution/factory.py | factory.py | py | 15,192 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.Dict",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.Callable",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.Type",
"line_numbe... |
17609260691 | # encoding: utf-8
import badgrlog
import datetime
from django.utils import timezone
from rest_framework import permissions
from rest_framework.response import Response
from rest_framework import serializers
from rest_framework import status
from backpack.models import BackpackCollection, BackpackBadgeShare, Backpac... | reedu-reengineering-education/badgr-server | apps/backpack/api.py | api.py | py | 16,711 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "badgrlog.BadgrLogger",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "entity.api.BaseEntityListView",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "issuer.models.BadgeInstance",
"line_number": 38,
"usage_type": "name"
},
{
"ap... |
22195221109 | from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import numpy as np
from btk import btk
import os
import matplotlib
import matplotlib.pyplot as plt
from tkinter import *
from tkinter.messagebox import *
from tkinter import ttk
# Label = strike / off ; con... | staufga0/DM_Project | Source/file.py | file.py | py | 14,754 | python | fr | code | 0 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.r_",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "numpy.ravel",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"line_number"... |
21095535591 | import torch
import torch.nn as nn
import numpy as np
from torch.nn.functional import upsample, interpolate
from Spa_downs import *
import torch.nn.functional as F
from torch.autograd import Variable
import argparse
from torch.nn import init
import scipy.io as sio
import os
import random
class ReshapeTo... | pyguan88/MDA-Net | function.py | function.py | py | 6,689 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "torch.reshape",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
"li... |
18834111771 | # -*- coding: utf-8 -*-
# Author:sen
# Date:9090/3/94 10:48
from typing import List
from heapq import *
class Solution:
def majorityElement(self, nums: List[int]) -> int:
from collections import Counter
counter = Counter(nums)
for item in counter.items(): # item: (元素, 数量)
if ite... | PandoraLS/CodingInterview | ProgrammingOJ/LeetCode_python/169_多数元素.py | 169_多数元素.py | py | 892 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "collections.Counter",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "{'Counter': 'collections.C... |
39201428004 | import cv2
import time
import os
import HandTrackingModule as htm
from dronekit import connect, VehicleMode, LocationGlobalRelative, APIException
import time
import socket
import math
import argparse
from pymavlink import mavutil
from time import sleep
import numpy as np
###############################################... | 2ashishmohan/Hand-Gesture-Controlled-Quadcopter-UAV | HandTrackingDemo.py | HandTrackingDemo.py | py | 6,355 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "dronekit.connect",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "dronekit.VehicleMode",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "time.sl... |
22248410521 | """
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
from urllib import parse
import os
import logging
class S(BaseHTTPRequestHandler):
def _set_response(self):
self.send_response(200)
self.send_he... | jacquesCedric/newWWP-server | listener/Listener.py | Listener.py | py | 2,426 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "http.server.BaseHTTPRequestHandler",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "urllib.parse.parse_qs",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "urllib.parse",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": ... |
8692787672 | from strong.models import Project, Images
from rest_framework import serializers
class ImagesSerializers(serializers.HyperlinkedModelSerializer):
project_id = serializers.PrimaryKeyRelatedField(queryset=Project.objects.all(),source='project.id')
class Meta:
model = Images
fields = ('project_id'... | urielcookies/RESTFUL_API | strong/serializers.py | serializers.py | py | 753 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rest_framework.serializers.HyperlinkedModelSerializer",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.PrimaryKeyRelatedField",
"line... |
72579481788 | from flask import Flask, request, redirect, url_for
from flask_jsonpify import jsonify
from flask import render_template
from flask import abort
from flask import Response
from flask_api import status
import json
from flaskext.mysql import MySQL
import pandas as pd
import requests
from datetime import datetime, timedel... | cotraak/weather-app-flask | app.py | app.py | py | 4,277 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flaskext.mysql.MySQL",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "flask.request.... |
31211286041 | # -*- coding: utf-8 -*-
"""
Created on Wed Oct 28 07:07:43 2015
@author: RAHUL JAIN
"""
from xml.dom.minidom import parse
import xml.dom.minidom
DOMTree = xml.dom.minidom.parse("chemsep1.xml")
compounds = DOMTree.documentElement
compound = compounds.getElementsByTagName("compound")
i = 1
for comp in comp... | RahulJain7/Openmodelica-Thermodynamic-Engine | PythonFiles/getComp.py | getComp.py | py | 15,689 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "xml.dom.minidom.dom.minidom.parse",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "xml.dom.minidom.dom",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "xml.dom.minidom",
"line_number": 10,
"usage_type": "name"
}
] |
16480507143 | """Original from https://github.com/yhenon/pytorch-retinanet"""
import torch
import torch.nn as nn
import numpy as np
import skimage.io
import skimage.transform
import skimage.color
import skimage
from PIL import Image
def comptue_dim(dim, padding, kernel_size, stride):
return np.floor((dim + 2*padding - kerne... | sebastiani/pytorch-attention-augmented-convolution | utils/utils.py | utils.py | py | 7,137 | python | en | code | 18 | github-code | 6 | [
{
"api_name": "numpy.floor",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "torch.nn.Module",
"line_numb... |
37021992627 | from django.core.exceptions import ObjectDoesNotExist
from django.http import StreamingHttpResponse, HttpResponse
from rest_framework.response import Response
from .models import AudioSlice, Audio
from .serializers import AudioSerializer, AudioSliceSerializer
from rest_framework.decorators import api_view
from rest_fra... | Choleor/choleor-audio-reboot | audio/views_old.py | views_old.py | py | 8,450 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "re.compile",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "re.I",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.parsers.MultiPartParser.parse",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "res... |
30282625342 | from dataclasses import dataclass, replace
from typing import Any
from uuid import UUID
from topics.domain.repositories.topic_repository import TopicRepository
from topics.domain.usecases.base import Usecase
@dataclass(kw_only=True)
class UpdateTopicRequest:
id: UUID
content: str | None = None
discussed:... | cbenavid/topics | src/topics/domain/usecases/topic/update_topic.py | update_topic.py | py | 893 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "uuid.UUID",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "topics.domain.usecases.base.Usecase",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "to... |
30503616911 | # Author: Ron Jones
# Date Created: 7-3-17
# Date Last Modified: 7-4-17
# Purpose: Check CDS Overlay Excel Sheet with Master Data Sheet
# Status: Working perfectly with MDS and CDS_Overlay_Final2.xlsx as of July 4, 2017
'''Note: The "compare dicts function iterates through every
correct combination of entries from the... | NISTBoard/data_validation | Classified_Info_Script.py | Classified_Info_Script.py | py | 3,365 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "openpyxl.load_workbook",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "openpyxl.load_workbook",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sys.argv"... |
22514895256 | #!/usr/bin/env python3
from fastapi import APIRouter, Body, Request, Response, HTTPException, status
from bson.objectid import ObjectId
from typing import List
from lib.mongo import insert_one, find_one, find_many, update_one
from models.prescription import Prescription, PrescriptionUpdate
router = APIRouter()
coll ... | Serlych/national-medical-record | routes/prescription.py | prescription.py | py | 1,582 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "fastapi.Request",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "lib.mongo.find_many",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "fastapi.status.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.