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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
30068084459 | from Bio.Blast.Applications import NcbiblastpCommandline
from Bio import SeqIO, Entrez, pairwise2
import pandas as pd
from os.path import dirname, abspath
import glob, sys, csv
import os.path
Entrez.email = 'td1515@ic.ac.uk'
Entrez.api_key = '41267f8592172caaa22ab00ec006c4330208'
# need 2 command line arguments: the i... | tinadro/bbh-other-classes | BBH-pipeline.py | BBH-pipeline.py | py | 7,670 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "Bio.Entrez.email",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "Bio.Entrez",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "Bio.Entrez.api_key",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "Bio.Entrez",
... |
25175961731 | import pytest
import urllib.request
import io
from unittest.mock import Mock, MagicMock
from workeremazident import utils
import json
def test_rank(monkeypatch):
sentiment = {
'happiness' : 1,
'surprise' : 1,
'calm' : 1,
'fear' : 1,
'sadness' : 1,
'anger' : 1,
... | aradqubasi/webemazident | worker_tests/test_utils_gemotion.py | test_utils_gemotion.py | py | 1,874 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "io.BytesIO",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "unittest.mock.Mock",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
... |
8306796882 | ### capture voice commands and respond accordingly
## HOW IT WORKS:
## DEPENDENCIES:
# OS:
# Python: SpeechRecognition
## CONFIGURATION:
# required: engine (google|pocketsphinx), speaker
# optional: device
## COMMUNICATION:
# INBOUND:
# OUTBOUND:
# - notification/speaker RUN: respond to the voice command through the... | egeoffrey/egeoffrey-interaction-microphone | interaction/microphone.py | microphone.py | py | 6,465 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sdk.python.module.interaction.Interaction",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "sdk.python.module.interaction.python.utils.command.run",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "sdk.python.module.interaction.python",
"line... |
34333523354 | #creates and produces a decision tree the classifies which drug a patient should take based on their age, sex, cholesterol, age, BP
#Outputs tree visual called DrugTree.png,
import numpy as np
import pandas as pd
from sklearn.tree import DecisionTreeClassifier
csv_path = 'https://s3-api.us-geo.objectstorage.softlaye... | Visheshj123/PyProjects | DecisionTrees.py | DecisionTrees.py | py | 2,500 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.LabelEncoder",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing",
"line_number": 16,
"usage_type": "name"
},
{
"api_name"... |
3708970763 | import pprint
from collections import Counter, defaultdict
import json
from typing import Tuple, Dict
def parse_names(film_names):
name_dict = {}
first_round_matches = film_names.get('matches_by_round').get('1')
for match in first_round_matches:
name_dict[match.get('player1').get('id')] = match.ge... | lstmemery/filmspotting-2019 | filmspotting_tourney/2022/predictions_counter.py | predictions_counter.py | py | 1,466 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.Dict",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "json.load",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_nu... |
35614156924 | from .base import *
from ..utils import is_python2
# Set Python2 to use for unicode field conversion to text
RUNNING_PYTHON2 = is_python2()
# removing security enforcement in development mode
DEBUG = True
SECRET_KEY = env('DJANGO_SECRET_KEY', '1234567890')
HOSTNAME_URL = env('HOSTNAME_URL', 'http://127.0.0.1:8000')
... | shihuaxing/hhs_oauth_server | hhs_oauth_server/settings/dev.py | dev.py | py | 1,554 | python | en | code | null | github-code | 6 | [
{
"api_name": "utils.is_python2",
"line_number": 5,
"usage_type": "call"
}
] |
19400238409 | from typing import List
class Solution:
def rob(self, nums: List[int]) -> int:
if len(nums) == 0:
return 0
if len(nums) == 1:
return nums[0]
dp = [0]*len(nums)
dp[0] = nums[0]
dp[1] = max(nums[0], nums[1])
for i in range(2, len(nums)):
... | Yigang0622/LeetCode | rob.py | rob.py | py | 427 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
}
] |
10511867776 | from itertools import chain
import json
from xml.etree.ElementTree import tostring
from django.urls.base import reverse
from django.shortcuts import render
from django.http import HttpResponseRedirect,HttpResponse,JsonResponse
import datetime
from to_do_list.models import User
from .models import Chat_group,Chat_mes... | LucaYan0506/NoteBook | chat/views.py | views.py | py | 6,967 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "itertools.chain",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "models.Chat_group.objects.filter",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "models.Chat_group.objects",
"line_number": 17,
"usage_type": "attribute"
},
{
"a... |
43085169237 | #!/usr/bin/env python3
#################################################
#
# connect button between ground and GPIO pin 4
# connect the led anode (long leg) to GPIO pin 23
# the cathode connect to a 320 ohom resister
# The other side of the resitor goes to ground
#
#################################################
... | gchoke/Physical-Computing | buttonPress.py | buttonPress.py | py | 534 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "gpiozero.Button",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "gpiozero.LED",
"line_number": 14,
"usage_type": "call"
}
] |
22537348687 | from django.urls import reverse
from rest_framework.response import Response
from django.shortcuts import render
from rest_framework.views import APIView
from libraries.DataTables import DataTables
from apps.common.models import ContactPage as Contact
# from django.views.generic.edit import CreateView, UpdateView
from ... | Abhisheksoni1/pkbpy | application/pkbadmin/views/contact_view.py | contact_view.py | py | 3,060 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pkbadmin.views.decorators.GroupRequiredMixin",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "django.views.View",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "django.shortcuts.render",
"line_number": 25,
"usage_type": "call"
},
{... |
17043015734 | # https://atcoder.jp/contests/abc249/tasks/abc249_c
import collections
N, K = map(int, input().split())
L = [input() for _ in range(N)]
result = 0
"""
N=3の場合は以下の8通り。
0b000
0b001
0b010
0b011
0b100
0b101
0b110
0b111
0b011の場合は
L[1]とL[0]を選ぶ。
N-1=2 まで右にシフトして0b1との論理積が1の場合は対象である。
書き方は、(n >> i) & 1。nをiだけ右へビットシフトして1との論理積をとる
... | atsushi-matsui/atcoder | beginner_contest/contest249/abc249_c.py | abc249_c.py | py | 790 | python | ja | code | 0 | github-code | 6 | [
{
"api_name": "collections.Counter",
"line_number": 25,
"usage_type": "call"
}
] |
28269676936 | import os
import argparse
import pandas as pd
from termcolor import colored
from constants import *
CHARS_TO_SHOW = 50
parser = argparse.ArgumentParser(description="Displaying a given word's relations")
parser.add_argument("file_id")
parser.add_argument("word")
args = parser.parse_args()
filename_text = os.path.... | RomainC123/Anastomosis | src/display_relation.py | display_relation.py | py | 2,769 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
... |
35400441869 | from django.conf.urls.defaults import *
from django.conf.urls.i18n import i18n_patterns
from django.contrib import admin
from django.conf import settings
from cms.sitemaps import CMSSitemap
from zinnia.sitemaps import TagSitemap
from zinnia.sitemaps import EntrySitemap
from zinnia.sitemaps import CategorySitemap
from z... | robertour/commas | commas/urls.py | urls.py | py | 1,253 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "django.contrib.admin.autodiscover",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.conf.urls.i18n.i18n_patterns",
"line_number": 13,
"usage_type": "call"
},... |
25706402830 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Execute Atlas Generation on EMR
@author: Vladimir Lemberg
@history: 11/05/2020 Created
"""
import argparse
import boto3
import json
import logging
import os
import time
from botocore.exceptions import ClientError
from datetime import datetime
VERSION = "1.0.0"
AWS_R... | osmlab/atlas-checks | scripts/DeployAtlasChecksAWS/DeployAtlasChecksAWS.py | DeployAtlasChecksAWS.py | py | 15,409 | python | en | code | 51 | github-code | 6 | [
{
"api_name": "logging.INFO",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "logging.basicConfig",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "argparse.Argu... |
19670933181 | import pandas as pd
import tomotopy as tp
import os
from konlpy.tag import Kkma
import re
def create_noun():
kkma = Kkma()
path_dir = "C:\\Users\\gusals\\Desktop\\현민\\딥러닝 특론\\크롤링결과\\2020년2월~2020년2월"
file_list = os.listdir(path_dir)
file_list.sort()
print(file_list)
remove_list = ['기자', '네이버'... | gusals6804/TopicModelling | TopicModeling.py | TopicModeling.py | py | 3,547 | python | ko | code | 0 | github-code | 6 | [
{
"api_name": "konlpy.tag.Kkma",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number"... |
74418981949 | import os
from typing import cast
import numpy
import trimesh
from PyQt5.QtCore import QObject, pyqtSlot
from UM.Extension import Extension
from UM.Logger import Logger
from UM.Mesh.MeshBuilder import MeshBuilder
from UM.Mesh.MeshData import MeshData, calculateNormalsFromIndexedVertices
from UM.Operations.AddSceneNod... | diegopradogesto/cura-primitives-extension | src/PrimitivesExtension.py | PrimitivesExtension.py | py | 3,529 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "UM.i18n.i18nCatalog",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtCore.QObject",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "UM.Extension.Extension",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "PyQt5... |
8606462841 | import urllib.request, json
with urllib.request.urlopen("https://raw.githubusercontent.com/Biuni/PokemonGO-Pokedex/master/pokedex.json") as url:
data = json.loads(url.read().decode())
# print(json.dumps(data, indent=4, sort_keys=True))
nombre = (len(data['pokemon']))
print ('il y a : ' + str(nombre) + '... | Mathilde-J/Exercices | mercredi1401/pokemon.py | pokemon.py | py | 690 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "urllib.request.request.urlopen",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "urllib.request",
"line_number": 2,
"usage_type": "name"
},
{
"api_name":... |
43705736104 | """
This is a PostgreSQL Database Web App made with Flask.
User needs to input height data and an email.
The app saves the data in the postgresql database.
The app then calculates the average height of the inputs in the database
and then sends back to the user the confirmation mail with the calculated average height.
"... | PolonaM/Data-Collector-Web-App | data_collector_frontend.py | data_collector_frontend.py | py | 2,560 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "flask.r... |
35087220889 | import boto3
import botocore
def get_stack_status(stackname):
client = boto3.client('cloudformation')
r = client.describe_stacks(StackName=stackname)
for stack in r['Stacks']:
if str(stack['StackName']) == stackname:
return stack['StackStatus']
def get_stack_output_value_from_key... | benoitMariaux/MagicEightBall | src/utils/tools.py | tools.py | py | 974 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "boto3.client",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number": 14,
"usage_type": "call"
}
] |
73876831228 | from yaml import load_all
try:
from yaml import CLoader as Loader
except ImportError:
from yaml import Loader
import re
import os
from os import path
import nltk
from nltk.stem import LancasterStemmer
from ..wordmodifiers import context
from pkg.preprocessor import Document
class DictBuilder:
def __init... | tsontario/minerva | pkg/dictionary/dictbuilder.py | dictbuilder.py | py | 1,488 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "wordmodifiers.context.normalizer_funcs_for_context",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "wordmodifiers.context",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "wordmodifiers.context.filter_funcs_for_context",
"line_number": 22,
... |
42814254071 | from itertools import combinations
from sklearn.metrics.pairwise import cosine_similarity
from gensim.models import Word2Vec
from sklearn.feature_extraction.text import TfidfVectorizer
from collections import defaultdict
import numpy as np
import pandas as pd
from tqdm import tqdm
import random
import torch
i... | JJJJerry/DayDietRecommend | classhelper.py | classhelper.py | py | 18,829 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "sklearn.feature_extraction.text.TfidfVectorizer",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 71,
"usage_type": "call"
},
{
... |
31871102732 | from dash import Dash
import dash_core_components as dcc
import dash_html_components as html
import dash_table as dt
import plotly.express as px
import plotly.graph_objects as go
from dash.dependencies import Input, Output
from pandas_datareader import data
import pandas as pd
import re
df = pd.read_csv("C:/Users/jfen... | jimmy-feng/GEOG509 | LocationApp.py | LocationApp.py | py | 6,406 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "dash.Dash",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "plotly.express.scatter_mapbox",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "plotly.expres... |
44154484585 | import os.path
import time
import json
from haralyzer import HarParser
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
fr... | Maxga/Crunchy-Streamer | scraper.py | scraper.py | py | 19,324 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "pathlib.Path",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path.path.dirname",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"li... |
29867397003 | import urllib.request
import datetime
import os.path
import os
BASE = "http://archive.luftdaten.info"
def download(url):
"""
Download and return data from the given URL.
>>> data = download('https://de.wikipedia.org')
>>> type(data)
<class 'bytes'>
"""
# Alternatives are described here:
... | Jan200101/feinstaub-projekt | download.py | download.py | py | 1,495 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "urllib.request.request.urlopen",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "urllib.request",
"line_number": 17,
"usage_type": "name"
},
{
"api_nam... |
72995156028 | import os
import time
import struct
import wallet
import eosapi
import initeos
from eosapi import N
from tools import cpp2wast
from common import prepare, producer
import debug as _debug
print('please make sure you are running the following command before testing')
print('./pyeos/pyeos --manual-gen-block --debug -i... | learnforpractice/pyeos | programs/pyeos/tests/python/call/t.py | t.py | py | 1,895 | python | en | code | 131 | github-code | 6 | [
{
"api_name": "os.path.dirname",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "tools.cpp2wast.set_src_p... |
11579964560 | # -------------------------------- IMPORTS -------------------------------- #
# Constants
from config import (
BEST_CONTROLLER_WEIGHTS,
OPTIMAL_CONTROLLER_WEIGHTS,
TRAIN_STEPS,
TRIALS_PER_WORKER,
MAX_STEPS,
RENDER_MODE,
MAX_INT,
PRECISION
)
# Environment, Evolution S... | dinesh-krishnan-balakrishnan/rAIcer | Controller_Train.py | Controller_Train.py | py | 5,840 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "config.TRIALS_PER_WORKER",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "CMA_ES.CMA_ES",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "Controller.Controller",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "config.T... |
75316083066 | import wx
from wx.lib import sheet
from ..controller.xlsx import XlsxController
__author__ = 'Joeny'
class SpreadSheet(sheet.CSheet):
"""
Spreadsheet view
* Clear(self)
Clear the currently selected cells
* Copy(self)
Copy the currently selected cells to the clipboar... | JoenyBui/boa-gui | boaui/panel/xlsx.py | xlsx.py | py | 2,456 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "wx.lib.sheet.CSheet",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "wx.lib.sheet",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "controller.xlsx.XlsxController",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "... |
10786898832 | import os
import sys
import glob
from pathlib import Path
from rich import print
def fetchLatestSeqDir(pref, PI, postfix):
globStr = os.path.join(
pref,
PI,
postfix + '*'
)
if len(glob.glob(globStr)) == 1:
return glob.glob(globStr)[0]
else:
maxFolder = 0
... | maxplanck-ie/dissectBCL | src/wd40/release.py | release.py | py | 5,296 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "glob.glob",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 15,
... |
3929187613 | import logging
import logging.handlers as handlers
from logging.handlers import TimedRotatingFileHandler
from pathlib import Path
from typing import Union
from src.infrastructure.locations import Locations
from src.infrastructure.singleton_decorator import Singleton
from enum import Enum
class RollingFileMethod(Enu... | mariusvrstr/PythonMicroservice | src/infrastructure/logger.py | logger.py | py | 2,554 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "enum.Enum",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "src.infrastructure.singleton_decorator.Singleton",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "logging.Formatter",
"line_number": 22,
"usage_type": "call"
},
{
"api_... |
1470129490 | import logging
import qt, ctk, slicer
from collections import deque
from slicer.ScriptedLoadableModule import *
from SlicerCaseIteratorLib import IteratorBase
from SlicerCaseIteratorLib.IteratorFactory import IteratorFactory
# ------------------------------------------------------------------------------
# SlicerCa... | JoostJM/SlicerCaseIterator | SlicerCaseIterator/SlicerCaseIterator.py | SlicerCaseIterator.py | py | 16,647 | python | en | code | 12 | github-code | 6 | [
{
"api_name": "SlicerCaseIteratorLib.IteratorFactory.IteratorFactory.reloadSourceFiles",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "SlicerCaseIteratorLib.IteratorFactory.IteratorFactory",
"line_number": 52,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",... |
15376054901 | import sys
from mysql import DBase
from colorama import Fore
############################################
# #
# importador de spiders #
# #
############################################
#
class SpiderImport:
# res... | DanielSoaresM/BD_maintenance | import_spider.py | import_spider.py | py | 5,373 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "colorama.Fore.WHITE",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "colorama.Fore",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "colorama.Fore.RED",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "coloram... |
19886926660 | import pytest
import pendulum
from tests.common import freeze_time
day0 = pendulum.datetime(1999, 12, 31)
day1 = pendulum.datetime(2000, 1, 1)
day2 = pendulum.datetime(2000, 1, 2)
day3 = pendulum.datetime(2000, 1, 3)
day4 = pendulum.datetime(2000, 1, 4)
day5 = pendulum.datetime(2000, 1, 5)
day6 = pendulum.datetime(20... | bitlogik/guardata | tests/client/fs/workspacefs_timestamped/conftest.py | conftest.py | py | 3,492 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "pendulum.datetime",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pendulum.datetime",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pendulum.datetime",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pendulum.datetime"... |
24287478943 | from itertools import chain
def swap_even_with_odd(numbers):
return list(
chain(*[(numbers[x], numbers[x - 1]) for x in range(1, len(numbers), 2)])) if not len(
numbers) % 2 else list(
chain(*[(numbers[x], numbers[x - 1]) for x in range(1, len(numbers), 2)])) + [numbers[
... | ckallum/Daily-Coding-Problem | solutions/#109.py | #109.py | py | 722 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "itertools.chain",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "itertools.chain",
"line_number": 8,
"usage_type": "call"
}
] |
12037622446 | # import datetime
import requests
import json
menu_items = ['1️⃣ 🎲 Random', '2️⃣ Input']
def get_random():
parameters = {}
url = "https://api.chucknorris.io/jokes/random"
response = requests.get(url, params=parameters)
api_data = json.loads(response.content)
return api_data["value"]
def get_word... | philffm/hu_ddd | 05/norris_random.py | norris_random.py | py | 996 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": ... |
33089788289 | from statistics import mean, median
import cv2
import numpy as np
from pdf2image import convert_from_path
import sys
import os
import pytesseract
import json
import language_tool_python
tool = language_tool_python.LanguageTool('en-US')
OUT = os.path.dirname(__file__)
def get_paragraphs_from_image(imagefile, sizemin... | Jacarte/KTH-Licentiate-Thesis | build_images/ocr_spell_check.py | ocr_spell_check.py | py | 9,277 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "language_tool_python.LanguageTool",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "cv2.im... |
14037887572 | import pandas as pd
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.cluster import AgglomerativeClustering
from sklearn.metrics import pairwise_distances
def encode_and_bind(original_dataframe, feature_to_encode, ans_modalities,m):
dummies = pd.get_dummies(original_dataframe[[feature_to_e... | EyalHadad/drug-target | src/data/data_feature_extraction/data_migration_handler.py | data_migration_handler.py | py | 3,059 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.get_dummies",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.melt",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sklearn.feature_extraction... |
30510484595 | # coding=utf-8
import falcon
import os
import re
from mimetypes import guess_type
from ultros_site.base_sink import BaseSink
__author__ = "Gareth Coles"
BASE_PATH = os.path.abspath("./static/")
class StaticRoute(BaseSink):
route = re.compile("/static/(?P<filename>.*)")
def __call__(self, req, resp, filena... | UltrosBot/Ultros-site | ultros_site/routes/static.py | static.py | py | 918 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "os.path.abspath",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "ultros_site.base_sink.BaseSink",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "re.compil... |
75275602746 | from django.shortcuts import render, redirect
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
from django.http import HttpResponse
from .models import Photo
from django.contrib.auth.decorators import login_required
from .forms import photo_form
def index(request):
photos = Photo.objects.f... | ewertonpaulo/gallery | photos/views.py | views.py | py | 1,349 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "models.Photo.objects.filter",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "models.Photo.objects",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "models.Photo",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "dj... |
35888160323 | from django.contrib.auth.models import User
from django.db import transaction
from datasources.models import Assembly, TrackFile
from evaluation.defaults import (
CLINGEN_FILE_ID,
DECIPHER_HAPLOINSUFFICENCY_FILE_ID,
ENCODE_DISTAL_DHS_ENHANCER_PROMOTER_FILE_ID,
HIC_NA12787_FILE_ID,
HIC_NA12787_TADS_... | bposzewiecka/TADeus2 | scripts/import_evaluation_data.py | import_evaluation_data.py | py | 7,331 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "datasources.models.Assembly.objects.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datasources.models.Assembly.objects",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "datasources.models.Assembly",
"line_number": 15,
"usage_... |
12881424290 | # All imports
from mongokit import Connection, Document
from flask import Flask, jsonify, render_template
# configuration
HOST = 'localhost'
PORT = 27017
DATABASE = 'test'
# little app
app = Flask(__name__)
app.config.from_object(__name__)
# connect to test database
connection = Connection(app.config['HOST'],
... | Tyapkin/flask_mongoDB | application.py | application.py | py | 985 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "mongokit.Connection",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "mongokit.Document",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "flask.render_templa... |
6041418653 | import numpy as np
import librosa
from scipy.signal import butter, sosfilt
from scipy.io import wavfile
import sounddevice as sd
def butter_bandpass(lowcut, highcut, sample_frequency, order=5):
nyq = 0.5 * sample_frequency
low = lowcut / nyq
high = highcut / nyq
return butter(order, [low, high], analo... | MazurierPierre/Projet_Recherche | audio_manager.py | audio_manager.py | py | 2,335 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "scipy.signal.butter",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "scipy.signal.sosfilt",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.int16",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "scipy.io.wa... |
4956391125 | from django.shortcuts import render, redirect
from .forms import Pricebabaf
from django.contrib import messages
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth import login, authenticate
from django.contrib.auth.decorators import login_required
from .decorators import user_is_entry_autho... | nidhisha-shetty/Human-Resource-CRM-System | pricebabaapp/views.py | views.py | py | 2,122 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "forms.Pricebabaf",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "forms.Pricebabaf",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "django.contrib.messages.info",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "django... |
17095901137 | import io
import os
from dotenv import load_dotenv
import pandas as pd
from clean_upload_data import replace_quotes_in_columns, upload_to_s3, \
check_col_in_df, check_cell_in_col, get_value_checked_if_true, pivot_json_values, concat_df, remove_useless_columns, \
replace_commas_with_semicolon
from get_sharepoint... | jul1998/PythonScripts | psc_table_scripts/checkboxes_data_main_GEAR.py | checkboxes_data_main_GEAR.py | py | 3,403 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "get_sharepoint_files.get_username",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "get_sh... |
24628038274 | import json
fileName = 'user_setting.txt'
myFile = open(fileName,mode='w')
Player1 ={
'Name':'Ramon',
'Score':456,
'Items':['Wild hog','Magic wand','Some shit']
}
Player2 ={
'Name':'Patrik',
'Score':478,
'Items':['Magic ring','Iron but','Double bubble']
}
AllTogether = []
AllTogeth... | Nahtigal/PythonStudy | JSON/1.py | 1.py | py | 458 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.dump",
"line_number": 25,
"usage_type": "call"
}
] |
12740982081 | import argparse
import os
import sys
import time
import requests
from dotenv import load_dotenv
from itertools import count
from requests.exceptions import ConnectionError, HTTPError
from terminaltables import AsciiTable
HH_API_URL = 'https://api.hh.ru/vacancies/'
SJ_API_URL = 'https://api.superjob.ru/2.0/vacancies... | pszhuchkov/language-salary | main.py | main.py | py | 7,017 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "itertools.count",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "itertools.count",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line... |
42976923753 | from collections import deque
N, K = map(int, input().split())
q = deque([i for i in range(1, N+1)])
print('<', end='')
while len(q) != 1:
for _ in range(K-1):
q.append(q.popleft())
print(q.popleft(), end=', ')
print(f'{q.popleft()}>') | jinhyo-dev/BOJ | 요세푸스 문제 0.py | 요세푸스 문제 0.py | py | 244 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "collections.deque",
"line_number": 3,
"usage_type": "call"
}
] |
16629880040 | import csv
import json
import datetime
import os
import re
import codecs
import timeit
import numpy as np
import pandas as pd
import spacy
from numpy import zeros, float32 as REAL
from gensim.models import keyedvectors
from nltk import WordNetLemmatizer
from nltk.corpus import stopwords
from random import sample
from ... | EdwinPuertas/DomainSentimentAnalysis | sa_logic/support.py | support.py | py | 18,713 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "spacy.load",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "nltk.c... |
8664921964 | #!/usr/bin/env python
import yaml
import sys
import boto3
import os
from yaml import ScalarNode, SequenceNode
from six import string_types
from botocore.exceptions import ClientError
# This helper copied almost entirely from
# https://github.com/awslabs/serverless-application-model/blob/master/samtranslator/yaml_hel... | AlisProject/serverless-application | deploy_api_function.py | deploy_api_function.py | py | 2,937 | python | en | code | 54 | github-code | 6 | [
{
"api_name": "yaml.SafeLoader.add_multi_constructor",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "yaml.SafeLoader",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "yaml.safe_load",
"line_number": 20,
"usage_type": "call"
},
{
"api_nam... |
71570239869 | from django import forms
from django.core.exceptions import ValidationError
from faculty.models import Faculty, Department, Program, Teacher, Course, Curriculum, FacultyDean, DepartmentHead
from tempus_dominus.widgets import DatePicker
from django.contrib.auth.models import User
class FacultyForm(forms.ModelForm):
... | Emad-ahmed/luRoutine | faculty/forms.py | forms.py | py | 3,381 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.forms.CharField",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.... |
69923764988 | import logging
from datetime import datetime
from pyspark.sql import SparkSession
# Initialize Spark session
spark = SparkSession.builder.appName("DataPipeline").getOrCreate()
# Configure logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
def extract_from_logs():
# Code to extra... | Babarindeolanrewaju2/Practises- | datapipeline.py | datapipeline.py | py | 2,344 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pyspark.sql.SparkSession.builder.appName",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pyspark.sql.SparkSession",
"line_number": 6,
"usage_type": "... |
13638107841 | import cv2
import tkinter
import os, time
from PIL import Image, ImageTk
import threading
import time
class Image_Process():
def crop(self, image):
h, w, _ = image.shape
cut = int((w-h)/2)
return image[0:h, cut: int(w-cut)]
def resize(self, image, resize=(224, 224)):... | p513817/Custom_Coral_Teachable_Machine | project_teachable_v3/1204_test.py | 1204_test.py | py | 4,304 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "cv2.resize",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2RGB",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image.fromarray",
... |
12733103065 | #!/usr/bin/env python3
import json
import os
import sys
from pprint import pprint
import requests
from bson import json_util
from pymongo import MongoClient
# TODO: Pull these from pkg/config.py?
MONGO_URI = os.getenv('MONGO_URI', 'mongodb://localhost:27017/ndslabs')
MONGO_DB = os.getenv('MONGO_DB', 'ndslabs')
DEB... | nds-org/workbench-apiserver-python | jobs/loadspecs.py | loadspecs.py | py | 4,028 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.getenv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 18,
... |
26458526785 | import os
import chess.engine
import backoff
import subprocess
import logging
logger = logging.getLogger(__name__)
@backoff.on_exception(backoff.expo, BaseException, max_time=120)
def create_engine(config):
cfg = config["engine"]
engine_path = os.path.join(cfg["dir"], cfg["name"])
engine_type = cfg.get("... | LichessBot-Coders/Lichess-Coded-Bot | engine_wrapper.py | engine_wrapper.py | py | 7,334 | python | en | code | 12 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "subprocess.DEVNULL",
"... |
8345250390 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import base64
from io import BytesIO
from flask import render_template, request
from webapp import app
from webapp.img.imgdiff import ImageDiff
from webapp.exceptions.imagediff_exception import *
from webapp.img.imgmatch import ImageMatch
@app.route('/', methods=['POST',... | megolee/Imgdiff | webapp/indexs/image_index.py | image_index.py | py | 1,220 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.request.method",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "flask.render_template",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "flask.r... |
24311132116 | import multiprocessing
import datetime
import time
import os
import sys
class Progress(object):
def __init__(self, EsN0: list, SIM: object):
self.EsN0 = EsN0
self.num = len(EsN0)
self.EsN0_idx = 0
self.path = get_caller_directory() + '/progress_bar.txt'
self.cpu_count = get... | clcl777/HPCtoolkit | HPCtoolkit/main.py | main.py | py | 5,057 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "time.time",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 55,
... |
32584313194 | from typing import List
from typing import Set
from pymoo.algorithms.genetic_algorithm import GeneticAlgorithm
from pymoo.algorithms.nsga2 import NSGA2 as NSGA2_
from pymoo.model.evaluator import Evaluator as Evaluator_
from pymoo.model.population import Population
from .base import BaseNSGA
from ...estimator import ... | Cloudslab/FogBus2 | containers/master/sources/utils/master/scheduler/policies/nsga/ohnsga.py | ohnsga.py | py | 3,780 | python | en | code | 17 | github-code | 6 | [
{
"api_name": "base.BaseNSGA",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.Set",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "types.Address",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "component.basic.BasicComponent... |
43242795281 | from preggy import expect
from tornado.testing import gen_test
from tests.fixtures.images import default_image
from tests.handlers.test_base_handler import BaseImagingTestCase
from thumbor.config import Config
from thumbor.context import Context, ServerParameters
from thumbor.importer import Importer
class ImageOper... | thumbor/thumbor | tests/handlers/test_base_handler_with_stored_keys.py | test_base_handler_with_stored_keys.py | py | 2,961 | python | en | code | 9,707 | github-code | 6 | [
{
"api_name": "tests.handlers.test_base_handler.BaseImagingTestCase",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "thumbor.config.Config",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "thumbor.importer.Importer",
"line_number": 22,
"usage_type": "... |
18073172644 | #!/usr/bin/env python3
import time
import socket
import struct
import sys
from evdev import UInput, InputDevice, ecodes as e, InputEvent
# CANPad - Gamepad client - v2.0
# Use this script on the receiver computer
# to send data over evdev by hijacking your controller
# Settings for Dirt Showdown
# Path to XBox evdev... | P1kachu/talking-with-cars | canpad/CANPad_game_v2.py | CANPad_game_v2.py | py | 3,860 | python | en | code | 100 | github-code | 6 | [
{
"api_name": "evdev.ecodes.BTN_EAST",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "evdev.ecodes",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "evdev.ecodes.ABS_X",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "evdev... |
18600404642 | from __future__ import division
from __future__ import print_function
import copy
import logging
import numpy as np
import os
import torch
import torch.nn as nn
import torch.nn.functional as F
from chainer import reporter
from torch.autograd import Variable
from e2e_asr_attctc_th import th_accuracy
from e2e_asr_att... | Zarana-Parekh/espnet-mt | src/lm/lm_pytorch.py | lm_pytorch.py | py | 10,020 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "torch.nn.functional.cross_entropy",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "... |
32159422265 | __author__ = 'Mursalin'
import requests
from bs4 import BeautifulSoup
url="https://jigsaw.w3.org/css-validator/validator?uri="
siteurl="http://www.heppnetz.de"
mainurl=url+siteurl
localurl="http://localhost/cssvalid/validator.htm"
r = requests.get(mainurl)
html= r.content
soup = BeautifulSoup(html)
g_data = soup.find_... | mursalinkabir/UIvalidator | cssvalidator.py | cssvalidator.py | py | 566 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 11,
"usage_type": "call"
}
] |
43967637256 | #!/usr/bin/python
import re
import sys
import copy
import argparse
import logging
from CPT_GFFParser import gffParse, gffWrite, gffSeqFeature
logging.basicConfig(level=logging.INFO)
log = logging.getLogger(name="blastxml2gff3")
__doc__ = """
BlastXML files, when transformed to GFF3, do not normally show gaps in the
b... | TAMU-CPT/galaxy-tools | tools/blast/blastxml_to_gapped_gff3-nt.py | blastxml_to_gapped_gff3-nt.py | py | 8,316 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "logging.basicConfig",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "Bio.Blast.NCBIX... |
4582061486 | import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from tqdm import tqdm
import warnings
import pandas as pd
import time
import pandas as pd
from sklearn.cluster import KMeans #used for comparison purposes
from mpl_toolkits.mplot3d import Axes3D
from sklearn.mixture import GaussianMixture
from sci... | pdavar/Analysis-of-3D-Mouse-Genome-Organization | constrained_k_means.py | constrained_k_means.py | py | 21,220 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 3... |
26249820377 | import argparse
import json
import shlex
import subprocess
import sys
from viztracer.prog_snapshot import ProgSnapshot
from .perfutils import read_events, parse_header
from .script import stacktrace_inject, print_stderr
from .perf2trace import perf2trace
usage = """
Take stacktraces from VizTracer, and inject the... | maartenbreddels/per4m | per4m/offgil.py | offgil.py | py | 4,863 | python | en | code | 43 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "argparse.RawDescriptionHelpFormatter",
"line_number": 32,
"usage_type": "attribute"
},
{
"a... |
21479533093 | import joblib
def load_model():
# 加载模型
return joblib.load('models/music-recommender.joblib')
def predict():
model = load_model()
# 预测21岁男性喜欢的音乐类型 和 22岁女性喜欢的音乐类型
return model.predict([
[21, 1],
[22, 0]
])
if __name__ == '__main__':
predictions = predict()
print(pred... | yulu86/machine-learning | learn-python/p13/predict_music_recommender.py | predict_music_recommender.py | py | 383 | python | zh | code | 0 | github-code | 6 | [
{
"api_name": "joblib.load",
"line_number": 6,
"usage_type": "call"
}
] |
74668125946 | from collections import Counter
from itertools import permutations
with open('in.txt') as f:
lines = list(map(int, f.read().splitlines()))
PREAMBLE = 25
for i, num in enumerate(lines[PREAMBLE:]):
sums = map(sum, permutations(set(lines[i:i+PREAMBLE]), r=2))
if num not in sums:
target = num
break
print(t... | dionyziz/advent-of-code | 2020/9/9.py | 9.py | py | 623 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "itertools.permutations",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 24,
"usage_type": "call"
}
] |
30493940975 | import os
from typing import List
import re
from importlib.util import module_from_spec, spec_from_file_location
from pkg_resources import parse_requirements
from setuptools import find_packages, setup
# https://packaging.python.org/guides/single-sourcing-package-version/
# http://blog.ionelmc.ro/2014/05/25/python-pa... | creyesp-peya/peya-recsys | setup.py | setup.py | py | 2,582 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "os.path.dirname",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number"... |
71210085307 | from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait
import time
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.common.by import By
driver = webdriver.Chrome(executable_path="C:\\chromedriver.exe")
driver.get("https://rahulshettyacademy.com/seleni... | MounikaAsula/gitdemo | assignment.py | assignment.py | py | 894 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 11,
"usage_type": "call"
}
] |
28784663867 | from PyQt5 import QtWidgets, uic
from PyQt5.QtWidgets import QPushButton,QDialog,QLineEdit,QVBoxLayout ,QMainWindow,QApplication,QLabel ,QGroupBox,QMessageBox,QWidget,QComboBox,QTableWidgetItem,QTableWidget,QTabWidget
from PyQt5.QtCore import QTimer, QTime, Qt
from PyQt5 import QtCore
#from ds import Ui_MainWindow
imp... | Mohamed-python/pyQt5_python_v1 | main.py | main.py | py | 15,431 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "PyQt5.uic.loadUi",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "PyQt5.uic",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidget... |
20594676533 | import cv2
import mediapipe as mp
mp_pose = mp.solutions.pose
# MediaPipe pose初期化
pose = mp_pose.Pose(
min_detection_confidence=0.5,
min_tracking_confidence=0.5
)
def get_pose(frame):
# MediaPipeで扱う画像は、OpenCVのBGRの並びではなくRGBのため変換
rgb_image = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
... | Bakeneko-git/MoChiOn | pose_input.py | pose_input.py | py | 1,643 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "mediapipe.solutions",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "cv2.cvtColor",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2RGB",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "mediapipe... |
10665520696 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sqlite3
from sqlite3 import Error
def sql_connection():
try:
base = sqlite3.connect('Proposito.db')
return base
except Error:
print(Error)
def sql_insert(con, entities):
cursorObj = con.cursor()
cursorObj.execute('INSERT... | sergiop22/Proposito | PropositoBD.py | PropositoBD.py | py | 600 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sqlite3.connect",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sqlite3.Error",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "sqlite3.Error",
"line_number": 14,
"usage_type": "argument"
}
] |
37290656375 | from pydoc import locate
import logging
import yaml
import os
import json as JSON
def pickitems(data, pickname="", excludes=["schema"]):
if isinstance(pickname, str):
names = [item for item in pickname.split(".") if item]
elif isinstance(pickname, list):
names = pickname
else:
name... | miacro/pyconfigmanager | pyconfigmanager/utils.py | utils.py | py | 4,846 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pydoc.locate",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "logging.warning",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "yaml.load_all",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"lin... |
7275647144 | import tensorflow as tf
import tensorflow_probability as tfp
import numpy as np
class DCT3D(tf.keras.layers.Layer):
"""
DCT3D - real Discrete Cosine Transform
Performs the discrete cosine transform
Example usage:
>>> import numpy as np
>>> import tensorflow as tf
>>> import tensorflow_probability as tfp
... | eeg-to-fmri/eeg-to-fmri | src/eeg_to_fmri/layers/fft.py | fft.py | py | 21,917 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "tensorflow.keras",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "numpy.arange",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"li... |
13442821953 | import xml.etree.ElementTree as ET
import iso8601
import json
from django.utils.timezone import now as now
from io import StringIO
from django.http import HttpResponse
from .models import Policy,PolicyAuthorization
# Create your views here.
def upload_policy(request):
success = False
try:
user = reque... | shadmaan4f93/paysure_project | insurer/views.py | views.py | py | 4,031 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "models.Policy",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "django.http.HttpResponse",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree.iterparse",
"line_number": 42,
"usage_type": "call"
},
{
"api_name":... |
41682640970 | """ For every raw address in the table, query the google maps API and record
its response """
import configparser
import pprint
from concurrent.futures import Future, FIRST_COMPLETED, wait
from time import sleep
from typing import Mapping, List, Set, Union, MutableMapping
from urllib import parse
import progressbar
fr... | MondayHealth/provider-import | gmaps_for_addresses.py | gmaps_for_addresses.py | py | 7,159 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.Mapping",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "configparser.ConfigParser",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "db_url.get_db_url",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "sqlalchemy... |
74262228347 | #A permutation of length n is an ordering of the positive integers {1,2,…,n} For example, π=(5,3,2,1,4)
#is a permutation of length 5.
#Given: A positive integer n≤7.
#Return: The total number of permutations of length n, followed by a list of all such permutations (in any order).
import itertools as it
impo... | AdrianaAceroFV/ROSALIND | CODE/PERM.py | PERM.py | py | 701 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "itertools.permutations",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "math.factorial",
"line_number": 14,
"usage_type": "call"
}
] |
2856138608 | import unittest
from conans.test.tools import TestServer, TestClient
from conans.model.ref import ConanFileReference
from conans.test.utils.cpp_test_files import cpp_hello_conan_files
from collections import OrderedDict
class MultiRemoteTest(unittest.TestCase):
def setUp(self):
self.servers = OrderedDict... | AversivePlusPlus/AversivePlusPlus | tools/conan/conans/test/integration/multi_remote_test.py | multi_remote_test.py | py | 3,902 | python | en | code | 31 | github-code | 6 | [
{
"api_name": "unittest.TestCase",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "collections.OrderedDict",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "conans.test.tools.TestServer",
"line_number": 14,
"usage_type": "call"
},
{
"api_na... |
28582599254 | import ray
from ray.exceptions import RayActorError
from utils.logger import logger
from agent.worker.ray_rollout_worker import RayRolloutWorker
from agent.manager.abstract.worker_manager_base import WorkerManagerBase
from queue import Queue
class RayManager(WorkerManagerBase):
def __init__(self, stop_event, tra... | parralplex/elite_buffer_vtrace | agent/manager/abstract/ray_manager.py | ray_manager.py | py | 2,401 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "agent.manager.abstract.worker_manager_base.WorkerManagerBase",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "ray.is_initialized",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "ray.init",
"line_number": 15,
"usage_type": "call"
},
... |
9679630272 | """ All telegram methods from https://core.telegram.org/bots/api (v 6.0) """
from typing import Any
from .base import SimpleTypes
from .new_objects import Translations, InlineKeyboard, ReplyKeyboard
from .tg_objects import *
__all__ = [
'send_message',
'get_updates',
'get_chat_member',
'get_my_comman... | LDmitriy7/template_bot3 | core/models/tg_methods.py | tg_methods.py | py | 8,391 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "new_objects.Translations",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "context.ctx.lang",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "context.ctx",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "typing.Any... |
7217801445 | import pygame
import random
import wx
#import IK
#import Robot
black=(0,0,0)
white=(255,255,255)
red=(255,0,0)
yellow=(255,255,0)
blue=(0,0,255)
#myIK=IK.myIK()
#myrobot=Robot()
def draw():
screen.fill(white)
allSpritesList.draw(screen)
split_line.draw(screen,black)
for i in conn... | csjiyw/test | GUI/test1.py | test1.py | py | 10,004 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.display.flip",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "pygame.sprite",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "pygame.spr... |
24167773894 | import tensorflow as tf
import numpy as np
import argparse
from datetime import datetime
from TwoInputDataset import TwoInputDataset
from tensorflow.python.tools.inspect_checkpoint import print_tensors_in_checkpoint_file
import tensorflow.contrib.slim as slim
import sys, os
sys.path.append(os.path.dirname(os.path.dir... | shigenius/tensorflow_works | tf-slim/transfer_learning.py | transfer_learning.py | py | 16,071 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
14519490 | import os
import unittest
import json
from flask_sqlalchemy import SQLAlchemy
from app import create_app
from database.models import setup_db, Actor, Movie
class CastingAgencyTestCase(unittest.TestCase):
# This class represents the Casting agency test case
def setUp(self):
# Define test variables and... | azzero/castingAgency | backend/test_app.py | test_app.py | py | 11,046 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "unittest.TestCase",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "app.create_app",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "database.models.setup_db",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "flask_s... |
41382950799 | from abc import ABC, abstractmethod
from enum import Enum
from hvac import Quantity
from ..schedule import OnOffSchedule
Q_ = Quantity
class Equipment(ABC):
class Category(Enum):
MACHINE = 'machine'
HOODED_COOKING_APPLIANCE = 'hooded cooking appliance'
OFFICE_APPLIANCE = 'office applianc... | TomLXXVI/HVAC | hvac/cooling_load_calc/core/internal_heat_gains/equipment.py | equipment.py | py | 4,999 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "hvac.Quantity",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "abc.ABC",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "schedule.OnOffSchedule",
"line_numb... |
17650449969 | # TRAINING
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.parameter import Parameter
from timm.models.vision_transformer import _cfg
from functools import partial
from SwinTransformer import SwinTransformer
def softmax(data):
for i in range(data.shape[0]):
... | hieultse150560/SwinTranUnet | SwinLarge.py | SwinLarge.py | py | 6,874 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "torch.exp",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.sum",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.parameter.Parameter",
... |
27033619134 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Program: SSL Host Expiration Checker from ak545
#
# Author of the original script: Andrey Klimov < ak545 at mail dot ru >
# https://github.com/ak545
#
# Current Version: 0.1.5
# Creation Date: 2021-08-12 (yyyy-mm-dd)
# Date of last changes: 2023-09-18 (yyyy-mm-dd)
#
# L... | ak545/ssl-host-expiration-checker | ssl-check.py | ssl-check.py | py | 26,393 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "sys.exit",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "colorama.init",
"line_number": 84,
... |
3807707321 | """Combination operators."""
import asyncio
import builtins
from ..aiter_utils import anext
from ..context_utils import AsyncExitStack
from ..core import operator, streamcontext
__all__ = ['chain', 'zip', 'map', 'merge']
@operator(pipable=True)
async def chain(*sources):
"""Chain asynchronous sequences togethe... | SillyFreak/aiostream | aiostream/stream/combine.py | combine.py | py | 3,806 | python | en | code | null | github-code | 6 | [
{
"api_name": "core.streamcontext",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "core.operator",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "context_utils.AsyncExitStack",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "core.st... |
23312980717 | import bpy
from .. SFX_Action_Props import SFX_Action_Props
class SFX_Actuators_Expanded_Inset(bpy.types.PropertyGroup):
'''Defines Physical Props of an Actuator'''
bl_idname = "SFX_simple_Actuator_Inset"
def update_HardMax(self,context):
self.update_HardMax_do(context)
def update_HardMi... | wiredworks/wiredworks_winches | Node/Actuators/SFX_Actuators_Expanded_Inset.py | SFX_Actuators_Expanded_Inset.py | py | 6,766 | python | en | code | 12 | github-code | 6 | [
{
"api_name": "bpy.types",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "bpy.props.FloatProperty",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "bpy.props",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "bpy.props.FloatP... |
6286173681 | #-----------------------------------------------O_N_V_R_I_O----------------------------------------------
import os
import cv2
import tempfile
import win32api
import win32print
from datetime import datetime
import time
import serial
from tkinter import messagebox
from tkinter import *
from tkinter import filedialog
fro... | VIGNESHRAJKUMAR2000/vigilant-octo-parakeet | onviro.py | onviro.py | py | 6,401 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.system",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 61,
... |
74232100668 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from xml.sax import ContentHandler, make_parser
from xml.sax.handler import feature_namespaces
from solvertools.wordlist import case_insensitive_clean
import unicodedata
import re
import sys
def ascii_enough(text):
# cheap assumption: if it's ASCII, and it's meant to ... | cesium12/solver-tools | scripts/scrape_wiktionary_definitions.py | scrape_wiktionary_definitions.py | py | 8,738 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "re.compile",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 31,
... |
70476168507 | import logging
from flask import Flask, jsonify, request
from config import Environment
from model.hs import reset_test, reset_prod
app = Flask(__name__)
@app.route('/api/healthz')
def healthz_api():
# 探针
return jsonify('OK')
@app.route('/api/hs/reset', methods=["POST"])
def manual_reset_api():
data =... | Ferrair/ml_model | app.py | app.py | py | 1,014 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.request.get_json",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "flask.request",
"... |
9920874849 | from django.shortcuts import render
from rest_framework import generics
from rest_framework.renderers import TemplateHTMLRenderer
from rest_framework.response import Response
from rest_framework import status
from common.models import License
from .models import Term, Relationship, TermRelationshipTerm
from .serializer... | kevinmporter/VocabularyHarmonizer | vocab/views.py | views.py | py | 2,388 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rest_framework.generics.ListCreateAPIView",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.generics",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "serializers.TermSerializer",
"line_number": 12,
"usage_type": "nam... |
1008751562 | '''Pandigital Products'''
from itertools import permutations
import time
def farrell():
'''My solution'''
t1 = time.time()
a = permutations('123456789')
count = 0
prods = set()
while True:
try:
b = next(a) #list of string objects
c = '... | hackingmath/Project-Euler | euler32.py | euler32.py | py | 1,944 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "time.time",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "itertools.permutations",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 32,
"usage_type": "call"
}
] |
34272368778 | import sys
import os
import getopt
import numpy as np
import csv
import json
verboseprint = None
def main(argv):
json_file = None
dest_path = None
verbose = False
# Argument parsing
try:
opts, args = getopt.getopt(argv, "hj:vw:",["help", "json=", "verbose", "write="])
except getopt.Get... | rattletat/java-code-analysis | src/main/tools/python/bug_tool/bug_solver.py | bug_solver.py | py | 3,715 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "getopt.getopt",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "getopt.GetoptError",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_n... |
36943388210 | from django.shortcuts import render
from . import forms
# Create your views here.
def index(request):
return render(request,'myapp/index.html')
def test_form_view(request):
form=forms.TestForm()
if request.method=='POST':
form= forms.TestForm(request.POST)
if form.is_valid():
pr... | bhawnathakur/mydjango | myapp/views.py | views.py | py | 568 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.shortcuts.render",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 16,
"usage_type": "call"
}
] |
4553377897 | import pandas as pd
import requests
from bs4 import BeautifulSoup
#Get link
url = 'https://www.worldometers.info/world-population/'
page = requests.get(url)
soup = BeautifulSoup(page.text, 'lxml')
#Getting nested table
table = soup.find('table', class_='table table-striped table-bordered table-hover table-condensed... | guilhermelamb/WebScraping | Project-One/Getting_data_from_table.py | Getting_data_from_table.py | py | 715 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 25,
"usage_type": "call"
}
] |
37033530111 | import os
import re
import sys
import time
import pathlib
import textwrap
import itertools
from getpass import getpass
from dotenv import load_dotenv
from urllib.parse import urlparse
from pydantic import BaseModel, Field, validator
from typing import Dict, List, Set, Type, Any, Union
import torch
import numpy as np
f... | maastrichtlawtech/lleqa | src/generator/inference.py | inference.py | py | 14,831 | python | en | code | 11 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 54,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "src.utils.FastChat.registe... |
24021335676 | """
Defines a class that allows impersonating
common browsers for web requests.
"""
import random
import time
from functools import partialmethod
from typing import Callable, Optional
import requests as req
from curl_cffi import CurlError
from curl_cffi import requests as ireq
from curl_cffi.requests.cookies import C... | MattMoony/d4v1d | d4v1d/utils/anonsession.py | anonsession.py | py | 4,290 | python | en | code | 34 | github-code | 6 | [
{
"api_name": "requests.Session",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "typing.Optional",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "curl_cffi.requests.session.BrowserType",
"line_number": 29,
"usage_type": "name"
},
{
"api_... |
15531773691 | from flask import Flask, render_template,request,abort,json
import os
import sys
app = Flask(__name__)
datos = open('MSX.json')
msx = json.load(datos)
@app.route('/',methods=["GET","POST"])
def inicio():
return render_template("inicio.html")
@app.route('/juegos')
def juegos():
return render_template("juegos.html")... | alemd01/Tarea-MSX | app.py | app.py | py | 927 | python | es | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask.json.load",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.json",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "flask.render_template",
"line... |
38048693112 | import os
from pydantic import BaseModel, Field
from jsonformer import Jsonformer
from transformers import AutoModelForCausalLM, AutoTokenizer
class NormalizedData(BaseModel):
name: str = Field(..., description="The name of the person")
age: int = Field(..., description="The age of the person")
address: s... | atibaup/llm-normalization-examples | normalize_via_generation_guiding.py | normalize_via_generation_guiding.py | py | 1,292 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pydantic.BaseModel",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "pydantic.Field",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pydantic.Field",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pydantic.Field",
"l... |
36851928256 | # -*- coding: utf-8 -*-
import time
import pandas as pd
import numpy as np
from sklearn.linear_model import LinearRegression
from sklearn import preprocessing
from sklearn.preprocessing import PolynomialFeatures
import array as arr
#from scipy import stats
import math
from datetime import datetime
from sklearn import m... | alvaromateus/IR-HMC | IR-HMC.py | IR-HMC.py | py | 23,125 | python | pt | code | 0 | github-code | 6 | [
{
"api_name": "warnings.simplefilter",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.polyfit",... |
74473721469 | import tensorflow as tf
import numpy as np
from tensorflow.keras import datasets, layers, models
import matplotlib.pyplot as plt
import os
from getHotelData import getHotelData
from getInputModel import getInputModel, plotModel
from getModel import getModel
checkpoint_path = "weights/weights.ckpt"
# Data
(train_data... | kvintessents/hotel-data-tensorflow-keras | train.py | train.py | py | 1,155 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "getHotelData.getHotelData",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "getInputModel.getInputModel",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "getModel.getModel",
"line_number": 17,
"usage_type": "call"
},
{
"api_name"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.