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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9194404834 | import os
import hydra
from pathlib import Path
from omegaconf import OmegaConf
import pytorch_lightning as pl
from pytorch_lightning.loggers import CSVLogger
from pytorch_lightning import Trainer
from dataloader import get_dataloader
from model.PlanT.lit_module import LitHFLM
@hydra.main(config_path=f"../config", ... | ge75her/Trajectory-Prediction-for-Utilizing-Geometric-Relationships | carla_agent_files/model/PlanT/lit_train.py | lit_train.py | py | 2,977 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "omegaconf.OmegaConf.to_yaml",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "omegaconf.OmegaConf",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "os.environ",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "pytor... |
20408748520 | """
This variables and constants are using in
the main file - main.py. Each section
is dived by following comment.
"""
from math import ceil
from pygame import init, display, FULLSCREEN
# display
init()
display_info = display.Info()
width = display_info.current_w
height = display_info.current_h
screen_mode = FULLSCR... | a1k0u/uni-projects | python/galton_board/config.py | config.py | py | 4,504 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "pygame.init",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pygame.display.Info",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "pygame.FULLSCREEN",
... |
25527382576 | import numpy as np
from matplotlib import pyplot as plt
from matplotlib import ticker
from PIL import Image
from statistics import mean
from collections import Counter
def threshold(imageArray):
balanceAr = []
newAr = imageArray
from statistics import mean
for eachRow in imageArray:
for eachPix... | MakGulati/OCR | OCR1/thres.py | thres.py | py | 2,809 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "statistics.mean",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "statistics.mean",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "statistics.mean",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
... |
3881200220 | from typing import Tuple
import gym
from imitation.rewards.reward_nets import RewardNet
import numpy as np
import torch
from reward_preprocessing.env import maze, mountain_car # noqa: F401
class MazeRewardNet(RewardNet):
def __init__(self, size: int, maze_name: str = "EmptyMaze", **kwargs):
env = gym.m... | HumanCompatibleAI/reward-preprocessing | src/reward_preprocessing/models.py | models.py | py | 2,415 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "imitation.rewards.reward_nets.RewardNet",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "gym.make",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.Tensor",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "to... |
28891606871 | """Tests for tool_utils.py."""
import sys
from pytype.platform_utils import path_utils
from pytype.tests import test_utils
from pytype.tools import tool_utils
import unittest
class TestSetupLoggingOrDie(unittest.TestCase):
"""Tests for tool_utils.setup_logging_or_die."""
def test_negative_verbosity(self):
... | google/pytype | pytype/tools/tool_utils_test.py | tool_utils_test.py | py | 1,346 | python | en | code | 4,405 | github-code | 36 | [
{
"api_name": "unittest.TestCase",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pytype.tools.tool_utils.setup_logging_or_die",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pytype.tools.tool_utils",
"line_number": 17,
"usage_type": "name"
}... |
74973219303 | import time
from selenium import webdriver
from selenium.webdriver.chrome.service import Service as ChromeService
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import Acti... | Marwan8766/Scrapper | utils/scrappingLink.py | scrappingLink.py | py | 5,713 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "utils.placeClass.Place",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "webdriver_manager.chrome.ChromeDriverManager",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.ChromeOptions",
"line_number": 41,
"usage_type": "... |
14791501184 | # -*- coding: utf-8 -*-
# 02/28/2022
import argparse
import os
import re
import json
import sys
import copy
from collections import OrderedDict
import opcodes_def
import cpx_opcode_def
def _read_json(filename=None):
json_object = None
crashfile = open(filename, 'r')
json_object = json.load(crashfile)
# ... | 0moyi0/onekeylog | onekeylog/converterranalyrpt.py | converterranalyrpt.py | py | 25,577 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "json.load",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "cpx_opcode_def.Sad_Result_Decoding",
"line_number": 58,
"usage_type": "attribute"
},
{
"api_name": "cpx_opcode_def.Targeted_Port_Decoding",
"line_number": 65,
"usage_type": "attribute"
... |
7078700910 | import requests
from datetime import date, timedelta
import os
from twilio.rest import Client
STOCK_NAME = "TSLA"
COMPANY_NAME = "Tesla Inc"
STOCK_ENDPOINT_API = "https://www.alphavantage.co/support/#api-key"
NEWS_ENDPOINT_API = "https://newsapi.org/"
parameters = {
"function": "TIME_SERIES_DAILY",
"symbol"... | Omisw/Python_100_days | Day 36/main.py | main.py | py | 1,694 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetime.date.today",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "datetime.timedelta",
... |
34162635034 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
logger = logging.getLogger(None)
logger.setLevel(logging.DEBUG)
formatter = logging.Formatter(
'%(asctime)s %(filename)s:%(lineno)s - %(funcName)20s() %(levelname)-8s %(message)s')
# StreamHandler
sh = logging.StreamHandler()
sh.setLevel(logging.INFO)
... | daimrod/opinion-sentence-annotator | logger_config.py | logger_config.py | py | 485 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "logging.Formatter",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.StreamHan... |
34526532786 | import requests
import pandas
from sqlalchemy import create_engine
import datetime as dt
engine = create_engine(
'mysql+pymysql://leiming:vg4wHTnJlbWK8SY@rm-2zeq92vooj5447mqzso.mysql.rds.aliyuncs.com:3306/cider')
# 判断订单是否为全部发货
url = 'https://erp.banmaerp.com/Order/Order/ListDataHandler'
headers = {
'content-ty... | yourant/ERPdata_Transfer | ERP_order_trans.py | ERP_order_trans.py | py | 8,230 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strftime",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "date... |
2884103209 | # coding:utf-8
from utils.util import get_code_token, get_requests, get_header ,form_post ,login ,json_post
#login('00852','20181205')
# rf_url = 'https://passport.lagou.com/grantServiceTicket/grant.html'
# get_header(rf_url)
cUserid = 80
def calling(cUserid):
calling_url = 'https://easy.lagou.com/phonecall/getVir... | Ariaxie-1985/aria | api_script/business/B_calling.py | B_calling.py | py | 688 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "utils.util.get_code_token",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "utils.util.form_post",
"line_number": 15,
"usage_type": "call"
}
] |
26097388362 | import fixtures
from authomatic.providers import oauth2
conf = fixtures.get_configuration('facebook')
LINK = 'https://www.facebook.com/' + conf.user_username_reverse
PICTURE = 'http://graph.facebook.com/{}/picture?type=large'\
.format(conf.user_username_reverse)
CONFIG = {
'class_': oauth2.Facebook,
'sc... | rnandan273/python | pyramid/authomatic-master/tests/functional_tests/expected_values/facebook.py | facebook.py | py | 1,299 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "fixtures.get_configuration",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "authomatic.providers.oauth2.Facebook",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "authomatic.providers.oauth2",
"line_number": 12,
"usage_type": "name"... |
70862760425 | from django.conf import settings
from simple_salesforce import Salesforce
import re
__author__ = 'eMaM'
E164_RE = re.compile('^\+\d{11}$')
class SalesForceClass():
def __init__(self):
self.sf = Salesforce(
username=settings.USERNAME,
password=settings.PASS,
security_... | eMaM1921990/Scrappers | travelmobApp/SalesForce.py | SalesForce.py | py | 3,066 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "re.compile",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "simple_salesforce.Salesforce",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.USERNAME",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_nam... |
37059824306 | import cv2
import streamlit as st
from streamlit_webrtc import webrtc_streamer
import av
st.title("QRコード読みとり")
FRAME_WINDOW = st.image([])
cap = cv2.VideoCapture(0)
detector = cv2.QRCodeDetector()
class VideoProcessor:
def recv(self, frame):
img = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
data = detect... | haru48/CameraTest | camera.py | camera.py | py | 712 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "streamlit.title",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "streamlit.image",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.QRCodeDetector",
... |
20816840348 | from __future__ import print_function
import copy
import warnings
import graphviz
import matplotlib.pyplot as plt
import numpy as np
from graph import feed_forward_layers, DrawNN
def plot_time(begin, end, filename, generation_time):
""" Plots the population's average and best fitness. """
if plt is None:
... | Dyend/NEAT-CAR-DRIVER | visualize.py | visualize.py | py | 10,018 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "matplotlib.pyplot",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "warnings.warn",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyp... |
1126909056 | import ply.yacc as yacc
from Parser.Lexer import Lexer
class Parser:
tokens = Lexer.tokens
def __init__(self):
self.input = None
self.symbolList = {'globalSymbol': {}, 'subFuncSymbol': {}, 'funcID': {}}
self.isInSubFunc = False
self.error = []
self.warning = []
... | wyjBot/Pascal_complier | Parser/Parser.py | Parser.py | py | 45,005 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "Parser.Lexer.Lexer.tokens",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "Parser.Lexer.Lexer",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "Parser.Lexer.Lexer",
"line_number": 1220,
"usage_type": "call"
},
{
"api_name": "... |
29605976878 | from types import LambdaType
from typing import Any, Dict, Type, Union, Callable, List, overload, TypeVar
from kink.errors.service_error import ServiceError
from kink.typing_support import is_optional, unpack_optional
_MISSING_SERVICE = object()
T = TypeVar("T")
class Container:
def __init__(self):
se... | kodemore/kink | kink/container.py | container.py | py | 3,509 | python | en | code | 266 | github-code | 36 | [
{
"api_name": "typing.TypeVar",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "typing.Dict",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.Type",
"line_numbe... |
475767730 | import re
from .string import String
from ..autodoc.schema import Array as AutoDocArray
from ..autodoc.schema import Object as AutoDocObject
from ..autodoc.schema import String as AutoDocString
from collections import OrderedDict
class BelongsTo(String):
"""
Controls a belongs to relationship.
This colum... | cmancone/clearskies | src/clearskies/column_types/belongs_to.py | belongs_to.py | py | 10,829 | python | en | code | 5 | github-code | 36 | [
{
"api_name": "string.String",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "collections.OrderedDict",
"line_number": 163,
"usage_type": "call"
},
{
"api_name": "autodoc.schema.String",
"line_number": 180,
"usage_type": "call"
},
{
"api_name": "autodoc.... |
34622549711 | from pathlib import Path
from multiprocessing import Pool
from itertools import product
import click
import numpy as np
import pandas as pd
import SimpleITK as sitk
from tqdm import tqdm
from radiomics.featureextractor import RadiomicsFeatureExtractor
center = "mda_test"
project_dir = Path(__file__).resolve().parents... | voreille/hecktor | src/data/quality_control.py | quality_control.py | py | 5,658 | python | en | code | 65 | github-code | 36 | [
{
"api_name": "pathlib.Path",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Pool",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_... |
7777942198 | import os
import requests
import csv
import os
import json
import sys
import ast
import time
f = csv.writer(open('submissions.csv', 'a'))
uf= open('Tables/users.csv', 'r')
user_dict = set()
store_id = 0
authro = ''
worked = 0
zz = 0
for line in uf:
if zz != 0:
user_dict.add(line.split(',')[0])
zz... | H-KY/Codeforces | Dataset/rungetSubmissions.py | rungetSubmissions.py | py | 2,935 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "csv.writer",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 99,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 101,
"usage_type": "call"
}
] |
42578423711 | # WordNetのlemma.count()を用いて各word,synset,lemmaの頻度を算出してtextファイル化
import os
import sys
#WordNet
import nltk
from nltk.corpus import WordNetCorpusReader
from nltk.corpus import wordnet as wn
import codecs
import util
class ForwardWNGeneralityExtractor:
def __init__(self, folder, lang):
self.folder = folder
... | arairyoto/CrosslingualAutoExtend | Extractor/Frequency/ForwardWNGeneralityExtractor.py | ForwardWNGeneralityExtractor.py | py | 2,642 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "nltk.corpus.wordnet.langs",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.wordnet",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "nltk.corpus.wordnet.get_version",
"line_number": 27,
"usage_type": "call"
},
{
"api... |
44404769623 | """
dictionary_hogwartshouses.py
create dictionary from JSON and prints information for any given Hogwarts house
"""
import sys
import json
import urllib.request
url = "https://raw.githubusercontent.com/kathyvsinternet/Python-INFO1-CE9990/master/hogwarts_houses.json"
try:
data = urllib.request.urlopen(url)
exc... | kathyvsinternet/Python-INFO1-CE9990 | dictionary_hogwartshouses.py | dictionary_hogwartshouses.py | py | 1,331 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "urllib.request.request.urlopen",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "urllib.request",
"line_number": 15,
"usage_type": "name"
},
{
"api_nam... |
43438362913 | import numpy as np
import pandas as pd
import pytest
from datetime import datetime, timedelta
from metloom.variables import MesowestVariables, CdecStationVariables
from metloom.dataframe_utils import (
join_df, append_df, merge_df, resample_df, resample_whole_df
)
df1 = pd.DataFrame.from_records([{"foo": 12.0}, {... | M3Works/metloom | tests/test_dataframe_utils.py | test_dataframe_utils.py | py | 6,377 | python | en | code | 10 | github-code | 36 | [
{
"api_name": "pandas.DataFrame.from_records",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pandas.DataFrame.from_records",
"line_number": 12,
"usage_type": "call"
},
{
... |
23525371756 | from __future__ import annotations
import pathlib
from collections import deque
class Monka:
def __init__(
self,
items: list,
operator_value: str,
operator_type: str,
divider: int,
target_index_true: int,
target_index_false: int,
high_worry: bool
... | Timozen/AoC2022 | 11/11.py | 11.py | py | 3,467 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "collections.deque",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 111,
"usage_type": "call"
}
] |
19474473863 | datbase_url = "https://handsin-bot-database.herokuapp.com/"
from pprint import pprint
import requests
import json
from pyinflect import getAllInflections, getInflection
import re
import random
import copy
from nltk.stem import PorterStemmer
from collections import OrderedDict
porter = PorterStemmer()
def isEntityUn... | Rodrigo010497/bot-test-strapi | queries.py | queries.py | py | 5,851 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "nltk.stem.PorterStemmer",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "random.choice",
... |
19448722325 | import sqlite3
from datetime import *
class DB:
def __init__(self) -> None:
self.con = sqlite3.connect('clock.db')
self.cur = self.con.cursor()
def create_table(self):
"""
CREATE TIME TABLE TO SAVE USER'S TIMES
"""
self.cur.execute("CREATE TABLE IF NOT EXIS... | aminm08/python-alarm-clock-GUI | database.py | database.py | py | 1,526 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sqlite3.connect",
"line_number": 8,
"usage_type": "call"
}
] |
34682582382 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 16 11:49:53 2019
@ author: cacquist
@ date : 16 juli 2019
@ goal : built statistics of PBL observations and ICON LEM model outputs. The
code reads in the data from observations and model from the three different sites,
check if data are not there... | ClauClouds/PBL_paper_repo | PBLpaper_prepare_dataset_model_obs_stat.py | PBLpaper_prepare_dataset_model_obs_stat.py | py | 62,498 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "numpy.repeat",
"line_number": 131,
"usage_type": "call"
},
{
"api_name": "myFunctions.f_selectingPBLcloudWindow",
"line_number": 148,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 152,
"usage_type": "call"
},
{
"api_name": "... |
12737078183 | import flet
from flet import Column, Container, ElevatedButton, Page, Row, Text, UserControl, border_radius, colors, TextField, Ref
class GreetingsApp(UserControl):
def build(self):
first_name = Ref[TextField]()
last_name = Ref[TextField]()
greetings = Ref[Column]()
def btn_click(... | applego/flet-practice | Apps/Greetings/Greetings.py | Greetings.py | py | 1,324 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flet.UserControl",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "flet.Ref",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "flet.TextField",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "flet.Ref",
"line_number": 8... |
22706839636 | import math
import torch
import torch.nn as nn
class EnsembleLinear(nn.Module):
""" linear layer optimized for ensemble """
def __init__(self, ensemble_size, input_size, output_size):
super(EnsembleLinear, self).__init__()
self.weight = nn.Parameter(torch.zeros((ensemble_size, input_size, ou... | APM150/Continuous_Envs_Experiments | mujoco/models/ensemble.py | ensemble.py | py | 931 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.nn.Module",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.nn.Parameter",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_n... |
8556600358 | from aiogram import types, Dispatcher
from config import bot, ADMIN
from database import command_all_mentors_sql, command_delete_sql
from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton
async def show_all_mentors(message: types.Message):
if message.from_user.id != ADMIN:
await message.answ... | Yummy312/Geekbot | handlers/admin.py | admin.py | py | 2,163 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "aiogram.types.Message",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "aiogram.types",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "config.ADMIN",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "database.command_a... |
25108216019 | import enum
import importlib
import logging
from dataclasses import dataclass
from enum import auto
from os import path
from typing import List
import tensorflow as tf
logger = logging.getLogger(__name__)
def parse_mapping_from_path(mapping_path):
"""
Parse the input accelerator residing in... | wangxdgg/zigzag_2 | zigzag/classes/io/onnx/pb_utils.py | pb_utils.py | py | 4,319 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "importlib.import_module",
... |
12444957695 | import os
import json
import numpy as np
import pandas as pd
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.keras import layers
from tensorflow.keras.callbacks import EarlyStopping, ModelCheckpoint
def plot_graphs(history, string):
plt.plot(history.history[string])
plt.plot(history.hi... | happiness6533/AI-study-project | supervised_learning/natural_language_process/text_clustering/cnn_rnn.py | cnn_rnn.py | py | 6,131 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matpl... |
4897197081 | #!/usr/bin/env python3
# coding=utf-8
"""
Add non-free photos to an album.
"""
import argparse
import flickrapi # http://www.stuvel.eu/flickrapi
import os
import sys
# import xml.etree.ElementTree as ET # ET.dump()
# from pprint import pprint
# https://www.flickr.com/services/api/flickr.photos.licenses.getInfo.htm... | hugovk/flickr-tools | nonfree.py | nonfree.py | py | 6,206 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "flickrapi.FlickrError",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "sys.exc_info",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "sys.exc_info",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "flickrapi.Flickr... |
28151017591 | import json
import matplotlib.pyplot as plt
def draw(pro_dict):
scores=[] # 1准备数据
for v in pro_dict.values():
scores.append(v["avg_score"])
plt.figure(figsize=(20,8),dpi=100) # 2创建画布
# 3绘制直方图
dist=4
group_num=int((max(scores)-min(scores))/dist)
plt.hist(scores,bins=group_num)
... | xidao4/2020DataScience | src/method1/RDI/get_RDI.py | get_RDI.py | py | 2,255 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.hist",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matpl... |
2671461396 | from typing import Any
import torch
import torch.nn.functional as F
from torch.cuda.amp import autocast
from Exceptions import (
DeviceCannotSupportHalfPrecisionException,
DeviceChangingException,
HalfPrecisionChangingException,
NotEnoughDataExtimateF0,
)
from mods.log_control import VoiceChangaerLogger... | w-okada/voice-changer | server/voice_changer/DiffusionSVC/pipeline/Pipeline.py | Pipeline.py | py | 7,903 | python | en | code | 12,673 | github-code | 36 | [
{
"api_name": "mods.log_control.VoiceChangaerLogger.get_instance",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "mods.log_control.VoiceChangaerLogger",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "voice_changer.RVC.embedder.Embedder.Embedder",
"line_n... |
3094488106 | #
# Input Output
# 1 2 3 4 5 5 4 3 2 1
#
# Write a program that reads a string with N integers from the console,
# separated by a single space, and reverses them using a stack. Print the reversed
# integers on one line, separated by a single space.
#
#n = input()
#
from collections import deque
#
n = '1 2 3 4 5'
#
n_... | ivn-svn/SoftUniPythonPath | Programming OOP and Advanced with Python/Advanced/1_lists_stacks_queues/exercise/1_reverse_numbers.py | 1_reverse_numbers.py | py | 465 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "collections.deque",
"line_number": 15,
"usage_type": "call"
}
] |
41153221424 | import os
import sys
sys.path.append(os.getcwd())
from functools import partial
import os
import pickle
import sys
import torch
from copy import deepcopy
import numpy as np
import matplotlib.pyplot as plt
import csv
from collections import defaultdict
import math
import glob
import re
from safe_control_gym.utils.c... | ustc-arg/Safe-Robot-Learning-Competition | experiments/arxiv/quadrotor_performance/utils/eval.py | eval.py | py | 15,039 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "sys.path.append",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "safe_control_gym.utils.utils.set... |
14102788486 | from sklearn.base import BaseEstimator, TransformerMixin
import pandas as pd
import numpy as np
from typing import List
class FormatMissingData(BaseEstimator, TransformerMixin):
"""Modify missing data values as required by model sklearn Pipeline."""
def __init__(
self,
skip_inputs: List[str] ... | nasa/ML-airport-data-services | data_services/format_missing_data.py | format_missing_data.py | py | 1,896 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "sklearn.base.BaseEstimator",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "sklearn.base.TransformerMixin",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "pa... |
2201440478 | import webapp2
import jinja2
import os
import json
import logging
import datetime
import csv
from StringIO import StringIO
from urllib import quote, urlencode
from google.appengine.api import urlfetch
from models import TrackedUser, Followers
import headers
jinja_environment = jinja2.Environment(
loader=jinja2.F... | guardian/gu-tuser-tracker | app.py | app.py | py | 2,323 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "jinja2.Environment",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "jinja2.FileSystemLoader",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
74147861225 | """https://web3py.readthedocs.io/en/stable/"""
from typing import Union, Any
from eth_typing import URI
from web3.contract import Contract
from web3.types import Wei, Address, HexStr, TxParams
from .reader import Reader
class Transactor(Reader):
def __init__(self, provider: Union[URI, str], timeout: int = 60) -... | zepcp/web3tools | web3tools/transactor.py | transactor.py | py | 1,666 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "reader.Reader",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "eth_typing.URI",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_nu... |
29250154282 | import boto3
import json
import logging
import datetime
from elasticsearch import Elasticsearch, RequestsHttpConnection
import uuid
from requests_aws4auth import AWS4Auth
import requests
logger = logging.getLogger()
logger.setLevel('ERROR')
ELASTIC_HOST = 'https://vpc-photos-cr73giiqwxko7a2t22rzqu44rq.us-east-1.es.am... | huxin331/cloudhw3 | Lambda/LF2.py | LF2.py | py | 5,313 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "boto3.Session",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "requests_aws4auth.AWS4Auth",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "json.loads... |
8086312972 | from fastapi import FastAPI
from fastapi.openapi.utils import get_openapi
from starlette.middleware.cors import CORSMiddleware
from app.core.config import ALLOWED_HOSTS, PROJECT_NAME
from app.api.endpoints import router as api_router
# create the app
app = FastAPI(title=PROJECT_NAME)
if not ALLOWED_HOSTS:
ALLO... | chriswmackey/energy-model-schema | app/main.py | main.py | py | 1,617 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "app.core.config",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "fastapi.FastAPI",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "app.core.config.PROJECT_NAME",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "app.core... |
14787358518 | import cv2
import sklearn
import os
import numpy as np
import random
import skimage.transform as sktransform
from keras.preprocessing.image import random_shift
# 0.2,0.125
# def augment_brightness_camera_images(image):
# image1 = cv2.cvtColor(image, cv2.COLOR_RGB2HSV)
# image1 = np.array(image1, dtype=np.flo... | kalyanramu/CarND-BehavioralCloning-P3 | data_gen.py | data_gen.py | py | 6,966 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "cv2.cvtColor",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_RGB2HSV",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.float64",
"... |
11525604396 | import asyncio
async def square(num):
await asyncio.sleep(num)
# print(f"tasks {num} compute value is {num * num}")
return num
async def main():
tasks = []
for i in range(10, 0, -1):
t1 = asyncio.create_task(square(i))
tasks.append(t1)
results = await asyncio.gather(*tasks)
... | avinash431/IntroductionToPython | asyncio/asyncio-3.py | asyncio-3.py | py | 390 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "asyncio.sleep",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "asyncio.create_task",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "asyncio.gather",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "asyncio.run",
"li... |
10500980706 | """
Experiment metadata parsing and validation.
"""
import os.path as osp
import json
from collections import defaultdict
from lrgasp import LrgaspException, gopen, iter_to_str, existing_datafile_name
from lrgasp.objDict import ObjDict
from lrgasp.defs import Repository, Species, Challenge, DataCategory, Sample, Librar... | LRGASP/lrgasp-submissions | lib/lrgasp/experiment_metadata.py | experiment_metadata.py | py | 16,668 | python | en | code | 8 | github-code | 36 | [
{
"api_name": "lrgasp.metadata_validate.Field",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "lrgasp.metadata_validate.Field",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "lrgasp.defs.validate_symbolic_ident",
"line_number": 18,
"usage_type": "nam... |
9665851444 | #!/usr/bin/env python
# -*- encoding: utf-8
import gzip
import scipy.io as sio
from utils.utils import Utils
class GenericSparseDB(Utils):
def init(self):
self.data = sio.mmread(gzip.open(self._matrix_fn)).tolil()
self.factors = self._load_pickle(self._factors_fn)
self.fac_len = len(self.factor... | wojtekwalczak/FB_datalab | lib/generic_sparse_db.py | generic_sparse_db.py | py | 628 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "utils.utils.Utils",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "scipy.io.mmread",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "scipy.io",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "gzip.open",
"line_numbe... |
15008161859 | import pandas as pd
from PyQt5 import QtGui
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import *
from pandas import DataFrame as DataframeObject
import Dataframe
from GraphMenu import GraphMenu
from GraphModel import GraphModel
from LoadedSheets import LoadedSheets
from PandasModel import PandasModel
import sys
... | Chremmer/SimpleCell | MainWindowGUI.py | MainWindowGUI.py | py | 9,022 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "LoadedSheets.LoadedSheets",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "pandas.DataFrame",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "GraphMenu.GraphMenu",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "Loaded... |
17263839933 | #!/usr/bin/env python3
"""
Unreal Engine 5: Plugin Manager
"""
import os
import json
import tkinter
from tkinter import ttk, messagebox
from ttkwidgets import CheckboxTreeview
script_directory = os.path.dirname(os.path.abspath(__file__))
uproject_files = [f for f in os.listdir(script_directory) if f.endsw... | calebgray/UE5SkeletonProject | PluginManager.py | PluginManager.py | py | 1,905 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.dirname",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_n... |
39876784242 | # -*- coding: utf-8 -*-
import pandas as pd
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import cosine_similarity
from recommender.models import Movie
class ContentSimilarity:
# MELHORIA FUTURA: SALVAR MOST SIMILAR NO BD E ATUALIZAR SOMENTE QDO NECESSÁRIO
def conte... | guimedeiros1/adapt_recommender | recommender/algorithms/content_similarity.py | content_similarity.py | py | 1,452 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.DataFrame",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "recommender.models.Movie.objects.all",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "recommender.models.Movie.objects",
"line_number": 12,
"usage_type": "attribute"
}... |
6073418311 | '''
Created on Feb 25, 2010
'''
from math import pi as Pi, cos, sin, exp, sqrt as scalar_sqrt
from ibvpy.tmodel.mats2D.mats2D_eval import MATS2DEval
from numpy import \
array, zeros, dot, \
float_, \
sign
from traits.api import \
Array, Enum, \
Event, provides, \
Dict, Property, cached_p... | bmcs-group/bmcs_ibvpy | ibvpy/tmodel/mats2D5/mats2D5_bond/mats2D5_plastic_bond.py | mats2D5_plastic_bond.py | py | 8,049 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "ibvpy.tmodel.mats2D.mats2D_eval.MATS2DEval",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "traits.api.Enum",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "bmcs_utils.api.Float",
"line_number": 36,
"usage_type": "call"
},
{
"a... |
41105772447 | """
satpy_overlay_plots.py
module implementing satpy based plots with OCO-2 data overlays.
intended to integrate with oco_vistool.py
"""
import os, glob, datetime, collections, itertools
import tempfile, shutil
import bz2
import numpy as np
from satpy import Scene
from satpy.writers import get_enhanced_image
impo... | hcronk/oco_vistool | satpy_overlay_plots.py | satpy_overlay_plots.py | py | 34,189 | python | en | code | 11 | github-code | 36 | [
{
"api_name": "os.path.dirname",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 47,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "pyorbital.orbital.get_o... |
7040661613 | from adr.World import Ambient
import numpy.testing as npt
import pytest
@pytest.fixture
def base_ambient():
base_ambient = Ambient(temperature=288.15, pressure=101325, humidity=30)
return base_ambient
def test_instantiation(base_ambient):
assert base_ambient.temperature == 288.15
assert base_ambient... | CeuAzul/ADR | tests/World/test_Ambient.py | test_Ambient.py | py | 898 | python | en | code | 12 | github-code | 36 | [
{
"api_name": "adr.World.Ambient",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "numpy.testing.assert_almost_equal",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": ... |
3238185308 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
f ="../test_batch.bin"
def read_img(file,k):
file_=open(file, 'rb')
val=int.from_bytes (file_.read(3073*k), byteorder='big')
label=int.from_bytes (file_.read(1), byteorder='big') # Correspond au label de l'ima
R=np.fr... | ouhmmouch-ls-me/project_CNN | Python/read.py | read.py | py | 1,221 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.frombuffer",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "numpy.frombuffer",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
... |
32473785722 | from config import bot, chat_id
from telebot import types
import requests
from bs4 import BeautifulSoup
from plugins.error import in_chat
@in_chat()
def cats(m):
bot.delete_message(m.chat.id, m.message_id)
keyboard = types.InlineKeyboardMarkup() #Добавляем кнопки
cats = types.InlineKeyboardButton(text="Еще... | evilcatsystem/telegram-bot | plugins/cats.py | cats.py | py | 1,178 | python | ru | code | 1 | github-code | 36 | [
{
"api_name": "config.bot.delete_message",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "config.bot",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "telebot.types.InlineKeyboardMarkup",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": ... |
37634219850 | # Given a list of words, list of single letters (might be repeating) and score of every character.
# Return the maximum score of any valid set of words formed by using the given letters (words[i] cannot be used two or more times).
# It is not necessary to use all characters in letters and each letter can only be use... | sunnyyeti/Leetcode-solutions | 1255 Maximum Score Words Formed by Letters.py | 1255 Maximum Score Words Formed by Letters.py | py | 2,883 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "collections.Counter",
"line_number": 55,
"usage_type": "call"
}
] |
71598655464 | from sqlalchemy import create_engine
from sqlalchemy import Table, Column, MetaData, Index
from sqlalchemy.types import DateTime, Integer, Float
class SQLDriver:
"""This SQLAlchemy wrapper exposes only those functions
that are used by pysatel, and hides all database interaction
details.
"""
def _... | dpq/pysatel | pysatel/sqldriver.py | sqldriver.py | py | 2,295 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sqlalchemy.MetaData",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.create_engine",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "sqlalc... |
28067719212 | # 큐 : 선입선출
import sys
input = sys.stdin.readline
n = int(input())
from collections import deque
queue = deque()
for _ in range(n):
data = input().split()
# push : x를 큐에 넣는 연산
if data[0] == 'push':
queue.append(data[1])
# pop : 큐 가장 앞 정수 빼고 출력, 큐에 들어있는 정수가 없는 경우 -1 출력
elif... | hwanginbeom/algorithm_study | 1.algorithm_question/3.stack,queue/128.Queue_sejin.py | 128.Queue_sejin.py | py | 1,247 | python | ko | code | 3 | github-code | 36 | [
{
"api_name": "sys.stdin",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 7,
"usage_type": "call"
}
] |
28446656659 | """"
AutoMap class
"""
# import
import os
import joblib
import pandas as pd
from datetime import datetime
from sklearn.preprocessing import LabelEncoder
from sklearn.model_selection import GridSearchCV
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.linear_model import SGDClassifier
from skle... | tariqdam/automap | src/AutoMap.py | AutoMap.py | py | 7,996 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "datetime.datetime.utcnow",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "nltk.download",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "nltk.downloa... |
1252854862 | from pip._vendor.requests.packages.urllib3.connectionpool import xrange
class RotateString(object):
def rotateString(self, A, B):
if len(A) != len(B):
return False
if len(A) == 0:
return True
for s in xrange(len(A)):
if all(A[(s+i) % len(A)] == B[i] for... | lyk4411/untitled | beginPython/leetcode/RotateString.py | RotateString.py | py | 509 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pip._vendor.requests.packages.urllib3.connectionpool.xrange",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pip._vendor.requests.packages.urllib3.connectionpool.xrange",
"line_number": 12,
"usage_type": "call"
}
] |
27052373239 | from typing import List
class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
class Solution:
def getAllElements(self, root1: TreeNode, root2: TreeNode) -> List[int]:
def convertList(node: TreeNode, ls: List[int])... | ikedaosushi/leetcode | interviews/python/getAllElements.py | getAllElements.py | py | 896 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "typing.List",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 12,
"usage_type": "name"
}
] |
73871751145 | from django.contrib.auth import get_user_model
from django.db import models
from apps.consultations.models import AvailableConsultation
class Review(models.Model):
consultation = models.ForeignKey(
AvailableConsultation,
on_delete=models.CASCADE,
related_name="reviews",
verbose_na... | r1kk1s/mindsafe | apps/review/models.py | models.py | py | 795 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.db.models.Model",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.models.ForeignKey",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": ... |
71315309865 | from flask import Flask, render_template, url_for, request, redirect, jsonify
from flask_sqlalchemy import SQLAlchemy
from flask_marshmallow import Marshmallow
from datetime import datetime
from netmiko import Netmiko
import util
import json
from ntc_templates.parse import parse_output
# Init app
app = Flask(__name__)
... | gnasses/python | BGP_ASN_Management/app.py | app.py | py | 6,211 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask_marshmallow.Marshmallow",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": ... |
6192905424 | #!/usr/bin/env python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (c) 2013-2018 ProphetStor Data Services, Inc.
# All Rights Reserved.
#
import json
from httplib import UNAUTHORIZED
from flask import request, abort, make_response
from functools import wraps
SERVICE_KEY = "n3oNJ8CE6FIJiMHQuCD... | Colinslik/practice_for_python | api/ifttt/define.py | define.py | py | 1,598 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.request.headers.get",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "flask.request.headers",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "fl... |
9520734015 | '''Code for running a simulation and saving its data.'''
from framework.lattice import Lattice
from simulation.simulator import Simulator
from analysis.visualisation import LatticeVisual
import matplotlib.pyplot as plt
import numpy as np
temp = 5.0
N = 50
#path = r"/net/vdesk/data2/buiten/COP/"
path = "C:\\Users\\vic... | vbuiten/monte-carlo-ising | tests/save_simulation.py | save_simulation.py | py | 970 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "framework.lattice.Lattice",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "analysis.visualisation.LatticeVisual",
"line_number": 18,
"usage_type": "call"
},
{
"api_nam... |
3508350083 | # -*- coding: utf-8 -*-
from django.contrib.admin import ModelAdmin
from .forms import SeoAdminModelForm
from .models import Metatags
class SeoAdminMixin(object):
"""
Миксин, добавляющий метатеги к форме
"""
form = SeoAdminModelForm
def save_formset(self, request, form, formset, change):
... | aderugin/django-seo | seo/admin.py | admin.py | py | 1,706 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "forms.SeoAdminModelForm",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "models.Metatags.objects.update_or_create",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "models.Metatags.objects",
"line_number": 36,
"usage_type": "attribute"
... |
15189085805 | import networkx as nx
import os
import pylab
class depbuilder(nx.DiGraph):
"""Subclass of the directed graph class from the networkx package.
When initialized, it builds a directed graph of all the cuts dependencies."""
def __init__(
self,
cutdir='/tera2/data3/cdmsbatsProd/processing'
... | tdoughty1/python_cut_tera | graphbuilder.py | graphbuilder.py | py | 2,406 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "networkx.DiGraph",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "networkx.DiGraph.__init__",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "networkx.DiGraph",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "... |
38301099 | import os
import configparser
import numpy as np
from basis_set_exchange import lut
def read_xyz(xyz_file_name):
with open(xyz_file_name) as fh:
xyz_lines = fh.readlines()
nuclear_numbers = []
coordinates = []
count = 0
mol_xyz = ''
for line in xyz_lines:
count += 1
if count == 1:
num_a... | takafumi-shiraogawa/SimpleQC | src/setting.py | setting.py | py | 2,182 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "basis_set_exchange.lut.element_Z_from_sym",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "basis_set_exchange.lut",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 30,
"usage_type": "call"
},
{
"api_... |
26297362799 | import urllib.request
import os
import json
import time
f = open("api_key", "r")
api_key= f.read()
f.close()
#this will work the same as if directly had the api key inserted into document. so you can hide api key, which is like your password from anyone who may read your code.
response = urllib.request.urlopen("ht... | sgturne/tmdb_data | tmdb_request.py | tmdb_request.py | py | 890 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "urllib.request.request.urlopen",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "urllib.request",
"line_number": 12,
"usage_type": "name"
},
{
"api_nam... |
73424750504 | import json
import jwt
import socket
import struct
from nose.tools import ok_, eq_, assert_is_not_none
try:
from mock import Mock, patch
except ImportError:
from unittest.mock import Mock, patch
try:
from httplib import OK, FOUND, CREATED
except:
from http.client import OK, FOUND, CREATED
from uuid import uuid4... | belodetek/unzoner-api | src/tests/paypal_tests.py | paypal_tests.py | py | 20,462 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "application.application.testing",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "application.application",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "application.application.test_client",
"line_number": 33,
"usage_type": "call... |
36152484622 | import hashlib
import uuid
import os
def key_hash(key):
"""
32-byte hash used for lookup of primary keys of jobs
"""
hashed = hashlib.md5()
for k, v in sorted(key.items()):
hashed.update(str(v).encode())
return hashed.hexdigest()
def uuid_from_buffer(*buffers):
"""
:param buf... | guzman-raphael/datajoint-test | datajoint/hash.py | hash.py | py | 988 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "hashlib.md5",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "hashlib.md5",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "uuid.UUID",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "hashlib.md5",
"line_number": 31... |
3985529019 | import math
import torch
import numpy as np
from src.utils.utils import l2_normalize
from src.objectives.simclr import SimCLRObjective
class AdversarialSimCLRLoss(object):
def __init__(
self,
embs1,
embs2,
t=0.07,
view_maker_loss_weight=1.0,
**kwargs
):
... | jbayrooti/divmaker | src/objectives/adversarial.py | adversarial.py | py | 1,390 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "src.utils.utils.l2_normalize",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "src.utils.utils.l2_normalize",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "torch.norm",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "... |
39742184711 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torchfile
class VGG_16(nn.Module):
"""
Main Class
"""
def __init__(self):
"""
Constructor
"""
super().__init__()
self.block_size = [2, 2, 3, 3, 3]
self.conv_1_1 = nn.Conv2d(3, 64, 3... | Sumching/Deep_Regression_Forests | networks/vgg_face.py | vgg_face.py | py | 4,010 | python | en | code | 5 | github-code | 36 | [
{
"api_name": "torch.nn.Module",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numb... |
29085647325 | import random
from threading import Timer
from typing import List
from zone_api.audio_manager import Genre, get_music_streams_by_genres, get_nearby_audio_sink
from zone_api.core.action import action, Action
from zone_api.core.devices.motion_sensor import MotionSensor
from zone_api.core.event_info import EventInfo
from... | yfaway/zone-apis | src/zone_api/core/actions/play_music_at_dinner_time.py | play_music_at_dinner_time.py | py | 2,183 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "zone_api.core.action.Action",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "zone_api.core.action.Action.supported_parameters",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "zone_api.core.action.Action",
"line_number": 23,
"usage_type... |
42998082606 | from __future__ import annotations
import decimal
import time
from datetime import datetime, timedelta, tzinfo
from logging import getLogger
from sys import byteorder
from typing import TYPE_CHECKING
import pytz
from pytz import UTC
from .constants import PARAMETER_TIMEZONE
from .converter import _generate_tzinfo_fr... | snowflakedb/snowflake-connector-python | src/snowflake/connector/arrow_context.py | arrow_context.py | py | 5,186 | python | en | code | 511 | github-code | 36 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.utcfromtimestamp",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 31,
"usage_type": "name"
},
{
"api_nam... |
27779071450 | from collections import Counter
import sys
sys.stdin = open('input.txt')
def solve():
t = int(input())
for _ in range(t):
n = int(input())
arr = [int(i) for i in input().split()]
ctr = Counter(arr)
counts = []
for i in ctr.items():
counts.append(i)
c... | live-abhishek/ds-algo | codechef/practice/alexnumb.py | alexnumb.py | py | 508 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.stdin",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "collections.Counter",
"line_number": 11,
"usage_type": "call"
}
] |
25209785200 | import threading
import zmq
import time
import socket
import sys
import datetime
def zmq_recv(context,url):
socket = context.socket(zmq.SUB)
# socket = context.socket(zmq.REP)
socket.connect(url)
socket.setsockopt(zmq.SUBSCRIBE,''.encode('utf-8')) # 接收所有消息
zhanbao=0
buzhanbao=0
start_tim... | Scottars/nis_website | dataservice/zmq/single_threading_subsys/tcp_receive_pub_multiregisters.py | tcp_receive_pub_multiregisters.py | py | 6,510 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "zmq.SUB",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "socket.connect",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "socket.setsockopt",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "zmq.SUBSCRIBE",
"li... |
16892668251 | import re
import os
import base64
import datetime
class User:
def __init__(
self,
is_admin,
surname,
name='',
birth_year=2000,
address='',
email='',
phone=''):
self.is_admin = is_admin
self.surname... | McWillie/midis | src/users.py | users.py | py | 5,582 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "datetime.datetime.utcnow",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "base64.b64encode",
"line_number": 85,
"usage_type": "call"
},
{
"api_name": "os.p... |
34927095374 | from tkinter import *
from PIL import ImageTk,Image
from tkinter import filedialog
from Interpolation import *
root = Tk()
root.title("Image Interpolation")
root.geometry("1250x770")
#Definitions for buttons
#temp - current displaying image
#temp1 - temporary variable used to store prev image for Undo
#original - Ori... | Sudheeradh/Image-Interpolation-and-Superresolution | GUI/Project_Interface.py | Project_Interface.py | py | 4,040 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "tkinter.filedialog.askopenfilename",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "tkinter.filedialog",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "... |
34338246402 | # https://leetcode.com/problems/best-time-to-buy-and-sell-stock/
from typing import List
class Solution:
def maxProfit(self, prices: List[int]) -> int:
curMaxProfit = 0
minPrice = prices[0]
for price in prices:
curMaxProfit = max(curMaxProfit, price - minPrice)
minP... | 0x0400/LeetCode | p121.py | p121.py | py | 376 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "typing.List",
"line_number": 6,
"usage_type": "name"
}
] |
22981434767 | from flask import Flask, render_template, redirect, url_for, request
from flask_bootstrap import Bootstrap
from flask_sqlalchemy import SQLAlchemy
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField
from wtforms.validators import DataRequired
import requests
tmdbkey = "16784bd3fece5ddb139f8b61... | p0c4/100-Days-of-Code-The-Complete-Python-Pro-Bootcamp | Day 64/top-movies-project/main.py | main.py | py | 3,891 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask_bootstrap.Bootstrap",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "fla... |
33211564014 | __all__ = ['WeightShareTransform', 'NeuralModule', 'PretrainedModelInfo', 'ModuleType', 'OperationMode']
import uuid
from abc import abstractmethod
from collections import namedtuple
from enum import Enum
from inspect import getargvalues, getfullargspec, stack
from os import path
from typing import Any, Dict, List, Op... | cppxaxa/ICAN.ShapeShifter | ICAN.ShapeShifter.Worker/nemo/core/neural_modules.py | neural_modules.py | py | 31,047 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "ruamel.yaml.YAML",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "collections.namedtuple",
"li... |
72747192423 | import os
import platform
from typing import Dict, List, Tuple, Union
import pyqtgraph as pg
from PyQt5 import QtCore, QtWidgets, QtGui
from PyQt5.QtGui import QPixmap
import constants
from data import load_json_data, calculate_extrema
from gauge import GaugeWidget
from user import User, get_user_percentage
def _cr... | Fard-Faru/CSC110-Final-Project | ui.py | ui.py | py | 23,144 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "PyQt5.QtWidgets.QLabel",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "constants.TITLE",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtC... |
495100847 | import os
from dagster import check
from dagster.core.errors import DagsterSubprocessError
from dagster.core.events import DagsterEvent, EngineEventData
from dagster.core.execution.api import create_execution_plan, execute_plan_iterator
from dagster.core.execution.config import MultiprocessExecutorConfig
from dagster.... | helloworld/continuous-dagster | deploy/dagster_modules/dagster/dagster/core/engine/engine_multiprocess.py | engine_multiprocess.py | py | 7,989 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "child_process_executor.ChildProcessCommand",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "dagster.check.inst",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "dagster.core.execution.config.MultiprocessExecutorConfig",
"line_number": 36,
... |
24589263913 | import bs4
get_ipython().system('pip install selenium')
get_ipython().system('pip install webdriver_manager')
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
driver = webdriver.Chrome(ChromeDriverManager(version="87.0.4280.88").install())
driver.get("https://www.google.com")
... | haziqrao1/zameen.com_scrapper | zameen.com_data.py | zameen.com_data.py | py | 3,582 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "webdriver_manager.chrome.ChromeDriverManager",
"line_number": 9,
"usage_type": "call"
},
{... |
39783040335 | from sklearn.metrics import confusion_matrix
from sklearn.utils.multiclass import unique_labels
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
import torch
import torch.utils.data
import os
from shutil import rmtree
from .constants import BAS... | iamhectorotero/learning-physical-properties-with-rnns | libraries/isaac/utils.py | utils.py | py | 3,715 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "matplotlib.pyplot.cm",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "sklearn.metrics.confusion_matrix",
"line_number": 31,
"usage_type": "call"
},
{
"api_... |
42090662310 | import random
import warnings
import numpy as np
import torch
from mmcv.parallel import MMDataParallel, MMDistributedDataParallel
from mmcv.runner import EpochBasedRunner, build_runner
from mmseg.core import DistEvalHook, EvalHook
from mmseg.datasets import build_dataloader, build_dataset
from mmseg.utils import get_r... | Gumpest/AvatarKD | mmrazor/apis/mmseg/train.py | train.py | py | 6,319 | python | en | code | 6 | github-code | 36 | [
{
"api_name": "warnings.warn",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "random.seed",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_... |
71605340584 | import cv2
import numpy as np
import face_recognition
import os
from datetime import datetime
import multiprocessing as mp
path = 'ImagesAttendance'
images = []
classNames = []
for cl in os.listdir(path):
curImg = cv2.imread(f'{path}/{cl}')
images.append(curImg)
# get names from filename (without the .*)
... | jiayi1129/AttendanceProject | AttendanceProject.py | AttendanceProject.py | py | 3,972 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.listdir",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.splitext",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 1... |
21889526113 | # ugly fix for loading upstream.local.LocalUpstream
import sys
import os
sys.path.insert(0, os.path.abspath('..'))
import logging
import tornado.web
import tornado.process
from tornado.options import define, options, parse_config_file
import tornado.ioloop
import json
from upstreams.local import LocalUpstream
from int... | changpingc/shuttle | xmpp/relay.py | relay.py | py | 6,154 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "sys.path.insert",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
19199302998 | import argparse
import pandas as pd
import numpy as np
from pathlib import Path
from sklearn.model_selection import train_test_split
from ebm.probability import log_distributions, fit_distributions
from ebm.mcmc import greedy_ascent, mcmc
if __name__=="__main__":
# EXAMPLE
# python run_experiment_mcmc.py --f... | kurmukovai/ebm-progression | scripts/run_experiment_mcmc.py | run_experiment_mcmc.py | py | 3,960 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 46,
"usage_type": "call"
},
{
"... |
19107589976 | from twitter_crawler import Twitter_crawler
import json
import time
import datetime
#get the keys
with open("keys/keys2.txt","r") as f:
tmplist = f.read().split('\n')
consumer_key = tmplist[0]
consumer_secret = tmplist[1]
access_token = tmplist[2]
access_token_secret = tmplist[3]
#宣告Twitter_crawler物件
tc = Twi... | JJ-Tom-Li/project | twitter_crawler/test.py | test.py | py | 885 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "twitter_crawler.Twitter_crawler",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 17,
"usage_type": "call"
}
] |
74869512103 | from apiclient.discovery import build
class BigQueryClient(object):
def __init__(self, httpss):
"""Creates the BigQuery client connection"""
self.service = build('bigquery', 'v2', http=httpss)
def getTableData(self, project, dataset, table):
tablesCollection = self.service.tables()
... | bsyouness/PunORama | FrontEnd/bqclient.py | bqclient.py | py | 1,072 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "apiclient.discovery.build",
"line_number": 6,
"usage_type": "call"
}
] |
70481931625 | from django.db import models
from .apps import ApiConfig
import sqlite3
# Create your models here.
# ** Make raw SQL queries.
class Weather(object):
__columns__ = ['id', 'city', 'sky', 'temp', 'wind_speed', 'wind_degree', 'clouds', 'time']
__db_name__ = ApiConfig.db_name
def __init__(self):
... | AlexMuliar/WeatherPortal | api/models.py | models.py | py | 3,527 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "apps.ApiConfig.db_name",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "apps.ApiConfig",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "sqlite3.connect",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sqlite3.co... |
26476541074 | import pandas as pd
import requests
from lxml import html
tarot_cards = pd.read_csv("tarot.csv")
def fetch_content(url):
print(f"FETCHING {url}")
res = requests.get(url)
tree = html.fromstring(res.content)
xpath = "(//*[not(self::script or self::style)]/text()[string-length() > 50])"
output = "\n... | PrototypesProjects/TAROT | tarot_fetch_text.py | tarot_fetch_text.py | py | 608 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "lxml.html.fromstring",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "lxml.html",
"lin... |
74940728105 | import pybullet as p
import numpy as np
import os
class Robot:
def __init__(self,client):
self.client = client
f_name = os.path.join(os.path.dirname(__file__), 'custom_robot.urdf')
self.robot = p.loadURDF(fileName=f_name, basePosition=[0,0,0.205], physicsClientId=client)
self.jointA... | anujkprajapati/Quadruped_env | quadruped/resources/robot.py | robot.py | py | 1,539 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.join",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pybullet.loadURDF",
"line_... |
7108293533 | from qgis.core import *
import pickle
import networkx as nx
# QGIS Processing Script Parameters "##" indicates a parameter to QGIS
##Graph=group
##Vector=vector
##Field=field Vector
##Output_File_Path=file
def rectBounds(geometry):
"""
Generates bounding rectangles for QGIS polygon geometries.
:param ge... | eborke/QGISGraphPlugin | Graph.py | Graph.py | py | 11,541 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "networkx.Graph",
"line_number": 333,
"usage_type": "call"
},
{
"api_name": "pickle.dump",
"line_number": 362,
"usage_type": "call"
}
] |
16249965323 | from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import train_test_split
from sklearn.metrics import plot_confusion_matrix
import pandas as pd
import pickle
import json
import os
def dynamic_data_extract(path):
dataline = pd.DataFrame()
with open(path) as f:
data = json.... | sbalan7/HCL-Hack-IITK-2020 | Challenge-Round-1/Dynamic-Analysis/dynamic_model_building.py | dynamic_model_building.py | py | 2,930 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.DataFrame",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_... |
485002500 | # My entry number is 2019CS10465.
import time
import sys
from typing import SupportsComplex
from nltk.corpus.reader.chasen import test
import numpy as np
import pandas as pd
from cvxopt import matrix as cvxopt_matrix
from cvxopt import solvers as cvxopt_solvers
def load_data(file, a, b):
a, b = a % 10, b % 10
... | AparAhuja/Machine_Learning | Naive Bayes and SVM/Q2/binary_a.py | binary_a.py | py | 2,670 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "cvxopt.matrix",
"line_num... |
3539505659 | import os
from pathlib import Path
from split_settings.tools import include
from dotenv import dotenv_values
BASE_DIR = Path(__file__).resolve().parent.parent
config = dotenv_values(".env")
DEBUG = config.get('DEBUG', False) == 'True'
include(
'components/database.py',
'components/middleware.py',
'compone... | bogatovad/new_admin_panel_sprint_2 | docker_compose/simple_project/app/example/settings.py | settings.py | py | 932 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pathlib.Path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "dotenv.dotenv_values",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "split_settings.tools.include",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.... |
74260986982 | import numpy as np
import torch
from pcdet.config import cfg, cfg_from_yaml_file
from pcdet.datasets import build_dataloader
from pcdet.utils import common_utils
from pcdet.models.detectors import build_detector
import time
import argparse
def build_test_infra(cfg_file: str, **kwargs):
np.random.seed(666)
cfg... | quan-dao/practical-collab-perception | tools/create_sample_batch_dict.py | create_sample_batch_dict.py | py | 2,968 | python | en | code | 5 | github-code | 36 | [
{
"api_name": "numpy.random.seed",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pcdet.config.cfg_from_yaml_file",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "p... |
31433336762 | from flask import Flask, request
import json
import uuid
from models.poker import Poker
from models.state import State
app = Flask(__name__)
poker = Poker()
@app.route("/state", methods=["GET"])
def state():
return json.dumps(State.to_dict(poker.state))
@app.route("/add-player", methods=["POST... | akbae/poker | server/server.py | server.py | py | 1,971 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "models.poker.Poker",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "models.state.State.to_dict",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.