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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
280801201 | import re
from os import path, mkdir, makedirs, remove, rmdir
from glob import glob
from shutil import copyfile
from src.fonts_sampler.html import HTML
# Import the needed sub-dir's, if needed
__all__ = [ path.basename(f)[:3] for f in glob(path.dirname(__file__) + "/*py")
if path.isfile(f) and not f.endswith("__i... | xransum/fonts-sampler | src/fonts_sampler/__init__.py | __init__.py | py | 5,708 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.basename",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "glob.glob",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number... |
37971391788 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019/5/14/014 15:09
# @Author : 刘登攀
# @Site :
# @File : group_purchase.py
# @Software: PyCharm
import requests
from Daily_city_group.group_port.get_token import get_token
import json
import threading
session = requests.Session()
def get_money():
... | LDPGG/dm | ZXYJ_GG-master/Daily_city_group/group_port/group_purchase.py | group_purchase.py | py | 2,963 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.Session",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "Daily_city_group.group_port.get_token.get_token",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 59,
"usage_type": "call"
},
{
"api_n... |
37777523664 | # -*- coding:utf-8 -*-
from django.http import HttpResponse
from django.shortcuts import render
from pymongo import MongoClient
from django.shortcuts import render_to_response
from django.template import RequestContext
import logging
import json
import time
logging.basicConfig(
level = logging.DEBUG,
format = ... | Runnyu/website | website/website/view.py | view.py | py | 1,529 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.basicConfig",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.htt... |
4458860862 | import logging.config
import os
from flask import Flask, Blueprint
import settings
from api.restplus import api
from api.auth.endpoints.register import ns as authentication_namespace
from database.models import mysql as db
app = Flask(__name__)
logging_conf_path = os.path.normpath(os.path.join(os.path.dirna... | mani144/flask_blueprint_swagger_mysql | server.py | server.py | py | 2,094 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.normpath",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_nu... |
23854850311 | """Store global variables, in this modual by default"""
"""defaults for prodigal"""
from pathlib import Path
PRODIGAL_MODE_DFT = "meta"
PRODIGAL_MODE_CHOICES = ["train", "meta", "single"]
PRODIGAL_TRANS_TABLE_CHOICES = [str(i) for i in range(1, 26)]
PRODIGAL_TRANS_TABLE_DFT = 11
MIN_CONTIG_SIZE_DFT = 2500
BIT_SCORE_... | rmFlynn/collection_of_typical_ocoli_samples | dram2/utils/globals.py | globals.py | py | 510 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pathlib.Path",
"line_number": 19,
"usage_type": "name"
}
] |
5811212464 | from tpdb2xbvr import handle_request, search, get_xtras, get_scene
from main import get_config, calculate_age
from pathlib import Path
import json
from datetime import (date)
import unittest
class MyTestCase(unittest.TestCase):
def setUp(self) -> None:
Path(Path.cwd() / 'data').mkdir(exist_ok=True)
... | make-it-fun/GUI-for-tpdb2xbvr | tests/test_tpdb2xbvr.py | test_tpdb2xbvr.py | py | 3,352 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "unittest.TestCase",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pathlib.Path.cwd",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "main.get_config"... |
28588370599 | from django.db import models
from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
from django.contrib.auth.models import PermissionsMixin
import chimera.settings as settings
import random
from hashlib import sha256
from PIL import Image, ImageDraw, ImageFont
# Create your models here.
class U... | kadenkan/Project-Chimera | chimera_core/models.py | models.py | py | 4,699 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.contrib.auth.base_user.BaseUserManager",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.base_user.AbstractBaseUser",
"line_number": 49,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.models.PermissionsMixin",
"l... |
7100733902 | import argparse
import sys
from post_timestamp_app_poc.commands.deploy import Deploy
from post_timestamp_app_poc.commands.destroy import Destroy
from post_timestamp_app_poc.commands.post import Post
class CLI:
"""Coordinating class to run the CLI
"""
def __init__(self, stdin=sys.stdin, stdout=sys.stdout,... | jfharden/post-timestamp-app-poc | post_timestamp_app_poc/cli.py | cli.py | py | 3,786 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.stdin",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sys.stdout",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sys.stderr",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_n... |
8909909632 | # -*-coding:utf-8-*-
from selenium.webdriver.chrome.options import Options
from lianxi2 import BaseOperator
from selenium import webdriver
import time
from selenium.webdriver.common.action_chains import ActionChains
class lianxi:
def __init__(self):
chrome_options=Options()
chrome_options.add_argu... | cjc598033763/Climb-to-the-U.S.-Postal-Code | runmain.py | runmain.py | py | 2,500 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "selenium.webdriver.chrome.options.Options",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 14,
"usage_type": "name"
},
{... |
8490794184 | import pyposeidon
import pyposeidon.model as pm
import pyposeidon.mesh as pmesh
from pyposeidon.utils.get_value import get_value
import numpy as np
import errno
import datetime
import sys
import os, errno
from shutil import copy2
import glob
import pandas as pd
import pathlib
import json
import logging
logger = log... | ec-jrc/pyPoseidon | pyposeidon/utils/cast.py | cast.py | py | 14,505 | python | en | code | 17 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_... |
6477205354 | import requests
def address_to_coordinates(address):
try :
# requesting from Geopunt
geo_resp = requests.get("http://loc.geopunt.be/geolocation/location?q="+address+"&c=25")
geo_loc = geo_resp.json()['LocationResult'][0]
# Storing value into variables
lat = geo_loc... | WimChristiaansen/testapp | coordinates.py | coordinates.py | py | 575 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 6,
"usage_type": "call"
}
] |
29376927959 | from trellowarrior.clients.taskwarrior import TaskwarriorClient
from trellowarrior.clients.trello import TrelloClient
from trellowarrior.config import config
import logging
logger = logging.getLogger(__name__)
class TrelloWarriorClient:
def __init__(self, config):
self.taskwarrior_client = TaskwarriorCli... | ogarcia/trellowarrior | trellowarrior/clients/trellowarrior.py | trellowarrior.py | py | 18,357 | python | en | code | 101 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "trellowarrior.clients.taskwarrior.TaskwarriorClient",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "trellowarrior.config.config.taskwarrior_taskrc_location",
"line_number":... |
70171476835 | #! /usr/bin/env python3
"""
plot the time vs miRNA ratio box plot
"""
import os, sys, re
import json
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
fn = '/data/cqs/chenh19/findadapt/findadapt_bench/2023_realdata/findadapt_res.time_mem_summary.txt'
def get_miRNA_ratio(lb):
... | chc-code/findadapt | utils/simulation_and_benchmark/plot_realdata_time_vs_miRNA_ratio.py | plot_realdata_time_vs_miRNA_ratio.py | py | 2,843 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "re.match",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"... |
37176069079 | import bpy
import bmesh
import json
def clean():
for o in bpy.data.objects:
if o.type == 'MESH':
o.select = True
else:
o.select = False
# call the operator once
bpy.ops.object.delete()
clean()
file_obj = r'C:\Users\Christian\Dropbox\Arbejde\DTU BYG\Livestock\live... | livestock3d/livestock | tests/archive/local_test/blender_drainge_mesh.py | blender_drainge_mesh.py | py | 1,707 | python | en | code | 8 | github-code | 1 | [
{
"api_name": "bpy.data",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "bpy.ops.object.delete",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "bpy.ops",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "bpy.ops.import_scene.... |
3682685578 | #!/usr/bin/env python
# coding=UTF-8
import sys
import os
import time
import reportlab
import StringIO
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
from reportlab.pdfgen.canvas import Canvas
#import reportlab
from reportlab.pdfgen import canvas
##from pdfmetrics import standar... | abelenki/Billy | common/render.py | render.py | py | 6,375 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "reportlab.pdfgen.canvas",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "reportlab.lib.pagesizes.A4",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "reportlab.pdfgen.canvas.Canvas",
"line_number": 37,
"usage_type": "call"
},
{
... |
15274724012 | """Session helper."""
import traceback
from functools import wraps
from ilswbot.db import get_session
def job_session_wrapper():
"""Create a session and handle exceptions for jobs."""
def real_decorator(func):
"""Parametrized decorator closure."""
@wraps(func)
def wrapper(context):
... | Nukesor/ilswbot | ilswbot/session.py | session.py | py | 1,464 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "ilswbot.db.get_session",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "traceback.print_exc",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "functools.wraps",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "ilswbot.db... |
3275459846 | from typing import List, Optional, Set
from PyQt5 import QtCore, QtGui
from commandbar.api import cmdutils
from mainwindow.canvas import CanvasContentManager, Canvas, CanvasPainter
from mainwindow.painters.painter import CustomPainter
from mainwindow.painters import tools
from commandbar.utils import objreg
ANNOTATE... | yairmol/graphui | mainwindow/painters/annotate.py | annotate.py | py | 2,096 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "mainwindow.canvas.Canvas",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "commandbar.api.cmdutils.register",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "commandbar.api.cmdutils",
"line_number": 15,
"usage_type": "name"
},
{
... |
13596239415 | import json
from flask import Blueprint, jsonify
from redis import Redis
redis_endpoint = Blueprint("redis_endpoint", __name__)
r = Redis(host="redis-container", port=6379)
# Endpoint
def ping_service():
try:
if r.ping():
response = jsonify({'Connection': "OK"})
response.status_co... | henry-geary/JwtRestApiFlask | Services/queue.py | queue.py | py | 2,140 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Blueprint",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "redis.Redis",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_num... |
14111108103 |
# This script creates TFRecord files for the testing data set.
import tensorflow as tf
import cv2
import glob2
import math
def _bytes_feature(value):
return tf.train.Feature(bytes_list=tf.train.BytesList(value=[value]))
# Path to the directory containing test TIFF images.
image_paths = glob2.glob('../test-tif-v... | aayushARM/planet-cv | create_tfrecord_test.py | create_tfrecord_test.py | py | 1,821 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "tensorflow.train.Feature",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tensorflow.train",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.train.BytesList",
"line_number": 10,
"usage_type": "call"
},
{
"api_nam... |
17453309279 | # -*- coding: utf-8 -*-
"""
Created on Wed Jun 12 15:04:07 2019
@author: admin1
"""
from flask import Flask, render_template, request
import sqlite3 as sql
from datetime import datetime
import pandas as pd
from matplotlib import pyplot as plt
import io
import re
import base64
app = Flask(__name__)
def pie_chart():
... | fidelisgalla/flask_sqlite3 | app.py | app.py | py | 4,317 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.read_sql_query",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
... |
34529181883 | import os
from knack.log import get_logger
from knack.util import CLIError
logger = get_logger(__name__)
def filter_by_git_diff(selected_modules, git_source, git_target, git_repo):
if not any([git_source, git_target, git_repo]):
return selected_modules
if not all([git_target, git_repo]):
ra... | Azure/azure-cli-dev-tools | azdev/utilities/git_util.py | git_util.py | py | 4,005 | python | en | code | 71 | github-code | 1 | [
{
"api_name": "knack.log.get_logger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "knack.util.CLIError",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
4948004910 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Advent of code 2021 day 14 - https://adventofcode.com/2021/day/14
"""Goals:
1) What do you get if you take the quantity of the most common element and subtract the quantity
of the least common element?
2) Same as 1 but instead of 10 iterations, 40, which exponential gro... | CoolCat467/Advent-Of-Code | 2021/adv14.py | adv14.py | py | 3,094 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.Counter",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 60,
"usage_type": "call"
}
] |
24877260133 | """pytest configuration."""
import pathlib
from typing import Generator, Optional, Tuple
import pytest
from sqlalchemy.orm import Session
from remote_command_server.database import Base, database_connection
@pytest.fixture()
def db() -> Generator[Session, None, None]:
"""
Fixture for creating a fresh test d... | saltastroops/remote-command-server | conftest.py | conftest.py | py | 1,287 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.Optional",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.orm.Session",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "remote_command_server.database.database_connection",
"line_number": 21,
"usage_type": "call"
},
... |
16120973803 | import pytest
import os
from conflow import from_env
from conflow.manager import Config
DEFAULT_SETTINGS = {
'db': {
'master': {
'host': 'localhost',
'port': 5432,
},
'slave': {
'host': 'localhost',
'port': 5433,
}
}
}
ENV_SETTIN... | singulared/conflow | tests/unit/manager/config_test.py | config_test.py | py | 1,513 | python | en | code | 9 | github-code | 1 | [
{
"api_name": "conflow.manager.Config",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 62,
"usage_type": "attribute"
},
{
"api_name": "os.environ... |
37232639874 | from config import *
import pygame
from bullet import Bullet
class Player(pygame.sprite.Sprite):
def __init__(self, x, y, file_paths: list, lives,speed_x, sound_bullet, jumping_path, dead_path, character_type) -> None:
pygame.sprite.Sprite.__init__(self)
self.frame_index = 0
... | Behrens0/BehrensTomasLab1AJuegoPython | source/PlayerClass.py | PlayerClass.py | py | 3,507 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pygame.sprite",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "pygame.sprite.Sprite.__init__",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.sprite",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pyga... |
5408299059 | import copy
import sys
# for linux env.
sys.path.insert(0, '..')
import time
import pickle
import argparse
from utils import *
from torch.utils.data.sampler import SubsetRandomSampler
import numpy as np
import torch
import torch.nn.functional as F
import random
import pandas as pd
import json
import matplotlib.pyplot... | calvin-zcx/hidd-sui | main_lstm.py | main_lstm.py | py | 13,250 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.path.insert",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "functools.partial",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser... |
7469955324 | '''
Mini-Project1 - COMP 551 - Winter 2019
Mahyar Bayran
Luis Pinto
Rebecca Salganik
'''
import json # we need to use the JSON package to load the data, since the data is stored in JSON format
import numpy as np
import matplotlib.pyplot as pt
from proj1_task1 import splitData
from proj1_task2 import closed_... | luispintoc/Task-1 | proj1_task3.2.py | proj1_task3.2.py | py | 1,938 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "json.load",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.column_stack",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.square",
"line_numb... |
32810013472 | """
This code uses the onnx model to detect faces from live video or cameras.
"""
import os
import time
import random
import cv2
import numpy as np
import onnx
import sys
import pickle as pkl
sys.path.append("..")
from caffe2.python.onnx import backend
import vision.utils.box_utils_numpy as box_utils
from vision.ssd.... | deep-phd/rfb-detector | test/detect_imgs_onnx_without_nms.py | detect_imgs_onnx_without_nms.py | py | 4,231 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.path.append",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "vision.ssd.config.fd_config.define_img_size",
"line_number": 26,
"usage_type": "call"
},
{
"api_nam... |
73737553955 | # -*- coding: utf-8 -*-
"""Config for the Trunk.
"""
__authors__ = "emenager, tnavez"
__contact__ = "etienne.menager@inria.fr, tanguy.navez@inria.fr"
__version__ = "1.0.0"
__copyright__ = "(c) 2020, Inria"
__date__ = "Jun 29 2022"
import sys
import pathlib
sys.path.insert(0, str(pathlib.Path(__file__).parent.absolute... | SofaDefrost/CondensedFEMModel | Models/2Finger/Config.py | Config.py | py | 1,372 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "sys.path.insert",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.path.insert",
"lin... |
73011436194 | import numpy as np
import pandas as pd
import os
import matplotlib.pyplot as plt
import torch
import json
import pycocotools._mask as _mask
import wandb
class DynamicsEvaluator():
def __init__(self, config):
# list of the annotation files for the whole dataset
proposals=os.listdir('CLEVRER/derende... | iROSA-lab/MINT | src/downstream/dynamics_evaluator.py | dynamics_evaluator.py | py | 6,425 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "os.listdir",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.int32",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "numpy.int32",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "numpy.int32",
"line_... |
16878545135 | # -*- coding: utf-8 -*-
import datetime
from openerp import models, fields, api
from openerp.exceptions import Warning
from openerp.tools.translate import _
import logging
class hr_contract(models.Model):
_inherit = "hr.contract"
no_renewal = fields.Boolean('No Renewal', default=False)
@api.multi
de... | TinPlusIT05/tms | addons/app-trobz-hr/trobz_hr_mail_contract_end/model/hr_contract.py | hr_contract.py | py | 5,520 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "openerp.models.Model",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "openerp.models",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "openerp.fields.Boolean",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "openerp... |
41108550582 | import time
import pytest
from gitlabform.gitlabform import GitLabForm
from gitlabform.gitlabform.test import (
create_group,
create_project_in_group,
create_readme_in_project,
get_gitlab,
GROUP_NAME,
)
PROJECT_NAME = "archive_project"
GROUP_AND_PROJECT_NAME = GROUP_NAME + "/" + PROJECT_NAME
@p... | Pigueiras/gitlabform | gitlabform/gitlabform/test/test_archive_project.py | test_archive_project.py | py | 2,990 | python | en | code | null | github-code | 1 | [
{
"api_name": "gitlabform.gitlabform.test.GROUP_NAME",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "gitlabform.gitlabform.test.get_gitlab",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "gitlabform.gitlabform.test.create_group",
"line_number": 22,
... |
18941046063 | from time import sleep
from typing import List
from utils.PageObject import PageObject
PRODUCTS_LINK_SELECTOR = ".product .title > h2 > a"
class WallpapersPage(PageObject):
page_url = "https://avi-home.co.il/product-category/wallpapers/"
def scroll_down(self):
self.driver.execute_script("window.scr... | solomonBoltin/AviDesignScrapping | pages/WallpapersPage.py | WallpapersPage.py | py | 1,233 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "utils.PageObject.PageObject",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 36,
"usage_type": "name"
}
] |
24522986960 | # -*- coding: utf-8 -*-
import time
from fastapi import FastAPI,Request
from .routers import setu
from .db import on_shutdown, on_start
app = FastAPI()
app.include_router(setu.router)
app.on_event("startup")(on_start)
app.on_event("shutdown")(on_shutdown)
@app.middleware("http")
async def add_process_time_header(... | synodriver/asgi-server-benchmark | app/__init__.py | __init__.py | py | 542 | python | en | code | 7 | github-code | 1 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "routers.setu.router",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "routers.setu",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "db.on_start",
... |
33752525086 | # read the dataset
# divide it train test splet 60 to 40
# classfication using svm
# kernel linear and kerneal rbf
# acuuracy and presetion and f1 measure
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.svm import SVC
df = pd.read_csv('./classficationData/classifier.csv') # dat... | tawfik-s/ML-Algo | Quiz/main.py | main.py | py | 1,381 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sklearn.svm.SVC",
"line_number": 16,
"usage_type": "call"
},
{
"api_name... |
19676075192 | from stl import STL, Signal
time_begin = 0 # global begin time
signal = Signal(py_dict={"0": {"content": {"x": 1, "y": 2}},
"1": {"content": {"x": 2, "y": 1}}})
#stl_spec = STL("G[0, 1](0 < x < 1)")
stl_eval = stl_spec.eval(time_begin, signal)
print()
#print("original STL expr: ")
#print(st... | sychoo/STL-API | stl/example/api/stl/weaken2.py | weaken2.py | py | 517 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "stl.Signal",
"line_number": 4,
"usage_type": "call"
}
] |
6493781224 | import socket
import struct
import time
import pytest
from brain_computer_interface.utils import Connection
_DATA = b'Hello, world!'
_HOST = '127.0.0.1'
_PORT = 1234
@pytest.fixture
def server():
server = socket.socket()
server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
server.bind(('0.0.0.... | sahargavriely/the-unbearable-ease-of-programming | tests/test_connection.py | test_connection.py | py | 2,426 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "socket.socket",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "socket.SOL_SOCKET",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "socket.SO_REUSEADDR",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "time.sl... |
33949911726 | # needed imports
from matplotlib import pyplot as plt
from scipy.cluster.hierarchy import dendrogram, linkage
import scipy.cluster.hierarchy as sch
import numpy as np
# This determines the clustering method. Check https://docs.scipy.org/doc/scipy/reference/generated/scipy.cluster.hierarchy.linkage.html#scipy.cluster.h... | Sockenschlauch/Scenario-Software | clustering.py | clustering.py | py | 3,672 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.array",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "scipy.cluster.hierarchy.distance.pdist",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "scipy.cluster.hierarchy.distance",
"line_number": 49,
"usage_type": "attribute"
},
... |
72301148514 | from iota.crypto.types import Seed
from iota.crypto.addresses import AddressGenerator
from iota import Iota
from datetime import datetime
import requests, json, zmq
class Node:
def __init__(self, seed=None):
if seed != None:
self.seed = seed
else:
self.seed = str(Seed.r... | 0xCozart/IOTA-CLI | IotaCli/core/api.py | api.py | py | 3,082 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "iota.crypto.types.Seed.random",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "iota.crypto.types.Seed",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "iota.Iota",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "reques... |
17290104296 | from django.urls import path
from . import views
from .views import Register
urlpatterns = [
path('cart/', views.view_cart, name='cart'),
path('add_to_cart/<int:product_id>/', views.add_to_cart, name='add_to_cart'),
path('remove_from_cart/<int:cart_item_id>/', views.remove_from_cart, name='remove_from_cart... | MAA8007/ecommerce_django | core/urls.py | urls.py | py | 957 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "views.view_cart",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "views.add_to_cart... |
10390872903 |
from sklearn.decomposition import PCA, TruncatedSVD, SparsePCA
from sklearn.feature_extraction.text import CountVectorizer
from mpl_toolkits import mplot3d
from matplotlib import pyplot as plt
import d2v_model
import iterate_docs
import numpy as np
from itertools import accumulate
def get_pca(docs):
pca = PCA(n_c... | mihir-b-shah/time-analyzer | analyze/doc_visualizer.py | doc_visualizer.py | py | 1,264 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sklearn.decomposition.PCA",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "d2v_model.get_d2v_model",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "itertools.accumulate",
"line_number": 16,
"usage_type": "call"
},
{
"api_name":... |
73915914915 | #!/usr/bin/python3
# a simple script, meant to get the 1st initial shell on openAdmin machine from HTB
# Exploit Title: OpenNetAdmin 18.1.1 - Remote Code Execution
# Origin exploit @mattpascoe
# python version @m3dsec
# Software Link: https://github.com/opennetadmin/ona
# Version: v18.1.1
import requests
import json
i... | m3dsec/openNetAdmin18.1.1-SemiShell | openNetAdmin18.1.1_SemiShell.py | openNetAdmin18.1.1_SemiShell.py | py | 948 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "sys.argv",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "requests.post",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_numbe... |
71228823393 | import numpy as np
import cv2
'''include if you want some more information about the needed memory'''
#from memory_profiler import profile
#@profile
def NC():
'''Put file name here'''
input_name = "demo.png"
pic = cv2.imread(input_name,1)
gray = cv2.imread(input_name,0)
height, width, _ = pic.sh... | Jacobcrease/Normalmap-Calculator | NC.py | NC.py | py | 3,977 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "cv2.imread",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.adaptiveThreshold",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "cv2.ADAPTIVE_THRESH_GAUSS... |
19511530507 | """
Created on Jul 24, 2018
@author: ionut
"""
import logging
import datetime
from reach.base import Reach
class ReachGPS(Reach):
"""
GPS client implementation for Reach
"""
def __init__(self, host, port, queue):
Reach.__init__(self, host, port, queue, message_delimiter="\n$GNRMC")
... | BWiebe1/openexcavator | openexcavator/reach/gps.py | gps.py | py | 2,161 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "reach.base.Reach",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "reach.base.Reach.__init__",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "reach.base.Reach",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "logging.w... |
44376704296 | #-------------------------------------------------------------------
#
# Written by Phillip Grabovsky 03/20/2022
# This code is distributed under the GNU LGPL license.
#
# This code graphs the output produced by the Fortran code
# in the Stieltjes project. Fortran writes text files containing numbers
# This grapher re... | YuryGrabovsky/Stieltjes | PythonGrapher.py | PythonGrapher.py | py | 16,120 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "matplotlib.figure.Figure",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "matplotlib.gridspec.GridSpec",
"line_number": 43,
"usage_ty... |
8366309057 | #!/usr/bin/python3
"""new view for State objects"""
from api.v1.views import app_views
from models import storage
from models.state import State
from flask import jsonify, abort, request
@app_views.route(
'/states',
methods=['GET', 'POST'],
strict_slashes=False
)
def states():
""" GET and POST """
... | scan3ls/AirBnB_clone_v3 | api/v1/views/states.py | states.py | py | 1,524 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.request.method",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "models.storage.all",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "models.sto... |
2125778137 | from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from pgportfolio.marketdata.coinlist import CoinList
import numpy as np
import pandas as pd
from pgportfolio.tools.data import panel_fillna
from pgportfolio.constants import *
import sqlite3
from date... | dgeorge1000/portfolio_management_senior_capstone | pgportfolio/marketdata/stockglobaldatamatrix.py | stockglobaldatamatrix.py | py | 3,670 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "datetime.datetime.fromtimestamp",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 47,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.fromtimestamp",
"line_number": 48,
"usage_type": "call"
},
{
... |
40329203690 | import cvxpy as cvp
import numpy as np
from collections import namedtuple
from mayavi import mlab
from mayavi.mlab import points3d, plot3d, quiver3d
import matplotlib.pyplot as plt
"""
http://www.larsblackmore.com/iee_tcst13.pdf
carrying the same assumption here that X is up (i.e. normal to land)
TODO:
- fix q... | heidtn/ksp_autopilot | gfold_test.py | gfold_test.py | py | 7,980 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "collections.namedtuple",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"lin... |
30340972856 | #!/usr/bin/env python
# Requires PyQt5 and compiltion of GUI files via pyuic
from setuptools import setup, Extension
from setuptools.command.build_py import build_py
try:
from pyqt_distutils.build_ui import build_ui
except ImportError:
print("Please install pyqt_distutils")
print( "(sudo) pip(3) install ... | LemmaSoftware/akvo | setup.py | setup.py | py | 2,591 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "setuptools.command.build_py.build_py",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "setuptools.command.build_py.build_py.run",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "setuptools.command.build_py.build_py",
"line_number": 17,
"... |
18481376081 | """
Extract activations from a model, almost completely and shamelessly copied from
https://github.com/dieuwkehupkes/diagnosing_lms/tree/interventions.
"""
# STD
from argparse import ArgumentParser
# EXT
from diagnnose.config.setup import ConfigSetup
from diagnnose.extractors.base_extractor import Extractor
from diag... | Kaleidophon/tenacious-toucan | src/replication/extract.py | extract.py | py | 4,218 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "diagnnose.typedefs.corpus.LabeledSentence",
"line_number": 60,
"usage_type": "name"
},
... |
18444114202 | import os
import sys
os.environ["PYTHONDONTWRITEBYTECODE"] = 'stobbit'
import time
import logging
import datetime
import argparse
import threading
from array import array, typecodes
try:
import pygame
except ImportError as e:
print("Can't import `pygame`. Did you remember to activate the virtual environment?... | joshuatbadger/mmx_combat | __init__.py | __init__.py | py | 14,360 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.environ",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.system",
"line... |
27801575276 | #!/usr/bin/python3
# This software is distributed under the GNU Lesser General Public License (https://www.gnu.org/licenses/lgpl-3.0.en.html)
# WARNING: This is not a software to be used in production. I write this software for teaching purposes.
# TO DO: There lots of things to be done. This is experimental softwar... | esmallah/data_assistant | config_pyqt/ui/pyqt_sqlite.py | pyqt_sqlite.py | py | 11,277 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "os.path.dirname",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "PyQt5.uic.loadUiType",
... |
35423259791 | # Author: Xinyi Wang
# Date: 2021/10/05
import cv2
from PIL import Image
import numpy as np
import pandas as pd
import os
import torch
import torch.nn.functional as F
import torchvision.models as models
import scipy.io as io
import sys
sys.path.append('..')
from utils import *
from cam.scorecam import *
def fsam(vi... | xinyiW915/RVS-resize | src/func/frame_sam.py | frame_sam.py | py | 3,257 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.path.append",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "torch.cuda.empty_cache",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
... |
22351360896 | """
Module to call all API endpoints
Author: Moises Gonzalez
Date: 02/Jul/2023
"""
import requests
import json
import logging
from pathlib import Path
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
URL = "http://127.0.0.1:8000"
with open('config.json', 'r') as f:
config = json.load(... | moicesc/mldevops-dynamic-risk-assessment | apicalls.py | apicalls.py | py | 1,662 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.basicConfig",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "json.load",
... |
34189932533 | import numpy as np
import sys
import scipy.spatial.distance as dist
import pyparticles.forces.force as fr
class VanDerWaals( fr.Force ) :
def __init__(self , size , dim=3 , m=None , Consts=1.0 ):
self.__dim = dim
self.__size = size
self.__C = Consts # Hamaker coefficient ... | simon-r/PyParticles | pyparticles/forces/van_der_waals_force.py | van_der_waals_force.py | py | 987 | python | en | code | 77 | github-code | 1 | [
{
"api_name": "pyparticles.forces.force.Force",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pyparticles.forces.force",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "numpy.zeros",
"line_number": 15,
"usage_type": "call"
},
{
"api_name":... |
24761517333 | from .serializers import *
import logging
from rest_framework import generics, status
from rest_framework.response import Response
from rest_framework_simplejwt.tokens import RefreshToken
logger = logging.getLogger(__name__)
def get_tokens_for_user(user):
refresh = RefreshToken.for_user(user)
return {
... | slalit360/DRF-assignment | account/views.py | views.py | py | 2,047 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "rest_framework_simplejwt.tokens.RefreshToken.for_user",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "rest_framework_simplejwt.tokens.RefreshToken",
"line_number": 11,
... |
11830335032 | import numpy as np
import argparse
import cv2
ap = argparse.ArgumentParser()
ap.add_argument("-i", "--image", required = True, help = "Image pathname")
args = vars(ap.parse_args())
image = cv2.imread(args["image"])
image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
eq = cv2.equalizeHist(image)
cv2.imshow("Histogram Eq... | muhsinali/opencv-book | chapter7/equalize.py | equalize.py | py | 372 | python | en | code | 27 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
... |
8266025936 | from django.contrib import admin
from django.urls import path, include
from Crud import views
urlpatterns = [
path('admin/', admin.site.urls),
path('company/', include('company.urls')),
path('department/', include('department.urls')),
path('employee/',include('employee.urls')),
path('project/',incl... | zala49/CRUD-Django | Crud/urls.py | urls.py | py | 371 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "dja... |
44090219209 | import curses
import sys
import time
if False:
def pbar(window):
for i in range(10):
j = str(i * 10)
window.addstr(
0,
0,
"Time to download "
+ "["
+ ("#" * i)
+ ("-" * (9 - i))
... | Peilonrayz/dota_binds | src/dota_binds/progressbar.py | progressbar.py | py | 756 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "time.sleep",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "curses.wrapper",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "sys.stdout.write",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_num... |
73352650273 | # -*- coding: utf-8 -*-
"""
Created on Fri Mar 11 16:03:50 2022
@author: ethan
"""
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 19 14:05:58 2022
@author: ethan
"""
from datetime import date
from datetime import datetime as dt
from time import time
import math
import numpy as np
import pandas as pd
from scipy imp... | ethanr2/thesis | presentation/charts/charts.py | charts.py | py | 4,003 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "pandas.read_excel",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pandas.read_excel",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "bokeh.plotting.... |
16239791104 | import os
import time
import logging
import os.path as osp
import torch.distributed as dist
def setup_logger(logpth):
logfile = 'Deeplab_v3plus-{}.log'.format(time.strftime('%Y-%m-%d-%H-%M-%S'))
logfile = osp.join(logpth, logfile)
FORMAT = '%(levelname)s %(filename)s(%(lineno)d): %(message)s'
log_lev... | NoamRosenberg/autodeeplab | utils/logger.py | logger.py | py | 1,133 | python | en | code | 306 | github-code | 1 | [
{
"api_name": "time.strftime",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "logging.INFO",
"line_number": ... |
72593883553 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2021/3/28 8:39 下午
# @Author : 宋继贤
# @Description :
# @File : utils.py
# @Software: PyCharm
import torch
import gensim
def build_optimizer(args, model):
optimizer = getattr(torch.optim, args.optim)(
model.parameters(),
lr=args.lr,
... | behome/tianchi | code/utils.py | utils.py | py | 837 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.optim",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "gensim.models.Word2Vec.load",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "gensim.models",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "torch... |
14908687554 | import discord
from discord import app_commands
from discord.ext import commands
from discord.ext import tasks
from discord import ui
import requests
from bs4 import BeautifulSoup
import json
import sqlite3
import os
import asyncio
import twitchio
from twitchio.ext import commands as cmd
import datetime
... | NelsonD2004/Neonbot | main.py | main.py | py | 16,614 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "discord.ext.commands.Bot",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "discord.Intents.all",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "dis... |
39563984867 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2020/12/24 13:57
# @Author : Tian Hao
# @Email : hao.tian@intcolon.cn
# @File : tools.py
# @Software: PyCharm
# @Desc : 时间处理
import calendar
import datetime
from BaiduIndex.tools.DBHelper import DBHelper
def get_time_range_list(start_date, end_date... | CY113/PythonSpider | BaiduIndex/BaiduIndex/tools/tools.py | tools.py | py | 2,033 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 25,
"usage_type": "call"
},
{
"api_... |
195087124 | # encoding: utf-8
"""Test keras.layers.core.Layer.__call__"""
from __future__ import print_function
import unittest
import numpy as np
from numpy.testing import assert_allclose
from keras import backend as K
from keras.layers.core import Dense
from keras.models import Sequential
class TestCall(unittest.TestCase):... | jem0101/BigSwag-SQA2022-AUBURN | TestOrchestrator4ML-main/resources/Data/supervised/GITLAB_REPOS/mynameisfiber@keras/tests/keras/layers/test_call.py | test_call.py | py | 1,532 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "unittest.TestCase",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "keras.layers.core.Dense",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "keras.ba... |
31697017903 | from flask_wtf import FlaskForm
from wtforms import StringField, TextAreaField, validators
class CategoryForm(FlaskForm):
# Minimum in name is only one because some languages such as Japanese can easily have
# one character long words such as ухх as in picture.
name = StringField(
"Category",
... | CrescentKohana/keiji | application/categories/forms.py | forms.py | py | 566 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask_wtf.FlaskForm",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "wtforms.StringField",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "wtforms.validators.Length",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "wtfor... |
32166415006 | """Tool for sorting imports alphabetically, and automatically separated into sections."""
import argparse
import functools
import json
import os
import sys
from gettext import gettext as _
from io import TextIOWrapper
from pathlib import Path
from typing import Any, Dict, List, Optional, Sequence, Union
from warnings i... | PyCQA/isort | isort/main.py | main.py | py | 46,907 | python | en | code | 6,145 | github-code | 1 | [
{
"api_name": "logo.ASCII_ART",
"line_number": 52,
"usage_type": "name"
},
{
"api_name": "settings.Config",
"line_number": 76,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 80,
"usage_type": "name"
},
{
"api_name": "exceptions.FileSkipped",
... |
535490489 | import requests
from bs4 import BeautifulSoup
import smtplib
import email.message
Req = "https://store.playstation.com/pt-br/product/UP0082-PPSA10664_00-FF16SIEA00000002"
#Substituir o "browserA' pelo seu Browser agent > https://www.whatismybrowser.com/detect/what-is-my-user-agent/
headers = {'User-Agent': ... | Marcos-SL/FFXVI-price-monitor | FFXVImonitor.py | FFXVImonitor.py | py | 1,685 | python | pt | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "email.message.message.Message",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "email.me... |
16149837506 | from pygame import mixer # for audio playing
from tkinter import * # for gui
import os
from mutagen.mp3 import MP3 # extracting metadata from file
import tkinter.messagebox # for messages showing error for example
from tkinter import filedialog
from tkinter import ttk
from ttkthemes import themed_tk as t... | MartinKalchev/Music-Player | main.py | main.py | py | 8,410 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "ttkthemes.themed_tk.ThemedTk",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "ttkthemes.themed_tk",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "tkinter.ttk.Label",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "tk... |
14760350365 | try:
import importlib.resources as pkg_resources
except ImportError:
# Try backported to PY<37 `importlib_resources`.
import importlib_resources as pkg_resources
import pandas as pd
from worldcereal import resources
def load_refid_lut():
with pkg_resources.open_text(resources, 'CIB_RefIdLUT.csv') as... | WorldCereal/worldcereal-classification | src/worldcereal/classification/weights.py | weights.py | py | 1,057 | python | en | code | 12 | github-code | 1 | [
{
"api_name": "importlib_resources.open_text",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "worldcereal.resources",
"line_number": 13,
"usage_type": "argument"
},
{
"api_name": "pandas.read_csv",
"line_number": 14,
"usage_type": "call"
}
] |
71496463393 | import numpy as np
from scipy.optimize import root_scalar
from scipy.optimize import fsolve
class sieplasma(object):
def __init__(self, theta_E_g, eta, zl, c, Dl, Ds, Dls, psi0_plasma_num, theta_0_num, B, C, delta_rs, deltab_10, deltab_20):
self.theta_E_g = theta_E_g
self.eta = eta
self.ps... | everettiantomi/plasmalens | perturbative/validity_class.py | validity_class.py | py | 3,938 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.exp",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "scipy.optimize.root_scalar",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.sin",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line... |
28443403720 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# @Time : 2021/8/6 上午10:04
# @Author : PeiP Liu
# @FileName: BertModel.py
# @Software: PyCharm
import torch
import torch.nn as nn
from torch.nn import LayerNorm as BertLayerNorm
import sys
sys.path.append("..")
import torch.nn.functional as F
class BERT_SC(nn.Module):
... | LiuPeiP-CS/BertSeqC4Vul | Bert/BertModel.py | BertModel.py | py | 4,238 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.path.append",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Module",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"li... |
17847458843 | from twisted.trial.unittest import TestCase
from twisted.python.filepath import FilePath
from epsilon.extime import Time
from nevow import loaders, rend
from nevow.testutil import renderPage, renderLivePage
from axiom.store import Store
from axiom.dependency import installOn
from xmantissa.people import Person, Ema... | rcarmo/divmod.org | Quotient/xquotient/test/test_rendering.py | test_rendering.py | py | 6,301 | python | en | code | 10 | github-code | 1 | [
{
"api_name": "xquotient.test.test_inbox.testMessageFactory",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "epsilon.extime.Time",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "epsilon.extime.Time",
"line_number": 33,
"usage_type": "call"
},
{
... |
670609188 | import pandas as pd
import argparse
import json
# Creates json file with the number of times each hot topic appears in the annotaed file
parser = argparse.ArgumentParser()
parser.add_argument('-o', '--outfile')
parser.add_argument('-i', '--coded_file', required=True)
args = parser.parse_args()
# "Hot Topics"
result =... | BrendaNamuh/COMP598-UniversityHotTopics | src/analyze.py | analyze.py | py | 988 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 29,
"usage_type": "call"
}
] |
18461666541 | from flask import Flask, jsonify, request
from calculation import Calc
app = Flask(__name__)
@app.route('/get_time', methods=['POST'])
def give_res():
do = Calc()
answer_dict = {}
n = 1 # переменная для нумерации ответов в словаре answer_dict
for i, test in enumerate(request.json): ... | Dortov/Web-API | app.py | app.py | py | 921 | python | ru | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "calculation.Calc",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.request.json",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
... |
20567576086 | import matplotlib.pyplot as plt
import numpy as np
def loadData(fileName):
"""加载数据:解析以tab键分隔的文件中的浮点数
Args:
fileName : 数据集文件
Returns:
dataMat : feature 对应的数据集
labelMat : feature 对应的分类标签,即类别标签
"""
# 获取样本特征的总数,不算最后的目标变量
numFeat = len(open(fileName).readli... | yijunquan-afk/machine-learning | basic-learn/05-regression/code/Regression4.py | Regression4.py | py | 3,509 | python | zh | code | 1 | github-code | 1 | [
{
"api_name": "numpy.eye",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "numpy.shape",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.det",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"line_numbe... |
8742949407 | #!/usr/bin/env env/bin/python
import argparse
import mido
from timeit import default_timer as timer
PROG_NAME = 'rmidi'
PROG_DESCRIP = 'record midi data from given input to given file'
DEFAULT_INPUT = 'KeyLab mkII 61:KeyLab mkII 61 MIDI'
DEFAULT_BPM = 120
SECONDS_PER_MIN = 60
def get_cmd_args():
parser = argpar... | erickak/audiotools | rmidi/src/main.py | main.py | py | 3,066 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "mido.get_input_names",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "timeit.default_timer",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "mid... |
75059026592 | import triton
import triton.language as tl
def conv2d_forward_config(
BLOCK_SIZE_BATCH_HEIGHT_WIDTH: int,
BLOCK_SIZE_IN_FEAT: int,
BLOCK_SIZE_OUT_FEAT: int,
n_warps: int = 4,
n_stages: int = 2,
) -> triton.Config:
"""
Creates a triton.Config object for conv2d_forward_kernel
given m... | BobMcDear/attorch | attorch/conv_kernels.py | conv_kernels.py | py | 9,935 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "triton.Config",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "triton.Config",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "triton.language.constexpr",
"line_number": 67,
"usage_type": "attribute"
},
{
"api_name": "trito... |
38018655263 | import os
import h5py
import torch
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from collections import Counter
def write(data, gts, outfile):
'''
This function writes the pre-processed image data to a HDF5 file
Args:
data: numpy.array, ima... | buchholzmd/SharkBehaviorClassification | datasets/utils.py | utils.py | py | 5,524 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "h5py.File",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_num... |
16988033518 | from django.http import JsonResponse
from jam.spotify_api import url_argument_parse
import pitchfork
import re
import urllib
try:
import urllib.request as urllib2
except ImportError:
import urllib2
#######################
# PITCHFORK API WRAPPER
#######################
def search(request, artist, album):
... | cartev/Jam | jam/pitchfork_api.py | pitchfork_api.py | py | 1,079 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "pitchfork.search",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "jam.spotify_api.url_argument_parse",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.http.JsonResponse",
"line_number": 19,
"usage_type": "call"
},
{
"api_... |
22674612731 | # -*- coding: utf-8 -*-
import sys
from nltk.tag import StanfordNERTagger
from nltk.tokenize import word_tokenize
from sklearn.metrics import precision_recall_fscore_support as score
def computeStatistics(expected_tags, generated_tags):
unique_tags = list()
floatFormat = "{:.2f}"
for tag in generated_tags:
i... | YashashreeKolhe/Natural-Language-Processing | 111508041_Assign5/111508041_Assign5-Code.py | 111508041_Assign5-Code.py | py | 2,372 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sklearn.metrics.precision_recall_fscore_support",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "nltk.tokenize.word_tokenize",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 52,
"usage_type": "attribute"
},
... |
71345725154 | from .models import BookModel, AuthorModel
from django import forms
import re
from django.utils.translation import gettext_lazy as _
from django.core.exceptions import ValidationError
import datetime
class BookCreateForm(forms.Form):
authors = forms.CharField(max_length=100, required=True, widget=forms.TextInput(... | cyber-tatarin/booka | books/forms.py | forms.py | py | 3,799 | python | ru | code | 0 | github-code | 1 | [
{
"api_name": "django.forms.Form",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.forms.CharField",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.forms... |
26582542421 | import subprocess
import warnings
import sys
import numpy as np
from datetime import datetime
#---------------------------------------------------------------------------------------#
# Dics and Colors
#---------------------------------------------------------------------------------------#
Dic_Keys = {0:'energy'... | TB-IKP/CBSplot | CBSplot/CBS_commands.py | CBS_commands.py | py | 9,902 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "warnings.warn",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "warnings.warn",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "warnings.warn",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "warnings.warn",
"line_n... |
14366329848 | '''
@autor Simone Lima
'''
import pandas as pd
from .files import AppFilesPath
from domain.app.models import VersionModel, ReleaseNoteModel, ReleaseNoteType
from domain.utils.check_value_utils import CheckValuesUtils
from domain.utils.file_utils import CSVColumnsName, CSV_EXTENSION
from django.db import transaction
cl... | slimaElixir/restaurante | domain/app/services/versions.py | versions.py | py | 3,239 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "domain.app.models.VersionModel.objects.find_all",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "domain.app.models.VersionModel.objects",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "domain.app.models.VersionModel",
"line_number": 1... |
27177815209 | """
datasets.py
"""
import numpy as np
import pandas as pd
from collections import namedtuple
from gensim.corpora import Dictionary
# Load two dictionary
dct = Dictionary.load_from_text("vocab.txt")
def doc2bow(morphemes):
""" Converrt strings with non filtered dictionary to vector
:param morphemes: morphemes... | pytry3g/pytorch-example | nlp/classification/ldcc/datasets.py | datasets.py | py | 1,190 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "gensim.corpora.Dictionary.load_from_text",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "gensim.corpora.Dictionary",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "pandas.read_csv",
"line_number": 29,
"usage_type": "call"
},
{
... |
2378264148 | import cv2
from matplotlib import pyplot as plt
import numpy as np
input_image = "Prasanna.png"
def display_save(display_name, file_name, img):
cv2.imshow(display_name, img)
cv2.waitKey(0)
cv2.destroyAllWindows()
cv2.imwrite(file_name, img)
def grayscale():
img = cv2.imread(input_image, cv2.IMREA... | ppartha2018/ComputerVision---Projects | BasicTransformations/Transformations.py | Transformations.py | py | 3,122 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "cv2.imshow",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.destroyAllWindows",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.imwrite",
"line_nu... |
27894651886 | import streamlit as st
from PIL import Image
import random
import pandas as pd
def app():
image = Image.open('./picture/khtn.PNG')
st.image(image, width=500)
st.markdown("------")
st.markdown("""
<style>
.big-font {
font-size:80px !important;
}
</style>
""", unsafe_allow_html=True)
... | johnluk0092/leesson1 | webs/lesson18.py | lesson18.py | py | 5,335 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PIL.Image.open",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "streamlit.image",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "streamlit.markdown",
"line_... |
12039630568 | # -*- coding: utf-8 -*-
"""
Created on 02/17/2019
NSC - AD440 CLOUD PRACTICIUM
@author: Dao Nguyen
Changed ownership on 03/01/2019
@author: Michael Leon
"""
import urllib.request
import re
import os
import json
import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import selenium.... | ActoKids/web-crawler | scripts/browserCrawler/SSScraper.py | SSScraper.py | py | 6,625 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "boto3.resource",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "urllib.request... |
14932230430 | """Unit tests for metrics module."""
from ldp.utils import linalg
import torch
import torch.linalg
def test_effective_rank():
"""Test effective_rank matches intuition."""
matrix = torch.diag(torch.tensor([100, 100, 1e-6]))
actual = linalg.effective_rank(matrix)
assert torch.allclose(torch.tensor(actu... | evandez/low-dimensional-probing | tests/utils/linalg_test.py | linalg_test.py | py | 1,459 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "torch.diag",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torch.tensor",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "ldp.utils.linalg.effective_rank",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "ldp.utils.lin... |
74541216032 | import os
import tornado
import importlib
from ..base.handlers import default_handlers as default_base_handlers
from ..services.kernels.pool import ManagedKernelPool
from .cell.parser import APICellParser
from .swagger.handlers import SwaggerSpecHandler
from .handlers import NotebookAPIHandler, parameterize_path, Noteb... | jupyter-server/kernel_gateway | kernel_gateway/notebook_http/__init__.py | __init__.py | py | 6,877 | python | en | code | 459 | github-code | 1 | [
{
"api_name": "traitlets.config.configurable.LoggingConfigurable",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "traitlets.Unicode",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 29,
"usage_type": "call"
},
{
"api... |
73981839393 | from django.urls import path
from .views import (case_detail, add_case, update_case,
delete_case, add_task,upload_files,
new_case, pending_list, completed_list, CaseList, CaseCreateView, CategoryListView,
delete_cat, cat_update, cat_add, add_argument, cat_de... | succeed98/Lawyer | cases/urls.py | urls.py | py | 11,114 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "views.CaseList.as_view",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "views.CaseList",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "django.urls.pa... |
70645888353 | import os
import csv
from PIL import Image
import torch
from torch.utils.data import Dataset
from typing import Any, Callable, Optional, Tuple
class Emotions(Dataset):
def __init__(self, cvs_file, root_dir, transform=None):
self.root_dir = root_dir
self.transform=transform
data_file=os.path... | jump-orange/coms453-project | data.py | data.py | py | 1,167 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "torch.tensor",
... |
38418811597 | #!/usr/bin/env python
# coding: utf-8
# Data Analysis of Unemployment in India
# In[1]:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import plotly.express as px
# In[2]:
# importing the given dataset
df = pd.read_csv("C:/Users/ASUS/Downloads/Unemployment in India.c... | shrutiiiyadav/UNEMPLOYMENT-IN-INDIA-ANALYSIS-TASK2 | Unemployment in India Analysis.py | Unemployment in India Analysis.py | py | 2,761 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 89,
"usage_type": "call"
},
{
"api_name": "matplotlib.p... |
71919922594 | # Read text from a file, and count the occurence of words in that text
# Example:
# count_words("The cake is done. It is a big cake!")
# --> {"cake":2, "big":1, "is":2, "the":1, "a":1, "it":1}
from collections import Counter
import re
def read_file_content(filename):
# Reading the text file
with op... | Hephzihub/Python | Reading-Text-Files/main2.py | main2.py | py | 610 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "re.sub",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 23,
"usage_type": "call"
}
] |
43684655986 | import math
import string
from nltk.corpus import stopwords
from collections import Counter
from nltk.stem.porter import *
from sklearn.feature_extraction.text import TfidfVectorizer
import jieba
def tfidf_calc(text, corpus, k, file_path):
# corpus = ['This is the first document.',
# 'This is the se... | henry-nju/- | main-match.py | main-match.py | py | 2,000 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sklearn.feature_extraction.text.TfidfVectorizer",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "jieba.cut",
"line_number": 30,
"usage_type": "call"
}
] |
6484753583 | """
@Time : 2021/1/31 18:23
@Author : Steven Chen
@File : 8.selenium_cookies.py
@Software: PyCharm
"""
# 目标:
# 方法:
from selenium import webdriver
url = 'https://www.baidu.com'
driver = webdriver.Chrome()
driver.get(url)
cookies = {data["name"]: data["value"] for data in driver.get_cookies()}
print(cookies)
| PandaCoding2020/pythonProject | SpiderLearning/3.selenium/8.selenium_cookies.py | 8.selenium_cookies.py | py | 325 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 13,
"usage_type": "name"
}
] |
21701900747 | from decimal import Decimal
from django.contrib.gis.db.backends.base import BaseSpatialOperations
from django.contrib.gis.db.backends.util import SpatialFunction
from django.contrib.gis.geometry.backend import Geometry
from django.contrib.gis.measure import Distance
from django.utils import six
from sql_server.pyodbc.... | condense/django-pyodbc-gis | django_pyodbc_gis/operations.py | operations.py | py | 11,306 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "django.contrib.gis.db.backends.util.SpatialFunction",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "django.contrib.gis.db.backends.util.SpatialFunction",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "decimal.Decimal",
"line_number": 72,
... |
24666495868 | # coding:utf-8
import serial
import time
import atexit
import signal
class Laser(object):
def __init__(self, com):
self.rate = 230400
self.com = com
self.port = serial.Serial(port=self.com, baudrate=self.rate, timeout=2)
self.stop_cmd = b'e'
self.start_cmd = b'b'
... | reece15/hls_flcd2_python | Laser.py | Laser.py | py | 3,261 | python | en | code | 10 | github-code | 1 | [
{
"api_name": "serial.Serial",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "atexit.register",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "signal.signal",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "signal.SIGINT",
"line... |
2929396805 | from PyQt5 import QtCore, QtGui, QtWidgets
import os
import ctypes
from PyQt5.QtCore import QCoreApplication
import threading
from time import sleep
from PyQt5.QtGui import QCursor, QWindow
from PyQt5.QtCore import Qt, QPoint
from PyQt5.QtWidgets import (QMessageBox,QApplication, QWidget, QToolTip, QPushButton,... | ipys/jopmanage | SystemDatabase.py | SystemDatabase.py | py | 5,703 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PyQt5.QtCore.Qt.FramelessWindowHint",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtCore.Qt",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCore.Qt.WindowSystemMenuHint",
"line_number": 19,
"usage_type": "attribu... |
7611745222 | import gui
import pygame, sys
from pygame.locals import *
from tkinter import filedialog
WINDOW_DIMENSIONS = (700, 500)
BLACK = (0, 0, 0)
main_clock = pygame.time.Clock()
pygame.init()
pygame.display.set_caption('Play Aid!')
window = pygame.display.set_mode(WINDOW_DIMENSIONS, 0, 32)
font = pygame.font.SysFont("comics... | daveymclain/play_aid_app | main.py | main.py | py | 1,890 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pygame.time.Clock",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pygame.time",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pygame.init",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_capti... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.