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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
24714380863 | import logging
import sys
def setup_logger():
""" Setup logger to print out program information for server and client.
:returns: <Logger> The logger object with setups.
"""
#create logger object
logger = logging.getLogger()
#set logging level
logger.setLevel(logging.INFO)
#set l... | YingLuo111/CPSC471_2020fall_Project | src/util.py | util.py | py | 700 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "logging.StreamHandler",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sys.stdout"... |
13415619595 | import os
from pathlib import Path
from vigorish.config.project_paths import CONFIG_FILE, DOTENV_FILE, SQLITE_PROD_URL
from vigorish.constants import ENV_VAR_NAMES
from vigorish.util.result import Result
class DotEnvFile:
def __init__(self, dotenv_filepath=None):
self.dotenv_filepath = dotenv_filepath
... | a-luna/vigorish | src/vigorish/config/dotenv_file.py | dotenv_file.py | py | 2,747 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "pathlib.Path",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "vigorish.config.project_paths.DOTENV_FILE",
"line_number": 13,
"usage_type": "argument"
},
{
"api_nam... |
4627478363 | import argparse
import os
from chainer import links as L
from chainer import optimizers
import numpy as np
import chainerrl
from chainerrl.action_value import DiscreteActionValue
from chainerrl import agents
from chainerrl import experiments
from chainerrl import explorers
from chainerrl import links
from chainerrl i... | chainer/chainerrl | examples/atari/reproduction/dqn/train_dqn.py | train_dqn.py | py | 6,801 | python | en | code | 1,134 | github-code | 21 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "chainerrl.misc.set_random_seed",
"line_number": 59,
"usage_type": "call"
},
{
"api_na... |
12750998512 | from rest_framework import serializers
from generic_relations.relations import GenericRelatedField
from core.utils import count_field
from picturic.serializer_fields import PictureField
from community.models import CommunityChat, GroupCommunity
from user.serializers import UserInfoSerializer
import community.serialize... | ThePokerFaCcCe/messenger | community/serializers/community_serializers.py | community_serializers.py | py | 2,165 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "community.models",
"line_number": 12,
"usage_type": "name"
}... |
15164781333 | import requests as req
import json
from telegram.ext import CallbackContext
from artes import gerar_imagem_postagem
from util import FACEBOOK_ACCESS_TOKEN, INSTAGRAM_ACCESS_TOKEN, INSTAGRAM_USER_ID, FACEBOOK_USER_ID, GRAPH_URL
def criar_container_instagram(image_scr, carosel, texto, url, log):
try:
payl... | JonasCardoso/Bandeco-Unicamp | src/meta_servico.py | meta_servico.py | py | 5,173 | python | pt | code | 0 | github-code | 21 | [
{
"api_name": "util.INSTAGRAM_ACCESS_TOKEN",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "requests.post",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "util.GRAPH_URL",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "util.INSTAGR... |
18940785350 | # Library Imports #############################################################
import streamlit as st
import os
import pandas as pd
from langchain.llms.openai import OpenAI
import pandasai
from pandasai import SmartDataframe
from langchain_experimental.agents.agent_toolkits import create_pandas_dataframe_agent
# So... | suvofalcon/Generative-AI | ZEN-MASTER/pages/3_Data_Analysis.py | 3_Data_Analysis.py | py | 3,388 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.getenv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "langchain.llms.openai.OpenAI",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "langchain_expe... |
2794310617 | from common.tools import *
from common.coordinator_service import *
from collections import defaultdict, Counter
import time
''' This is used for communication between the different services,
i.e. if order service needs to communicate with payment service.'''
DEBUG = True
serviceID = sys.argv[2]
app = Flask(f"c... | tomasherq/wdm-project | coordinator/inter_com.py | inter_com.py | py | 4,787 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.defaultdict",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 104,
"usage_type": "call"
},
{
"api_name": "time.time",
... |
43636376080 | # This code script is for bm25 negative training file construction for node class retrieval.
import os
import json
import random
from tqdm import tqdm
from copy import deepcopy
from collections import defaultdict
from IPython import embed
from argparse import ArgumentParser
import numpy as np
# seed
random.seed(0)
p... | PeterGriffinJin/Patton | src/scripts/bm25_neg.py | bm25_neg.py | py | 5,348 | python | en | code | 14 | github-code | 21 | [
{
"api_name": "random.seed",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_... |
74991282931 | from gi.repository import Gtk, Pango
from quodlibet import app
from quodlibet import print_d, util, qltk, _
from quodlibet.plugins import PluginConfigMixin
from quodlibet.plugins.songshelpers import any_song, is_finite
from quodlibet.plugins.songsmenu import SongsMenuPlugin
from quodlibet.qltk.ccb import ConfigCheckBu... | quodlibet/quodlibet | quodlibet/ext/songsmenu/duplicates.py | duplicates.py | py | 16,126 | python | en | code | 1,306 | github-code | 21 | [
{
"api_name": "quodlibet.qltk.views.RCMHintedTreeView",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "quodlibet.qltk.songsmenu.SongsMenu",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "quodlibet.print_d",
"line_number": 68,
"usage_type": "call"
}... |
13015143065 | import time
from statistics import mean
from AWSIoTPythonSDK.MQTTLib import AWSIoTMQTTClient
import smbus
import RPi.GPIO as GPIO
import hc_sr04
import bme280
DEVICE = 0x76 # 0x77 was default device I2C address
TOPIC = "flooding-kit/ponte-vecchio-kit"
READS_PER_CYCLE = 10
LOWEST_READS_TO_DISCARD = 3
HIGHEST_READS_T... | candoz/city-flooding-kit | flooding-kit/get_all_sensors_values.py | get_all_sensors_values.py | py | 3,533 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "AWSIoTPythonSDK.MQTTLib.AWSIoTMQTTClient",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "smbus.SMBus",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "RPi.GPIO.setmode",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": ... |
13495781416 | #!/usr/bin/env python3
import hashlib
import os
import sys
import time
import traceback
from collections import defaultdict
from jinja2 import Environment, FileSystemLoader
from watchdog.events import FileModifiedEvent, DirModifiedEvent
from watchdog.observers import Observer
from models import *
from records import... | just2guys2/just2guys | gen.py | gen.py | py | 6,347 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.defaultdict",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "hashlib.md5",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "os.path.j... |
3080846550 |
#保存图片、音乐、视频文件用二进制格式wb
#单首音乐下载
# import requests
# url='http://music.163.com/song/media/outer/url?id=1369798757'
# headers={'user-agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0'}
# response=requests.get(url,headers=headers)
# data=response.content
# with open('芒种.mp3','wb')as f:
... | steadyrays/usermaster | python/python_base/网易云音乐下载.py | 网易云音乐下载.py | py | 1,302 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "lxml.etree.HTML",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"line_number": 20,
"usage_type": "name"
}
] |
23954606410 | from docutils import nodes
from sphinx.writers.latex import LaTeXTranslator
def visit_collected_footnote(self, node):
# type: (nodes.Node) -> None
self.in_footnote += 1
if 'footnotetext' in node:
self.body.append('\\footnotetext{')
else:
if self.in_parsed_literal:
self.body.... | future-architect/typescript-guide | ext/orgfootnote.py | orgfootnote.py | py | 865 | python | en | code | 469 | github-code | 21 | [
{
"api_name": "sphinx.writers.latex.LaTeXTranslator.visit_collected_footnote",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "sphinx.writers.latex.LaTeXTranslator",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "sphinx.writers.latex.LaTeXTranslator.depa... |
33202447122 | # from django.contrib import admin
# from django.urls import path
from django.conf.urls import url
# from django.conf.urls import include
from inventory import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'test', views.test, name='test'),
url(r'server/add', views.ServerAdd, name='Serve... | imajaydwivedi/SQLDBAToolsInventory | ____inventory/urls.py | urls.py | py | 330 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "inventory.views.index",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "inventory.views",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.c... |
16894760598 | from PIL import ImageFont, Image, ImageDraw
import os
im = Image.new('RGBA', (200, 200), 'white') #tyep: Image.Image
draw = ImageDraw.Draw(im) # type: ImageDraw
draw.text((20, 150), 'Hello', fill='purple')
fonts_folder = 'FONT_FOLDER'
arial_font = ImageFont.truetype(os.path.join(fonts_folder, 'KhmerOS.ttf'), 32)
draw... | aa962135230/automate_stuff_with_python | ch17/17.4.2.py | 17.4.2.py | py | 396 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "PIL.Image.new",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "PIL.ImageDraw.Draw",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "PIL.ImageDraw",
"line_num... |
20898801475 | """
This is the main module of pdbparser package.
It contains the pdbparser class definition as well as pdbTrajectory.
.. inheritance-diagram:: pdbparser.pdbparser
:parts: 2
"""
# This package is a personal effort and only developed according to my personal scientific needs.
# Any contribution and/or suggestion is... | bachiraoun/pdbparser | pdbparser.py | pdbparser.py | py | 149,604 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "sys.version",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "sys.maxsize",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "sys.maxint",
"line_number": 54,
"usage_type": "attribute"
},
{
"api_name": "Globals.PREFERENCES... |
38493671747 | from copy import deepcopy
from dataclasses import dataclass
from enum import Enum
import common.input_data as input_data
class InstructionType(Enum):
ACC = "acc"
JMP = "jmp"
NOOP = "nop"
@dataclass
class Instruction:
instruction_type: InstructionType
value: int
def to_instruction(data: str) -> In... | pviafore/AdventOfCode2020 | challenge8.py | challenge8.py | py | 2,817 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "enum.Enum",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "copy.deepcopy",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "common.input_data.read",... |
4951548045 | import argparse
from collections import Counter
import pickle
import numpy as np
from p_tqdm import p_map
from pymatgen.io.ase import AseAtomsAdaptor
from pymatgen.core.structure import Structure
from pymatgen.core.lattice import Lattice
from m3gnet.models import M3GNetCalculator
from m3gnet.models import Potential
fr... | merri5/score_based_crystal_generation | scripts/compute_energy_gen_validonly_run_pickle.py | compute_energy_gen_validonly_run_pickle.py | py | 7,005 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.Counter",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.gcd.reduce",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.gcd",
"lin... |
14091524963 | #!/usr/bin/env python3
from marpdan.layers._mha import _MHA_V1, _MHA_V2
import torch
import torch.nn as nn
import torch.nn.functional as F
if __name__ == "__main__":
import time
from itertools import chain
mha = _MHA_V1(8,4,128)
mha_v2 = _MHA_V2(8,4,128)
mha_v2.load_state_dict(mha.state_dict())
... | RuifanLiu/Deep-auction | routing_model/test/test_mha.py | test_mha.py | py | 1,842 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "marpdan.layers._mha._MHA_V1",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "marpdan.layers._mha._MHA_V2",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.nn.Linear",
"line_number": 16,
"usage_type": "call"
},
{
"api_name"... |
43381226982 | #https://blog.csdn.net/jining11/article/details/89644051
import torch
import numpy as np
import torch.nn as nn
import torch.optim as optim
import torchvision
import torchvision.transforms as transforms
import matplotlib.pyplot as plt
from tqdm import tqdm
from torchvision.utils import save_image
def initialize_weights... | imistyrain/mnist | gan/train_wgan.py | train_wgan.py | py | 9,950 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torch.nn.Conv2d",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "torch.nn.ConvTranspose2d",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "torch.nn"... |
204873483 | from transformers import AutoModelForCausalLM, AutoTokenizer, GPTQConfig
## Examples of model_id
#model_id = 'beomi/kollama-7b'
model_id = 'EleutherAI/polyglot-ko-1.3b'
save_id = 'polyglot-ko-1.3b_gptq'
tokenizer = AutoTokenizer.from_pretrained(model_id)
quantization_config = GPTQConfig(bits=4, dataset = "c4", tokeniz... | LearnItAnyway/corpus_ko_AI_competition_2023 | gptq_convert.py | gptq_convert.py | py | 516 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "transformers.AutoTokenizer.from_pretrained",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "transformers.AutoTokenizer",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "transformers.GPTQConfig",
"line_number": 8,
"usage_type": "call"
},... |
33859242902 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from . import ArgumentError
from . import Constants
from . import Defaults
from . import MgmntUtils
from . import Service, ServiceError
from . import SizeString
from . im... | qqshow/vdo | vdo-manager/vdomgmnt/VDOService.py | VDOService.py | py | 93,354 | python | en | code | null | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 124,
"usage_type": "call"
},
{
"api_name": "vdo.utils.runCommand",
"line_number": 261,
"usage_type": "call"
},
{
"api_name": "vdo.utils.Transaction.transaction",
"line_number": 293,
"usage_type": "call"
},
{
"api_n... |
38241586379 | from flask import Flask, render_template, url_for
from flask import request, redirect, flash, make_response, jsonify
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from Data_Setup import Base, TabletCompanyName, TabletName, User
from flask import session as login_session
import random
impo... | Karimulla0305/catalog | catalog/project.py | project.py | py | 17,014 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "Data_Setup.Base.metadata.create_all",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "Data_Setup.Base.metadata",
"line_number": 18,
"usage_type": "attribute"
},... |
31899836144 | import zmq.auth
from zmq.auth.thread import ThreadAuthenticator
from contextlib import contextmanager
import os
import logging
import sys
@contextmanager
def secure_server_creator():
# These directories are generated by the generate_certificates script
base_dir = os.path.dirname(__file__)
public_keys_dir =... | redsofa/zmq-soundtouch | src/python/helpers.py | helpers.py | py | 3,404 | python | en | code | 3 | github-code | 21 | [
{
"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"... |
72452324214 | from json import dumps
from gendiff.formatters.utils import get_key_info, get_children
from gendiff.CONSTANTS import TAB_STEP
def stylish_format(diff: list) -> str:
return '{\n' + dive(diff, 0) + '\n}'
def dive(items: list, depth: int) -> str:
result = []
for item in items:
name, type_, value = ... | Myakot/python-project-50 | gendiff/formatters/stylish.py | stylish.py | py | 1,842 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "gendiff.formatters.utils.get_key_info",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "gendiff.formatters.utils.get_children",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "gendiff.CONSTANTS.TAB_STEP",
"line_number": 35,
"usage_type":... |
5130640172 | import numpy as np
import pandas as pd
import tensorflow as tf
import warnings
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
from tensorflow.keras import Sequential
from tensorflow.keras.layers import Dense
df = pd.read_csv('data.csv')
df['Gender'].... | amalaj7/Keras | data_normalization.py | data_normalization.py | py | 1,178 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.StandardScaler",
"line_number": 22,
"usage_type": "call"
... |
72324776693 | from azureml.core import Run, Dataset, Workspace
import os
import subprocess
import sys
# Install packages
subprocess.check_call([sys.executable, "-m", "pip", "install", "transformers"])
# Import installed packages
import transformers
# get the Azure ML run object
run = Run.get_context()
# get workspace
workspace =... | hav4ik/azure-ml-usage-example | sample_code/train.py | train.py | py | 1,028 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "subprocess.check_call",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.executable",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "azureml.core.Run.get_context",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "... |
19860725003 | from haystack.fields import CharField
from haystack.exceptions import SearchFieldError
from django.template import loader, Context
class MultiLanguageCharField(CharField):
def _prepare_template(self, obj, language):
if self.instance_name is None and self.template_name is None:
raise SearchFie... | charlesmastin/django-simple-cms | simple_cms/contrib/translated_model/haystack/fields.py | fields.py | py | 938 | python | en | code | 6 | github-code | 21 | [
{
"api_name": "haystack.fields.CharField",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "haystack.exceptions.SearchFieldError",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.template.loader.select_template",
"line_number": 19,
"usage_type": "... |
9666663257 | import bs4
import json
class Parser:
def __init__(self, source):
self.list = []
self.source = source
self.dict = {}
def parse(self):
with open(self.source, encoding="utf-8", mode = "r") as f:
soup = bs4.BeautifulSoup(f, 'html.parser')
table = soup.find_a... | KochyanLV/cmc-parser | parse.py | parse.py | py | 1,973 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "bs4.BeautifulSoup",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 49,
"usage_type": "call"
}
] |
74632812533 | '''
Overall flow:
1. Triggered by the SQS, invoke handler function and get UUID
2. Use the UUID to retrieve the zip file from the S3
3. Create new lambda function
4. Add new endpoint to API gateway
5. return the endpoint
'''
from botocore.exceptions import ClientError
import logging
import json
import boto3
from botoc... | cyiafn/faas_wrapper | deploy_worker/lambda_function.py | lambda_function.py | py | 14,624 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "boto3.resource",
"line_number": 107,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number": 116,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"l... |
18748262146 | import pytest
from django.urls import reverse
from django.test import Client
from django.contrib.auth.models import User
from pytest_django.asserts import assertTemplateUsed
from profiles.models import Profile
@pytest.mark.django_db
def test_profiles_index():
client = Client()
path = reverse('profile_index')... | PhilippeOC/p13 | profiles/tests.py | tests.py | py | 1,110 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.test.Client",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.urls.reverse",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pytest_django.asserts.assertTemplateUsed",
"line_number": 17,
"usage_type": "call"
},
{
"a... |
41790387707 | #!/usr/bin/env python
# Author: Alan Wilms
import sys
import cv2
import numpy as np
import math
import threading
import time
import random
from scipy import stats
class EyeTracker:
# define several class variables
def __init__(self, webcam_index, calibration_sleep_time, measure_accuracy):
try:
... | AlanWilms/iTracking | Open CV Eye Detection/eye_detector.py | eye_detector.py | py | 19,428 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "cv2.CascadeClassifier",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "cv2.data",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "cv2.CascadeClassifier",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "cv2.data",
... |
42535609345 | import falcon
from falcon import testing
import pytest
from unittest.mock import MagicMock
from cdd.app import api
@pytest.fixture
def client():
return testing.TestClient(api)
def test_get_stocks(client):
doc = {
"id": 2,
"base": "AL - MACEIO",
"value": 98
}
response = client... | VitorinoAssuncao/stone_hugin | tests/cdd_tests/resources_tests/test_stocks.py | test_stocks.py | py | 1,993 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "falcon.testing.TestClient",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cdd.app.api",
"line_number": 10,
"usage_type": "argument"
},
{
"api_name": "falcon.testing",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "pytest.fixtu... |
30411114739 | from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select
import time
def calc(x, y):
return str(int(x) + int(y))
try:
link = "http://suninjuly.github.io/selects1.html"
browser = webdriver.Chrome()
browser.get(link)
x_element = b... | Avionic737/automation_course | section_2/less2_step3.py | less2_step3.py | py | 1,095 | python | ru | code | 0 | github-code | 21 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.common.by.By.CSS_SELECTOR",
"line_number": 16,
"usage_type": "attribute"
... |
10343233318 | import visa
import sys
def main():
instrument_address = getInstrumentAddress()
rm = visa.ResourceManager('@py')
instrument = rm.open_resource("TCPIP::{ip}".format(ip = instrument_address))
identification = instrument.query("*IDN?")
instrument.write("*WAI");
parseAndPrintIdentification(identification)
def... | pellaton/rohdeschwarz-playground | instrument-hello.py | instrument-hello.py | py | 803 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "visa.ResourceManager",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_numbe... |
27647580898 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu May 30 14:40:30 2019
@author: abhishek,shashank
"""
import numpy as np
import math
import xlrd
Ko = 0
# Factors
# 1.Dynamic Factor(Kv)
def KV(V,Qv,system):
B = 0.25*((12.0-Qv)**(2.0/3.0))
A = 50.0 + 56.0*(1-B)
if system == 'SI' ... | shashankramesh/DOME-Website | DOME_GEAR/factors.py | factors.py | py | 5,317 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "math.log",
"line_number": 135,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line_number": 143,
"usage_type": "call"
},
{
"api_name": "numpy.sin",
"line_number": 143,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line_number": 145,
... |
32709628277 | from django.conf import settings
from django.contrib import admin
from django.urls import path, include
from django.conf.urls.static import static
from apps.core.views import ProductListView, SearchListView, order_confirmation
from apps.store.views import productDetailView, categoryDetail
from apps.store.api import ap... | paudelgaurav/ecom | mpasal/urls.py | urls.py | py | 1,649 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.contrib.admin.site",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 14,
"usage_type": "attribute"
},
{
... |
12987390335 | import boto3, uuid
from datetime import datetime
from boto3.dynamodb.conditions import Key, Attr
def add_item_to_table(table, item_data):
# Añade un nuevo ítem a la tabla
response = table.put_item(
Item=item_data
)
return response
def add_conversation(table, user_id, atendido_id, audio_s3_uri... | matahaxusen/cruzroja | django/cruzroja/librerias/dynamodb.py | dynamodb.py | py | 1,866 | python | es | code | 0 | github-code | 21 | [
{
"api_name": "uuid.uuid4",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "uuid.uuid4",
"... |
23097693383 | import numpy as np
import torch
import torch.nn.functional as F
import torch.optim as optim
from base import BaseTrainer
import timeit
from utils import util, string_utils, error_rates
from collections import defaultdict
import random, json
from datasets.hw_dataset import PADDING_CONSTANT
from datasets.text_data import... | herobd/handwriting_line_generation | trainer/auto_trainer.py | auto_trainer.py | py | 11,785 | python | en | code | 59 | github-code | 21 | [
{
"api_name": "base.BaseTrainer",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "json.load",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "torch.nn.utils.clip_grad_value_",
"line_number": 136,
"usage_type": "call"
},
{
"api_name": "torch.nn"... |
32490777951 | from django.shortcuts import render,HttpResponse,redirect,get_object_or_404,reverse # get_object.... elemanı o idli varsa obje döndürür yoksa 404 sayfası döndürür|||reverse fonk. ise redirect işlemlerinde dinamik url kullanmak için gerekli
from article.forms import ArticleForm
from django.contrib import messages
from a... | ArifTarp/djangoBlogApp | article/views.py | views.py | py | 5,445 | python | tr | code | 0 | github-code | 21 | [
{
"api_name": "django.shortcuts.render",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "article.models.Article.objects.filter",
"line_number": 17,
"usage_type": "call"
},
{
... |
6030853878 | import cv2
import numpy as np
from time import sleep
cap = cv2.VideoCapture(1);
height = cap.get(cv2.CAP_PROP_FRAME_WIDTH)
width = cap.get(cv2.CAP_PROP_FRAME_HEIGHT)
centerX = 240
centerY = 320
# print(width,height)
a = 0
b = 0
relX = False
relY = False
isXCentered = False
isYCentered = False
while True:
rel... | Sizer12/My-Programming-Projects | circle_detection.py | circle_detection.py | py | 2,483 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.CAP_PROP_FRAME_WIDTH",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "cv2.CAP_PROP_FRAME_HEIGHT",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_na... |
33231025773 | from app.tests.base import BaseTestCase
from app.main.services import token_service
from app.main.dynamodb import tokens
from boto3.dynamodb.conditions import Key
from bson.objectid import ObjectId
class TestTokenService(BaseTestCase):
eml = 'test@unit.com'
pwd = '1234abcdA'
user_id = '5d2b543e5138fc33509... | mikezm/h2hapi | app/tests/test_token_service.py | test_token_service.py | py | 2,593 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "app.tests.base.BaseTestCase",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "app.main.services.token_service.encode_token",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "app.main.services.token_service",
"line_number": 14,
"usage_type"... |
28899644089 | from __future__ import print_function
import urllib2
import json
# --------------- Helpers that build all of the responses ----------------------
def build_speechlet_response(title, output, reprompt_text, should_end_session):
return {
"outputSpeech": {
"type": "PlainText",
"text": ... | DistrictData/Alexa-CaBi | lambda_function.py | lambda_function.py | py | 7,112 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "urllib2.urlopen",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "urllib2.urlopen",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "urllib2.urlopen",
"line... |
3488639871 | #
# @lc app=leetcode.cn id=797 lang=python3
#
# [797] 所有可能的路径
#
# @lc code=start
from typing import List
from copy import copy
class Solution:
def allPathsSourceTarget(self, graph: List[List[int]]) -> List[List[int]]:
"""dfs"""
res = []
visited = set()
def backtrack(path, can_mov... | Ehco1996/leetcode | random/797.所有可能的路径.py | 797.所有可能的路径.py | py | 814 | python | en | code | 6 | github-code | 21 | [
{
"api_name": "typing.List",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "copy.copy",
"line_number": 24,
"usage_type": "call"
}
] |
33936486173 | """
Pytest fixtures to be provided for all tests without import
"""
import logging
import os
import sys
from time import sleep
from typing import Dict, List, Union
from redis import asyncio as aioredis
import pytest
import pytest_asyncio
import redis
import pymemcache
import random
import subprocess
from copy import d... | dragonflydb/dragonfly | tests/dragonfly/conftest.py | conftest.py | py | 9,374 | python | en | code | 21,632 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "logging.WARNING",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "tempfile.TemporaryDirectory",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "pa... |
20727383822 | import io
from operator import mod
import sys
_INPUT = """\
4
3 2
1??
4 2
?1?0
6 3
011?1?
10 5
00?1???10?
"""
sys.stdin = io.StringIO(_INPUT)
# ---------------------------------
t = int(input())
ans = []
for _ in range(t):
n, k = map(int, input().split())
sum_1 = [0]
sum_0 = [0]
for s in input():... | makima333/Atcoder-ganbaru | contest/arc150/A.py | A.py | py | 600 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.stdin",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "io.StringIO",
"line_number": 17,
"usage_type": "call"
}
] |
10671155072 | import glob
import json
import os
import zipfile
from uuid import uuid4
import shutil
from flask import Flask, request, redirect, url_for, render_template, send_file
from pixel2number import image_converter
dir_path = os.path.dirname(os.path.realpath(__file__))
app = Flask(__name__)
@app.route("/")
@app.route("/in... | vincentclaes/pixel2number | pixel2number/application.py | application.py | py | 3,307 | python | en | code | 0 | github-code | 21 | [
{
"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.realpath",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line... |
2571231514 | import os
from PIL import Image
def util(key):
path = '/home/chan/dataset/{}'.format(key)
files = os.listdir(path)
i = 0
mode_list = ['1', 'L', 'I', 'F', 'P', 'RGB', 'RGBA', 'CMYK', 'YCbCr']
save_path = '/home/chan/dataset/{}/img/'.format(key)
if not os.path.exists(save_path):
os.mkdir(... | cournnnnnn/train_test_daily | utils/rename_jpg.py | rename_jpg.py | py | 707 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.listdir",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.mkdir",
"line_number": 1... |
21221690071 | import numpy
import warnings
import cupy
from cupy.cuda import cutensor
from cupy.cuda import device
from cupy.cuda import runtime
from cupy import util
_handles = {}
_tensor_descriptors = {}
_contraction_descriptors = {}
_contraction_finds = {}
_contraction_plans = {}
class Descriptor(object):
def __init__(se... | yuhc/ava-cupy | cupy/cutensor.py | cutensor.py | py | 17,535 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "cupy.util.is_shutting_down",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "cupy.util",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "cupy.cuda.device.get_device_id",
"line_number": 34,
"usage_type": "call"
},
{
"api_name... |
41744410405 | import os
import librosa
import json
NUM_SAMPLES = 22050
DATASET_PATH = "dataset"
JSON_PATH = "data.json"
def preprocess(dataset_path, json_path, num_mfccs=13, n_fft=2048, hop_len=512):
data = {
"mappings": [],
"labels": [],
"MFCCs": [],
"files": []
}
# loop through all s... | Archonz-crazy/Google-Audio | preprocessing.py | preprocessing.py | py | 1,809 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.walk",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "librosa.load",
"line_number": 3... |
29028925491 | from django import forms
from .models import Profile, Run, User
class DateInput(forms.DateInput):
input_type = "date"
class ProfileForm(forms.ModelForm):
"""
Form for adding a user profile.
Includes date picker widget
"""
class Meta:
model = Profile
widgets = {
"D... | ccp84/c25k | register/forms.py | forms.py | py | 1,476 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "django.forms.DateInput",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.forms.ModelForm",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "dja... |
1937292661 | """
Handles all the menu clicks in the client and returns what it should do next.
Three things need to be passed: menu id, item and state.
Menu id is used to determine which function to process the request. Item is which choice the user made.
State is changed to indicate the user's choice as well as used to create spe... | dungeontiger/gutlicsArena | rest_server/menu_handler.py | menu_handler.py | py | 3,361 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "json.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 31,
... |
5725891441 | import SimpleITK as sitk
from batchgenerators.utilities.file_and_folder_operations import *
import numpy as np
from skimage.morphology import label
def find_coms(img: np.ndarray):
components, n_comp = label(img, 0, True)
coms = []
for comp in range(1, n_comp + 1):
mask = components == comp
... | Fickincool/master-thesis | scripts/Task511_cryoET_patch_extraction.py | Task511_cryoET_patch_extraction.py | py | 4,280 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "numpy.ndarray",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "skimage.morphology.label",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.where",
... |
8780015226 | from rest_framework.exceptions import NotFound
from rest_framework import response, status, mixins, viewsets, permissions
from rest_framework.decorators import action
from api.advice.models.advice import Advice
from .models import Comment
from .serializers import (
CommentSerializer,
UpdateCommentSerializer,
... | raspberry-jam-jar/advisor-dog-tail | api/comment/viewsets.py | viewsets.py | py | 1,881 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "rest_framework.mixins.RetrieveModelMixin",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.mixins",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "rest_framework.mixins.CreateModelMixin",
"line_number": 16,
"usage_ty... |
21061680803 | """Support for Rain Bird Irrigation system LNK WiFi Module."""
from __future__ import annotations
import logging
import homeassistant.helpers.config_validation as cv
import voluptuous as vol
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity
from homeassistant.const import CONF_MON... | konikvranik/hacs_rainbird | custom_components/rainbird/binary_sensor.py | binary_sensor.py | py | 2,173 | python | en | code | 12 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "homeassistant.components.binary_sensor.PLATFORM_SCHEMA",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "homeassistant.components.binary_sensor.PLATFORM_SCHEMA.extend",
"lin... |
28758747354 | """
ID: mjmande1
LANG: PYTHON3
TASK: zerosum
"""
import regex as re
fin = open('zerosum.in', 'r')
fout = open('zerosum.out', 'w')
def numberToBase(n, b):
if n == 0:
return "0"
digits = []
while n:
digits.append(int(n % b))
n //= b
# digits = re.sub('[\[,\]\']', '', str(digits[::... | Boomer-Sooner-PC/Competitive-Programming | USACO/Zero Sum/zerosum.py | zerosum.py | py | 994 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "regex.sub",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "regex.sub",
"line_number": 28,
"usage_type": "call"
}
] |
18678483372 | from utils.abstract import FileReaderSolution
from abc import abstractmethod
from enum import Enum
from itertools import product
class Day21:
def __init__(self):
self.startpos = []
@abstractmethod
def solve_part(self):
pass
def solve(self, input_data: str) -> int:
self.parse_i... | svanjole/AoC2020 | solutions/2021/day21.py | day21.py | py | 2,416 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "abc.abstractmethod",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "utils.abstract.FileReaderSolution",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "utils.abstract.FileReaderSolution",
"line_number": 58,
"usage_type": "name"
},
{... |
73791844211 | """
@author: Li Xi
@file: train.py
@time: 2020/2/7 21:09
@desc:
"""
import argparse
import json
import os
import time
import gensim
import numpy as np
import torch
from allennlp.common.util import ensure_list
from allennlp.data import Vocabulary
from allennlp.data.iterators import BucketIterator
from allennlp.modules... | RingBDStack/KGEvetPred | train.py | train.py | py | 10,083 | python | en | code | 5 | github-code | 21 | [
{
"api_name": "os.environ",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "torch.backends",
"line_number": 82,
"usage_type": "attribute"
},
{
"api_name": "my_logger... |
74472971254 | """create history table
Revision ID: ef8826814e36
Revises:
Create Date: 2023-07-19 20:46:14.116888
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'ef8826814e36'
down_revision = None
branch_labels = None
depends_on = None
def upgrade() -> None:
# ### com... | OtavioRDF/mtu | alembic/versions/ef8826814e36_create_history_table.py | ef8826814e36_create_history_table.py | py | 990 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "alembic.op.create_table",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integ... |
13360076301 | from abc import ABC, abstractmethod
from dataclasses import dataclass, field
from typing import Any, Dict, FrozenSet, List, Optional, Tuple
import numpy as np
import torch
from transformers import PreTrainedTokenizer, PretrainedConfig, PreTrainedModel
from refined.doc_preprocessing.candidate_generator import Candidat... | amazon-science/ReFinED | src/refined/doc_preprocessing/preprocessor.py | preprocessor.py | py | 16,171 | python | en | code | 126 | github-code | 21 | [
{
"api_name": "refined.utilities.general_utils.get_logger",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "abc.ABC",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "datacl... |
1070383677 | import requests
import zipfile
from io import BytesIO
def download_chrome_driver(version = None):
try:
version_number = ""
if version:
version_number = "_" + version
latest_release = requests.get(f"https://chromedriver.storage.googleapis.com/LATEST_RELEASE{version_number}").cont... | Taggagii/Arbitrary-Coding | chromedriver_downloader.py | chromedriver_downloader.py | py | 671 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "io.BytesIO",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "zipfile.ZipFile",
"line_numb... |
22740636317 | import boto3
import requests
import ConfigParser
import copy
import re
import datetime
import dateutil
import json
import os
import operator
from aws_openshift_quickstart.logger import LogUtil
class EqualsSpaceRemover:
"""
Class to remove spaces around equal signs to confirm to INI style formatting.
Method... | tchatelli/quickstart-redhat-openshift | scripts/scaling/aws_openshift_quickstart/utils.py | utils.py | py | 25,799 | python | en | code | null | github-code | 21 | [
{
"api_name": "aws_openshift_quickstart.logger.LogUtil.get_root_logger",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "aws_openshift_quickstart.logger.LogUtil",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "copy.deepcopy",
"line_number": 65,
"usage... |
21068435562 | from flask import Flask, Response
from view import load_image_b64, make_svg
app = Flask(__name__)
@app.route("/", defaults={"path": ""})
@app.route("/<path:path>")
def catch_all(path):
artist_name = "Spotify Github Profile"
song_name = "Revolution with very long text - ft. someone"
img_url = "https://a... | kittinan/spotify-github-profile | api/theme_dev.py | theme_dev.py | py | 892 | python | en | code | 1,198 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "view.load_image_b64",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "view.make_svg",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "flask.Response",
"li... |
7787945827 | from matplotlib import pyplot as plt
from kernel import kernel
from tqdm import tqdm
import numpy as np
import cv2
leftImage = cv2.imread('../cutSSDByPython/leftPic.png', 0)
rightImage = cv2.imread('../cutSSDByPython/rightPic.png', 0)
# leftImage = cv2.imread('/home/farshad/Desktop/drivingStereo_left/2018-07-09-16-11... | gholamifarshad98/CompareMuliSmallKernelWithBigKernel | main.py | main.py | py | 1,740 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "cv2.imread",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 20,
... |
11741627217 | from typing import Union
class DeleteScenariosService:
def __init__(self, session, query_builder, logger, response_sql) -> None:
self.session = session
self.query_builder = query_builder
self.logger = logger
self.response_sql = response_sql
def delete_scenarios(self, scenarios... | kpinetwork/backend | src/service/scenario/delete_scenarios_service.py | delete_scenarios_service.py | py | 4,025 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "typing.Union",
"line_number": 82,
"usage_type": "name"
}
] |
74930062452 | import pygame
from gbxml import upload
from gbxml import list_local_xml_files
class LineItem(object):
def __init__(self, pos, text, res, id):
"""One study guide line item"""
self.rect = pygame.Rect(pos, res)
self.font = pygame.font.SysFont("Courier", 20)
temp = text.replac... | JovialKnoll/SDD-Project | SGUploader.py | SGUploader.py | py | 4,476 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "pygame.Rect",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pygame.font.SysFont",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pygame.font",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.load",
... |
17279102419 | """Module that implements Anderson localisation along with various methods,
mainly concerned with evolving the system non-unitarily."""
import numpy as np
import matplotlib.pyplot as plt
import scipy as sp
import scipy.sparse.linalg
from scipy.linalg import expm
class System():
"System object that rep... | jacklowe/anderson_decoherence | anderson_decoherence.py | anderson_decoherence.py | py | 4,221 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "scipy.sparse.lil_matrix",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "scipy.sparse",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "numpy.complex128",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "numpy... |
23009741310 | import torch
import torchvision.models as models
import torchvision.transforms as transforms
from PIL import Image
import pickle
from io import BytesIO
import base64
class ImageSearch:
# Load the pre-trained ResNet50 model
device = torch.device('cuda') if torch.cuda.is_available() else torch.de... | tthogho1/flaskapp | util/ImageSearch.py | ImageSearch.py | py | 3,269 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "torch.device",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torchvision.mode... |
14557174890 | """
`imu_print_data_serial_host.py`
====================================================
reading pycubed serial IMU data and calculating noise / maybe visualization
* Author(s): C. Hillis
--------------------
"""
import time
import serial
import sys
# main loop
while True:
#wait/get serial data
with ser... | bryceputman/mainboard | software/testing/imu_print_data_serial_host/imu_print_data_serial_host.py | imu_print_data_serial_host.py | py | 660 | python | en | code | null | github-code | 21 | [
{
"api_name": "serial.Serial",
"line_number": 21,
"usage_type": "call"
}
] |
10303168453 | # type: ignore
"""dispatch table name updated
Revision ID: 1d9f88fa28bf
Revises: a9391ec177e2
Create Date: 2020-05-28 11:04:16.170482
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "1d9f88fa28bf"
down_revision = "a9391... | mywork-dragon/dave-energy | migrations/versions/1d9f88fa28bf_dispatch_table_name_updated.py | 1d9f88fa28bf_dispatch_table_name_updated.py | py | 1,498 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "alembic.op.create_table",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integ... |
16862816936 | # -*- coding: utf-8 -*-
import json
from typing import Optional, Dict, List
from TM1py.Objects.TM1Object import TM1Object
def clean_null_terms(d: Dict):
clean = {}
for k, v in d.items():
if isinstance(v, dict):
nested = clean_null_terms(v)
if len(nested.keys(... | cubewise-code/tm1py | TM1py/Objects/GitProject.py | GitProject.py | py | 17,704 | python | en | code | 167 | github-code | 21 | [
{
"api_name": "typing.Dict",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 2... |
26559282391 | import numpy as np
import time
import multiprocessing
def obrienBaseline(data, timeWidth = 1.0, cadence = 18.75E-3, PERCENTILE_THRESH = 10, verbose=False):
"""
NAME: obrienBaseline(data, timeWidth = 1.0, cadence = 18.75E-3, PERCENTILE_THRESH = 10)
USE: Implements the baseline algorithm described by ... | mshumko/mission_tools | mission_tools/misc/obrienBaseline.py | obrienBaseline.py | py | 5,297 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "time.time",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.floor",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.zeros_like",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.percentile",
"line_n... |
19019669600 | from copy import deepcopy
from random import choice, randrange
import pygame
class Tetris:
def __init__(self):
self.running = False
self.sc = None
self.game_sc = None
self.clock = None
self.fps = 30
# score rule
self.scores = {0: 0, 1: 100, 2: 300, 3: 700,... | snucv-2022-team19/tetris-with-motion | tetris/game.py | game.py | py | 11,318 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pygame.Rect",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pygame.Rect",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "pygame.init",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"li... |
27267478601 | from operator import truediv
import psycopg2
class Base:
def __init__(self):
self.conn = None
def db_connect(self):
try:
self.conn = psycopg2.connect(
database="inventory",
user="postgres",
password="postgres2019",
ho... | destrotechs/inv | db/base.py | base.py | py | 1,194 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "psycopg2.connect",
"line_number": 11,
"usage_type": "call"
}
] |
4583599083 | from collections import deque
words = input().split()
size = [0] * len(words)
prev = [None] * len(words)
best_size = 0
best_index = 0
for i in range(len(words)):
current_word = words[i]
current_size = 1
parent = None
for prev_i in range(i - 1, -1, -1):
prev_word = words[prev_i]
if ... | Zapryanovx/Algorithms-with-Python | 09_Dynamic_programming_exercise/05_longest_string_chain.py | 05_longest_string_chain.py | py | 774 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.deque",
"line_number": 33,
"usage_type": "call"
}
] |
70014736692 | import numpy as np
import random
import os
import sys
from sklearn.model_selection import KFold, train_test_split
from tensorflow.keras.backend import clear_session
from . import save, predictions
import json
import torch
RANDOM_SEED=123456789
# Uso:
# train_test(x, y, x_test, {"cropsize": 256}, train_pixelnet, predic... | ari-dasci/S-metallograph-segmentation | metallograph_segmentation/utils/crossval.py | crossval.py | py | 4,176 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "numpy.ndarray",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "random.getrandbits",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.stderr",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "sklearn.model_s... |
33772439296 | # -----------------------------------------------------------------------------
# Pub-sub API.
#
# This pub-sub library provides best-effort, at-most-once delivery guarantee.
# If there are no subscribers reachable when a message is published, this
# message will not be re-transmitted.
# If there are multiple subscribe... | UCLA-IRL/ndn-python-repo | ndn_python_repo/utils/pubsub.py | pubsub.py | py | 11,994 | python | en | code | 16 | github-code | 21 | [
{
"api_name": "ndn.app.NDNApp",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "ndn.encoding.NonStrictName",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "ndn.name_tree.NameTrie",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "ndn.... |
42204284731 | '''
Python implementation of Conway's Game of Life
Original author: Mahesh Venkitachalam
Slight modifications by me
'''
import argparse
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from patterns import Pattern
ON = 255
OFF = 0
def load_patterns():
'''Loads pattern... | sdinanozer/PP_Exercices | GameOfLife/main.py | main.py | py | 7,325 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "patterns.Pattern",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "patterns.Pattern.pattern_list",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "patterns.Pattern",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "... |
73037150133 | import sys
import unittest
from flaky import flaky
sys.path.append('.')
import telegram
from tests.base import BaseTest
class VenueTest(BaseTest, unittest.TestCase):
"""This object represents Tests for Telegram Venue."""
def setUp(self):
self.location = telegram.Location(longitude=1., latitude=0.)... | LiuFang816/SALSTM_py_data | python/python-telegram-bot_python-telegram-bot/python-telegram-bot-master/tests/test_venue.py | test_venue.py | py | 1,907 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "sys.path.append",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "tests.base.BaseTest",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "unittest.TestCase",
... |
44910182631 | # ========================== #
# 1. Import and Copy Dataset #
# ========================== #
import os
import pandas as pd
import numpy as np
from xgboost import XGBRegressor
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_absolute_error
class ConfigSetting:
def _... | denisuleung/python_kaggle_house_prices | Comp_Housing_7.py | Comp_Housing_7.py | py | 17,154 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.set_option",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"... |
40746692008 | from multiprocessing import Process, Queue
from threading import Thread
from os import getpid
from random import randint
from time import time, sleep
def download_task(filename):
print('启动下载进程,进程号[%d]。' % getpid())
print('开始下载%s...' % filename)
time_to_download = randint(5, 10)
sleep(time_to_download)... | Hishikoz/vscode2019 | python/013 process thread.py | 013 process thread.py | py | 2,575 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.getpid",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number"... |
24074112440 | """
photofixer.py - Class for fixing photos to produce in discovery
"""
import json
import os
from datetime import datetime
from PIL import Image, ExifTags, ImageDraw, ImageFont, ImageOps, UnidentifiedImageError
from pillow_heif import register_heif_opener
import piexif
import PySimpleGUI as sg
import shutil
from hacho... | tjdaley/photofixer | photofixer.py | photofixer.py | py | 13,304 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
... |
14879261950 | import tornado.web
from views import Index
from views import admin
from views import users
from views import mall
import config
#路由
class Application(tornado.web.Application):
def __init__(self):
handlers = [
(r"/celery", users.CeleryHandler),
(r"/", Index.IndexHandler),
... | HaiBeiSuperior/mytornado | application.py | application.py | py | 2,787 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "tornado.web.web",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "tornado.web",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "views.users.CeleryHandler",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "views... |
40167222968 | import sys
from PyQt5.QtWidgets import QApplication, QWidget
from PyQt5 import QtWidgets
class Bio(QWidget):
def __init__(self) -> None:
super().__init__()
self.setWindowTitle("Bio")
self.centralLayout = QtWidgets.QVBoxLayout(self)
self.setLayout(self.centralLayout)
self... | ABHIJITH-EA/gitgram | test/bio.py | bio.py | py | 1,924 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QVBoxLayout",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "Py... |
42162847975 | #! python
# -*- coding:utf-8 -*-
import os
import sys
import json
import pathlib
from xml.dom.minidom import Document
# 加上不确定的层级缩进,60比较合适
BASE_LENGTH = 60
BASE_INDENT = " "
INDENT_LIST = {}
# 把一个dict的key转为字符串
def to_str_key_dict(d, prefix):
if not isinstance(d, dict): return d
found = False
for k, v ... | changnet/py_exceltools | writer.py | writer.py | py | 10,020 | python | en | code | 7 | github-code | 21 | [
{
"api_name": "pathlib.Path",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 101,
"usage_type": "call"
},
{
"api_name": "xml.dom.minidom.Document",
"line_number": 180,
"usage_type": "call"
}
] |
18379853021 | from os.path import join
from tempfile import gettempdir
from wazuh_testing.qa_ctl.provisioning.ansible.ansible_task import AnsibleTask
from wazuh_testing.qa_ctl.provisioning.ansible.ansible_runner import AnsibleRunner
from wazuh_testing.qa_ctl import QACTL_LOGGER
from wazuh_testing.tools.logging import Logging
from w... | wazuh/wazuh-qa | deps/wazuh_testing/wazuh_testing/qa_ctl/provisioning/qa_framework/qa_framework.py | qa_framework.py | py | 7,544 | python | en | code | 29 | github-code | 21 | [
{
"api_name": "wazuh_testing.tools.logging.Logging.get_logger",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "wazuh_testing.qa_ctl.QACTL_LOGGER",
"line_number": 28,
"usage_type": "argument"
},
{
"api_name": "wazuh_testing.tools.logging.Logging",
"line_number": 28,... |
10131395819 | import os
import socket
import pyscreenshot as ImageGrab
import zbarlight
from PIL import Image
host = "docker.hackthebox.eu"
port = 32137
s = socket.socket()
s.connect((host, port))
x = 1
with open('received_file', 'wb') as f:
print('file opened')
while True:
print('receiving data...')
data... | ScRiPt1337/hackthebox_notes | quickR_challange.py | quickR_challange.py | py | 1,174 | python | en | code | 6 | github-code | 21 | [
{
"api_name": "socket.socket",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pyscreenshot.grab",
"line_numbe... |
25755779304 |
from django.urls import path
from . import views
urlpatterns = [
path('index', views.index, name = 'index'),
path('add', views.addToDo, name = 'add'),
path('completed/<todo_id>', views.completed, name = 'completed'),
path('delete_completed', views.delete_completed, name = 'delete_compl... | Eugin-Paul/To-Do-List-App | ToDoProject/myproject/todo/urls.py | urls.py | py | 396 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
4146457856 | import PySimpleGUI as sg
from ultralytics import YOLO
from layouts import first_page_layout
import subprocess
import os
import yaml
from google_drive_downloader import GoogleDriveDownloader as gdd
import shutil
from PIL import Image
import random
def load_yaml(file_path):
with open(file_path, 'r') ... | Darthph0enix7/YoloV8_customer_UI | main.py | main.py | py | 8,559 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "yaml.safe_load",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "yaml.dump",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": ... |
13302184894 | """https://miyakogi.github.io/pyppeteer/"""
import asyncio
from pyppeteer import launch
async def main():
browser = await launch()
page = await browser.newPage()
await page.goto('http://www.google.com')
await page.screenshot({'path': 'example.png', 'fullPage':'True'})#choisir emplacement
await bro... | PierreGoe/FirstPythonProjects | FirstProgrammePython/pyppeteer.py | pyppeteer.py | py | 387 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "pyppeteer.launch",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "asyncio.get_event_loop",
"line_number": 13,
"usage_type": "call"
}
] |
43806846855 | import torch
from torch.utils.data import Dataset
class SentencePairDataset(Dataset):
def __init__(self, data, max_len, padding_idx):
super(SentencePairDataset, self).__init__()
self.data_size = len(data["input_ids"])
self.sentences = []
self.input_ids = torch.ones((self.data_size... | htfhxx/FinetuneZoo | utils/Data.py | Data.py | py | 1,717 | python | en | code | 6 | github-code | 21 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "torch.ones",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.int64",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.ones",
... |
71748387572 | from bs4 import BeautifulSoup
html = """
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>First HTML Page</title>
</head>
<body>
<div id="first">
<h3 data-example="yes">hi</h3>
<p>more text.</p>
</div>
<ol>
<li class="special super-special">This list item is special.</li>
... | BrettMcGregor/udemy-colt-steele | bs-basics.py | bs-basics.py | py | 898 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "bs4.BeautifulSoup",
"line_number": 24,
"usage_type": "call"
}
] |
23926350654 | """[GitHub](https://github.com/) forks: configure remote and sync."""
from invoke import Context, Exit, task
from conjuring.spells.git import Git
SHOULD_PREFIX = True
@task
def remote(c: Context, username: str, remote: str = "") -> None:
"""[Configure a remote for a fork](https://docs.github.com/en/github/colla... | andreoliwa/conjuring | src/conjuring/spells/fork.py | fork.py | py | 1,136 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "invoke.Context",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "invoke.Exit",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "invoke.task",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "invoke.Context",
"line_numb... |
15235961427 | import pytest
import torch
import torch.nn as nn
from gans.normal_gan.ngan import Generator_NGAN
from gans.normal_gan.ngan import Discriminator_NGAN
def test_Generator_NGAN():
"""
Test for the generator of Normal GAN
"""
input_dim = 100
gen = Generator_NGAN(z_dim=10, image_dim=input_dim, hidden_... | caron14/GANs | tests/test_ngan.py | test_ngan.py | py | 2,509 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "gans.normal_gan.ngan.Generator_NGAN",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.nn.Linear",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "tor... |
5211662800 | """
This is the matching script to MinTemperaturesDataset.scala.
"""
from pyspark.sql import SparkSession
from pyspark.sql.types import FloatType, IntegerType, StringType, StructType
from pyspark.sql.functions import *
def main() -> None:
spark = SparkSession.builder.appName("MinTemperaturesDataset").master("loc... | Tomer0013/pyspark-examples | MinTemperaturesDataFrame.py | MinTemperaturesDataFrame.py | py | 1,367 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pyspark.sql.SparkSession.builder.appName",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pyspark.sql.SparkSession",
"line_number": 11,
"usage_type"... |
31426054431 | #--- TEXT EXTRACTION ---#
#importing libraries
import PyPDF2
from nltk.tokenize import sent_tokenize
#reading document
pdf_file = open('JavaBasics-notes.pdf', 'rb')
read_pdf = PyPDF2.PdfFileReader(pdf_file)
number_of_pages = read_pdf.getNumPages()
#extracting text
text = []
for no in range(0,number_of_pages) :
... | nikhilamunipalli/keyword | final.py | final.py | py | 1,942 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "PyPDF2.PdfFileReader",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "nltk.tokenize.sent_tokenize",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "nltk.tokenize.... |
19373840300 | from PyQt5.QtCore import Qt, QModelIndex
from PyQt5.QtGui import QPainter
from PyQt5.QtWidgets import (QApplication, QStyle, QStyleOptionProgressBar, QStyledItemDelegate,
QStyleOptionViewItem)
class ProgressBarItemDelegate(QStyledItemDelegate):
def paint(self, painter: QPainter, opti... | AdvancedPhotonSource/ptychodus | ptychodus/view/widgets/progressBarItemDelegate.py | progressBarItemDelegate.py | py | 773 | python | en | code | 7 | github-code | 21 | [
{
"api_name": "PyQt5.QtWidgets.QStyledItemDelegate",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtGui.QPainter",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QStyleOptionViewItem",
"line_number": 9,
"usage_type": "name"
},... |
73041875893 | #!/usr/bin/env python
"""
This module tries to install all the required software.
"""
from __future__ import print_function
import sys
import os
from distutils.spawn import find_executable
from setuptools import setup, find_packages
import wifiphisher.constants as constants
def get_dnsmasq():
"""
Try to inst... | LiuFang816/SALSTM_py_data | python/wifiphisher_wifiphisher/wifiphisher-master/setup.py | setup.py | py | 6,991 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "os.path.isfile",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "wifiphisher.constants.T",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "wifiphisher.... |
74300683251 | from ..callback import Callback
from ..imports import plt
from statistics import mean
class RecorderCallback(Callback):
order = 10
'''
Records values along the iteractions
'''
def __init__(self):
super(RecorderCallback, self).__init__()
self.records = dict()
def begin_fit(sel... | dalisson/callback_training_loop | training_library/callbacks/recorder/recorder.py | recorder.py | py | 3,934 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "callback.Callback",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "statistics.mean",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "imports.plt.subplots",
"line_number": 95,
"usage_type": "call"
},
{
"api_name": "imports.plt",
... |
8723266896 | """
This file contains the unit tests
"""
import datetime
from fixedIncome.src.curves.yield_curves.yield_curve import YieldCurveFactory
from fixedIncome.src.assets.us_treasury_instruments.us_treasury_bond import Bond
from fixedIncome.src.curves.key_rate import KeyRate
# Create a series of test objects.
purchase_date =... | aflapan/fixedIncome | fixedIncome/tests/test_curves/test_yield_curve/test_yield_curve.py | test_yield_curve.py | py | 4,931 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "datetime.date",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "fixedIncome.src.assets.us_treasury_instruments.us_treasury_bond.Bond",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 19,
"usage_type": "call... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.