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
39295529986
import math from pyspark.ml.feature import VectorAssembler from pyspark.sql.functions import col, lit, min, max, asc, desc, concat_ws from pyspark.mllib.common import _java2py df = spark.read.option("header", "true").csv("data/cardataset.csv") metric_columns = ["Engine HP", "Engine Cylinders", "highway MPG", "city mp...
Fokko/spark-stochastic-outlier-selection
cars-outliers.py
cars-outliers.py
py
1,792
python
en
code
11
github-code
7
[ { "api_name": "pyspark.sql.functions.col", "line_number": 12, "usage_type": "call" }, { "api_name": "pyspark.sql.functions.lit", "line_number": 13, "usage_type": "call" }, { "api_name": "pyspark.sql.functions.min", "line_number": 13, "usage_type": "call" }, { "api...
29916922995
from sklearn.metrics import accuracy_score from data_functions import train_val_split_by_fold from xgboost import XGBClassifier import numpy as np import pandas as pd from tqdm import tqdm def cross_validation(df, processed_test_df, config): full_predictions = [] full_targets = [] for fold in df.fold...
eternelnrj/kaggle
spaceship-titanic/training.py
training.py
py
3,138
python
en
code
0
github-code
7
[ { "api_name": "data_functions.train_val_split_by_fold", "line_number": 14, "usage_type": "call" }, { "api_name": "sklearn.metrics.accuracy_score", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.concatenate", "line_number": 27, "usage_type": "call" }, ...
8094306065
import pymongo import uuid from bson.objectid import ObjectId client = pymongo.MongoClient( "mongodb+srv://jaime:12345678A@clusterdemo-zcrgs.mongodb.net/test?retryWrites=true&w=majority") db = client.project # db.project.insert_one({ # '_id': str(uuid.uuid4()), # 'budget_day': 1540, # 'expense_day': ...
jaimesHub/AppMoney
db.py
db.py
py
1,930
python
en
code
0
github-code
7
[ { "api_name": "pymongo.MongoClient", "line_number": 6, "usage_type": "call" }, { "api_name": "uuid.uuid4", "line_number": 27, "usage_type": "call" }, { "api_name": "bson.objectid.ObjectId", "line_number": 28, "usage_type": "call" }, { "api_name": "bson.objectid.Ob...
43133049015
import typer from HEACalculator.cli import app as cli_app from HEACalculator.gui import app as gui_app app = typer.Typer(add_completion=False, no_args_is_help=True) app.add_typer(gui_app, name='gui', help='Starts the HEACalculator Graphical User Interface (GUI)') app.add_typer(cli_app, ...
dogusariturk/HEACalculator
HEACalculator/__main__.py
__main__.py
py
700
python
en
code
3
github-code
7
[ { "api_name": "typer.Typer", "line_number": 6, "usage_type": "call" }, { "api_name": "HEACalculator.gui.app", "line_number": 7, "usage_type": "argument" }, { "api_name": "HEACalculator.cli.app", "line_number": 10, "usage_type": "argument" } ]
18752438363
# This problem was asked by Amazon. # Given an integer k and a string s, find the length of the longest substring that contains at most k distinct characters. # For example, given s = "abcba" and k = 2, the longest substring with k distinct characters is "bcb". from itertools import combinations unique_letters,result...
duanribeiro/DailyCodingProblem
SubstringK.py
SubstringK.py
py
1,283
python
en
code
0
github-code
7
[ { "api_name": "itertools.combinations", "line_number": 18, "usage_type": "call" } ]
8882516272
#!/usr/bin/env python from std_msgs.msg import Bool import rospy import sys, os SCRIPTS_PATH = os.path.abspath(os.path.join(sys.path[0] ,"../../../resources")) sys.path.append(SCRIPTS_PATH) from getter import Getter from utils import resource_name class Gripper(Getter): ### # Gripper information class extendin...
NickMcSweeney/AGTECH
hv_bridge/includes/Sensors/gripper.py
gripper.py
py
1,078
python
en
code
0
github-code
7
[ { "api_name": "os.path.abspath", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path", "line_number": ...
20062280068
import pytest from gibbs.utilities import convert_psi_to_Pa, convert_F_to_K, convert_bar_to_Pa @pytest.mark.parametrize('P_in_psi, P_in_Pa', [ [5.00, 34473.8], [10.00, 68947.6], [20.00, 137895], [100.00, 689476], [200.00, 1.379e6] ]) def test_psi_to_Pa(P_in_psi, P_in_Pa): assert convert_psi_to...
volpatto/gibbs
tests/test_utilities.py
test_utilities.py
py
871
python
en
code
36
github-code
7
[ { "api_name": "gibbs.utilities.convert_psi_to_Pa", "line_number": 13, "usage_type": "call" }, { "api_name": "pytest.approx", "line_number": 13, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 5, "usage_type": "call" }, { "api_name":...
9155624050
import matplotlib.pyplot as plt import numpy as np from scipy.interpolate import griddata filenames = ["data.txt", "data2.txt"] lines = list() for filename in filenames: with open(filename, "r") as file: lines += [line.strip().split(" ") for line in file.readlines()] temps = list() stepsizes = list() e_t...
tosi2504/monte-carlo-methods
production/sheet5/plots/computer_time_beta_dt/plot.py
plot.py
py
1,473
python
en
code
0
github-code
7
[ { "api_name": "numpy.array", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": ...
7587679445
#!/usr/bin/env python # Admits users from a .csv file with their email addresses in. # Emails should be in the first column and can be login or contact emails. from csv import reader from sys import argv import requests SERVER_BASE = "https://register.2023.hacktheburgh.com/" API_KEY = getenv("HTB_API_KEY") API_SECRET...
compsoc-edinburgh/htb21-reg
scripts/admit_all.py
admit_all.py
py
1,285
python
en
code
0
github-code
7
[ { "api_name": "requests.Session", "line_number": 13, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 17, "usage_type": "argument" }, { "api_name": "sys.argv", "line_number": 21, "usage_type": "name" }, { "api_name": "csv.reader", "line_number"...
27820503683
from flask import Flask, render_template, request app2 = Flask(__name__) @app2.route('/') def index(): return render_template('bmi.html') @app2.route('/calculate_bmi', methods=['POST']) def calculate_bmi(): weight = float(request.form['weight']) height = float(request.form['height']) bmi ...
Prajjwalpat/HealthOptimizer
bmi/bmif.py
bmif.py
py
901
python
en
code
0
github-code
7
[ { "api_name": "flask.Flask", "line_number": 3, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.request.form", "line_number": 11, "usage_type": "attribute" }, { "api_name": "flask.request...
20073244599
#Desafio054 from datetime import date maioridade = 0 menor = 0 for c in range(1, 8): idade = int(input(f'Insira a data de nascimento da {c}º pessoa: ')) pessoas = date.today().year - idade if pessoas >= 18: #ou 21 anos, eu preferi fazer com 18 :p maioridade += 1 else: menor += 1 pri...
ADMVicli/curso-em-video-python
Mundo 02/Desafio054.py
Desafio054.py
py
426
python
pt
code
2
github-code
7
[ { "api_name": "datetime.date.today", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 10, "usage_type": "name" } ]
12152135948
from flask import Flask, Blueprint from flask_restx import Api from flask_sqlalchemy import SQLAlchemy from flask_jwt_extended import JWTManager from datetime import timedelta from flask_migrate import Migrate from db import db authorizations={ "Bearer Auth":{ 'type':"apiKey", ...
stardev1/student_management_api
api/v1/__init__.py
__init__.py
py
1,968
python
en
code
0
github-code
7
[ { "api_name": "flask.Blueprint", "line_number": 19, "usage_type": "call" }, { "api_name": "flask_restx.Api", "line_number": 20, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 29, "usage_type": "call" }, { "api_name": "datetime.timedelta", ...
26967983504
import logging from configparser import ConfigParser import pandas as pd from matplotlib import pyplot as plt """ This module calculates customer tier using standard rules and points Rules: Points based system to divide the customers into three different groups past Loans Matured: if > 2: then points = 1...
abhisun/loan_default_prediction
get_customer_tier.py
get_customer_tier.py
py
2,910
python
en
code
0
github-code
7
[ { "api_name": "logging.basicConfig", "line_number": 28, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 28, "usage_type": "attribute" }, { "api_name": "logging.info", "line_number": 29, "usage_type": "call" }, { "api_name": "configparser.Conf...
27480654461
# -*- coding: utf-8 -*- import scrapy from seleniumtest.items import ProductItem class JingdonglistSpider(scrapy.Spider): name = 'jingdonglist' allowed_domains = ['list.jd.com'] url = 'https://list.jd.com/list.html?cat=670,671,672' def start_requests(self): for page in range(1, self.settings....
RenShixu/spider4
seleniumtest/seleniumtest/spiders/jingdonglist.py
jingdonglist.py
py
1,076
python
en
code
0
github-code
7
[ { "api_name": "scrapy.Spider", "line_number": 6, "usage_type": "attribute" }, { "api_name": "scrapy.Request", "line_number": 13, "usage_type": "call" }, { "api_name": "seleniumtest.items.ProductItem", "line_number": 19, "usage_type": "call" } ]
42875935976
import json import pprint import telepot from nasa import earth from typing import NamedTuple, Any from tqdm import tqdm import pendulum import os os.environ.setdefault( 'NASA_API_KEY', # 'xkPcYAoU93O1PeqPrKXyjpGChT1FkQ8TjA7Neg7V', 'xuOXLGNmyk4SPgtz4nIDaTQHcXo6la0PQpMoW8QM', ) class Bound: """ Re...
Raphiqui/Catching_Wildfires
app.py
app.py
py
6,602
python
en
code
0
github-code
7
[ { "api_name": "os.environ.setdefault", "line_number": 10, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 10, "usage_type": "attribute" }, { "api_name": "typing.NamedTuple", "line_number": 40, "usage_type": "name" }, { "api_name": "typing.Any", ...
10569119427
from flask import Flask, render_template, url_for, redirect, request import os from dotenv import load_dotenv from api import MatchHistory as MH from api import LiveGame as LG from helpers import GenericImages as GI from helpers import RegionDetails as RD from helpers import UserID as UID from helpers import cache #--...
PurifierRG/LolStats
app.py
app.py
py
3,282
python
en
code
2
github-code
7
[ { "api_name": "dotenv.load_dotenv", "line_number": 12, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 16, "usage_type": "call" }, { "api_name": "flask.render_template", ...
36522551461
import importlib import os import re import shlex import shutil import subprocess import sys import time import unittest from contextlib import contextmanager from functools import lru_cache from tempfile import TemporaryDirectory from threading import Thread from typing import ( Any, Callable, Dict, Ge...
kovidgoyal/kitty
kitty_tests/main.py
main.py
py
10,125
python
en
code
20,382
github-code
7
[ { "api_name": "sys.version_info", "line_number": 31, "usage_type": "attribute" }, { "api_name": "importlib.resources.contents", "line_number": 36, "usage_type": "call" }, { "api_name": "importlib.resources.files", "line_number": 37, "usage_type": "call" }, { "api_...
8048161809
from __future__ import absolute_import, division, unicode_literals from functools import wraps from future.utils import raise_from import AddonSignals from resources.lib.common import exceptions from resources.lib.globals import G from resources.lib.utils.logging import LOG, measure_exec_time_decorator from .misc_ut...
masQelec/repository.masqelec
plugin.video.netflix/resources/lib/common/ipc.py
ipc.py
py
10,476
python
en
code
2
github-code
7
[ { "api_name": "AddonSignals.registerSlot", "line_number": 39, "usage_type": "call" }, { "api_name": "resources.lib.globals.G.ADDON_ID", "line_number": 40, "usage_type": "attribute" }, { "api_name": "resources.lib.globals.G", "line_number": 40, "usage_type": "name" }, ...
73874430304
from astropy.wcs import WCS import reproject import numpy as np import astropy.units as u from photutils import SkyRectangularAperture from pathlib import Path from astropy.io import fits from astropy.table import Table import pickle from astropy.nddata import StdDevUncertainty from specutils import Spectrum1D from mul...
drvdputt/PAHFITcube
pahfitcube/wcshacks.py
wcshacks.py
py
11,209
python
en
code
0
github-code
7
[ { "api_name": "astropy.wcs.WCS", "line_number": 69, "usage_type": "call" }, { "api_name": "numpy.mgrid", "line_number": 93, "usage_type": "attribute" }, { "api_name": "astropy.units.degree", "line_number": 99, "usage_type": "attribute" }, { "api_name": "astropy.un...
36909212065
from tika import parser import shutil import os import subprocess from PIL import Image import pytesseract import sys from pdf2image import convert_from_path from pdf2image.exceptions import ( PDFInfoNotInstalledError, PDFPageCountError, PDFSyntaxError ) from cleanup import cleanUp import random headers = ...
vimanyuawal/digitalfingerprint
src/pdfsetup.py
pdfsetup.py
py
971
python
en
code
0
github-code
7
[ { "api_name": "tika.parser.from_file", "line_number": 30, "usage_type": "call" }, { "api_name": "tika.parser", "line_number": 30, "usage_type": "name" }, { "api_name": "random.randint", "line_number": 42, "usage_type": "call" }, { "api_name": "cleanup.cleanUp", ...
16418422296
import functools from os import path from sys import argv class Date(object): def __init__(self, day, month, year): self.day = int(day) self.month = int(month) self.year = int(year) if self.year < 100: self.year = 2000 + self.year @staticmethod def is_leap_yea...
daris/date-parser
date.py
date.py
py
3,013
python
en
code
0
github-code
7
[ { "api_name": "functools.cmp_to_key", "line_number": 90, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 115, "usage_type": "argument" }, { "api_name": "sys.argv", "line_number": 119, "usage_type": "name" }, { "api_name": "os.path.isfile", "li...
31340852974
from discord_components import DiscordComponents from discord.embeds import EmptyEmbed from discord.ext.commands import * from discord.ext import commands import discord from aiohttp import ClientSession from PIL import Image, ImageDraw, ImageFont, ImageOps from datetime import datetime import requests import asyncio...
Espiobest/DiscordBot
bot.py
bot.py
py
12,135
python
en
code
2
github-code
7
[ { "api_name": "dotenv.load_dotenv", "line_number": 26, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 27, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 27, "usage_type": "attribute" }, { "api_name": "os.environ", "l...
27771623699
from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals from googlecloudsdk.core import log as core_log from googlecloudsdk.core.console.style import text import six def _PrintResourceChange(operation, resource, ...
twistedpair/google-cloud-sdk
google-cloud-sdk/lib/googlecloudsdk/core/console/style/log.py
log.py
py
5,325
python
en
code
55
github-code
7
[ { "api_name": "googlecloudsdk.core.console.style.text.TextTypes.RESOURCE_NAME", "line_number": 50, "usage_type": "call" }, { "api_name": "googlecloudsdk.core.console.style.text.TextTypes", "line_number": 50, "usage_type": "attribute" }, { "api_name": "googlecloudsdk.core.console....
35379037933
# Steps to follow to get Selenium working in your project: # run `pip install selenium` # Add your we driver to the local directory # `geckodriver.exe` or `chromedriver.exe` # e.g.: In our case, the driver is in `qa_auto_testing` # folder as the `functional_test.py` script that uses # the driver. Once that is compl...
etsu-ninja-pirates/indicator-visualization-tool
qa_auto_testing/functional_tests.py
functional_tests.py
py
551
python
en
code
0
github-code
7
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 13, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 13, "usage_type": "name" } ]
28992789549
from featuretools.variable_types import Categorical, Numeric, Boolean, Discrete, Index, Id, Datetime, Timedelta, Text DEFAULT_VARIABLE_TYPES = { "categorical": Categorical, "numerical": Numeric, "boolean": Boolean, "discrete": Discrete, "index": Index, "id": Id, "datetime": Datetime, "t...
arshupt/Autofhm
Autofhm/feature/default_types.py
default_types.py
py
360
python
en
code
2
github-code
7
[ { "api_name": "featuretools.variable_types.Categorical", "line_number": 4, "usage_type": "name" }, { "api_name": "featuretools.variable_types.Numeric", "line_number": 5, "usage_type": "name" }, { "api_name": "featuretools.variable_types.Boolean", "line_number": 6, "usage_...
1326860406
# %% #! pip install kaggle --upgrade #! kaggle --version #! kaggle competitions download -c ieee-fraud-detection --force # %% if __name__ == "__main__": import pandas as pd import numpy as np import os import sklearn.preprocessing as sk_prep from sklearn.model_selection import train_...
BenZuckier/portfolio
fraud/prod/train/train.py
train.py
py
4,632
python
en
code
1
github-code
7
[ { "api_name": "pandas.DataFrame", "line_number": 24, "usage_type": "call" }, { "api_name": "zipfile.ZipFile", "line_number": 28, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 29, "usage_type": "call" }, { "api_name": "pandas.read_csv", ...
19332534269
from itertools import chain from pathlib import Path import pandas as pd from allennlp.common import Params from src.utils.helpers import filter_config, create_parent_dir_if_not_exists def create_vocab( train_qa_result_file, val_qa_result_file, vocab_result_file): qa_train = pd.read_pickle(train...
festeh/VisualQA
src/data_preprocessing/vocab_creation.py
vocab_creation.py
py
1,121
python
en
code
0
github-code
7
[ { "api_name": "pandas.read_pickle", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.read_pickle", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.concat", "line_number": 15, "usage_type": "call" }, { "api_name": "pathlib.Path", ...
23070496307
from django.db import models from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType class SourceCopyist(models.Model): class Meta: app_label = "diamm_data" MUSIC_COPYIST = 1 TEXT_COPYIST = 2 INDEXER = 3 LIMINARY_TEXT = 4...
diamm/diamm
diamm/models/data/source_copyist.py
source_copyist.py
py
1,641
python
en
code
8
github-code
7
[ { "api_name": "django.db.models.Model", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 6, "usage_type": "name" }, { "api_name": "django.db.models.ForeignKey", "line_number": 28, "usage_type": "call" }, { "api_name":...
26070446179
import bisect import codecs import collections as co import csv import io import itertools as it import math as m import os import shlex import shutil import time try: import inotify_simple except ModuleNotFoundError: inotify_simple = None COLORS = [ '1;34', # bold blue '1;31', # bold red '1;32',...
littlefs-project/littlefs
scripts/plot.py
plot.py
py
53,813
python
en
code
4,308
github-code
7
[ { "api_name": "math.log", "line_number": 87, "usage_type": "call" }, { "api_name": "math.log", "line_number": 106, "usage_type": "call" }, { "api_name": "codecs.escape_decode", "line_number": 120, "usage_type": "call" }, { "api_name": "os.fdopen", "line_number...
27765148869
from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import json from googlecloudsdk.command_lib.anthos.config.sync.common import exceptions from googlecloudsdk.command_lib.anthos.config.sync.common import utils from googlecloudsdk.core import log def ListRe...
twistedpair/google-cloud-sdk
google-cloud-sdk/lib/googlecloudsdk/command_lib/anthos/config/sync/resources/list.py
list.py
py
7,691
python
en
code
55
github-code
7
[ { "api_name": "googlecloudsdk.command_lib.anthos.config.sync.common.exceptions.ConfigSyncError", "line_number": 27, "usage_type": "call" }, { "api_name": "googlecloudsdk.command_lib.anthos.config.sync.common.exceptions", "line_number": 27, "usage_type": "name" }, { "api_name": "g...
30749975551
from utils import Input from itertools import product class Seat: def __init__(self, x, y): self.x = x self.y = y self.occupied = False self.next_state = None self.adjacents = [] def evaluate_next_state(self): self.next_state = None nb = [1 for _ in sel...
Swannbm/adventofcode
2020/puzzle_day_11.py
puzzle_day_11.py
py
2,760
python
en
code
0
github-code
7
[ { "api_name": "utils.Input", "line_number": 36, "usage_type": "name" }, { "api_name": "itertools.product", "line_number": 50, "usage_type": "call" } ]
32021767299
"""Atmospheric stability indices. This module's methods fetch or calculate predictors related to the stability of the atmosphere against air parcel convection. """ import logging import os import sys import re import pdb import copy import metpy.calc as calc from metpy.units import units import math import numpy as ...
NOAA-MDL/CAMPS
camps/libraries/mathlib/stability.py
stability.py
py
10,282
python
en
code
9
github-code
7
[ { "api_name": "core.Camps_data", "line_number": 53, "usage_type": "call" }, { "api_name": "metpy.units.units.Quantity", "line_number": 61, "usage_type": "call" }, { "api_name": "metpy.units.units", "line_number": 61, "usage_type": "name" }, { "api_name": "logging....
12045956419
from PIL import Image import requests image_url = 'https://i.scdn.co/image/ab67616d0000485109fd83d32aee93dceba78517' def rgb_to565(r, g, b): msb = ((r >> 3 & 0x1F) << 3) + (g >> 5 & 0x07) lsb = ((g >> 2 & 0x07) << 5) + (b >> 3 & 0x1F) return [msb, lsb] def get_image_bytes(url: str): image = Image.open...
rakib-shahid/rs4x4
miscellaneousCode/finalHID/test.py
test.py
py
701
python
en
code
0
github-code
7
[ { "api_name": "PIL.Image.open", "line_number": 11, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 11, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 11, "usage_type": "call" } ]
73653237984
# -*- coding: utf-8 -*- import smtplib from email.mime.text import MIMEText import os import sys import time _user = "lengyuenanfeng@163.com" _pwd = "huangzesang3018" _to = "1224106361@qq.com" if __name__ == '__main__': if len(sys.argv) < 2: print('Usage: python mail.py process_num [msg]')...
huangzsdy/my_code
python/mail.py
mail.py
py
1,057
python
en
code
0
github-code
7
[ { "api_name": "sys.argv", "line_number": 13, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 17, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 19, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number...
4011149598
import os import sentencepiece as spm import tensorflow as tf from tensorflow.data.experimental import AUTOTUNE from tensorflow.keras.losses import SparseCategoricalCrossentropy from tensorflow.keras.metrics import Mean, SparseCategoricalAccuracy from tensorflow.keras.optimizers import Adam from sklearn.model_selection...
Masao-Taketani/JPN-EN-Transformer-translator
train.py
train.py
py
8,422
python
en
code
0
github-code
7
[ { "api_name": "tensorflow.data.Dataset.from_tensor_slices", "line_number": 68, "usage_type": "call" }, { "api_name": "tensorflow.data", "line_number": 68, "usage_type": "attribute" }, { "api_name": "tensorflow.data.experimental.AUTOTUNE", "line_number": 72, "usage_type": ...
44448690211
# -*- coding: utf-8 -*- # Learn more: https://github.com/kennethreitz/setup.py from setuptools import setup, find_packages with open('README.md') as f: readme = f.read() with open('LICENSE') as f: license = f.read() setup( name='DS18B20', version='0.1.0', description='Module for interacting wi...
Wytamma/ds18b20
setup.py
setup.py
py
595
python
en
code
0
github-code
7
[ { "api_name": "setuptools.setup", "line_number": 14, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 23, "usage_type": "call" } ]
19950394839
from flask import render_template, Blueprint, jsonify from server.Kit import * pages = Blueprint('pages', __name__) @pages.route('/', methods=['GET']) @pages.route('/index.html', methods=['GET','POST']) def pre_ship(): try: return render_template('index.html') except: return jsonify(**{'message...
aakif-h/JobBoard
server/__init__.py
__init__.py
py
801
python
en
code
0
github-code
7
[ { "api_name": "flask.Blueprint", "line_number": 4, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.render_templa...
4780465476
import sys from PIL import Image # Check syntax if len(sys.argv) < 3: print("Usage: convert source dest") exit(1) # Pico Display size w = 240 h = 135 # Load image and convert to RGB img = Image.open(sys.argv[1]) conv = img.convert("RGB") # Get bounding box x1 = 0 x2 = img.width y1 = 0 y2 = img.height if (w...
petebeck1/picodisp
convert.py
convert.py
py
946
python
en
code
0
github-code
7
[ { "api_name": "sys.argv", "line_number": 5, "usage_type": "attribute" }, { "api_name": "PIL.Image.open", "line_number": 14, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 14, "usage_type": "name" }, { "api_name": "sys.argv", "line_number": 1...
26755360473
import re from enum import Enum from typing import Union from plotly.graph_objects import Figure class Axis(Enum): vertical = 0 horizontal = 1 def _plot_threshold(fig: Figure, threshold_op: str, threshold: Union[float, int], direction: Axis): '''Draw a dashed line on the target figu...
citadel-ai/langcheck
src/langcheck/plot/_utils.py
_utils.py
py
1,303
python
en
code
67
github-code
7
[ { "api_name": "enum.Enum", "line_number": 8, "usage_type": "name" }, { "api_name": "plotly.graph_objects.Figure", "line_number": 13, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 14, "usage_type": "name" } ]
74346920542
"""Support for command-line execution using `python -m termvisage`""" from __future__ import annotations import logging as _logging import multiprocessing import sys from threading import Event from term_image.utils import write_tty from .exit_codes import FAILURE, INTERRUPTED, codes def main() -> int: """CLI...
AnonymouX47/termvisage
src/termvisage/__main__.py
__main__.py
py
3,616
python
en
code
17
github-code
7
[ { "api_name": "argcomplete.autocomplete", "line_number": 21, "usage_type": "call" }, { "api_name": "parsers.parser", "line_number": 21, "usage_type": "argument" }, { "api_name": "logging.QUIET", "line_number": 27, "usage_type": "attribute" }, { "api_name": "tui.ma...
70996465503
import json import pickle from typing import Set def _check_consistency_of_data(json_entry): for sample in json_entry["samples"]: if sample["label_cite"] == "context-only": assert sample["label"] == "context-only", json_entry elif sample["label_cite"] == "non-check-worthy": ...
Data-Science-2Like/dataset-creation
citeworth/citeworth_dataset.py
citeworth_dataset.py
py
5,498
python
en
code
0
github-code
7
[ { "api_name": "typing.Set", "line_number": 59, "usage_type": "name" }, { "api_name": "json.loads", "line_number": 81, "usage_type": "call" } ]
16354295237
# # A simple python script to pull down a sounding text file from # U. Wyoming's website. # import sys import os import datetime if len(sys.argv) < 2: print ('usage: give a date argument as YYYY-MM-DD-HH where HH is 00 or 12') print (' Time is in UTC = Zulu = Z timezone') print (' an optional argument i...
BillSimpson/get-sounding
get-sounding.py
get-sounding.py
py
1,129
python
en
code
0
github-code
7
[ { "api_name": "sys.argv", "line_number": 9, "usage_type": "attribute" }, { "api_name": "datetime.datetime.strptime", "line_number": 17, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 17, "usage_type": "attribute" }, { "api_name": "sys.ar...
19462888890
from sqlalchemy import Column, DateTime, String, Integer, ForeignKey, func, Boolean from sqlalchemy.orm import relationship from . import Base class Song(Base): """ A Song with the following properties: """ __tablename__ = 'song' id = Column(Integer, primary_key=True) """int: primary key""" ...
jasonsbrooks/ARTIST
src/artist_generator/db/song.py
song.py
py
923
python
en
code
0
github-code
7
[ { "api_name": "sqlalchemy.Column", "line_number": 11, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer", "line_number": 11, "usage_type": "argument" }, { "api_name": "sqlalchemy.Column", "line_number": 14, "usage_type": "call" }, { "api_name": "sqlalchemy...
43128128857
from ammo.equilibrium import run_eq_md from argparse import ArgumentParser def __main__(): parser = ArgumentParser(description='Run equilibrium MD with BioSimSpace') parser.add_argument('--duration', type=float, required=True, help='MD simulation duration in ns') parser.add_argument('--topology', type=str...
michellab/AMMo
ammo/scripts/equilibrium_md.py
equilibrium_md.py
py
1,131
python
en
code
2
github-code
7
[ { "api_name": "argparse.ArgumentParser", "line_number": 6, "usage_type": "call" }, { "api_name": "ammo.equilibrium.run_eq_md", "line_number": 16, "usage_type": "call" } ]
72081093982
import pygame from pygame import mixer import random pygame.init() pygame.font.init() mixer.init() WIDTH = 640 HEIGHT = 480 SIZE = (WIDTH, HEIGHT) screen = pygame.display.set_mode(SIZE) clock = pygame.time.Clock() mixer.music.load("Snowball Park - Super Mario 3D World.mp3") mixer.music.set_volume(0....
Rishab432/christmas
christmas.py
christmas.py
py
11,980
python
en
code
0
github-code
7
[ { "api_name": "pygame.init", "line_number": 5, "usage_type": "call" }, { "api_name": "pygame.font.init", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.font", "line_number": 6, "usage_type": "attribute" }, { "api_name": "pygame.mixer.init", "l...
4034999078
import sys, pygame from Player import Player from Movement import Movement from Maze import Maze from StartMenu import StartMenu from LevelMenu import LevelMenu from WinScreen import WinScreen pygame.init() screenSize = width, height = 1280, 720 speed = 2, 2 black = pygame.Color(0, 0, 0) white = pygame.Color(255, 255...
AgusNeira/maze
main.py
main.py
py
1,913
python
en
code
0
github-code
7
[ { "api_name": "pygame.init", "line_number": 9, "usage_type": "call" }, { "api_name": "pygame.Color", "line_number": 13, "usage_type": "call" }, { "api_name": "pygame.Color", "line_number": 14, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "l...
30066621347
from django.shortcuts import render, HttpResponseRedirect, HttpResponse from django.urls import reverse from django.contrib.auth import authenticate, login, logout from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from App_Login.models import Follow, UserProfile from...
rahat-4/Instashohor
Instasohor/App_Login/views.py
views.py
py
3,875
python
en
code
0
github-code
7
[ { "api_name": "forms.SignupForm", "line_number": 13, "usage_type": "call" }, { "api_name": "forms.SignupForm", "line_number": 16, "usage_type": "call" }, { "api_name": "django.shortcuts.HttpResponseRedirect", "line_number": 20, "usage_type": "call" }, { "api_name"...
71660872862
# algorithms from .ioutil import splitedDict from .util import colored from dataclasses import dataclass, asdict import re import inspect from os import path from .paths import pth from . import myhash _debug = False _use_cache = True def split_paragraph(s): pattern = r"[\n \t\r]" spliter = re.findall(patte...
TkskKurumi/meow-memo
memo/algorithms.py
algorithms.py
py
7,478
python
en
code
0
github-code
7
[ { "api_name": "re.findall", "line_number": 18, "usage_type": "call" }, { "api_name": "re.split", "line_number": 19, "usage_type": "call" }, { "api_name": "inspect.getsource", "line_number": 66, "usage_type": "call" }, { "api_name": "os.path.join", "line_number...
26664027048
import sys import time import argparse import re import os import os.path from PyQt4.Qt import * from pybrain.tools.shortcuts import buildNetwork from pybrain.datasets import ClassificationDataSet from pybrain.structure.modules import SigmoidLayer from pybrain.supervised.trainers import BackpropTrainer from pybrain.uti...
alekseyivashin/character_recognition
brain.py
brain.py
py
5,487
python
en
code
0
github-code
7
[ { "api_name": "pybrain.supervised.trainers.BackpropTrainer", "line_number": 20, "usage_type": "name" }, { "api_name": "pybrain.tools.shortcuts.buildNetwork", "line_number": 26, "usage_type": "call" }, { "api_name": "pybrain.structure.modules.SigmoidLayer", "line_number": 26, ...
32601693543
# -*- encoding:utf-8 -*- __date__ = "18/9/18" __author__ = "jensen" import os import shutil from argparse import ArgumentParser def video_to_frames(video_path, frames_path, step_size = 20): if not os.path.exists(frames_path): os.makedirs(frames_path) else: shutil.rmtree(frames_path) ...
jxlin/happy
video/launch_video_detect.py
launch_video_detect.py
py
1,708
python
en
code
1
github-code
7
[ { "api_name": "os.path.exists", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 14, "usage_type": "call" }, { "api_name": "shutil.rmtree", "line_num...
70778525985
import os import numpy as np import matplotlib.pyplot as plt from matplotlib import figure from matplotlib.backend_tools import ToolBase plt.rcParams['toolbar'] = 'toolmanager' class ToolNext(ToolBase): description = 'View next data' image = 'forward' default_keymap = 'right' def trigger(self, *...
GKO95/Keras.QuickDraw
viewer.py
viewer.py
py
2,383
python
en
code
1
github-code
7
[ { "api_name": "matplotlib.pyplot.rcParams", "line_number": 8, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 8, "usage_type": "name" }, { "api_name": "matplotlib.backend_tools.ToolBase", "line_number": 10, "usage_type": "name" }, { ...
41073170669
from . import peripheral_server # from peripheral_server import PeripheralServer, peripheral_model from collections import deque, defaultdict from .interrupts import Interrupts import binascii import struct import logging import time log = logging.getLogger(__name__) # log.setLevel(logging.DEBUG) class UTTYInterface...
sandialabs/halucinator
src/halucinator/peripheral_models/utty.py
utty.py
py
6,183
python
en
code
25
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 19, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 20, "usage_type": "call" }, { "api_name": "interrupts.Inter...
71590146145
import os, re, sys, traceback try: from htmlentitydefs import name2codepoint as n2cp except: from html.entities import name2codepoint as n2cp if sys.version[0] == '2': is_py3 = False def py2_decode_utf8( text ): return text.decode('utf-8', 'ignore') def py2_encode_utf8( text ): return text.encode('utf-8',...
archivczsk/archivczsk-doplnky
tools_archivczsk/string_utils.py
string_utils.py
py
2,579
python
en
code
2
github-code
7
[ { "api_name": "sys.version", "line_number": 8, "usage_type": "attribute" }, { "api_name": "html.entities.name2codepoint.get", "line_number": 44, "usage_type": "call" }, { "api_name": "html.entities.name2codepoint", "line_number": 44, "usage_type": "name" }, { "api...
40344143001
from flask import render_template, flash, redirect, url_for, request from app import app, login, db from app.forms import (LoginForm, RegistrationForm, EditProfileForm, NewPostForm) from app.models import User, Post, PostComment from flask_login import current_user, login_user, logout_user, ...
myoui/webdev_gunicorn
app/routes.py
routes.py
py
8,268
python
en
code
0
github-code
7
[ { "api_name": "os.remove", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "app.app.config", "line_number...
18469009294
# -*- coding:utf-8 -*- from typing import List class Solution: def findSubsequences(self, nums: List[int]) -> List[List[int]]: nums_len = len(nums) used = [False for i in range(nums_len)] ans = [] from copy import deepcopy def dfs(idx, path): path_len = len(pat...
weizhixiaoyi/leetcode
everyday/491.递增子序列.py
491.递增子序列.py
py
1,113
python
en
code
0
github-code
7
[ { "api_name": "typing.List", "line_number": 6, "usage_type": "name" }, { "api_name": "copy.deepcopy", "line_number": 16, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 20, "usage_type": "call" }, { "api_name": "{'deepcopy': 'copy.deepcopy'}"...
2224319727
import sys from cx_Freeze import setup, Executable target_script = "GUI.py" # Create an instance of the Executable class executable = Executable( script=target_script, base="Win32GUI", # "Win32GUI" for a GUI application on Windows icon=None # Specify the path to icon file ) # Define additional options...
cmordi/IonTrapTeachingLab
setup.py
setup.py
py
633
python
en
code
0
github-code
7
[ { "api_name": "cx_Freeze.Executable", "line_number": 7, "usage_type": "call" }, { "api_name": "cx_Freeze.setup", "line_number": 21, "usage_type": "call" } ]
73928555103
import serial import time import sqlite3 # Sensor Keys # 1 = AM2320 humid; 2 = AM2320 temp; 3 = MQ4; 4 = MQ7; 5 = BMP180 pressure; # 6 = BMP180 temp; 7 = soil temp; 8 = soil moisture class Getnanoreadings: def __init__(self): self.ser = self.connect_to_nano() @staticmethod def connect_to_nano(): try: ser...
astrobenhart/Garden-Monitor
talk_to_nano.py
talk_to_nano.py
py
1,809
python
en
code
0
github-code
7
[ { "api_name": "serial.Serial", "line_number": 18, "usage_type": "call" }, { "api_name": "serial.Serial", "line_number": 21, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 22, "usage_type": "call" }, { "api_name": "time.sleep", "line_number"...
25648546523
#Queue implemention using Lists/Array import collections class Queue: def __init__(self): self.items=[] def enque(self,value): self.items.append(value) def deque(self): return self.items.pop(0) def Display(self): print(self.items) def isEmpty(se...
sivasai321/DataStructure-and-Algorithms
Stack and Queue/QueueImplementing_Array.py
QueueImplementing_Array.py
py
732
python
en
code
0
github-code
7
[ { "api_name": "collections.deque", "line_number": 32, "usage_type": "call" } ]
39555077326
#!/usr/bin/env python # -*- coding:utf-8 -*- """ 积分墙相关 数据 记录各个设备激活与否的相关信息: {'ts': 0, 'source': 'yijifen', # 广告平台来源 'callback': 'http://www.baidu.com', # 回调地址 'deviceid': '0C74C2E9F2D0' # 设备标识 'idfa': '99AD5E51-1164-47E4-BF0F-69646AE8F5B6',...
isoundy000/learn_python
learn_backend/views/ad_click.py
ad_click.py
py
2,765
python
en
code
0
github-code
7
[ { "api_name": "models.code.Adver.get", "line_number": 37, "usage_type": "call" }, { "api_name": "models.code.Adver", "line_number": 37, "usage_type": "name" }, { "api_name": "game_config.scorewall.get", "line_number": 40, "usage_type": "call" }, { "api_name": "gam...
36041762386
import cv2 import numpy as np orb = cv2.ORB_create() # detection frame1 = cv2.imread("Images/1.png") frame2 = cv2.imread("Images/2.png") pts1 = cv2.goodFeaturesToTrack(np.mean(frame1, axis=2).astype(np.uint8), 3000, qualityLevel=0.01, minDistance=7) pts2 = cv2.goodFeaturesToTrack(np.mean(frame2, axis=2).astype(np.uint...
TuckerBMorgan/Janus
python_zeroconf/featuretest.py
featuretest.py
py
672
python
en
code
0
github-code
7
[ { "api_name": "cv2.ORB_create", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.goodFeaturesToTrack", "line...
18477329322
from PIL import Image image_file = Image.open('pixil-frame-0.png','r') convert_RGB_IMAGE = image_file.convert('RGB') loaded_image = convert_RGB_IMAGE.load() text_copy = open('menu_copy.txt','a') def RGB_NUMBER(array_input): binary_array = [] for number in array_input: binary_array.append((bin(number)[2:...
IBNU1/EE2026-Final-Project-ZJ-jq
P_T.py
P_T.py
py
978
python
en
code
0
github-code
7
[ { "api_name": "PIL.Image.open", "line_number": 2, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 2, "usage_type": "name" } ]
71309381342
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
openstack/openstacksdk
openstack/cloud/_coe.py
_coe.py
py
10,887
python
en
code
245
github-code
7
[ { "api_name": "openstack.cloud._utils._filter_list", "line_number": 42, "usage_type": "call" }, { "api_name": "openstack.cloud._utils", "line_number": 42, "usage_type": "name" }, { "api_name": "openstack.cloud._utils._get_entity", "line_number": 66, "usage_type": "call" ...
28482025795
"""Generic functionality related to files and I/O""" import csv import email.parser import email.policy import hashlib import os import re import zipfile from dataclasses import dataclass, field from pathlib import Path from typing import Iterable, Optional, Pattern, Sequence @dataclass class ArchiveMapping: """A...
jwilges/drover
drover/io.py
io.py
py
5,064
python
en
code
4
github-code
7
[ { "api_name": "pathlib.Path", "line_number": 17, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 18, "usage_type": "name" }, { "api_name": "dataclasses.dataclass", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.Sequence", ...
34235970706
import json import plotly.graph_objects as go import datetime def validate(s,start,end): s=s.split("-") start=start.split("-") end=end.split("-") d1=datetime.datetime(int(s[0]), int(s[1]), int(s[2])) d2= datetime.datetime(int(start[0]), int(start[1]), int(start[2])) d3= datetime.dat...
Ravij22/Javascript
main.py
main.py
py
1,938
python
en
code
0
github-code
7
[ { "api_name": "datetime.datetime", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 11, "usage_type": "call" }, { "api_name": "plotly.graph_obj...
16314932526
import warnings from copy import deepcopy from typing import Any, List, Optional, Tuple, Union import cirq import numpy as np import numpy.typing as npt from cirq.value.linear_dict import _format_coefficient from mitiq import QPROGRAM from mitiq.interface import ( CircuitConversionError, UnsupportedCircuitErr...
unitaryfund/mitiq
mitiq/pec/types/types.py
types.py
py
10,638
python
en
code
300
github-code
7
[ { "api_name": "mitiq.QPROGRAM", "line_number": 25, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 26, "usage_type": "name" }, { "api_name": "numpy.typing.NDArray", "line_number": 26, "usage_type": "attribute" }, { "api_name": "numpy.typing...
19319831999
# From django from django.test import TestCase from django.test import Client # From drf from rest_framework.reverse import reverse # From DDF from ddf import G, N # From w from carts.models import Cart from products.models import Product class CartModelTest(TestCase): def test_new_cart_is_empty(self): ...
cap-diego/walen-api
carts/tests.py
tests.py
py
4,207
python
en
code
1
github-code
7
[ { "api_name": "django.test.TestCase", "line_number": 16, "usage_type": "name" }, { "api_name": "ddf.N", "line_number": 19, "usage_type": "call" }, { "api_name": "carts.models.Cart", "line_number": 19, "usage_type": "argument" }, { "api_name": "ddf.N", "line_nu...
71039919583
import enum from os import path, remove from ethereum.utils import denoms from golem.core.common import timeout_to_string from golem.core.variables import PICKLED_VERSION from golem.environments.environment import Environment from golem.task.taskstate import TaskState DEFAULT_TIMEOUT = 4 * 3600 DEFAULT_SUBTASK_TIME...
golemfactory/clay
apps/core/task/coretaskstate.py
coretaskstate.py
py
5,962
python
en
code
2,915
github-code
7
[ { "api_name": "enum.Enum", "line_number": 16, "usage_type": "attribute" }, { "api_name": "enum.auto", "line_number": 35, "usage_type": "call" }, { "api_name": "enum.auto", "line_number": 36, "usage_type": "call" }, { "api_name": "enum.auto", "line_number": 37,...
32545615061
from selenium import webdriver from selenium.webdriver.common.keys import Keys from writeToDisk import * driverLocation = r'/usr/local/bin/chromedriver' driver = webdriver.Chrome(driverLocation) driver.get("http://www.python.org") print(driver.title) assert "Python" in driver.title # Go to the search text field elem...
kz4/Weibo-Crawler
seleniumTest.py
seleniumTest.py
py
816
python
en
code
0
github-code
7
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 6, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 6, "usage_type": "name" }, { "api_name": "selenium.webdriver.common.keys.Keys.RETURN", "line_number": 19, "usage_type": "attribute" },...
32313277219
from flask import ( Blueprint, request ) from flaskr.db import get_db import json bp = Blueprint('products', __name__) @bp.route('/products', methods=('GET', 'POST')) def products(): if request.method == 'GET': prod_id = request.args.get('prod_id') if not prod_id: return {'status': 'error', 'messag...
modsoussi/sample_flask_app
flaskr/products.py
products.py
py
1,460
python
en
code
0
github-code
7
[ { "api_name": "flask.Blueprint", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 12, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 12, "usage_type": "name" }, { "api_name": "flask.request....
40420323805
import torch from transformers import AutoModelForSeq2SeqLM, AutoTokenizer, pipeline def summarize_text_with_hugging_face( text, model_name="facebook/bart-large-cnn", max_length=250, min_length=25 ): """ Summarize the given text using the specified model. Parameters: - text (str): The text to sum...
OlofHarrysson/iths-data-engineering-group-midjourney
src/newsfeed/hugging_face_model.py
hugging_face_model.py
py
934
python
en
code
0
github-code
7
[ { "api_name": "transformers.AutoTokenizer.from_pretrained", "line_number": 20, "usage_type": "call" }, { "api_name": "transformers.AutoTokenizer", "line_number": 20, "usage_type": "name" }, { "api_name": "transformers.pipeline", "line_number": 21, "usage_type": "call" }...
33089673084
import pygame as pg from random import randrange vec2 = pg.math.Vector2 snake1 = (227, 57, 25) snake2 = (26, 147, 187) snake3 = (122, 13, 89) snake4 = (31, 3, 106) green = (0, 255, 0) blue = (0, 0, 255) yellow = (255, 255, 0) black = (0, 0, 0) light_pink = (255, 182, 193) pink = (255, 105, 180) dark_pink = (255, 20, ...
fpolatynski/2v2snakeGame
game_objects.py
game_objects.py
py
7,615
python
en
code
0
github-code
7
[ { "api_name": "pygame.math", "line_number": 5, "usage_type": "attribute" }, { "api_name": "pygame.rect.Rect", "line_number": 29, "usage_type": "call" }, { "api_name": "pygame.rect", "line_number": 29, "usage_type": "attribute" }, { "api_name": "pygame.KEYDOWN", ...
9818023097
"""Configure for ASCAR DRL Evaluation Copyright (c) 2016, 2017 The Regents of the University of California. All rights reserved. Created by Yan Li <yanli@tuneup.ai>, Kenneth Chang <kchang44@ucsc.edu>, Oceane Bel <obel@ucsc.edu>. Storage Systems Research Center, Baskin School of Engineering. Redistribution a...
Tompkins-liu/rl-lustre
conf.py
conf.py
py
11,088
python
en
code
0
github-code
7
[ { "api_name": "os.path.join", "line_number": 87, "usage_type": "call" }, { "api_name": "os.path", "line_number": 87, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 96, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9...
19232089575
# coding=utf-8 from unidecode import unidecode from engine.models.record import * from engine.modules.data_cleansing.data_cleansing_module import DataCleansingModule from engine.modules.module import Module import dateparser class DateFormatting(DataCleansingModule): """ Formatea como date los valores qu...
sevetseh28/data-integration-extensible-framework
api/engine/modules/data_cleansing/date_formatting/module.py
module.py
py
1,377
python
en
code
1
github-code
7
[ { "api_name": "engine.modules.data_cleansing.data_cleansing_module.DataCleansingModule", "line_number": 10, "usage_type": "name" }, { "api_name": "dateparser.parse", "line_number": 31, "usage_type": "call" } ]
27675983435
from django.conf.urls import url from django.contrib.auth.decorators import login_required, permission_required from . import views, users_pdf from django.conf import settings from django.conf.urls.static import static urlpatterns = [ url(r'^$', permission_required('userprofile.view_user', login_url...
glosoftgroup/glosoftgroup-django-pos
saleor/dashboard/users/urls.py
urls.py
py
2,243
python
en
code
1
github-code
7
[ { "api_name": "django.conf.urls.url", "line_number": 10, "usage_type": "call" }, { "api_name": "django.contrib.auth.decorators.permission_required", "line_number": 10, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 12, "usage_type": "call" ...
39028897100
import math import os import sys import itertools import torch import torch.nn.functional as F import torch.optim as optim from envs import create_atari_env from model import ActorCritic from torch.autograd import Variable from torchvision import datasets, transforms def ensure_shared_grads(model, shared_model): ...
404akhan/kostya-a3c
train.py
train.py
py
4,538
python
en
code
0
github-code
7
[ { "api_name": "model.parameters", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.manual_seed", "line_number": 31, "usage_type": "call" }, { "api_name": "envs.create_atari_env", "line_number": 33, "usage_type": "call" }, { "api_name": "model.ActorC...
4443854931
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distrib...
V-Sekai/vsekai-blender-game-tools
addons/blenderkit/search.py
search.py
py
44,467
python
en
code
7
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 60, "usage_type": "call" }, { "api_name": "bpy.data", "line_number": 99, "usage_type": "attribute" }, { "api_name": "bpy.data", "line_number": 102, "usage_type": "attribute" }, { "api_name": "bpy.data", "line_n...
72863076062
import torch if torch.__version__ >= '1.8': import torch_npu import torch.nn.functional as F # from SSD import _C as C import numpy as np import itertools from math import sqrt def calc_iou_tensor(box1, box2): """ Calculation of IoU based on two boxes tensor, Reference to https://github.com/...
Ascend/ModelZoo-PyTorch
PyTorch/contrib/cv/detection/SSD-Resnet/box_coder.py
box_coder.py
py
16,390
python
en
code
31
github-code
7
[ { "api_name": "torch.__version__", "line_number": 2, "usage_type": "attribute" }, { "api_name": "torch.max", "line_number": 29, "usage_type": "call" }, { "api_name": "torch.min", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.array", "line_num...
74763006941
''' Python 3.0 PyLucene 8.11.0 Create Required PyLucene Index Retrieve Top-K Relevant Document for String Query ''' # Importing Necessary Libraries import os import nltk import math from collections import defaultdict import lucene from java.io import File from org.apache.lucene.document import Document, Field, FieldT...
iSiddharth20/Information-Retrieval
Vector-Space-Model-PyLucene/PyLucene_VectorSpaceModel.py
PyLucene_VectorSpaceModel.py
py
8,328
python
en
code
4
github-code
7
[ { "api_name": "nltk.RegexpTokenizer", "line_number": 29, "usage_type": "call" }, { "api_name": "lucene.initVM", "line_number": 32, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 51, "usage_type": "call" }, { "api_name": "org.apache...
19496395469
import matplotlib.pyplot as plt import numpy as np from matplotlib.font_manager import FontProperties # 字体管理器 import matplotlib.patheffects as pe import matplotlib.cm as cm import math from numpy.core.fromnumeric import size class DrawTransCDF(): def get_tag(self, num): if self.item_type == 'NULL': # 留空...
OneBST/GGanalysislib
GGanalysislib/DrawImage.py
DrawImage.py
py
11,052
python
en
code
59
github-code
7
[ { "api_name": "numpy.shape", "line_number": 35, "usage_type": "call" }, { "api_name": "math.log", "line_number": 38, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 42, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", ...
24932621997
#!/usr/bin/env python # coding: utf-8 # In[1]: print("printing") # In[2]: run_node_level_XenonPy = False # In[ ]: # In[3]: print("Starting Experiments!") import numpy as np import torch import torch.nn.functional as F import torch.nn as nn import torch.distributed as dist import torch_geometric import...
alexander-moore/MolecularRepresentation
eric_files/GCL_with_XenonPy.py
GCL_with_XenonPy.py
py
33,202
python
en
code
0
github-code
7
[ { "api_name": "torch.cuda", "line_number": 71, "usage_type": "attribute" }, { "api_name": "timeit.default_timer", "line_number": 78, "usage_type": "call" }, { "api_name": "GCL.augmentors.NodeDropping", "line_number": 197, "usage_type": "call" }, { "api_name": "GCL...
24931532401
import time import logging from autoPyTorch.pipeline.base.pipeline_node import PipelineNode class FitAutoNet(PipelineNode): def fit(self, autonet, data_manager, **kwargs): start_time = time.time() logging.getLogger('benchmark').debug("Fit autonet") config, score = autonet.fit( ...
guanlongtianzi/Auto-PyTorch
autoPyTorch/utils/benchmarking/benchmark_pipeline/fit_autonet.py
fit_autonet.py
py
599
python
en
code
null
github-code
7
[ { "api_name": "autoPyTorch.pipeline.base.pipeline_node.PipelineNode", "line_number": 5, "usage_type": "name" }, { "api_name": "time.time", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "ap...
648036365
from copy import deepcopy import numpy as np import math import itertools class Board: def __init__(self, board_h, board_w, initial_board, initial_pos): self.humansPos = {} # dict of tuple (x, y : nb) indicating positions on board as key and number of units as value self.vampiresPos = {} # list of...
AlexDuvalinho/AI_Vampire_vs_Werewolves
boards/board_split_smart.py
board_split_smart.py
py
30,941
python
en
code
0
github-code
7
[ { "api_name": "numpy.add", "line_number": 50, "usage_type": "call" }, { "api_name": "numpy.sign", "line_number": 50, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 50, "usage_type": "call" }, { "api_name": "numpy.add", "line_number": 51, ...
394651817
import os import numpy as np import torch from torch.optim import Adam import gym import time import core from spinup.utils.logx import EpochLogger from spinup.utils.mpi_pytorch import setup_pytorch_for_mpi, sync_params, mpi_avg_grads from spinup.utils.mpi_tools import mpi_fork, mpi_avg, proc_id, mpi_statistics_scalar,...
qhFang/AccurateACL
tools/ppo.py
ppo.py
py
14,149
python
en
code
27
github-code
7
[ { "api_name": "sys.path.append", "line_number": 13, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_num...
74831438943
# Constructing Simple Plots using matplotlib ## Numerical Data # Line Chart import matplotlib.pyplot as plt x_days = [1,2,3,4,5] y_stock1 = [10,11,10.5,13,14] y_stock2 = [11,13,12.5,13,15] plt.title('Stock Prices') plt.xlabel("Days") plt.ylabel("Prices") plt.plot(x_days,y_stock1,label='Stock 1') ...
HrithikRai/Matplotlib-Bible
DataVisualization_matplotlib.py
DataVisualization_matplotlib.py
py
2,557
python
en
code
0
github-code
7
[ { "api_name": "matplotlib.pyplot.title", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 13, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.xlabel", "line_number": 14, "usage_type": "call" }, { "api_name": "ma...
43019904927
# -*- coding: utf-8 -*- import pygame import base64 class ScoreBoard(): """ Show the infomation of scores """ def __init__(self, file_name): """ Init the options """ self._file_name = file_name self._stats = [] self._hiscore_string = ["" for i in range(6)] self.read_his...
shallwe999/Explore-Reactor-Room
scoreboard.py
scoreboard.py
py
3,614
python
en
code
3
github-code
7
[ { "api_name": "base64.b64decode", "line_number": 30, "usage_type": "call" }, { "api_name": "base64.b64encode", "line_number": 54, "usage_type": "call" } ]
20539276335
from flask import Flask, render_template, request,jsonify,redirect,session from flask_uploads import UploadSet, configure_uploads, ALL import warnings from save_result import get_result from flaskext.mysql import MySQL from glob import glob import os import json warnings.filterwarnings('ignore') app = Flask(__name__) f...
simengxin/lungapp
Main.py
Main.py
py
5,216
python
en
code
0
github-code
7
[ { "api_name": "warnings.filterwarnings", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 10, "usage_type": "call" }, { "api_name": "flask_uploads.UploadSet", "line_number": 11, "usage_type": "call" }, { "api_name": "flask_uplo...
73565313824
import os import re import time from functools import partial from collections import OrderedDict from PyQt5.QtWidgets import QWidgetItem, QMainWindow, QTextEdit, QAction, QToolBar, QPushButton, QHBoxLayout, \ QVBoxLayout, QLabel, QGridLayout, QWidget, QLayout, QLineEdit, QSplitter, QComboBox, QTreeView, QToolTip,...
alexbashkatov6/trial_Project
main_window.py
main_window.py
py
31,930
python
en
code
0
github-code
7
[ { "api_name": "PyQt5.QtWidgets.QToolBar", "line_number": 27, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.pyqtSignal", "line_number": 28, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 37, "usage_type": "call" }, { "api_name": "os.walk", ...
1823388828
# coding=utf-8 import hashlib import time from pyquery import PyQuery as pq import requests import json from flask import request, Response s = requests.session() def resume_liepin(db, name, password, customerId, accessToken, tpyeFlag): url = 'http://www.liepin.com/webUser/login4c.json' m = hashlib.md5() ...
shiyan123/importResume
modules/res_html/liepin.py
liepin.py
py
10,087
python
en
code
7
github-code
7
[ { "api_name": "requests.session", "line_number": 10, "usage_type": "call" }, { "api_name": "hashlib.md5", "line_number": 15, "usage_type": "call" }, { "api_name": "pyquery.PyQuery", "line_number": 27, "usage_type": "call" }, { "api_name": "pyquery.PyQuery", "l...
28272708919
import torch.backends.cudnn as cudnn import torch.distributed as dist import torch.multiprocessing as mp import torch.utils import torch.utils.data.distributed import torchvision.models as models from nvidia import dali from torch.nn.parallel import DistributedDataParallel from torchvision import datasets from imagene...
jorisquist/Understanding-WM-HP-in-BNNs
imagenet/step1/train.py
train.py
py
14,269
python
en
code
2
github-code
7
[ { "api_name": "torch.backends.cudnn.cuda.device_count", "line_number": 51, "usage_type": "call" }, { "api_name": "torch.backends.cudnn.cuda", "line_number": 51, "usage_type": "attribute" }, { "api_name": "torch.backends.cudnn", "line_number": 51, "usage_type": "name" },...
6976605543
from dataclasses import dataclass @dataclass class SelectOption: name: str id: str is_disabled: bool def process_data(options: tuple[str | tuple[str, str], ...]) -> list[SelectOption]: """ Processes the given `options` and returns the processed list :param options: A list of options to proc...
TheItsProjects/ItsPrompt
ItsPrompt/data/select.py
select.py
py
1,008
python
en
code
24
github-code
7
[ { "api_name": "dataclasses.dataclass", "line_number": 4, "usage_type": "name" } ]
39032644358
from fastapi import APIRouter, HTTPException, status from pydantic import BaseModel class Trees (BaseModel): idtree: int name: str high: float trees_list = [ Trees(idtree=1, name="Evano", high=3.45), Trees(idtree=2, name="Roble", high=5.6), Trees(idtree=3, name="Arbusto", high=2.0), Trees(...
AbdielPerezB/Routers
allRouters/router5.py
router5.py
py
804
python
en
code
0
github-code
7
[ { "api_name": "pydantic.BaseModel", "line_number": 4, "usage_type": "name" }, { "api_name": "fastapi.APIRouter", "line_number": 17, "usage_type": "call" }, { "api_name": "fastapi.status.HTTP_200_OK", "line_number": 19, "usage_type": "attribute" }, { "api_name": "f...
26315072027
import copy import torch class ObservationQueue(list): """ FIFO queue for storing observations. The queue is limited to a maximum length. """ def __init__(self, maxlen=3): super().__init__() self.maxlen = maxlen def append(self, observation): if torch.cuda.is_available()...
jwspaeth/ME-8843-Project
me_8843_project/core/ObservationQueue.py
ObservationQueue.py
py
478
python
en
code
0
github-code
7
[ { "api_name": "torch.cuda.is_available", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 16, "usage_type": "attribute" }, { "api_name": "copy.deepcopy", "line_number": 18, "usage_type": "call" } ]
34223865710
from sys import argv from textdistance import damerau_levenshtein import difflib import ast def create_pill(node, depth = 0): 'recursively creates a pill that contains every node first letter and `depth` of a node' resulting_pill = '' resulting_pill += type(node).__name__[0] + str(depth) + '.'*len(node._fi...
ipsavitsky/pythonprac
20220314/2/antip.py
antip.py
py
1,152
python
en
code
1
github-code
7
[ { "api_name": "ast.iter_child_nodes", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 16, "usage_type": "name" }, { "api_name": "sys.argv", "line_number": 17, "usage_type": "name" }, { "api_name": "ast.parse", "line_number":...
5289997208
import pyspark from operator import add sc = pyspark.SparkContext() def is_good_line(line): try: fields = line.split(',') if len(fields) == 7: # transactions str(fields[2]) # to_addr if int(fields[3]) == 0: return False elif len(fields) == 5: # contr...
expert02/Ethereum-Analysis
Ethereum Analysis/partD/comparison Analysis/sparkB.py
sparkB.py
py
1,087
python
en
code
0
github-code
7
[ { "api_name": "pyspark.SparkContext", "line_number": 4, "usage_type": "call" }, { "api_name": "operator.add", "line_number": 26, "usage_type": "argument" } ]
70079591582
# # Logging class for PyBaMM # Includes additional logging levels inspired by verboselogs # https://pypi.org/project/verboselogs/#overview-of-logging-levels # # Implementation from stackoverflow # https://stackoverflow.com/questions/2183233/how-to-add-a-custom-loglevel-to-pythons-logging-facility # import logging def...
emptylkj/PyBaMM
pybamm/logger.py
logger.py
py
1,725
python
en
code
0
github-code
7
[ { "api_name": "logging.basicConfig", "line_number": 20, "usage_type": "call" }, { "api_name": "logging.Formatter", "line_number": 21, "usage_type": "call" }, { "api_name": "logging.addLevelName", "line_number": 25, "usage_type": "call" }, { "api_name": "logging.ad...
19840860733
# azureml-core of version 1.0.72 or higher is required # azureml-dataprep[pandas] of version 1.1.34 or higher is required from azureml.core import Workspace, Dataset import pandas as pd import numpy as np import keras from sklearn.model_selection import train_test_split from azureml.core.model import Model # df = pd.r...
nvhoanganh/tennis-schiit
machine-learning/train-keras.py
train-keras.py
py
2,338
python
en
code
1
github-code
7
[ { "api_name": "pandas.read_csv", "line_number": 11, "usage_type": "call" }, { "api_name": "keras.models.Sequential", "line_number": 17, "usage_type": "call" }, { "api_name": "keras.models", "line_number": 17, "usage_type": "attribute" }, { "api_name": "keras.layer...
19225098359
import datetime from django.shortcuts import render from django.conf import settings from django.http import HttpResponse import requests import redis from .models import WeiboAccount # Create your views here. def weibo_login(request): app_key = settings.WEIBO_APP_KEY redirect_uri = settings.WEIBO_REDIRECT_...
NullOnSpace/wb2020
weibo/auth/views.py
views.py
py
2,612
python
en
code
0
github-code
7
[ { "api_name": "django.conf.settings.WEIBO_APP_KEY", "line_number": 14, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 14, "usage_type": "name" }, { "api_name": "django.conf.settings.WEIBO_REDIRECT_URI", "line_number": 15, "usage_type": "...
42000889888
import pyspark.sql.functions as f from shared import extract_data, load_data from pyspark.sql.window import Window def analyse_data(raw_primary_person_use_df, raw_units_use_df): """ This Function contain the main logic for the analysis :param raw_primary_person_use_df: Source Primary_person_use Dataframe...
praveenkmr/AccidentAnalysis
jobs/job04.py
job04.py
py
1,411
python
en
code
0
github-code
7
[ { "api_name": "pyspark.sql.window.Window", "line_number": 15, "usage_type": "call" }, { "api_name": "pyspark.sql.functions.lit", "line_number": 15, "usage_type": "call" }, { "api_name": "pyspark.sql.functions", "line_number": 15, "usage_type": "name" }, { "api_nam...
39479558270
# coding: utf-8 import urllib.request import json import ssl import constant context = ssl.SSLContext(ssl.PROTOCOL_TLSv1) class YoutubeAPI(): def get_video_info(self, channel_id, page_token=None, published_after=None): url = 'https://www.googleapis.com/youtube/v3/search' params = { 'ke...
shun1218/vtuber-calendar
youtube_api.py
youtube_api.py
py
1,345
python
en
code
1
github-code
7
[ { "api_name": "ssl.SSLContext", "line_number": 7, "usage_type": "call" }, { "api_name": "ssl.PROTOCOL_TLSv1", "line_number": 7, "usage_type": "attribute" }, { "api_name": "constant.YOUTUBE_API_KEY", "line_number": 13, "usage_type": "attribute" }, { "api_name": "ur...
4485393903
# --- # jupyter: # jupytext: # text_representation: # extension: .py # format_name: light # format_version: '1.5' # jupytext_version: 1.6.0 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # + import cv2 import matplotlib.pyplot as plt import n...
etarho/kxnet
blender/Codes/overlay.py
overlay.py
py
2,735
python
en
code
0
github-code
7
[ { "api_name": "os.path.exists", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path", "line_number": 29, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_number": 33, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_numb...