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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
23074821915 | from contextlib import contextmanager
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from planner.model import Base
class TransactionFactory(object):
def __init__(self, path=None, bind=None, expire_on_commit=False,
create_all=False):
if (not bind and not pat... | saltpy/planner | planner/model/connect.py | connect.py | py | 902 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "planner.model.Base.metadata.create_all",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "planner.model.Base.metadata",
"line_number": 16,
"usage_type": "attribute... |
28732913965 | import chess.pgn
import re
games_separator_regex = re.compile(r"(\[.*\]\W)+\n(.*\W(?!\[))+")
class Game:
"""This class is used to manage games loaded from .pgn files."""
def __init__(self, pgn_filepath):
self.games = []
try:
self.load_games(pgn_filepath)
except Exception a... | yaxlie/pgn-chess | strong_moves_extractor/src/game.py | game.py | py | 833 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "re.compile",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "io.StringIO",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "chess.pgn.pgn.read_game",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "chess.pgn.pgn",
"li... |
23577407972 | #Uses python3
import sys
from collections import deque
def number_of_components(adj):
def walk(node):
component = set([node])
queue = deque([node])
while queue:
cur = queue.pop()
for node in adj[cur]:
if node not in component:
qu... | zhangruochi/OnlineLearning | Data Structures and Algorithms/Algorithm on Graph/week1/09_graph_decomposition_starter_files_1/connected_components/connected_components.py | connected_components.py | py | 990 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "collections.deque",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.stdin.read",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 32,
"usage_type": "attribute"
}
] |
28482066145 | import codecs
import re
import sys
from pathlib import Path
from typing import List, MutableMapping, Optional, Sequence, Tuple, Type
import setuptools
def _read(source_file_name: Path):
if not source_file_name.is_file():
raise FileNotFoundError(source_file_name)
with codecs.open(str(source_file_name)... | jwilges/drover | setup.py | setup.py | py | 5,944 | python | en | code | 4 | github-code | 7 | [
{
"api_name": "pathlib.Path",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "codecs.open",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "typing.MutableMapping",
"li... |
36120614302 | import cv2
import face_recognition as fr
import numpy as np
import os
import image_to_numpy as im_np
#-----------Based on ageitgey/face_recognition demo-----------#
def main():
#----------Load Known values----------#
known_encodings = [] #arrays for encodings and associated names
known_names = []
fo... | mbkarle/IdentityInsight | recognize.py | recognize.py | py | 2,674 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.listdir",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "face_recognition.load_image_file",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "face_recognition.face_encodings",
"line_number": 19,
"usage_type": "call"
},
{
"api_n... |
35248871436 | # encoding=utf-8
# 用DNN做回归预测,训练X:t-3, t-2, t-1; y: t
from pandas import read_csv
import matplotlib.pyplot as plt
import numpy as np
import math
from keras.models import Sequential
from keras.layers import Dense, SimpleRNN
data_path = 'data/international-airline-passengers.csv'
footer = 3
seed = 7
look_back = 3
epochs ... | liuqinyi/deep-learning | generative_models/DNN_to_regress.py | DNN_to_regress.py | py | 2,409 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.array",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "keras.models.Sequential",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "keras.layers.Dense",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "keras.layers.D... |
7899025517 | # -*- coding: utf-8 -*-
"""
Created on Thu Jun 17 15:24:10 2021
@author: user
"""
import os
import numpy as np
from matplotlib import pyplot as plt
import math
from scipy import interpolate
station_path = "E:\\tech\\ncdr\\ncdr_rain_predict\\data\\station_data\\2016\\05\\20160501"
for file in os.listdir(station_path... | YiShan8787/ncdr_rain_predict | test_for_load_tmp.py | test_for_load_tmp.py | py | 3,049 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.listdir",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.full",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "math.ceil",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "numpy.nan",
"line_number": 66,
... |
32192665685 | __author__ = "Damian Giebas"
__email__ = "damian.giebas@gmail.com"
__license__ = "GNU/GPLv3"
__version__ = "1.1"
import config as c
import logging
from helpers.exceptions import MASCMException
from mascm.edge import Edge
from mascm.lock import Lock
from mascm.resource import Resource
from pycparser.c_ast import *
from... | PKPhdDG/rdao_detector | mascm/operation.py | operation.py | py | 8,989 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "mascm.resource.Resource",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "mascm.resource.Resource",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "logging.debug",
"line_number": 141,
"usage_type": "call"
},
{
"api_name": "mascm.... |
74541685983 |
""""
config
* Update variables used by unit tests as msAI evolves
"""
import pytest
from collections import namedtuple
# Attributes that should exist in the MSfile interface and have values provided by subclass implementations (mzMLfile)
MSfile_attributes = ['_run_id',
'_run_date',
... | IsotopeC/msAI | tests/config.py | config.py | py | 2,617 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "collections.namedtuple",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 77,
"usage_type": "call"
}
] |
23394259322 | """
Texas has CSV files containing county-level and statewide results for all offices
for all years back to 2000. All of the files are pre-processed and available on Github at
https://github.com/openelections/openelections-data-tx.
"""
from future import standard_library
standard_library.install_aliases()
from builtins... | openelections/openelections-core | openelex/us/tx/datasource.py | datasource.py | py | 3,939 | python | en | code | 175 | github-code | 7 | [
{
"api_name": "future.standard_library.install_aliases",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "future.standard_library",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "openelex.base.datasource.BaseDatasource",
"line_number": 18,
"usage_type": ... |
37381777761 | from django.core.validators import MinValueValidator, MaxValueValidator
from django.db import models
from django.conf import settings
from geopy import distance
class Location(models.Model):
zip = models.PositiveIntegerField(
'Индекс',
validators=[MinValueValidator(100), MaxValueValidator(99999)],... | IBA20/welbex | welbex/cargo/models.py | models.py | py | 3,731 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.db.models.Model",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.models.PositiveIntegerField",
"line_number": 8,
"usage_type": "call"
},
{
"a... |
16515644132 | """Defines URL patterns for store."""
from django.urls import path, include
from . import views
app_name = 'store'
urlpatterns = [
# Home page
path('', views.products, name = 'products'),
# New use registration page.
path('users/register', views.register, name ='register'),
# Individual product'... | AaRyAmIsTrY/Web-Store | store/urls.py | urls.py | py | 817 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.urls.path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.urls.path",... |
602112596 | from requests import get
from pprint import PrettyPrinter
BASE_URL ='https://status.aws.amazon.com'
ALL_JSON = '/data.json'
printer = PrettyPrinter()
# accesses the json file and stores its data
data = get(BASE_URL + ALL_JSON).json()
archive = data["archive"]
# creates a list containing issues found... | lucyt245/amazon-data | amazon-data.py | amazon-data.py | py | 1,274 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pprint.PrettyPrinter",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
}
] |
27131172301 | import json
from collections import OrderedDict
with open("vectors.txt", 'r') as f:
a = f.read()
# 0*1001~(0+1)*1001
# 1*1001~(1+1)*1001
# 2*1001~(2+1)*1001
# ...
# 24022*1001~(24022+1)*1001
elements = a.split()
WORD_NUM = len(elements)/1001
wordVectors = {}
wordVectors['word2vec'] = OrderedDict()
wordVectors['vec... | MenSanYan/create_coco_dataset | createWordVectors.py | createWordVectors.py | py | 706 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "collections.OrderedDict",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 23,
"usage_type": "call"
}
] |
36144883629 | #!/usr/bin/env python
import pika
parameters = pika.URLParameters('amqps://Administrator:administrator123@b-8894e7fb-ac9c-4657-8912-473a0bf03efa.mq.us-east-1.amazonaws.com:5671/%2f')
connection = pika.BlockingConnection(parameters)
# connection = pika.BlockingConnection(
# pika.ConnectionParameters(host='localhos... | wong-fu-jie/CS5224-project-frontend | rabbitmq/optimisation_server_v2.py | optimisation_server_v2.py | py | 1,182 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "pika.URLParameters",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pika.BlockingConnection",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pika.BasicProperties",
"line_number": 32,
"usage_type": "call"
}
] |
74336785504 | from django.shortcuts import render, redirect
from django.db.models import F
from .forms import StudentLoginForm, StudentForm, LibrarianForm, StudentRemoveForm, BookForm, BookRemoveForm
from .models import Student, Librarian, Book, History
import datetime
def StudentLogin(request):
if request.method == "POST":
... | JoKeR-VIKING/LibraryManagementSystem | base/views.py | views.py | py | 8,800 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "forms.StudentLoginForm",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "models.Student.objects.filter",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "models.Student.objects",
"line_number": 12,
"usage_type": "attribute"
},
{
"a... |
36884996683 | from flask import Flask, jsonify
import requests
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
votes = [
{
'post_id': 0,
'vote_count': -1,
},
{
'post_id': 1,
'vote_count': 5,
},
{
'post_id': 2,
'vote_count': 42,
... | swakita14/Microservice-Architecture | final-swakita14-master/microservice/app.py | app.py | py | 634 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 37,
"usage_type": "call"
}
] |
37343534085 | # Author: Andrew.M.G.Reynen
from __future__ import print_function
from copy import deepcopy
from future.utils import iteritems
from PyQt5 import QtWidgets,QtGui,QtCore
from PyQt5.QtCore import Qt
import pyproj
from CustomFunctions import dict2Text, text2Dict
from lazylyst.UI.CustomPen import Ui_customPenDia... | AndrewReynen/Lazylyst | lazylyst/Preferences.py | Preferences.py | py | 31,987 | python | en | code | 16 | github-code | 7 | [
{
"api_name": "copy.deepcopy",
"line_number": 107,
"usage_type": "call"
},
{
"api_name": "CustomFunctions.dict2Text",
"line_number": 118,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QDialog",
"line_number": 160,
"usage_type": "attribute"
},
{
"api_name"... |
7370348913 | from fastapi import FastAPI
# from fastapi import status
from starlette import status
app = FastAPI()
@app.post("/demo01/", status_code=201)
async def create_item(name: str):
return {"name": name}
#
# POST请求:http://127.0.0.1:8000/demo01/?name=one
# 返回结果:相应系统状态码:201Created
"""
{
"name": "one"
}
"""
@app.po... | Thousandhack/fastapi_stu | fastapi_demo19_statusCode/main.py | main.py | py | 1,038 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "starlette.status.HTTP_201_CREATED",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "starlette.status",
"line_number": 22,
"usage_type": "name"
},
{
"api_name":... |
24560947387 | from __future__ import annotations
import logging
from typing import Any, Iterable, List, Optional, Tuple, Union
from uuid import uuid4
import numpy as np
from langchain_core.documents import Document
from langchain_core.embeddings import Embeddings
from langchain_core.vectorstores import VectorStore
from langchain_... | langchain-ai/langchain | libs/community/langchain_community/vectorstores/milvus.py | milvus.py | py | 31,749 | python | en | code | 68,990 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "langchain_core.vectorstores.VectorStore",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "langchain_core.embeddings.Embeddings",
"line_number": 104,
"usage_type": "name"... |
8668970766 | import pymysql.cursors
class PyMysqlBaseUsage(object):
def __init__(self,
host='localhost',
port=3306,
user='user',
password='passwd',
db='db',
charset='utf8mb4',
cursorclass=pymysql.cursors.Dic... | fadeawaylove/spider_improve | spider_04_爬虫数据处理/爬虫数据存储/d03_pymysql使用.py | d03_pymysql使用.py | py | 3,101 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pymysql.cursors.cursors",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "pymysql.cursors",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "pymysql.cursors.connect",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "... |
34474998728 | """Adapted from https://github.com/zzzace2000/GAMs_models/.
It implements the bagging of GAM models. Unlike sklearn implmementation of BaggingClassifier, it
averages the logits instead of the probability to make sure the bagging of GAMs is still a GAM. It
also implements the get_GAM_df() that automatically takes avera... | zzzace2000/nodegam | nodegam/gams/MyBagging.py | MyBagging.py | py | 13,655 | python | en | code | 32 | github-code | 7 | [
{
"api_name": "base.MyGAMPlotMixinBase",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "utils.get_GAM_df_by_models",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "numpy.... |
69994904222 | from pycocoevalcap.tokenizer.ptbtokenizer import PTBTokenizer
from pycocoevalcap.bleu.bleu import Bleu
from pycocoevalcap.meteor.meteor import Meteor
from pycocoevalcap.rouge.rouge import Rouge
from pycocoevalcap.cider.cider import Cider
from pycocoevalcap.spice.spice import Spice
class EvalCap:
def __init__(self... | GX77/Dual-Stream-Transformer-for-Generic-Event-Boundary-Captioning | densevid_eval/caption_eval/pycocoevalcap/eval.py | eval.py | py | 3,142 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "pycocoevalcap.tokenizer.ptbtokenizer.PTBTokenizer",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "pycocoevalcap.bleu.bleu.Bleu",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "pycocoevalcap.meteor.meteor.Meteor",
"line_number": 44,
"u... |
74892080544 | import sys
sys.path.insert(0,'..')
import numpy as np
import tensorflow as tf#
from tensorflow.keras.losses import BinaryCrossentropy
# import tensorflow_addons as tfa
from tensorflow.keras import activations
from tensorflow.keras import utils
from tensorflow.keras.losses import BinaryCrossentropy
from tensorflow.ker... | DanielDimanov/RAMOSS | retrain_city_model_from_enc.py | retrain_city_model_from_enc.py | py | 8,274 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.path.insert",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "dataloaders.cityscapes.cityscapes.get_img_paths",
"line_number": 33,
"usage_type": "call"
},
{
"api_n... |
35705708754 | import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
import syft as sy
import torch
from torch import nn
from torch import optim
import torch.nn.functional as F
from torchvision import datasets, transforms
import sys
from collections import defaultdict
from researcher_worker import Researche... | SiloML/silo-researcher | test_researcher.py | test_researcher.py | py | 4,498 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "warnings.simplefilter",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "syft.TorchHook",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "researcher_dataloader.ResearcherDataset",
"line_number": 43,
"usage_type": "call"
},
{
"api_n... |
18272397197 | import requests
import re
import scrapy.func as func
r = requests.get("https://movie.douban.com/subject/1293929/")
content = r.content.decode('utf-8')
# print(content)
reg = re.compile(r'id="info">(.*?)<div id="interest_sectl">', re.S | re.M)
s = reg.findall(content)[0]
regBlank = re.compile(r'\s{2}', re.S | re.M)
s... | edxiang/Scrapy_Python | scrapy/GetFundamentalInfo.py | GetFundamentalInfo.py | py | 604 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "re.S",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "re.M",
"line_number": 9,
"usag... |
38481140554 | import cv2
import glob
import imghdr
import os
import tempfile
from pathlib import Path
import numpy as np
from PySide2.QtWidgets import QVBoxLayout, QHBoxLayout, QToolButton, QSpinBox, QLineEdit, QGraphicsView, QSlider, QWidget, QApplication, QFileDialog, QMainWindow, QAction, QMessageBox, QPushButton, QLabel, QGroup... | Mullans/ImageSegmenter | src/SegmenterWindow.py | SegmenterWindow.py | py | 22,858 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.path.join",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
74432335262 | # %%
from cellpose import models
import numpy as np
import matplotlib.pyplot as plt
# from process_zebrafish_zarr import process_bette_zarr
import zarr
#%% preprocess dataset into groups
# zarr_file = "/mnt/efs/shared_data/YeastiBois/zarr_files/Tien/glass_60x_023.zarr"
# process_bette_zarr(zarr_file)
# # %% Get voxel... | cmalinmayor/yeastibois | competition.py | competition.py | py | 1,689 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.percentile",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.imshow",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "matplotli... |
5360553131 | import collections as coll
from utils import *
def find_options(cur):
options = set()
for i in range(len(cur)):
if cur[i:i+2] in ins:
for ii in ins[cur[i:i+2]]:
options.add(cur[0:i] + ii + cur[i + 2:])
if cur[i] in ins:
for ii in ins[cur[i]]:
... | lamprecht-dev/adventofcode | 2015/19/main.py | main.py | py | 2,599 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "collections.defaultdict",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 22,
"usage_type": "call"
}
] |
18955611319 | from Auto_Augment.core.mnist import get_mnist, data_generator, SimpleModel, get_and_compile_model
from Auto_Augment.core.util.supervised_loop import supervised_train_loop
from ray import tune
def run_trial(lr=1e-5, batch_size=16, epochs=5):
print("--------------------")
print(lr, batch_size, epochs)
print... | Krithika16/final_year_project_jarrow | Auto_Augment/core/stationary_policy.py | stationary_policy.py | py | 1,296 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "Auto_Augment.core.mnist.get_mnist",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "Auto_Augment.core.mnist.get_and_compile_model",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "Auto_Augment.core.mnist.SimpleModel",
"line_number": 11,
... |
23155166836 | """The bridge data file definitions and functions for any horde worker type."""
from __future__ import annotations
import pathlib
import re
import urllib.parse
from loguru import logger
from pydantic import BaseModel, ConfigDict, Field, field_validator, model_validator
from strenum import StrEnum
from horde_sdk.ai_... | Haidra-Org/horde-sdk | horde_sdk/ai_horde_worker/bridge_data.py | bridge_data.py | py | 13,911 | python | en | code | 11 | github-code | 7 | [
{
"api_name": "strenum.StrEnum",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "pydantic.ConfigDict",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "loguru.logger.... |
27113087429 | import os
import sys
import scipy.io as sio
from readfiles import *
EPS = np.finfo(float).eps
whiskers=[
"RA0","RA1","RA2","RA3","RA4",
"RB0","RB1","RB2","RB3","RB4",#"RB5",
"RC0","RC1", "RC2","RC3","RC4","RC5",
"RD0","RD1","RD2","RD3","RD4","RD5",
"RE1","RE2","RE3","RE4","RE5"]
whisker_id=[(0,0... | trashpirate/py-research | py_research/whiskit_import.py | whiskit_import.py | py | 3,618 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "scipy.io.savemat",
"line_number": 141,
"usage_type": "call"
},
{
"api_name": "scipy.io",
"line_number": 141,
"usage_type": "name"
}
] |
9923497853 | from __future__ import print_function
import os
import json
import uproot
import hist
import numpy as np
from scipy.optimize import curve_fit
from scipy.stats import moyal
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import mplhep as hep
import re
hep.set_style(hep.style.CMS)
def calc_mean(... | UHH2/JetMass | rhalph/unfolding_toys_closure.py | unfolding_toys_closure.py | py | 10,484 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "matplotlib.use",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "mplhep.set_style",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "mplhep.style",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "numpy.sqrt",
"l... |
6637036081 | #!/bin/python3
#######################################
# RPi SSD1306 I2C display service
#
# Taka Kitazume
# Version 0.2
# March 1, 2021
#######################################
import time
import socket
import busio
from PIL import Image, ImageDraw, ImageFont
import adafruit_ssd1306
from flask import Flask, request
... | takarocks/rpissd1306display | ssd1306display.py | ssd1306display.py | py | 1,871 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "busio.I2C",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "adafruit_ssd1306.SSD1306_I2C",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "PIL.Image.new",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
... |
2468652434 | from gevent import monkey;
monkey.patch_all()
import gevent
import time
from multiprocessing import Process
from queue import Queue
from settings import *
from vpsClinet import VpsClient
from proxyPool import ProxyPool
"""
拨号策略:
定时拨号,间隔拨号
协程拨号
代理使用策略:
阈值:超过阈值拨号
"""
class Schedule(object):
def __in... | tl566/proxyPool-1 | schedule.py | schedule.py | py | 2,763 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "gevent.monkey.patch_all",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "gevent.monkey",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "proxyPool.ProxyPool",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "vpsClinet.Vps... |
42289005028 | from .views import ProductListView ,ProductDetailView,deleteProduct,UpdateProductView,add_product, myProductsListView
from django.urls import path
app_name = 'product'
urlpatterns=[
path('home/',ProductListView.as_view(), name="home"),
path(r'?P<slug>/',ProductDetailView.as_view(),name="product_detail"),
... | NKrChauhan/Django-HandySell-ecommerce | ecommerce/Product/urls.py | urls.py | py | 585 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "views.ProductListView.as_view",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "views.ProductListView",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "dja... |
6235623668 | from __future__ import division
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from torch.nn.utils.rnn import pack_padded_sequence as pack
from torch.nn.utils.rnn import pad_packed_sequence as unpack
import onmt
from onmt.Utils import aeq
def rnn_... | harvardnlp/var-attn | onmt/Models.py | Models.py | py | 27,518 | python | en | code | 327 | github-code | 7 | [
{
"api_name": "onmt.modules.SRU",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "onmt.modules",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 24,
"usage_type": "argument"
},
{
"api_name": "torch.nn.Module",
... |
72979492702 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# @FileName :tune.py
# @Time :2021/11/20 下午7:42
# @Author :Miracleyin
# @Mail :miracleyin@live.com
import argparse
import os
from recbole.trainer import HyperTuning
from recbole.quick_start import objective_function
from recbole.utils import init_logger, ensure... | LEOXC1571/pgcc | tune.py | tune.py | py | 2,133 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.path.dirname",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"lin... |
9263974561 | from typing import TextIO
def read(input_file: TextIO) -> list[list[int]]:
lst1 = []
x = input_file.readlines()
for i in x:
i = i.split()
if '\n' in i:
i.remove('\n')
lst1.append(i)
return lst1
reader = open('hdbhb', 'r')
print(read(reader))
| inder460/CSC108-Python-Projects | testing code/2017Exam.py | 2017Exam.py | py | 300 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "typing.TextIO",
"line_number": 4,
"usage_type": "name"
}
] |
14650707536 | import pygame
from src.Video.VisualiserOneLiner import VisualiserOneLiner
class CommandModule:
def __init__(self, x, y, w, h):
self.current = ""
self.visualiser = VisualiserOneLiner(x, y, w, h)
self.visualiser.update_text("> " + self.current)
self.history = [""]
self.index... | CribberSix/finding_earl_minigame | src/Input/CommandModule.py | CommandModule.py | py | 1,650 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "src.Video.VisualiserOneLiner.VisualiserOneLiner",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pygame.KEYDOWN",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "pygame.K_UP",
"line_number": 18,
"usage_type": "attribute"
},
{
... |
21693759779 | from django.urls import path
from . import views
urlpatterns = [
path('index',views.index,name='index'),
path('categorias',views.categorias,name='categorias'),
path('periodistas',views.periodistas,name='periodistas'),
path('contacto',views.contacto,name='contacto'),
path('noticia1',views.noticia1,n... | bhartalduoc/caosnews | pjcaosnews/caosnews/urls.py | urls.py | py | 763 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"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",
... |
70910122145 | import numpy as np
np.set_printoptions(linewidth=np.nan)
import matplotlib.pyplot as plt
import cv2
from face_data import load_faces
from plotting import plot_img_with_bbox
def get_bounding_boxes(im, window_size=100, shift_size=50, thresh=0.3):
H, W = im.shape
bboxes = {}
def get_window(j, i):
ret... | cynthiaxhua/feature-animation | classify.py | classify.py | py | 2,095 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "numpy.set_printoptions",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "numpy.nan",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "face_data.load_faces",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "cv2.imread",... |
71862060385 | """oxpam URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based... | friedkiwi/oxhack-pamela | oxpam/urls.py | urls.py | py | 1,069 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.conf.urls.url",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.include",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_... |
33107047797 | from pyspark.sql import SparkSession
spark = SparkSession.builder.master("local[*]").getOrCreate()
import json
import numpy as np
import sys
sc = spark.sparkContext
text = sc.textFile(sys.argv[1])
df_fin =text.map(lambda x: json.loads(x))
def myFuncA(x):
return ((x['reviewerID'], x['asin']),(x['overall'], x['... | Preetham97/RecommenderSystemforBooks | Code.py | Code.py | py | 3,804 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "pyspark.sql.SparkSession.builder.master",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "pyspark.sql.SparkSession",
"line_number": 2,
"usage_type": "n... |
368660942 | from __future__ import print_function
import os
import h5py
import numpy as np
import copy
from collections import OrderedDict
from simnibs.simulation.tms_coil.tms_coil import TmsCoil
from simnibs.utils.mesh_element_properties import ElementTags
from . import pygpc
from ..mesh_tools import mesh_io
from .sim_struct ... | simnibs/simnibs | simnibs/simulation/gpc.py | gpc.py | py | 37,495 | python | en | code | 87 | github-code | 7 | [
{
"api_name": "h5py.File",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "h5py.File",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "numpy.squeeze",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "os.path.splitext",
"line_number... |
38085707864 | import glob
import asyncio
from dir_settings import DATA_PATH
from asgiref.sync import sync_to_async
import pandas as pd
import spotipy
from spotipy.oauth2 import SpotifyClientCredentials
class Uris:
'''Handling Uris'''
spotify_key = None
spotify_secret = None
def __init__(self):
pass
... | ytneu/audiofeatures-downloader | get_uris/uris_downloader.py | uris_downloader.py | py | 3,389 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "asyncio.get_event_loop",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "asyncio.ensure_future",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "dir_settings.DATA_PATH",
"line_number": 58,
"usage_type": "name"
},
{
"api_name": "g... |
32460159135 | import os
import numpy as np
import pyqtgraph as pg
from PyQt5.QtCore import QThread, QObject, pyqtSignal, QRunnable, QThreadPool
from PyQt5.QtGui import QImage
from PyQt5.QtWidgets import QAction, QSpinBox, QLabel, QDoubleSpinBox, QMenu, QTableWidget, QPushButton, QWidget, \
QVBoxLayout, QHBoxLayout
from mne.viz i... | nickware44/DeepBCI | pynfb/widgets/signals_painter.py | signals_painter.py | py | 22,501 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "PyQt5.QtCore.QObject",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCore.pyqtSignal",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtCore.pyqtSignal",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "... |
40627211651 |
from messy.lib import roles as r
from messy.lib import plate_utils
from dateutil import parser
import uuid
def setup(dbh):
dbh.EK.bulk_update(ek_initlist, dbsession=dbh.session())
dbh.Group.bulk_insert(messy_groups, dbsession=dbh.session())
# add controls
dbh.session().add(
dbh.Institutio... | trmznt/messy | messy/models/setup.py | setup.py | py | 11,668 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "uuid.uuid4",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "dateutil.parser.parse",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "dateutil.parser",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "dateutil.parser.pars... |
32764669886 | from tkinter import StringVar, Tk, ttk
from tkinter.messagebox import showinfo
import routes
from sqlalchemy.exc import DataError
import time
from datetime import date
import calendar
class App(Tk):
def __init__(self) -> None:
super().__init__()
self.title('Employee Login')
self.geometry(... | Latinobull/Employee-Time-Management | gui.py | gui.py | py | 3,744 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "tkinter.Tk",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "tkinter.ttk.Label",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "tkinter.ttk",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "tkinter.StringVar",
"lin... |
7574969195 | import unittest
import mock
import sys
import os
module_path = os.path.dirname(os.path.curdir + "." + os.path.sep)
sys.path.insert(0, os.path.abspath(module_path+"/source"))
from serial_connection import serial_port_connection, serial_open
from roboapi import Atmega, Buzzer
# Creating an instance object for testing
... | sauravshandilya/SDES-2016-Project2 | tests/test_serial.py | test_serial.py | py | 3,170 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.path.dirname",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "sys.path.insert",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number... |
25999435498 | import numpy as np
np.seterr(invalid='ignore')
from configs.config import BaseEnvConfig
from envs.model.agent import *
from envs.model.mdp import JointState
from shapely.geometry import *
tmp_config = BaseEnvConfig()
def tensor_to_joint_state(state): # 恢复原先尺度
robot_states, human_states = state
robot_stat... | BIT-MCS/GCRL-min-AoI | envs/model/utils.py | utils.py | py | 8,375 | python | en | code | 37 | github-code | 7 | [
{
"api_name": "numpy.seterr",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "configs.config.BaseEnvConfig",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "envs.model.mdp.JointState",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "nu... |
33550704025 | ## 0926
## week1 assignment spell checker by claire
import re
from collections import Counter
import streamlit as st
def words(text): return re.findall(r"[^\d\W]+\'*[^\d\W]+", text.lower())
## match all words without numbers
## include ' if there's any
WORDS = Counter(words(open('big.txt').read()))
def P(word, N=su... | Clairelin298/2022_NLP_Spell_checker | spell_checker.py | spell_checker.py | py | 2,340 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "re.findall",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "streamlit.title",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "streamlit.sidebar.check... |
43905875253 | from fastapi import FastAPI, Query
import uvicorn
from typing import Annotated
from pymongo import MongoClient
client = MongoClient("mongodb://localhost:27017/")
db = client['transaction']
transaction_collection = db['transaction']
collections_in_db = db.list_collection_names()
transaction_user_day_collection = db... | RaziyeNikookolah/m93-practices | hw19/q/main.py | main.py | py | 3,723 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "fastapi.FastAPI",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "typing.Annotated",
"line_number": 54,
"usage_type": "name"
},
{
"api_name": "fastapi.Query",
... |
43707904555 | import numpy as np
import operator
from sklearn.utils import shuffle
from statistics import mean, stdev
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from tqdm import tqdm
from sklearn.model_selection import train_test_split
import gc
import utils_autograd_hacks as auto... | jasonwei20/bert-frozen | code/utils_mlp_8_knn.py | utils_mlp_8_knn.py | py | 3,286 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.nn.Module",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
36766362394 | import os
import torch
import numpy as np
import boltzgen as bg
import mdtraj
import matplotlib as mpl
from matplotlib import pyplot as plt
from openmmtools.testsystems import AlanineDipeptideVacuum
def evaluate_aldp(z_sample, z_test, log_prob, transform,
iter, metric_dir=None, plot_dir=None,
... | lollcat/fab-torch | fab/utils/aldp.py | aldp.py | py | 14,128 | python | en | code | 28 | github-code | 7 | [
{
"api_name": "boltzgen.mixed",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "boltzgen.internal",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "numpy.ceil",
... |
41598161768 | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.common.exceptions import NoSuchElementException
from time import sleep
import time
from threading import Timer
import winrt.windows.ui.notifications as notifications
import winrt.wind... | Nwott/CovidVaccineBot | main.py | main.py | py | 9,716 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "json.load",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "winrt.windows.ui.notifications.ToastNotificationManager",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "winrt.windows.ui.notifications",
"line_number": 23,
"usage_type": ... |
33374727005 | from sklearn.model_selection import train_test_split
from sklearn.naive_bayes import GaussianNB
import pandas as pd
import numpy as np
tennis_data = pd.read_csv('playtennis.csv')
# print(tennis_data)
tennis_data.Outlook = tennis_data.Outlook.replace('Sunny', 0)
tennis_data.Outlook = tennis_data.Outlook.repla... | sangwoo-sean/Dolearn-machine-Learning | dolearn_박상우_10주_NaiveBayes.py | dolearn_박상우_10주_NaiveBayes.py | py | 2,307 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_n... |
24817627097 | """Serializer for Price model"""
from ...models import Price
from rest_framework import serializers
class PriceSerializer(serializers.ModelSerializer):
"""Serializes prices by showing currency, value and date seen"""
class Meta(object):
"""Some model meta"""
model = Price
fields =... | ponyriders/django-amazon-price-monitor | price_monitor/api/serializers/PriceSerializer.py | PriceSerializer.py | py | 403 | python | en | code | 153 | github-code | 7 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "models.Price",
"line_number": 15,
"usage_type": "name"
}
] |
23655778438 | import argparse
import h5py
from math import *
import tensorflow as tf
from tensorflow.python.tools import freeze_graph
import numpy as np
import json
import os, ast
import sys
np.set_printoptions(threshold=sys.maxsize)
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(BASE_DIR)
sys.path.append(os.... | ViniciusMikuni/PCT_HEP | scripts/save_model.py | save_model.py | py | 3,363 | python | en | code | 7 | github-code | 7 | [
{
"api_name": "numpy.set_printoptions",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.maxsize",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
10199220212 | import sys
import argparse
import gzip
import re
import subprocess
"""
usage: polarizeVCFbyOutgroup [-h] [-vcf VCF] [-out OUT] [-ind IND] [-keep] [-add] [-gz]
Switch REF and ALT allele of a vcf file if the specified individual is homozygous ALT.
This script was modified by Javi Sala-Garcia (javier.sala@mncn.csic.es... | mataman2017/Junco_reseq | Various/polarizeVCFbyOutgroup.py | polarizeVCFbyOutgroup.py | py | 4,333 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "re.compile",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "re.escape",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "re.DOTALL",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"li... |
12822973529 | from flask import render_template, request, redirect, session, abort
from app import app
import database
@app.route("/")
def index():
return render_template("index.html", msg="")
@app.route("/login", methods=["GET", "POST"])
def login():
if request.method == "POST":
username = request.form["username"]... | oskrsjlnd/sajinboard | routes.py | routes.py | py | 7,464 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.render_template",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "app.app.route",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "app.app",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "flask.request.method",
"... |
75002983583 | import collections
import logging
import uuid
# NOTE(jkoelker) Patch Vlog so that is uses standard logging
from ovs import vlog
class Vlog(vlog.Vlog):
def __init__(self, name):
self.log = logging.getLogger('ovs.%s' % name)
def __log(self, level, message, **kwargs):
level = vlog.LEVELS.get(le... | OpenState-SDN/ryu | ryu/services/protocols/ovsdb/client.py | client.py | py | 9,535 | python | en | code | 33 | github-code | 7 | [
{
"api_name": "ovs.vlog.Vlog",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "ovs.vlog",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "ovs.vlog.LEVELS.get",
... |
15188578415 | import module_manager
module_manager.review()
import pyaudio
import numpy
import pygame
import os
import aubio
import random
from collections import deque
import time
import math
import pygame.gfxdraw
import wave
import sys
from aubio import source, onset
#adapted from the aubio demo code
def getOnsets(filename):
... | mhsieh808/Osu-112TP | TP2.py | TP2.py | py | 23,382 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "module_manager.review",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.argv.append",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "sys.argv.append",
... |
19920538530 | #!/usr/bin/env python
## Script to replace original seq. ids with unique internal ids.
import argparse
import os
from pathlib import Path
from Bio import SeqIO
parser = argparse.ArgumentParser(description="Script to replace original seq. ids with unique internal ids.")
# Read in args
parser.add_argument("--infile"... | vmikk/SHMatcher | bin/replace_seq_names_w_codes.py | replace_seq_names_w_codes.py | py | 1,115 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "Bio.SeqIO.parse",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "Bio.SeqIO",
"line_number": 26,
"usage_type": "name"
}
] |
12954509145 | """
This module constructs an object representing the file structure and the abstract
syntax tree (AST) for every Python code file in a given git repo.
This module creates a dictionary object mapping the SHA1 hash of a commit of a git
repo to a custom object that maintains information about the directory of the git
re... | antoniopugliese/module-structure | parsing.py | parsing.py | py | 6,319 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "os.walk",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "networkx.Graph",
"line_number":... |
39656624824 | from __future__ import unicode_literals
from django.db import migrations
from django.contrib.auth import get_user_model
from oauth2_provider.models import get_application_model
from django.conf import settings
# This migration file creates default admin user for the mezzanine server
# and default EM client app and de... | onap/vvp-cms | django/cms/migrations/0002_user_application.py | 0002_user_application.py | py | 2,019 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "django.conf.settings.CMS_APP_USER",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.conf.settings.CMS_APP_USER_PASSWORD",
"line_number": 12,
"usage_type":... |
5852037646 | from pytest import raises
from io import BytesIO
from svgast.ast import Svg, G, Rect, Circle, Text
from svgast.units import px
from svgast.xml import serialise, write
example_ast = Svg(
G(
Rect(x=1, y="2", width=px(3), height=4),
Text('Hello', Rect(), 'World', cls='awesome')
),
G(
... | concert/svgast | test/test_xml.py | test_xml.py | py | 1,792 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "svgast.ast.Svg",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "svgast.ast.G",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "svgast.ast.Rect",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "svgast.units.px",
"lin... |
5029069751 | #!/usr/bin/env python3
import os
import sys
import json
import collections
import unicodedata
TEXT_FIELD = "t"
OPTIONS_FIELD = "o"
KIND_FIELD = "k"
CORRECT_FIELD = "c"
MANDATORY_FIELDS = {TEXT_FIELD, OPTIONS_FIELD, CORRECT_FIELD}
def norm(s):
return unicodedata.normalize("NFD", s)
def error(message, *, n):
... | kapyshin/rusk | scripts/check-questions.py | check-questions.py | py | 2,195 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "unicodedata.normalize",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path.normpath",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "os.pat... |
26045633558 | from __future__ import print_function
import os.path
from bs4 import BeautifulSoup
from google.auth.transport.requests import Request
from google.oauth2.credentials import Credentials
from google_auth_oauthlib.flow import InstalledAppFlow
from googleapiclient.discovery import build
from googleapiclient.errors import H... | ohio-software-development/RustGoogleTUI | RustTUIOUSDC/src/gmailCleanAPI.py | gmailCleanAPI.py | py | 6,633 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.path.path.exists",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "google.oauth2.credentia... |
22901201100 | import numpy as np
import pylab
from scipy.optimize import curve_fit
import pyregion
from astropy.io import fits
from matplotlib import rc
#rc('font',**{'family':'serif','serif':['Palatino']})
#rc('text', usetex=True)
from matplotlib import gridspec
from matplotlib import ticker
from matplotlib import font_manager
impo... | ebonnassieux/Scripts | MakeFluxPlot.py | MakeFluxPlot.py | py | 20,002 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "pickle.dump",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_nu... |
1833855468 | from typing import List, Tuple
import polars as pl
from focus_converter.configs.base_config import (
ConversionPlan,
MissingColumnDType,
SetColumnDTypesConversionArgs,
)
from focus_converter.conversion_functions.validations import ColumnValidator
class DeferredColumnFunctions:
"""
# Set of funct... | finopsfoundation/focus_converters | focus_converter_base/focus_converter/conversion_functions/deferred_column_functions.py | deferred_column_functions.py | py | 5,778 | python | en | code | 6 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "focus_converter.configs.base_config.ConversionPlan",
"line_number": 21,
"usage_type": "name"
},
{
"api_n... |
38622535026 | import uuid
import flask
from flask import request
import json
from BusinessLayer.AnswerManager import AnswerManager
from BusinessLayer.IntentManager import IntentManager
from CustomConfigurations.AnswerRepositoryConfiguration import AnswerRepositoryConfiguration
from CustomConfigurations.IntentRepositoryConfiguratio... | SerhatKumas/Flask--ExternalDialogflowApi | RestApi/IntentApi.py | IntentApi.py | py | 3,584 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "uuid.uuid4",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "BusinessLayer.AnswerManager.AnswerManager",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "DataAccessLayer.AnswerRepository.AnswerRepository",
"line_number": 24,
"usage_type":... |
70531746142 | """Console script for qnorm."""
import argparse
import sys
from .util import get_delim
try:
import pandas as pd
except ModuleNotFoundError:
raise ImportError(
"To make use of the CLI of qnorm pandas needs to be installed!"
)
import qnorm
def main():
"""Console script for qnorm."""
parse... | Maarten-vd-Sande/qnorm | qnorm/cli.py | cli.py | py | 944 | python | en | code | 19 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "qnorm.__version__",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "util.get_delim",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pandas.... |
14432067119 | from datetime import tzinfo, timedelta, datetime
from BaseLog import *
ZERO = timedelta(0)
HOUR = timedelta(hours=1)
# A UTC class.
class UTC(tzinfo):
"""UTC"""
def utcoffset(self, dt):
return ZERO
def tzname(self, dt):
return "UTC"
def dst(self, dt):
return ZERO
utc = UTC... | iop-apl-uw/basestation3 | BaseTime.py | BaseTime.py | py | 5,638 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "datetime.timedelta",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "datetime.tzinfo",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "datetime.tzinfo",
... |
26233400935 | from flask import Flask, request, render_template, redirect
import joblib
import requests
# Declare a Flask app
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
def main():
if request.method == "POST":
if request.form.get("predict")=="predict":
return redirect("/predic... | IBM-EPBL/IBM-Project-25300-1659957984 | Project Development/Sprint 4/Code/app.py | app.py | py | 3,762 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "flask.request.form... |
4931503507 | import pygame, sys
from pygame.locals import *
import random
pygame.init()
FPS = 60
FramePerSec = pygame.time.Clock()
# Predefined some colors
BLUE = (0, 0, 255)
RED = (255, 0, 0)
GREEN = (0, 255, 0)
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
# Screen information
SCREEN_WIDTH = 600
SCREEN_HEIGHT = 600
# Game... | Solem66/PythonGameExample | main.py | main.py | py | 4,187 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pygame.init",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.time.Clock",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.time",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.set_mode",... |
71273511584 | import sys, json, csv
import concurrent.futures as futures
from datetime import datetime
import utility.airtable_manager as airtable
import sheets.LO_OverChallengesWeeks as s1
import sheets.LO_OverDaysNotPersistent as s2
import sheets.LO_OverDaysPersistent as s3
import sheets.StudentEvaluations_OverDaysNotPersistent as... | eddy10957/python_Student_Analytics | mark-analytics/run.py | run.py | py | 6,916 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.stdout.write",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "utility.airtable_manager.getStudentsContent",
"line_number": 24,
"usage_type": "call"
},
{
"api_... |
5123803484 | import matplotlib.pyplot as plt
lenguajes = ['py','java','dart','ts','elixir']
encuesta = [50.,10,20,10,10]
plt.bar(lenguajes,encuesta)
#########
plt.title('lenguajes mas usados')
plt.xlabel('lenguajes de programacion')
plt.ylabel ('porcentaje de uso de lengiajes')
plt.savefig ('graficos lenguaje.png')
#########
plt.sh... | geronimo0630/2021 | clases/GRAFICA/graficosbarra.py | graficosbarra.py | py | 325 | python | es | code | 0 | github-code | 7 | [
{
"api_name": "matplotlib.pyplot.bar",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.title",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotl... |
16914431253 | """
abc300 C
"""
from itertools import product
def correct(section):
"""区間がバツ印かどうか
Args:
section (list): 区間
Returns:
bool: バツ印かどうか
"""
for i, j in product(range(len(section)), range(len(section[0]))):
if (i == j or len(section) - i - 1 == j) and section[i][j] != "#":
... | shunya-fug/atcoder-python | contest/abc300/c/main.py | main.py | py | 837 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "itertools.product",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "itertools.product",
"line_number": 29,
"usage_type": "call"
}
] |
25062067396 | __author__='AlVictor'
import json
import os
import time
import datetime
import pyodbc as Banco
class GravaBanco:
def __init__(self, dadosJson):
self.dadosJson = dadosJson
def insertdados(self, queryString):
conexao = Banco.connect("Driver={SQL Server};Server=wadb02.webaula.dc;Databa... | AlexandreVictor/Extrator_Direct_T | grava_banco.py | grava_banco.py | py | 6,534 | python | pt | code | 0 | github-code | 7 | [
{
"api_name": "pyodbc.connect",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "time.strftime",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "time.gmtime",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "time.strftime",
"line_nu... |
29070382598 | from europe_option_price import european_option_pricing
from america_option_price import american_option_pricing
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif'] = ['SimHei'] # 中文显示
plt.rcParams['axes.unicode_minus'] = False # 用来正常显示负号
class implied_vol:
def... | bboyGit/derivatives | option/implied_volatility.py | implied_volatility.py | py | 4,771 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 7,
"usage_type": "attribute"
},
{
"ap... |
70886550622 | # sudo apt-get install python3-pil.imagetk
# sudo apt-get install python3-tkinter.filedialog
from datetime import datetime
from random import randint
from tkinter import *
from tkinter import filedialog
import pydotplus
from PIL import ImageTk
from DeleteCache import *
from ProdClass import *
from graphProperties imp... | Fasinir/Graph-Transformations | Ostateczna_wersja_v2/main.py | main.py | py | 20,431 | python | pl | code | 0 | github-code | 7 | [
{
"api_name": "pydotplus.Dot",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "pydotplus.Node",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "pydotplus.Edge",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "random.randint",
"lin... |
35415360911 | '''
Created on 03/05/2015
@author: arsenioferreira
'''
import wx
import matplotlib
matplotlib.use('WXAgg')
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
from matplotlib.backends.backend_wx import NavigationToolbar2Wx
from matplotlib.figure import Figure
from pandas.tools.plotting impo... | abrahanfretes/tava_antes | py/una/pol/tava/view/vscatter_matrix.py | vscatter_matrix.py | py | 5,531 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "matplotlib.use",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "wx.Panel",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "wx.Panel.__init__",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "wx.Panel",
"line_nu... |
36738994247 | import os, random, numpy as np
from typing import List, Union, Tuple, Optional, Dict, Callable, Iterable
import matplotlib.pyplot as plt
import scipy.stats as stats
from matplotlib.figure import Figure
from matplotlib.image import AxesImage
from matplotlib.axes import Axes, BarContainer
import xarray as xa
from skimage... | nasa-nccs-cds/spectraclass | spectraclass/test/texture/LBP_view_histograms.py | LBP_view_histograms.py | py | 2,290 | python | en | code | 4 | github-code | 7 | [
{
"api_name": "xarray.DataArray",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "spectraclass.test.texture.util.load_test_data",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "matplotlib.figure.Figure",
"line_number": 25,
"usage_type": "name"
... |
41588219678 | import pandas as pd
import numpy as np
from sklearn.ensemble import RandomForestRegressor
from sklearn.ensemble import GradientBoostingRegressor
from staticMethod.feature_extract import featureExtract, featureExtractTest
from sklearn.model_selection import cross_val_score
from sklearn.metrics import mean_absolute_error... | LogisticFreedom/kdd_cup | staticMethod2/rf.py | rf.py | py | 4,882 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.mean",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.abs",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.abs",
"line_number": 19,
... |
27669807200 |
# DFS
def dfs ( graph, v, visited ) :
visited[v] = True
print(v, end=' ')
for i in graph[v] :
if not visited[i] :
dfs( graph, i, visited )
graph = [
[],
[2, 3, 8],
[1, 7],
[1, 4, 5],
[3, 5],
[3, 4],
[7],
[2, 6, 8],
[1, 7]
]
visited = [False]*9
df... | JinnyHwang/2023_Study_backup | python_study_file_backup/python/20210413/DFS, BFS_복습.py | DFS, BFS_복습.py | py | 787 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "collections.deque",
"line_number": 35,
"usage_type": "call"
}
] |
71351857183 | import bcrypt
from pydantic import BaseModel
from enum import Enum
from connection.CouchbaseConnection import CouchbaseConnection
from connection.Neo4jConnection import Neo4jConnection
class TipoUsuario(int, Enum):
alunoMedio = 0,
alunoSuperior = 1
professor = 2
class Usuario(BaseModel):
cpf: str
... | HenriqueHartmann/NovoSofa-Backend | models/Usuario.py | Usuario.py | py | 2,312 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "enum.Enum",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "bcrypt.gensalt",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "bcrypt.hashpw",
"line_... |
86987493523 | import sqlalchemy
import pandas as pd
from datetime import datetime
import numpy as np
from choose_stocks import choose_stocks
def get_date_series():
"""Returns a series of dates which are the last date in
every month"""
engine = sqlalchemy.create_engine("sqlite:///backtesting.db")
with engine.connect(... | ChrisDarley/momentum_sp500_backtesting | get_returns.py | get_returns.py | py | 3,002 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.read_sql",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "d... |
73326353824 | from pyFTS.common import FuzzySet
from pyFTS.partitioners import partitioner
from sklearn.cluster import MiniBatchKMeans
from . import ClusterMembership
class KMeansPartitioner(partitioner.Partitioner):
def __init__(self, **kwargs):
super(KMeansPartitioner, self).__init__(name="KMeans", preprocess=False, ... | cseveriano/spatio-temporal-forecasting | src/spatiotemporal/models/clusteredmvfts/partitioner/KMeansPartitioner.py | KMeansPartitioner.py | py | 1,188 | python | en | code | 6 | github-code | 7 | [
{
"api_name": "pyFTS.partitioners.partitioner.Partitioner",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pyFTS.partitioners.partitioner",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "sklearn.cluster.MiniBatchKMeans",
"line_number": 22,
"usage_... |
17330716823 | import psycopg2
# ------------------------ Way 1 (preffered) -------------------------
# connection_string = "host='localhost' dbname='example' user='postgres' password='root'"
# connection = psycopg2.connect(connection_string)
# ------------------------------ Way 2 -------------------------
connection = psycopg2.c... | mohammadrajabraza/fullstack-nanodegree | psychopg2-demo1.py | psychopg2-demo1.py | py | 1,230 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "psycopg2.connect",
"line_number": 9,
"usage_type": "call"
}
] |
34321434696 | import sys
import time
from datetime import timedelta, datetime
import telnetlib
import re
import argparse
import logging
import json
import socket
import paho.mqtt.client as mqtt
from __version import __version__
from homeassistant_auto_discovery import (
HassDevice,
HassSensor, HassBinarySensor, HassSelect,
... | cruwaller/viessmann_optolink2mqtt | viessmann_optolink_mqtt.py | viessmann_optolink_mqtt.py | py | 21,397 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "homeassistant_auto_discovery.HassDevice",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "__version.__version__",
"line_number": 24,
"usage_type": "argument"
},
{
... |
24983516705 | # https://docs.streamlit.io/library/api-reference
import streamlit as st
import numpy as np
import pandas as pd
from PIL import Image
import time
st.title('Streamlit 超入門')
st.write('プログレスバーの表示')
'Start!!'
latest_interation = st.empty()
bar = st.progress(0)
for i in range(100):
latest_interation.text(f'Interati... | masato-kobayashi5427/youtube.streamlit | main.py | main.py | py | 1,629 | python | ja | code | 0 | github-code | 7 | [
{
"api_name": "streamlit.title",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "streamlit.write",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "streamlit.empty",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "streamlit.progress",
... |
21007605250 | from __future__ import annotations
import logging
import sys
import warnings
import cloudpickle
import json_tricks
import numpy
import yaml
import nni
def _minor_version_tuple(version_str: str) -> tuple[int, int]:
# If not a number, returns -1 (e.g., 999.dev0 -> (999, -1))
return tuple(int(x) if x.isdigit()... | microsoft/nni | nni/common/version.py | version.py | py | 2,921 | python | en | code | 13,409 | github-code | 7 | [
{
"api_name": "sys.version_info",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "numpy.__version__",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "torch.__version__",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "l... |
33395988763 | import enum
from flask_babel import lazy_gettext
ShipStatusKinds = enum.Enum(value="ShipStatus", names="pending delivered received")
PaymentStatusKinds = enum.Enum(
value="PaymentStatus", names="waiting preauth confirmed rejected"
)
OrderStatusKinds = enum.Enum(
value="OrderStatus", names="draft unfulfilled f... | hjlarry/flask-shop | flaskshop/constant.py | constant.py | py | 1,904 | python | en | code | 254 | github-code | 7 | [
{
"api_name": "enum.Enum",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "enum.Enum",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "enum.Enum",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "enum.Enum",
"line_number": 12,
"us... |
39602526145 | import os
import numpy as np
import torch
from PIL import Image
from VisCPM.cpm_tokenizers import CPMBeeTokenizer
from diffusers.pipelines.stable_diffusion import StableDiffusionSafetyChecker
from timm.models import create_model
from torchvision.transforms.functional import to_tensor, to_pil_image
from torchvision.util... | OpenBMB/VisCPM | VisCPM/viscpm_chat.py | viscpm_chat.py | py | 6,038 | python | en | code | 884 | github-code | 7 | [
{
"api_name": "os.path.dirname",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "typing.List",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "PIL.Image.Image",
"line_... |
35238434181 | import os
import time
import shutil
import torch
import torch.nn as nn
import numpy as np
import pickle
from .kNN import kNNClassify
from .util import *
from sklearn.metrics import accuracy_score
def train(image_model, att_model, mod_model, mod_transformer, attn_img, attn_att, decoder_img, decoder_att,
trai... | heli06/attention_based_ZSL | attention_based_ZSL/steps/traintest.py | traintest.py | py | 21,016 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.device",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torch.set_grad_e... |
29895088266 | import dash
from dash import html
from dash import dcc
import dash_bootstrap_components as dbc
from dash.dependencies import Input, Output
from plotly.subplots import make_subplots
import plotly.express as px
import plotly.graph_objects as go
import numpy as np
import pandas as pd
app = dash.Dash(__name__, title='MDA ... | tpjln/mda_2022_app_xiaomeng | app.py | app.py | py | 3,538 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "dash.Dash",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "dash_bootstrap_components.themes",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "plotly.subplots.make_subplots",
"line_number": 18,
"usage_type": "call"
},
{
"api... |
36141144528 | from django.db.models import F
from contingent.controllers.views_controllers import ViewDepartment
from contingent.models import Spec, DictEduType, DictLang, DictEduForm
def get_students_fields(dep=None):
if dep:
students = ViewDepartment(dep).get_student_query_set()
citizen_options = list(studen... | AlexandraVoronkova/ReportForDepartment | contingent/controllers/students_filter.py | students_filter.py | py | 8,647 | python | hi | code | 0 | github-code | 7 | [
{
"api_name": "contingent.controllers.views_controllers.ViewDepartment",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.db.models.F",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "contingent.models.Spec.objects.filter",
"line_number": 16,
"usa... |
26932166250 | from flask import Flask, request, redirect
app = Flask(__name__)
@app.route('/some/path/bad1')
def unsafe1():
target = request.args.get('target', '')
if "example.com" in target: # lgtm ignore
return redirect(target)
app.run()
| RasmusWL/example-ignore | foo.py | foo.py | py | 247 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask.request.args.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.request.args",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "flask.request... |
26578697413 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
'''
Created on 2016年10月23日
@author: qupenghui
'''
import unittest
from utils import Crawler
class TestUtils(unittest.TestCase):
def test_start(self):
# crawler=Crawler('http://www.qiushibaike.com/8hr/page/1',target='/usr/local/qsbk/')
# crawler=Crawler('... | gon-superman/study-python | tests/test_utils.py | test_utils.py | py | 708 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "unittest.TestCase",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "utils.Crawler",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "unittest.main",
"line_number": 23,
"usage_type": "call"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.