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
25183906689
from django.shortcuts import render,redirect,get_object_or_404,HttpResponse from .forms import BlogForm from .models import Blog from django.contrib.auth.decorators import login_required # Create your views here. def home(request): blogs=Blog.objects.all() return render(request,'Home/index.html',{'blogs':blogs...
kushalsubedi/Bloggie
Home/views.py
views.py
py
2,090
python
en
code
1
github-code
1
[ { "api_name": "models.Blog.objects.all", "line_number": 8, "usage_type": "call" }, { "api_name": "models.Blog.objects", "line_number": 8, "usage_type": "attribute" }, { "api_name": "models.Blog", "line_number": 8, "usage_type": "name" }, { "api_name": "django.shor...
70035569954
# mnist classification # backend: Theano (make sure to disable fastmath i.e. nvcc.fastmath=false. if you want to add many epoches and wish to avoid the nan issue) # you can play with the layers and maybe add a few (maybe dropout layers). import numpy as np from keras.models import Sequential from keras.layers import D...
dasraf9/Keras_Mini_Projects
mmist/mnist.py
mnist.py
py
1,498
python
en
code
0
github-code
1
[ { "api_name": "numpy.random.seed", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 13, "usage_type": "attribute" }, { "api_name": "keras.datasets.mnist.load_data", "line_number": 16, "usage_type": "call" }, { "api_name": "ke...
9284007937
from kivymd.uix.screen import MDScreen from kivymd.uix.menu import MDDropdownMenu from kivymd.uix.list import OneLineIconListItem from kivy.metrics import dp from kivy.properties import ObjectProperty, StringProperty from kv.components.empty_screen_msg import EmptyScreenMessage class NotesDashboard(MDScre...
pyto-p/NoteRex
view/dashboard.py
dashboard.py
py
3,678
python
en
code
1
github-code
1
[ { "api_name": "kivymd.uix.screen.MDScreen", "line_number": 11, "usage_type": "name" }, { "api_name": "kivy.properties.ObjectProperty", "line_number": 18, "usage_type": "call" }, { "api_name": "kivymd.uix.menu.MDDropdownMenu", "line_number": 48, "usage_type": "call" }, ...
37804385829
import os from notion_client import Client from dotenv import load_dotenv load_dotenv() NOTION_TOKEN = os.getenv("NOTION_TOKEN") DATABASE_ID = os.getenv('DATABASE_ID') notion = Client(auth=NOTION_TOKEN) def note(res): new_page = { "title": {"title": [{"text": {"content": res}}]} } notion.pages.crea...
kinba09/Telegram_to_notion
notion_back.py
notion_back.py
py
381
python
en
code
0
github-code
1
[ { "api_name": "dotenv.load_dotenv", "line_number": 5, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 7, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 8, "usage_type": "call" }, { "api_name": "notion_client.Client", "line_...
19270541376
import math import numpy as np import torch from torch.nn.modules.module import Module import torch.nn as nn import torch.nn.functional as F import numpy as np import scipy.sparse as sp from sklearn.metrics import roc_auc_score def get_interventional_emb(train_edges, probe_edge_index, model, x, device, type_set='test'...
ErikJhones/in_n_out
utils_calib.py
utils_calib.py
py
3,308
python
en
code
0
github-code
1
[ { "api_name": "torch.cat", "line_number": 26, "usage_type": "call" }, { "api_name": "torch.cat", "line_number": 28, "usage_type": "call" }, { "api_name": "torch.softmax", "line_number": 42, "usage_type": "call" }, { "api_name": "torch.max", "line_number": 43, ...
72799933795
import unittest import datetime from django.contrib.auth.models import User from django_multivoting.models import Vote, Popularity from django.core.exceptions import ObjectDoesNotExist from django.contrib.contenttypes.models import ContentType class Tests(unittest.TestCase): def setUp(self): try: ...
genghisu/eruditio
eruditio/shared_apps/django_multivoting/tests.py
tests.py
py
5,053
python
en
code
0
github-code
1
[ { "api_name": "unittest.TestCase", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.contrib.auth.models.User.objects.get", "line_number": 12, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.User.objects", "line_number": 12, "usage_typ...
21377790638
import requests import json def next1f(): url = "https://fdo.rocketlaunch.live/json/launches/next/5" response = requests.get(url) data = response.json() next1 = (data["result"][0]["launch_description"]) return next1 #print(data["result"][0]["name"]) #print(data["result"][0]["vehicle"]["name"]) #pri...
SimonTheCommunist/SpaceBot
SpaceBot/nextlunch.py
nextlunch.py
py
990
python
en
code
0
github-code
1
[ { "api_name": "requests.get", "line_number": 6, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 16, "usage_type": "call" } ]
43597335889
################################################################################################# ########################## BASE APP PART ######################################################## class LoginData(object): username = "guest" class MainSinglegameClass: target_word = None target_word_len =...
Fantomas4/GUI_Hangman
GUI_Hangman.py
GUI_Hangman.py
py
10,855
python
en
code
0
github-code
1
[ { "api_name": "kivy.uix.screenmanager.Screen", "line_number": 149, "usage_type": "name" }, { "api_name": "kivy.uix.screenmanager.Screen", "line_number": 156, "usage_type": "name" }, { "api_name": "kivy.properties.ObjectProperty", "line_number": 157, "usage_type": "call" ...
72708314593
import asyncio from typing import Union, Callable, List, Coroutine, Optional import discord import linkbot.utils.emoji as emoji from linkbot.bot import client class Option: def __init__(self, emote: str, text: str="", *, func: Callable[[discord.User, discord.R...
tjbrockmeyer/LinkBot
linkbot/utils/menu.py
menu.py
py
8,723
python
en
code
1
github-code
1
[ { "api_name": "typing.Callable", "line_number": 15, "usage_type": "name" }, { "api_name": "discord.User", "line_number": 15, "usage_type": "attribute" }, { "api_name": "discord.Reaction", "line_number": 15, "usage_type": "attribute" }, { "api_name": "typing.Option...
5863312381
from typing import Any, Dict, List, Type, TypeVar, Union import attr from ..models.fault_model import FaultModel from ..models.fault_summary_model import FaultSummaryModel from ..models.sub_system_health_rollup_status import SubSystemHealthRollupStatus from ..models.sub_system_health_sub_system import SubSystemHealth...
dell/omivv
Python/omevv/v1/omevv_apis_client/models/sub_system_health.py
sub_system_health.py
py
4,766
python
en
code
3
github-code
1
[ { "api_name": "typing.TypeVar", "line_number": 11, "usage_type": "call" }, { "api_name": "typing.Union", "line_number": 24, "usage_type": "name" }, { "api_name": "types.Unset", "line_number": 24, "usage_type": "name" }, { "api_name": "models.sub_system_health_sub_...
23517680253
#!/usr/bin/env python # -*- coding: utf-8 -*- ################################################################################ # # 将mongoDB中的赛程数据导出为XML模板表格式 # # usage: # python export_fixtures.py --help # # 导出英超2016/2017赛季赛程数据到8_2017.xml # python export_fixtures.py -h 10.1.0.6 -p 27017 -d football -c fixtures -m...
huiliu/spiders.learning.hui
sports/sports/spiders/addons/fixtures.py
fixtures.py
py
6,112
python
en
code
0
github-code
1
[ { "api_name": "codecs.open", "line_number": 42, "usage_type": "call" }, { "api_name": "ConfigParser.ConfigParser", "line_number": 43, "usage_type": "call" }, { "api_name": "enum.ST_FOOTBALL", "line_number": 65, "usage_type": "attribute" }, { "api_name": "pymongo.M...
35227290608
from .base import FunctionalTest import time from selenium.common.exceptions import WebDriverException from datetime import datetime, date from django.contrib.auth.models import User # from selenium.webdriver.firefox.webdriver import WebDriver # from selenium.webdriver.common.keys import Keys # import unittest # import...
NeelRoshania/MarPersonnel
functional_tests/test_home_CRU.py
test_home_CRU.py
py
4,757
python
en
code
0
github-code
1
[ { "api_name": "base.FunctionalTest", "line_number": 13, "usage_type": "name" }, { "api_name": "django.contrib.auth.models.User.objects.create_user", "line_number": 17, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.User.objects", "line_number": 17, "usa...
9291937956
#!/usr/bin/env python3 #importo librerías import pyspark from pyspark import SparkContext, SparkConf, SQLContext from pyspark.sql.functions import * from pyspark.sql import DataFrameStatFunctions, DataFrame from pyspark.sql.types import * from pyspark.ml import Pipeline from pyspark.ml.feature import * from pyspark.ml....
EduardoHidalgoGarcia/MGE_ITAM_2017
alumnos/jorge_altamirano/tarea_7/tarea_7.py
tarea_7.py
py
10,065
python
en
code
0
github-code
1
[ { "api_name": "pyspark.SparkConf", "line_number": 18, "usage_type": "call" }, { "api_name": "pyspark.SparkContext", "line_number": 25, "usage_type": "call" }, { "api_name": "pyspark.SQLContext", "line_number": 27, "usage_type": "call" }, { "api_name": "pyspark.ml....
42654646818
from io import BytesIO from time import time import pybase16384 as pybs pybs.is_64bits() with open("input.pcm", "rb") as f: data = f.read() st = time() for i in range(10): pybs.encode_file(BytesIO(data), open("output2.pcm", "wb"), True, len(data) // 7) print(f"耗时: {time() - st}")
synodriver/pybase16384
tests/test_encode.py
test_encode.py
py
298
python
en
code
7
github-code
1
[ { "api_name": "pybase16384.is_64bits", "line_number": 6, "usage_type": "call" }, { "api_name": "time.time", "line_number": 10, "usage_type": "call" }, { "api_name": "pybase16384.encode_file", "line_number": 12, "usage_type": "call" }, { "api_name": "io.BytesIO", ...
14751142418
""" The :mod:`!xml_prm.parser` module contains the parsers that instatiate a :mod:`probrem` instance from the XML specifications. There is parser for * Data Interface specification, :class:`DataInterfaceParser` * PRM specifcation, :class:`PRMparser` * Loading model parameters stored on disk, :class:`LocalDistributionP...
declerambaul/ProbReM
src/xml_prm/parser.py
parser.py
py
32,969
python
en
code
4
github-code
1
[ { "api_name": "prm.relationalschema.Entity", "line_number": 214, "usage_type": "call" }, { "api_name": "prm.relationalschema.UncertainRelationship", "line_number": 240, "usage_type": "call" }, { "api_name": "prm.relationalschema.Relationship", "line_number": 242, "usage_t...
41059786168
from setuptools import setup, find_packages import re import os import sys import subprocess ROOT = os.path.dirname(__file__) def get_long_description(): with open(os.path.join(ROOT, 'README.md'), encoding='utf-8') as f: return f.read() def get_version(): VERSION_RE = re.compile(r'''VERSION\s+=\s+['"...
mjpost/bibsearch
setup.py
setup.py
py
3,249
python
en
code
59
github-code
1
[ { "api_name": "os.path.dirname", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...
6966301148
import sqlite3 import logging from variables import schema from string import Template from utilities import func_name from os.path import isfile, isdir, join from PIL import Image from io import BytesIO def connect_database(config, logger, **kwargs): logger = logging.getLogger(func_name()) logger.debug(kwargs...
cbitterfield/deepstack-multiprocessing
database.py
database.py
py
5,567
python
en
code
0
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "utilities.func_name", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 16, "usage_type": "call" }, { "api_name": "sqlite3.connect"...
41579410870
import os import random import pygame from data.base_modifier import BaseModifier from data.colors import Colors class Fortifier(BaseModifier): def __init__(self, game): self.name = "fortifier" self.game = game self.block_positions = self.get_block_positions() self.image = pygame...
rimai4/snake
data/fortifier.py
fortifier.py
py
1,805
python
en
code
0
github-code
1
[ { "api_name": "data.base_modifier.BaseModifier", "line_number": 10, "usage_type": "name" }, { "api_name": "pygame.image.load", "line_number": 15, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 15, "usage_type": "attribute" }, { "api_name": "o...
11258535263
# -*- coding: utf-8 -*- from lxml import etree oaidcns = "{http://www.openarchives.org/OAI/2.0/oai_dc/}" dcns = "{http://purl.org/dc/elements/1.1/}" def getEmptyOaidcDict(): oaidcdict = { "title": "", "description": "", "subject": [], "publisher": "", "format": "", "identifier": "", "language": "", "...
wimmuskee/mangrove
formatter/oaidc.py
oaidc.py
py
1,460
python
en
code
0
github-code
1
[ { "api_name": "lxml.etree.Element", "line_number": 21, "usage_type": "call" }, { "api_name": "lxml.etree", "line_number": 21, "usage_type": "name" }, { "api_name": "lxml.etree.tostring", "line_number": 48, "usage_type": "call" }, { "api_name": "lxml.etree", "l...
33618366539
import pandas as pd import requests API_KEY = 'Bearer e3920e0f60c88136aa66dca3bbfbae7f-bb9c32f4d0ab0fc0106137b0467a4394' HEADERS = { 'Content-Type': 'application/json', 'Authorization': API_KEY } # format: Currency1_Currency2 INSTRUMENT = 'EUR_USD' # e.g. 'S5', 'M15', 'H1', 'D', 'W', 'M' # https://developer...
brunadossantos-tech/data-to-csv
R-testes/OandaDataGetterV2.py
OandaDataGetterV2.py
py
3,123
python
en
code
0
github-code
1
[ { "api_name": "requests.get", "line_number": 36, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 39, "usage_type": "call" } ]
6584385706
from PyQt6.QtCore import QTimer from UM.Application import Application from UM.Logger import Logger from UM.Scene.SceneNode import SceneNode from UM.Scene.Iterator.BreadthFirstIterator import BreadthFirstIterator from UM.Math.Vector import Vector from UM.Scene.Selection import Selection from UM.Scene.SceneNodeSettings...
Ultimaker/Cura
cura/PlatformPhysics.py
PlatformPhysics.py
py
10,950
python
en
code
5,387
github-code
1
[ { "api_name": "PyQt6.QtCore.QTimer", "line_number": 29, "usage_type": "call" }, { "api_name": "UM.Application.Application.getInstance", "line_number": 37, "usage_type": "call" }, { "api_name": "UM.Application.Application", "line_number": 37, "usage_type": "name" }, { ...
621928178
from collections import OrderedDict from braindecode.datautil.signalproc import exponential_running_standardize from braindecode.datautil.trial_segment import create_signal_target_from_raw_mne import logging import numpy as np from braindecode.datasets.bbci import BBCIDataset from braindecode.datautil.signalproc import...
Sebas-h/eeg_thesis
data_loader/process_data/hgd.py
hgd.py
py
6,071
python
en
code
2
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 14, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.abspa...
5175592455
import udi_interface import sys import time import string import re import urllib.parse,http.client,math,time,datetime,base64 # Standard Library from typing import Optional, Any, TYPE_CHECKING from nodes import SPAN_breakerController,SPAN_circuitController LOGGER = udi_interface.LOGGER Custom = udi_interface.Custom...
residualimages/span_ud_nodeserver
nodes/SPAN_ctl.py
SPAN_ctl.py
py
24,394
python
en
code
0
github-code
1
[ { "api_name": "udi_interface.LOGGER", "line_number": 14, "usage_type": "attribute" }, { "api_name": "udi_interface.Custom", "line_number": 15, "usage_type": "attribute" }, { "api_name": "udi_interface.ISY", "line_number": 16, "usage_type": "attribute" }, { "api_na...
37988024234
import feedparser import urllib.request from pydub import AudioSegment from pydub.utils import make_chunks import SpeechRecognition as sr # Carga el archivo MP3 audio = AudioSegment.from_file("audio.mp3", format="mp3") # Convierte el archivo a formato WAV audio.export("audio.wav", format="wav") # Crea chunks de audi...
Mig29x/CheckMovieParentsRating
Podcast.py
Podcast.py
py
1,358
python
es
code
0
github-code
1
[ { "api_name": "pydub.AudioSegment.from_file", "line_number": 8, "usage_type": "call" }, { "api_name": "pydub.AudioSegment", "line_number": 8, "usage_type": "name" }, { "api_name": "pydub.utils.make_chunks", "line_number": 14, "usage_type": "call" }, { "api_name": ...
25888700131
import datetime import inspect import json import logging import os from typing import Any, Callable, Dict, List, Optional, Union from django.core import serializers from django.core.exceptions import SuspiciousOperation from django.db import models from django.http import HttpRequest, HttpResponse, HttpResponseBadReq...
ruler501/multipoll
multipoll/views.py
views.py
py
12,628
python
en
code
0
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 19, "usage_type": "call" }, { "api_name": "django.http.HttpRequest", "line_number": 22, "usage_type": "name" }, { "api_name": "os.environ.get", "line_number": 23, "usage_type": "call" }, { "api_name": "os.environ",...
35627409276
import os import zipfile import pandas as pd import csv import mariadb import os import configparser import glob config = configparser.ConfigParser() config.read_file(open(r'CONF/mariadb.conf')) try: db = mariadb.connect( host = config.get('peru','host'), user = config.get('peru','user' ...
manuelcorpas/15-PERU
PYTHON/PERU/07-ukbb-pop-af-insert.py
07-ukbb-pop-af-insert.py
py
1,535
python
en
code
0
github-code
1
[ { "api_name": "configparser.ConfigParser", "line_number": 10, "usage_type": "call" }, { "api_name": "mariadb.connect", "line_number": 14, "usage_type": "call" }, { "api_name": "mariadb.Error", "line_number": 20, "usage_type": "attribute" }, { "api_name": "glob.glo...
4253799393
import numpy as np from typing import List class BBox3D: def __init__(self, bbox_min: np.array, bbox_max: np.array): """ Initializes a 3D axis-aligned bbox from the min and max points Args: bbox_min: the minimum point, expected to be a """ assert bbox_m...
PolyCam/polyform
polyform/core/bbox.py
bbox.py
py
1,688
python
en
code
111
github-code
1
[ { "api_name": "numpy.array", "line_number": 5, "usage_type": "attribute" }, { "api_name": "numpy.shape", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.shape", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.array", "line_numbe...
24184544608
# ebay gpu prices visualizer from ebaysdk.finding import Connection as finding from bs4 import BeautifulSoup import gspread from oauth2client.service_account import ServiceAccountCredentials from pprint import pprint import matplotlib import time from decouple import config ''' GOOGLE SHEETS OPENING CON...
octavian-stoch/average_ebay_prices_app
GPUprices.py
GPUprices.py
py
1,830
python
en
code
1
github-code
1
[ { "api_name": "oauth2client.service_account.ServiceAccountCredentials.from_json_keyfile_name", "line_number": 21, "usage_type": "call" }, { "api_name": "oauth2client.service_account.ServiceAccountCredentials", "line_number": 21, "usage_type": "name" }, { "api_name": "gspread.auth...
43157972809
import pandas as pd import numpy as np from annoy import AnnoyIndex import re import os from sklearn.feature_extraction.text import CountVectorizer import matplotlib.pyplot as plt import time from memory_profiler import memory_usage import psutil import csv start_time = time.time() # get the absolute path...
nan0neko/LogClusteringHP
ANNOY/count vectorizer/angular/approach1/Count Vectorization Approach 1 Updated.py
Count Vectorization Approach 1 Updated.py
py
4,522
python
en
code
0
github-code
1
[ { "api_name": "time.time", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_nu...
13221751063
import os import sys from pathlib import Path, PurePath, PurePosixPath from unittest.mock import patch import boto3 import pytest from moto import mock_s3 from prefect_aws import AwsCredentials from prefect_aws.deployments.steps import get_s3_client, pull_from_s3, push_to_s3 @pytest.fixture def s3_setup(): with...
PrefectHQ/prefect-aws
tests/deploments/test_steps.py
test_steps.py
py
10,915
python
en
code
82
github-code
1
[ { "api_name": "moto.mock_s3", "line_number": 16, "usage_type": "call" }, { "api_name": "boto3.client", "line_number": 18, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 14, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "lin...
32090928144
import streamlit as st from transformers import ( AutoModelForSeq2SeqLM, AutoTokenizer, BartForConditionalGeneration, BartTokenizer ) import torch import nltk import re from transformers import pipeline import numpy as np model = None tokenizer = None summarizer = None @st.cache_data() def loadModel()...
oshikaroy/bartTextSummarization-Streamlit
bartTextSummarizer-streamlit-main/oldMainPage/response.py
response.py
py
9,208
python
en
code
0
github-code
1
[ { "api_name": "transformers.BartForConditionalGeneration.from_pretrained", "line_number": 26, "usage_type": "call" }, { "api_name": "transformers.BartForConditionalGeneration", "line_number": 26, "usage_type": "name" }, { "api_name": "transformers.BartTokenizer.from_pretrained", ...
9906643482
# coding:utf-8 ''' 爬虫 create by qmh 2018-05-06 ''' from urllib.request import urlopen import re from bs4 import BeautifulSoup response = urlopen("http://www.google.com") html = response.read() # print(html) soup = BeautifulSoup(html,features="lxml") result={} # 房源信息 all_img=soup.find_all("img") imglist=...
qinmenghuan/flappybirdserver
webCrawler/webwormdemo.py
webwormdemo.py
py
613
python
en
code
0
github-code
1
[ { "api_name": "urllib.request.urlopen", "line_number": 11, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 15, "usage_type": "call" } ]
4113591124
#!/usr/bin/env python # encoding: utf-8 import codecs import os from tornado.gen import coroutine import tornado.web import wsrpc from tornado import testing from tornado.httpserver import HTTPServer from tornado.testing import gen_test, AsyncTestCase from wsrpc import wsrpc_static from tornado.httpclient import AsyncH...
vvsha/w21
mysite/tests/test_js_static.py
test_js_static.py
py
1,650
python
en
code
0
github-code
1
[ { "api_name": "tornado.gen.web", "line_number": 21, "usage_type": "attribute" }, { "api_name": "tornado.gen", "line_number": 21, "usage_type": "name" }, { "api_name": "wsrpc.wsrpc_static", "line_number": 24, "usage_type": "call" }, { "api_name": "tornado.gen.web.A...
25461186503
from flask_restx import Namespace, Resource, fields from models import Recipe from flask_jwt_extended import jwt_required from flask import request recipe_ns = Namespace('recipe', description='A namespacce for Recipes' ) #model serializer recipe_model = recipe_ns.model( 'Recipe', { 'id':fields.Inte...
Grace-5507/my-recipe
recipes.py
recipes.py
py
1,722
python
en
code
1
github-code
1
[ { "api_name": "flask_restx.Namespace", "line_number": 7, "usage_type": "call" }, { "api_name": "flask_restx.fields.Integer", "line_number": 14, "usage_type": "call" }, { "api_name": "flask_restx.fields", "line_number": 14, "usage_type": "name" }, { "api_name": "fl...
31330715314
import requests import json hakusana = input(f'Kaupunki: ') pyyntö = 'https://api.openweathermap.org/data/2.5/weather?q=' + hakusana + '&appid=b506dbf5aa172758d111318ced349bb3&units=metric' vastaus = requests.get(pyyntö).json() json_vastaus = json.dumps(vastaus, indent=2) print(f'Weather:\n {vastaus["weather"...
Javimetro/Python-tasks
moduuli12/weather.py
weather.py
py
396
python
fi
code
0
github-code
1
[ { "api_name": "requests.get", "line_number": 6, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 8, "usage_type": "call" } ]
25158386576
from typing import Optional, List, Callable from .model import LifeModelAgent class LifeEvents(LifeModelAgent): def __init__(self, model, life_events: Optional[List['LifeEvent']] = None): """List of life events Args: model (LifeModel): LifeModel in which the life events take place. ...
sw23/life-model
src/life_model/lifeevents.py
lifeevents.py
py
1,620
python
en
code
0
github-code
1
[ { "api_name": "model.LifeModelAgent", "line_number": 5, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 6, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 6, "usage_type": "name" }, { "api_name": "typing.Callable", "...
19128100495
import io #from multiprocessing.dummy import Array import socket import time import cv2 import numpy as np from PIL import Image from math import atan2, cos, sin, sqrt, pi serv = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # address '0.0.0.0' or '' work to allow connections from other machines. 'localhost' d...
JD-edu/JD_robot_platform
206_esp32_camera_python_socket/206_esp32_camera_socket.py
206_esp32_camera_socket.py
py
1,421
python
en
code
0
github-code
1
[ { "api_name": "socket.socket", "line_number": 13, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 13, "usage_type": "attribute" }, { "api_name": "socket.SOCK_STREAM", "line_number": 13, "usage_type": "attribute" }, { "api_name": "time.time",...
22743188983
from flask import Flask, Blueprint, render_template, request, send_file, redirect, url_for import os from csv_changer import change_csv_1 app = Flask(__name__) change_csv = Blueprint('change_csv', __name__) app.config['UPLOAD_FOLDER'] = os.path.join(os.environ["USERPROFILE"], 'Desktop') @change_csv.route('/change-c...
hsamvel/Flask_App
website/change_csv.py
change_csv.py
py
1,178
python
en
code
0
github-code
1
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.Blueprint", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8,...
19015335793
#!/usr/bin/env python3 import os import datetime import concurrent.futures import time import logging import jinja2 import chronos def get_year(): y = datetime.datetime.now().year return y + 2 if datetime.datetime.now().month < 7 else y + 3 STUDENT_PROM = get_year() ASSISTANT_PROM = STUDENT_PROM - 2 OUTP...
epita/chronos-ics
cron.py
cron.py
py
1,883
python
en
code
12
github-code
1
[ { "api_name": "datetime.datetime.now", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 15, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 16, "usage_type": "call" }, { "api_name": "da...
16685518806
import torch import torch.utils.data as data import cv2 import random import numpy as np from os.path import join from .base_provider import ImagesDataSet def augment_image(image, pad): ''' Perform zero padding, randomly crop image to original size, maybe mirror horizontally ''' init_shape = image...
FatDs-lrc/SER_KD
preprocess/denseface/data/fer.py
fer.py
py
4,880
python
en
code
0
github-code
1
[ { "api_name": "numpy.zeros", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.random.randint", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 21, "usage_type": "attribute" }, { "api_name": "numpy.random.randi...
73129044195
from django.urls import path from .views import * urlpatterns = [ path('', payment_info, name='payment-info'), path('purchase/', purchase_product, name="purchase-product"), path('purchase/<int:payment_id>/', cancel_purchase, name="cancel-purchase"), path('deliveries/', add_deliveries, name="add-delive...
iamthasanthan/Ecommerce-react-django
payment/urls.py
urls.py
py
420
python
en
code
0
github-code
1
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", ...
40638839003
import streamlit as st import pandas as pd import os import datetime import sqlite3 ############################################################# # This program reads member infomation from a db and finds # # the next in line to scrub based on the next saturday # ################################################...
Anino1996/dutyRosterWebApp
duty_roster_app.py
duty_roster_app.py
py
2,825
python
en
code
0
github-code
1
[ { "api_name": "sqlite3.connect", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.read_sql", "line_number": 17, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 20, "usage_type": "call" }, { "api_name": "datetime.date", ...
43578234288
from flask import Flask, render_template import redis app = Flask(__name__) redis_client = redis.Redis(host='localhost', port=6379) @app.route('/') def index(): count = redis_client.get('count') return render_template('index.html', count=count) @app.route('/update') def update(): redis_client.incr('count...
wellington90/Python-Redis
app.py
app.py
py
468
python
en
code
0
github-code
1
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "redis.Redis", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.render_template", ...
72218499235
# -*- coding:utf-8 -*- import os import pymssql import xlrd import xlwt import datetime import time import chardet import shutil #数据库全局连接对象 conn=pymssql.connect(host="127.0.0.1",user="sa",password="4869Ahui...A",database="GoldControlDB") #conn=pymssql.connect(host="47.91.154.143:1433",user="sa",password="4869Ahui...A"...
bugken/KenCodeSnipet
PythonForExcelDB/ExeclDBHandle.py
ExeclDBHandle.py
py
5,276
python
en
code
0
github-code
1
[ { "api_name": "pymssql.connect", "line_number": 12, "usage_type": "call" }, { "api_name": "xlwt.Workbook", "line_number": 37, "usage_type": "call" }, { "api_name": "xlwt.Workbook", "line_number": 58, "usage_type": "call" }, { "api_name": "xlrd.open_workbook", ...
8318774067
"""Collection of experimental functions (beta)""" import os import numpy as np import csv as csv import lmlib as lm import itertools import datetime as datetime __all__ = ['find_max_mask', 'load_source_csv', 'zero_cross_ind', 'diff0', 'edge_detection', 'poly_fil...
lmlib/lmlib
lmlib/utils/beta.py
beta.py
py
21,866
python
en
code
1
github-code
1
[ { "api_name": "numpy.inf", "line_number": 28, "usage_type": "attribute" }, { "api_name": "numpy.zeros", "line_number": 71, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 73, "usage_type": "call" }, { "api_name": "numpy.array", "line_number"...
20702891231
import pytest import dynamic_yaml import logging import sys,os sys.path.append('.') import torch from model.backbone import backbonebase def get_hyper(): CFG_PATH = './cfg/hyperparameter.yaml' with open(CFG_PATH, 'r') as file: para = dynamic_yaml.safe_load(file) return para # print(get_hyper()) @...
leoliu5550/researchObjDet
TEST/test_backbone.py
test_backbone.py
py
725
python
en
code
1
github-code
1
[ { "api_name": "sys.path.append", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "dynamic_yaml.safe_load", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.ones", "...
71813433315
#!/usr/bin/env python from __future__ import print_function import cv2 import random import os.path import numpy as np import PIL.ImageOps import tensorflow as tf from collections import deque from sklearn.utils import shuffle from PIL import Image, ImageChops from pandas.io.parsers import read_csv TRAIN_DATA_PATH = ...
NAVEENMN/PersonalArchives
CNN_facekeypoints/facekey_CNN.py
facekey_CNN.py
py
5,086
python
en
code
0
github-code
1
[ { "api_name": "tensorflow.truncated_normal", "line_number": 49, "usage_type": "call" }, { "api_name": "tensorflow.Variable", "line_number": 50, "usage_type": "call" }, { "api_name": "tensorflow.constant", "line_number": 53, "usage_type": "call" }, { "api_name": "t...
17609606258
# Author: Jordan Cain, 2015-16 import re import sys import time import parse import walker from debugUtil import Trace from methodHolder import Method from classHolder import Class from optimisations import Recursion from optimisations import LoopToUnroll def detect(parent, debugObj): global debug debug = deb...
jordanCain-zz/Java-Optimisation-Atom-Plugin
OptimisationDetect/scan.py
scan.py
py
9,391
python
en
code
0
github-code
1
[ { "api_name": "walker.getForLoops", "line_number": 43, "usage_type": "call" }, { "api_name": "walker.checkIfCStyleLoop", "line_number": 48, "usage_type": "call" }, { "api_name": "optimisations.LoopToUnroll", "line_number": 57, "usage_type": "call" }, { "api_name":...
39669419418
#!/usr/bin/python3 # -*- Mode: Python; indent-tabs-mode: nil; tab-width: 4; coding: utf-8 -*- import apt import apt_pkg import hashlib import mock import os import unittest import shutil import tempfile import json from DistUpgrade.DistUpgradeQuirks import DistUpgradeQuirks CURDIR = os.path.dirname(os.path.abspath(_...
mvo5/ubuntu-release-upgrader
tests/test_quirks.py
test_quirks.py
py
34,613
python
en
code
0
github-code
1
[ { "api_name": "os.path.dirname", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 16, "usage_type": "call" }, { "api_name": "json.loads", "line_n...
25433089369
from itertools import combinations import sys input = sys.stdin.readline dx = (1,0,-1,0) dy = (0,1,0,-1) INF = int(1e9) def out_of_range(ny:int, nx:int) -> bool: return ny < 0 or nx < 0 or ny >= n or nx >= n def position(val: tuple[int]) -> list[int]: return [(num//n, num%n) for num in val] de...
reddevilmidzy/baekjoonsolve
백준/Silver/14620. 꽃길/꽃길.py
꽃길.py
py
878
python
en
code
3
github-code
1
[ { "api_name": "sys.stdin", "line_number": 3, "usage_type": "attribute" }, { "api_name": "itertools.combinations", "line_number": 35, "usage_type": "call" } ]
4457628669
import subprocess as sp import sys import ctypes import os import random import json import base64 import pathlib import tempfile import functools import operator import time import numpy # ol-install: numpy # from memory_profiler import profile import cProfile import pstats import io doProfile = True def printCSV...
NathanTP/fakefaas
examples/sort/handler/f.py
f.py
py
5,425
python
en
code
1
github-code
1
[ { "api_name": "pathlib.Path", "line_number": 25, "usage_type": "call" }, { "api_name": "io.StringIO", "line_number": 27, "usage_type": "call" }, { "api_name": "pstats.Stats", "line_number": 29, "usage_type": "call" }, { "api_name": "pstats.SortKey", "line_numb...
74136873634
#!/usr/bin/env python3 import socket from threading import Thread from config import SERVER_IP, SERVER_PORT, CLIENT_CONNECT_TIMEOUT class Client(object): def __init__(self, server_ip, server_port, client_connect_timeout): self._server_ip = server_ip self._server_port = server_port self._c...
aviafelix/simplechatpy
client.py
client.py
py
1,510
python
en
code
0
github-code
1
[ { "api_name": "socket.socket", "line_number": 16, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 35, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 36, "usage_type": "call" }, { "api_name": "config.SERVER_IP", ...
9909868792
from pymysql import IntegrityError from sqlalchemy import func from sqlalchemy.orm.exc import MultipleResultsFound from flask_sqlalchemy import BaseQuery as QueryClass from miniapp.corelibs.stone import db class BaseQuery(QueryClass): def __iter__(self): return QueryClass.__iter__(self._undeleted()) ...
qinlinli/small
models/base.py
base.py
py
3,602
python
en
code
0
github-code
1
[ { "api_name": "flask_sqlalchemy.BaseQuery", "line_number": 9, "usage_type": "name" }, { "api_name": "flask_sqlalchemy.BaseQuery.__iter__", "line_number": 12, "usage_type": "call" }, { "api_name": "flask_sqlalchemy.BaseQuery", "line_number": 12, "usage_type": "name" }, ...
38762305767
''' 给定一个链表,删除链表的倒数第 n 个节点,并且返回链表的头结点。 ''' ''' 使用有界队列,队列大小为n+1,遍历链表的时候不停向队列里添加节点,遍历完成后,队列的头就是倒数第n+1个节点,队列第二个就是倒数第n个节点 本质上就是使得遍历到链表终点时,能够拿到倒数第n+1个节点 ''' # Definition for singly-linked list. # class ListNode(object): # def __init__(self, x): # self.val = x # self.next = None from collections import deq...
love525150/leetcode-answer
a19v1.py
a19v1.py
py
1,117
python
en
code
0
github-code
1
[ { "api_name": "collections.deque", "line_number": 22, "usage_type": "call" } ]
3022188184
from setuptools import setup, find_packages from os import path from io import open here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'README.md'), encoding='utf-8') as f: long_description = f.read() setup( name='Zeek-Indenter', version='0.1.0', description='Python package to indent Zeek s...
corelight/zeek-indenter
setup.py
setup.py
py
750
python
en
code
4
github-code
1
[ { "api_name": "os.path.abspath", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5, "usage_type": "name" }, { "api_name": "os.path.dirname", "line_number": 5, "usage_type": "call" }, { "api_name": "io.open", "line_number": 7, ...
20239780834
from django.shortcuts import render,redirect from .models import * from .forms import * from django.contrib.auth.decorators import login_required # Create your views here. @login_required(login_url=('accounts:login')) def home(request): products = Product.objects.all().order_by('-id') context = {'products':produc...
rcoffie/store-inventory
products/views.py
views.py
py
2,790
python
en
code
0
github-code
1
[ { "api_name": "django.shortcuts.render", "line_number": 12, "usage_type": "call" }, { "api_name": "django.contrib.auth.decorators.login_required", "line_number": 8, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 21, "usage_type": "call" ...
8999900973
from django.contrib import admin from payment.models import PaidMember, UserInfo class PaidMemberAdmin(admin.ModelAdmin): """ Premium User Admin """ list_display = ( 'user', 'start_date', 'end_date', 'subscription', ) admin.site.register(PaidMember, PaidMemberAdmin) cla...
stefbez/bee-fitness
payment/admin.py
admin.py
py
567
python
en
code
0
github-code
1
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 5, "usage_type": "name" }, { "api_name": "django.contrib.admin.site.register", "line_number": 15, "usage_type": "call" },...
21765562207
# -*- coding:utf-8 -*- ''' Author: MrZQAQ Date: 2022-03-29 14:06 LastEditTime: 2023-03-01 22:24 LastEditors: MrZQAQ Description: turely model execute file FilePath: /MCANet/RunModel.py ''' import os import random import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.optim ...
MrZQAQ/MCANet
RunModel.py
RunModel.py
py
12,346
python
en
code
5
github-code
1
[ { "api_name": "torch.device", "line_number": 35, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 35, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 35, "usage_type": "attribute" }, { "api_name": "random.seed", ...
39393923147
# Script to process hyperopt log and summarise results. Useful for multiple hyperopts in one file (e.g. from hyp_exchange.sh) import sys import os from re import search import statistics import pandas import numpy from tabulate import tabulate infile = None curr_line = "" strat_results = {} strat_summary = {} # ro...
nateemma/strategies
scripts/SummariseHyperOptResults.py
SummariseHyperOptResults.py
py
4,899
python
en
code
199
github-code
1
[ { "api_name": "pandas.DataFrame", "line_number": 107, "usage_type": "call" }, { "api_name": "pandas.set_option", "line_number": 112, "usage_type": "call" }, { "api_name": "tabulate.tabulate", "line_number": 115, "usage_type": "call" }, { "api_name": "sys.argv", ...
24859931153
from typing import cast from fastapi import Request from starlette.datastructures import UploadFile from fcg.infrastructure.types import OutputFormat from fcg.viewmodels import parse from fcg.viewmodels.form_base_viewmodel import FormBaseViewModel class MosViewModel(FormBaseViewModel): def __init__(self, reques...
saltastroops/finder-chart-generator
fcg/viewmodels/mos_viewmodel.py
mos_viewmodel.py
py
1,029
python
en
code
0
github-code
1
[ { "api_name": "fcg.viewmodels.form_base_viewmodel.FormBaseViewModel", "line_number": 11, "usage_type": "name" }, { "api_name": "fastapi.Request", "line_number": 12, "usage_type": "name" }, { "api_name": "starlette.datastructures.UploadFile", "line_number": 14, "usage_type...
3559214492
# Odin M. Moron-Garcia # Date of Creation 21st September, 2021 # For our purposes we need Doc2Vec since it is suitable for downstream machine learning applications # And this script will refurbish the original Doc2Vec tutorial so the models are calculated for KEGG, COGs and pFAm # datasets for the GenePhene2 bacteri...
omgmvi/genephene2
Genomes/scripts/D2V_bk/Doc2Vec_Genomes_GenePhene2.py
Doc2Vec_Genomes_GenePhene2.py
py
4,332
python
en
code
0
github-code
1
[ { "api_name": "logging.basicConfig", "line_number": 40, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 40, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 66, "usage_type": "call" }, { "api_name": "os.path.join", ...
23035981858
import logging import os from scrapy.exceptions import CloseSpider from scrapy.linkextractors import LinkExtractor import scrapy from scrapy.spiders import CrawlSpider, Rule class SpiderOne(scrapy.Spider): name = "sp1" counter = 0 linkextractor = LinkExtractor(allow=('https://en.wikipedia.org/wiki/(.)')...
ViliamJ/VINF
vinf_airplanes/vinf_airplanes/spiders/spider_one.py
spider_one.py
py
2,369
python
en
code
0
github-code
1
[ { "api_name": "scrapy.Spider", "line_number": 11, "usage_type": "attribute" }, { "api_name": "scrapy.linkextractors.LinkExtractor", "line_number": 14, "usage_type": "call" }, { "api_name": "scrapy.Request", "line_number": 33, "usage_type": "call" }, { "api_name": ...
22466508863
import wiotp.sdk.application import json import uuid from time import sleep import jarHelper import bot class ApplicationClient: def __init__(self): f = open('../../properties.json') properties = json.load(f) self.typeId = properties['DEVICE']['DEVICE_TYPE'] self.deviceId = propert...
sak007/SmartJar
code/bot/wiotpApplicationClient.py
wiotpApplicationClient.py
py
1,429
python
en
code
2
github-code
1
[ { "api_name": "json.load", "line_number": 12, "usage_type": "call" }, { "api_name": "wiotp.sdk.application.sdk.application.parseConfigFile", "line_number": 15, "usage_type": "call" }, { "api_name": "wiotp.sdk.application.sdk", "line_number": 15, "usage_type": "attribute" ...
7043092758
# coding: utf-8 import sys import time import dataset import sorting from collections import defaultdict TESTS = ["basico", "ordenado", "ordenado_inverso"] # gets the list of supported sorting algorithms from the `sorting` module ALGORITHMS = [f for f in dir(sorting) if callable(getattr(sorting, f)) and not f.star...
eze210/tda1
tp1/sorting/run_test.py
run_test.py
py
3,753
python
en
code
0
github-code
1
[ { "api_name": "time.perf_counter", "line_number": 47, "usage_type": "call" }, { "api_name": "time.perf_counter", "line_number": 49, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 61, "usage_type": "call" }, { "api_name": "dataset.g...
22261399048
""" analysis of foreign umpires""" import matplotlib.pyplot as plt from main import matches,umpires def foreign_umpire_analysis(): """foreign umpire analysis""" foreign_umpire = set() for match in matches: foreign_umpire.add(match['umpire1']) foreign_umpire.add(match['umpire2']) umpire_...
shivapittala19/IPL_dataset_analysis
foregin_umpire.py
foregin_umpire.py
py
1,127
python
en
code
0
github-code
1
[ { "api_name": "main.matches", "line_number": 8, "usage_type": "name" }, { "api_name": "main.umpires", "line_number": 12, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.bar", "line_number": 25, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", ...
17000288984
from django.shortcuts import render, redirect from .models import * # course filter from django.template.loader import render_to_string from django.http import JsonResponse # total duration sum from django.db.models import Sum def home(request): course_menu_category = Categories.get_all_category(Categories) ...
foyez-ahammad/lms-course
course/views.py
views.py
py
4,163
python
en
code
0
github-code
1
[ { "api_name": "django.shortcuts.render", "line_number": 22, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 30, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 38, "usage_type": "call" }, { "api_name"...
10852006322
# encoding:utf-8 from common.douyu_request import dyreq from common.logger import logger from common.config import conf from common.get_secrets import get_secrets from lxml import etree import re import math import requests def get_badge(): """ :return: 获取具有粉丝牌的房间号、当前经验、升级所需经验、升级还需要的经验 """ badges_url ...
TheSlientnight/douyu_helper
common/dy_badge.py
dy_badge.py
py
2,248
python
en
code
34
github-code
1
[ { "api_name": "common.douyu_request.dyreq.request", "line_number": 17, "usage_type": "call" }, { "api_name": "common.douyu_request.dyreq", "line_number": 17, "usage_type": "name" }, { "api_name": "lxml.etree.HTML", "line_number": 18, "usage_type": "call" }, { "api...
19644698860
from fractions import Fraction import re class Conversions: def __init__(self, *args, **kwagrs): pass def us_to_dec(self, value: str) -> float: """ Convert US odds to float Args: value (str): US odds ie -600, 475 Returns: float: converted us odd...
gVkWY8NJAa/OddsCalculator
conversions.py
conversions.py
py
3,688
python
en
code
1
github-code
1
[ { "api_name": "fractions.Fraction", "line_number": 63, "usage_type": "call" }, { "api_name": "re.match", "line_number": 99, "usage_type": "call" }, { "api_name": "re.match", "line_number": 101, "usage_type": "call" }, { "api_name": "re.match", "line_number": 1...
14831446889
import requests #visit this website to get a soup commands <https://www.crummy.com/software/BeautifulSoup/bs4/doc/> def fetchAndSaveToFile(url, path): r = requests.get(url) with open(path , "w") as f: f.write(r.text) url="https://www.learncbse.in/ncert-solutions-for-class-10-english-literature/" fe...
dsc-gtbit/Hacktoberfest-2023-WebDev
Web Scraping/Web Scraping.py
Web Scraping.py
py
365
python
en
code
1
github-code
1
[ { "api_name": "requests.get", "line_number": 6, "usage_type": "call" } ]
32061857397
"""RecipeBase URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.2/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-ba...
djangoner/RecipeBase
recipes/urls.py
urls.py
py
1,995
python
en
code
0
github-code
1
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 36, "usage_type": "call" }, { "api_name": "rest_framework.routers", "line_number": 36, "usage_type": "name" }, { "api_name": "recipes.views.StatsViewset", "line_number": 37, "usage_type": "argument" },...
6649249684
import logging from flask import jsonify, request from flask_swagger import swagger from flask_swagger_ui import get_swaggerui_blueprint from ocean_provider.constants import BaseURLs, Metadata from ocean_provider.myapp import app from ocean_provider.routes import services from ocean_provider.utils.basics import get_co...
oceanprotocol/provider
ocean_provider/run.py
run.py
py
3,539
python
en
code
25
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.request.scheme", "line_number": 20, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 20, "usage_type": "name" }, { "api_name": "flask.reque...
73811586273
import json from flask import current_app as app, request, session from flask_login import login_user, current_user import models from utils import request_json, get_https_conn, success, failed, user_to_dict, sort_models, stop, hash_pwd, str_rand from plugins.fileHelper import save_remote_pic from plugins.ResourceContr...
dickhfchan/borocol
server/controllers/GoogleAuthController.py
GoogleAuthController.py
py
5,429
python
en
code
0
github-code
1
[ { "api_name": "models.user", "line_number": 56, "usage_type": "attribute" }, { "api_name": "flask_login.login_user", "line_number": 62, "usage_type": "call" }, { "api_name": "utils.success", "line_number": 63, "usage_type": "call" }, { "api_name": "flask.session",...
43514752978
''' 1010. 总持续时间可被 60 整除的歌曲 在歌曲列表中,第 i 首歌曲的持续时间为 time[i] 秒。 返回其总持续时间(以秒为单位)可被 60 整除的歌曲对的数量。形式上,我们希望索引的数字 i 和 j 满足  i < j 且有 (time[i] + time[j]) % 60 == 0。 示例 1: 输入:[30,20,150,100,40] 输出:3 解释:这三对的总持续时间可被 60 整数: (time[0] = 30, time[2] = 150): 总持续时间 180 (time[1] = 20, time[3] = 100):...
km1994/leetcode
topic9_hash_table/T1010_numPairsDivisibleBy60/interview.py
interview.py
py
1,432
python
zh
code
24
github-code
1
[ { "api_name": "collections.defaultdict", "line_number": 27, "usage_type": "call" } ]
72143594595
#!/usr/bin/env python # -*- coding: utf-8 -*- from typing import Optional import warnings from .base import TemplateWidget, Block from .buttons import ModalButton, CollapseButton, LinkButton, FormButton class BasicHeader(TemplateWidget): """ The base header class, which contains the bulk of the functionalit...
caltechads/django-wildewidgets
wildewidgets/widgets/headers.py
headers.py
py
8,800
python
en
code
9
github-code
1
[ { "api_name": "base.TemplateWidget", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 28, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 30, "usage_type": "name" }, { "api_name": "typing.Optional",...
216313915
import datetime import pytz # Cogs Configuration cogs = ["cog_manager", "currency", "moderation", "miscellaneous"] # Moderation Configuration filtered = ["dick"] # Bot Configuration name = "Dreamworld" shop_emoji = None shop_categories = ["mlbb", "genshin", "roblox", "valorant", "discord", "roles"] formal_shop_cate...
MothTheMortal/dreamworld
config.py
config.py
py
11,845
python
en
code
1
github-code
1
[ { "api_name": "pytz.timezone", "line_number": 160, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 161, "usage_type": "call" } ]
3246717195
from pathlib import Path, PurePath import xlrd import xlwt src_path = '/Users/miraclewong/github/PythonPractice/python_productivity/调查问卷' # dst_file = '/Users/miraclewong/github/PythonPractice/python_productivity/result/结果.xlsx' dst_path = '/Users/miraclewong/github/PythonPractice/python_productivity/工资单/工资单.xlsx' p ...
MiracleWong/PythonPractice
python_productivity/01_excel_merge_spilt.py
01_excel_merge_spilt.py
py
2,362
python
en
code
0
github-code
1
[ { "api_name": "pathlib.Path", "line_number": 9, "usage_type": "call" }, { "api_name": "pathlib.PurePath", "line_number": 10, "usage_type": "call" }, { "api_name": "xlrd.open_workbook", "line_number": 46, "usage_type": "call" }, { "api_name": "xlwt.Workbook", "...
8490813014
import numpy as np import geopandas as gp import shapely import pyresample import pandas as pd import xarray as xr import sys import os from pyposeidon.utils.coastfix import simplify # logging setup import logging logger = logging.getLogger(__name__) def fix(dem, coastline, **kwargs): # ------------------------...
ec-jrc/pyPoseidon
pyposeidon/utils/fix.py
fix.py
py
16,054
python
en
code
17
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "geopandas.GeoDataFrame.from_file", "line_number": 26, "usage_type": "call" }, { "api_name": "geopandas.GeoDataFrame", "line_number": 26, "usage_type": "attribute" }, { "ap...
14236671750
import cv2 import imutils import sys import math import tkinter as tk import numpy as np from colormath.color_objects import sRGBColor, LabColor from colormath.color_conversions import convert_color from colormath.color_diff import delta_e_cie2000 # import pickle np.set_printoptions(threshold=sys.maxsize) PERFECT_HEX...
kashmoney2000/catan-spot-chooser
cv.py
cv.py
py
12,931
python
en
code
0
github-code
1
[ { "api_name": "numpy.set_printoptions", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.maxsize", "line_number": 12, "usage_type": "attribute" }, { "api_name": "cv2.boundingRect", "line_number": 40, "usage_type": "call" }, { "api_name": "colormath.co...
42952895279
import uproot#3 as uproot import numpy as np import pandas as pd from tqdm import tqdm import torch import dgl from dgl import backend as F from torch.utils.data import Dataset, DataLoader, Sampler #from modules.fixed_radius_graph import FixedRadiusNNGraph #from dgl.geometry.pytorch import FarthestPointSampler lay...
atlas-calo-ml/ML4PIONS_GRAPH
modules/ML4Pions_Dataset.py
ML4Pions_Dataset.py
py
19,597
python
en
code
1
github-code
1
[ { "api_name": "torch.utils.data.Dataset", "line_number": 74, "usage_type": "name" }, { "api_name": "uproot.open", "line_number": 78, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 104, "usage_type": "call" }, { "api_name": "dgl.rand_graph", ...
8518140724
import gzip import os import logging from functools import partial import numpy as np import numpy.ma as ma from pyg2p import Loggable from . import grib_interpolation_lib from .latlong import LatLong from .scipy_interpolation_lib import ScipyInterpolation, DEBUG_BILINEAR_INTERPOLATION, DEBUG_ADW_INTERPOLATION, \ ...
ec-jrc/pyg2p
src/pyg2p/main/interpolation/__init__.py
__init__.py
py
21,232
python
en
code
5
github-code
1
[ { "api_name": "pyg2p.Loggable", "line_number": 20, "usage_type": "name" }, { "api_name": "pyg2p.util.files.filename", "line_number": 35, "usage_type": "call" }, { "api_name": "pyg2p.util", "line_number": 35, "usage_type": "attribute" }, { "api_name": "latlong.LatL...
18540755230
import string import time from copy import deepcopy from math import sqrt from random import shuffle, sample, random, choice from typing import Set, List import numpy as np from tensorflow.python.keras.utils.np_utils import to_categorical from utils import Grid, Region_map, Rule, Move, calc_dim, calc_moveset, EMPTY, C...
ST3LL/Projet_PTS-DIA_13
sudoku_base.py
sudoku_base.py
py
6,974
python
en
code
0
github-code
1
[ { "api_name": "utils.Grid", "line_number": 14, "usage_type": "name" }, { "api_name": "utils.Grid", "line_number": 15, "usage_type": "name" }, { "api_name": "utils.Region_map", "line_number": 16, "usage_type": "name" }, { "api_name": "typing.Set", "line_number"...
73823335394
# import necessary libraries import numpy as np import matplotlib.pyplot as plt from sklearn import cluster, datasets, mixture from sklearn.preprocessing import StandardScaler from itertools import cycle, islice import warnings # for reproducibility np.random.seed(201277) # ============ # Generate data # =======...
ArkaB-DS/SpectralClustering
Codes/comparisons.py
comparisons.py
py
3,418
python
en
code
1
github-code
1
[ { "api_name": "numpy.random.seed", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 15, "usage_type": "attribute" }, { "api_name": "sklearn.datasets.make_circles", "line_number": 22, "usage_type": "call" }, { "api_name": "skl...
28883027729
from flask import ( redirect, request, session, render_template, url_for, Blueprint, ) main = Blueprint('main', __name__) @main.route('/', methods=['GET', 'POST']) def index(): if request.method == 'POST': name = request.form.get('name') if not name: return red...
LeeW-jc/chat-by-websocket
routes/main_route.py
main_route.py
py
616
python
en
code
4
github-code
1
[ { "api_name": "flask.Blueprint", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 15, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 15, "usage_type": "name" }, { "api_name": "flask.request...
35635936481
import numpy as np import sympy import matplotlib.pyplot as plt import copy param_names=["K", "r"] params={x:sympy.symbols(x) for x in param_names} t=sympy.symbols("t") p0=sympy.symbols("P0") P_t=params["K"]/(1+(sympy.exp(-params["r"]*t)*(params["K"]-p0)/p0)) P_t=(params["K"]*p0*sympy.exp(params["r"]*t))/(params["K"]+...
HOLL95/General_electrochemistry
Theory/FIM/sympy_fim_logistic.py
sympy_fim_logistic.py
py
2,056
python
en
code
2
github-code
1
[ { "api_name": "sympy.symbols", "line_number": 6, "usage_type": "call" }, { "api_name": "sympy.symbols", "line_number": 7, "usage_type": "call" }, { "api_name": "sympy.symbols", "line_number": 8, "usage_type": "call" }, { "api_name": "sympy.exp", "line_number":...
9903202895
from django.urls import reverse_lazy from django.views.generic import ListView from django.views.generic.edit import CreateView from django.views.generic.detail import DetailView from django.views.generic.edit import UpdateView from django.views.generic.edit import DeleteView from .models import Thing class ThingLis...
oryon-dominik/skeleton-django-postgres-docker
apps/things/views.py
views.py
py
1,089
python
en
code
2
github-code
1
[ { "api_name": "django.views.generic.ListView", "line_number": 11, "usage_type": "name" }, { "api_name": "models.Thing", "line_number": 12, "usage_type": "name" }, { "api_name": "django.views.generic.edit.CreateView", "line_number": 17, "usage_type": "name" }, { "a...
38806556181
import cv2 archivo_video = './videos/video.avi' fourcc = cv2.VideoWriter_fourcc(*'DIVX') # Se establece que el video se almacena el contenido en la variable archivo_video con una tasa de refresco # de 20 cuadros/segundo y una resolucion 640x480 video = cv2.VideoWriter(archivo_video, fourcc, 20, (640, 480)) camara =...
omarjcm/p59-programacion_hipermedial
code/ra/02_camara.py
02_camara.py
py
785
python
es
code
1
github-code
1
[ { "api_name": "cv2.VideoWriter_fourcc", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.VideoWriter", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.imshow", ...
86663640809
from django.urls import path,include,re_path from django.conf.urls import url from . views import * from . import views app_name="home" urlpatterns = [ path("", views.home, name="home"), path("projectadd", views.addproject, name="addproject"), path("projectadded", views.projectadded, name="projectadded")...
sourabh-art/ufaber
projects/urls.py
urls.py
py
901
python
en
code
1
github-code
1
[ { "api_name": "django.urls.path", "line_number": 10, "usage_type": "call" }, { "api_name": "views.home", "line_number": 10, "usage_type": "attribute" }, { "api_name": "django.urls.path", "line_number": 11, "usage_type": "call" }, { "api_name": "views.addproject", ...
17144967943
import datetime from django.test import TestCase from Test_Designing.forms import TestCreateForm, QuestionForm from Result_Analysis.models import Teacher from django.contrib.auth.models import User from Discussion_Forum.models import * class ExamFormTest(TestCase): name = 'ASE Quiz 1' description = 'ASE Quiz...
BrijeshBumrela/Scholaris
Scholaris/testModule/test_forms.py
test_forms.py
py
1,804
python
en
code
3
github-code
1
[ { "api_name": "django.test.TestCase", "line_number": 9, "usage_type": "name" }, { "api_name": "datetime.date.today", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 13, "usage_type": "attribute" }, { "api_name": "django.con...
39651466436
import logging import os from twisted.internet import reactor from .extra.kv_client import KvClient from .hipchat_api import HipChatApi from .hipchat_db import HipchatUserDb from .hipchat_xmpp import make_client from .schedule import Schedule from .util.config import init_config, write_config_file_utf8 from .util.day...
LipuFei/team-hipchat-bot
bot/bot.py
bot.py
py
2,874
python
en
code
0
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 18, "usage_type": "call" }, { "api_name": "util.config.init_config", "line_number": 34, "usage_type": "call" }, { "api_name": "util.daysoff_parser.DaysOffParser", "line_number": 37, "usage_type": "call" }, { "api_n...
35388028773
from sklearn.ensemble import GradientBoostingRegressor from xgboost import XGBRegressor from catboost import CatBoostRegressor import pandas as pd import numpy from numpy import ndarray def df_processing(df, df_test): df.drop('genres', axis=1, inplace=True) df_test.drop('genres', axis=1, inplace=True) ...
akozlovskaya/ml_msu
GradBoost/awards_prediction.py
awards_prediction.py
py
2,479
python
en
code
1
github-code
1
[ { "api_name": "pandas.DataFrame", "line_number": 23, "usage_type": "call" }, { "api_name": "pandas.concat", "line_number": 25, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 27, "usage_type": "call" }, { "api_name": "pandas.concat", "...
32599542666
#!/usr/bin/python3 from typing import List import json from bplib.butil import TreeNode, arr2TreeNode, btreeconnect from collections import deque # Definition for a Node. class Node: def __init__(self, val: int = 0, left: 'Node' = None, right: 'Node' = None, next: 'Node' = None): self.val = val s...
negibokken/sandbox
leetcode/117_populating_next_right_pointers_in_each_node_II/main.py
main.py
py
907
python
en
code
0
github-code
1
[ { "api_name": "collections.deque", "line_number": 22, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 35, "usage_type": "call" }, { "api_name": "bplib.butil.arr2TreeNode", "line_number": 36, "usage_type": "argument" }, { "api_name": "bplib.butil...
32620909163
from xml.parsers import expat import textInfos from logHandler import log class XMLTextParser(object): def __init__(self): self.parser=expat.ParserCreate('utf-8') self.parser.StartElementHandler=self._startElementHandler self.parser.EndElementHandler=self._EndElementHandler self.parser.CharacterDa...
atsuoishimoto/tweetitloud
source/XMLFormatting.py
XMLFormatting.py
py
1,394
python
en
code
1
github-code
1
[ { "api_name": "xml.parsers.expat.ParserCreate", "line_number": 8, "usage_type": "call" }, { "api_name": "xml.parsers.expat", "line_number": 8, "usage_type": "name" }, { "api_name": "textInfos.ControlField", "line_number": 16, "usage_type": "call" }, { "api_name": ...
31617496117
import datetime,json from django.test import TestCase from rest_framework import status from rest_framework.test import APITestCase from StringIO import StringIO from rest_framework.parsers import JSONParser from django.utils import timezone from django.core.urlresolvers import reverse from django.test import Client ...
EdgeCaseBerg/whoseopinion.com
api/questions/tests.py
tests.py
py
17,831
python
en
code
0
github-code
1
[ { "api_name": "questions.models.Category.objects.create", "line_number": 22, "usage_type": "call" }, { "api_name": "questions.models.Category.objects", "line_number": 22, "usage_type": "attribute" }, { "api_name": "questions.models.Category", "line_number": 22, "usage_typ...
20648101318
#!/usr/bin/env python # coding: utf-8 # In[2]: import pandas as pd import numpy as np import matplotlib.pyplot as plt # In[3]: df=pd.read_csv(r"C:\Users\lenovo\Downloads\CarDataSet.csv") # In[4]: df # In[5]: df=df.drop('New_Price',axis=1) # In[6]: df=df.dropna() # In[7]: df # In[8]: df['Milea...
HardeshPratap/Used-car-sales-analysis
ML Project.py
ML Project.py
py
4,208
python
en
code
0
github-code
1
[ { "api_name": "pandas.read_csv", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 141, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 141, "usage_type": "name" }, { "api_name": "matplotl...
37774782473
import numpy as np import pandas as pd from sklearn.feature_extraction.text import CountVectorizer import project.data.preprocess_data as preprocess import torch from sklearn.preprocessing import LabelEncoder from pytorch_pretrained_bert import BertTokenizer def tokenize_input(baseline_text, context_text, split, token...
Sanger2000/Predicting-Lung-Cancer-Disease-Progression-from-CT-reports
project/data/make_features.py
make_features.py
py
5,785
python
en
code
0
github-code
1
[ { "api_name": "pytorch_pretrained_bert.BertTokenizer.from_pretrained", "line_number": 11, "usage_type": "call" }, { "api_name": "pytorch_pretrained_bert.BertTokenizer", "line_number": 11, "usage_type": "name" }, { "api_name": "project.data.preprocess_data.preprocess_tokens", ...
14124670906
# encoding: utf-8 import datetime from south.db import db from south.v2 import DataMigration from django.db import models SETTINGS_RENAMES = ( ("SHOP_SSL_ENABLED", "SSL_ENABLED"), ("SHOP_SSL_FORCE_HOST", "SSL_FORCE_HOST"), ) class Migration(DataMigration): def forwards(self, orm): "Write your f...
phodal/echoes
conf/migrations/0004_ssl_account_settings_rename.py
0004_ssl_account_settings_rename.py
py
1,887
python
en
code
14
github-code
1
[ { "api_name": "south.v2.DataMigration", "line_number": 14, "usage_type": "name" }, { "api_name": "django.db.models", "line_number": 39, "usage_type": "name" } ]
32053631377
import csv import json import sys import traceback from bs4 import BeautifulSoup from time import sleep import os from get_restaurants_list import check_element_by_xpath, wait_to_display, load_restaurants, save_restaurants from utils import VERSION, log, launch_driver, save_file # 主方法 def get_restaurant_info(r): ...
djangommq/ifood
src_v0/get_restaurants_info.py
get_restaurants_info.py
py
12,563
python
en
code
0
github-code
1
[ { "api_name": "utils.launch_driver", "line_number": 16, "usage_type": "call" }, { "api_name": "utils.log", "line_number": 21, "usage_type": "call" }, { "api_name": "utils.log", "line_number": 28, "usage_type": "call" }, { "api_name": "time.sleep", "line_number...
72592409635
import json from lemon.app import Lemon from lemon.const import HTTP_METHODS from lemon.request import HttpHeaders class ASGIResponse: def __init__(self, status, headers: HttpHeaders, content): self.status = status self.headers = headers self.content = content @property def statu...
joway/lemon
tests/asgi.py
asgi.py
py
3,904
python
en
code
28
github-code
1
[ { "api_name": "lemon.request.HttpHeaders", "line_number": 9, "usage_type": "name" }, { "api_name": "json.loads", "line_number": 23, "usage_type": "call" }, { "api_name": "lemon.app.Lemon", "line_number": 33, "usage_type": "call" }, { "api_name": "json.dumps", ...
3150635854
"""citeseer_rnm.py The domain knowledge here is represented in paper connections p1 and p2 which tend to be about the same topic. For example: ∀p1 ∀p2 AG(p1 ) ∧ Cite(p1 , p2 ) → AG(p2 ) Where Cite is an evidence predicate (value over the groundings is known a priori), determining whether a pattern cites another one. "...
samuelebortolotti/rnm
citeseer_rnm.py
citeseer_rnm.py
py
12,360
python
en
code
0
github-code
1
[ { "api_name": "os.environ", "line_number": 18, "usage_type": "attribute" }, { "api_name": "tensorflow.get_logger", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path", "lin...
70977147233
"""Training module for nondefaced-detector.""" import os import math import tensorflow as tf import pandas as pd import numpy as np from sklearn.utils import class_weight from tensorflow.keras import backend as K from tensorflow.keras import metrics from tensorflow.keras.optimizers import Adam from tensorflow.keras...
nipreps/nondefaced-detector
nondefaced_detector/training/training.py
training.py
py
6,609
python
en
code
6
github-code
1
[ { "api_name": "tensorflow.math.exp", "line_number": 25, "usage_type": "call" }, { "api_name": "tensorflow.math", "line_number": 25, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 73, "usage_type": "call" }, { "api_name": "os.path", "...