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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
41410074028 | ##################################################################################
# EXIF情報を編集する
#
# 設定可能項目(設定例)
# - レンズメーカー
# - Asahi Optical
# - Canon
# - レンズモデル
# - Super Takumar 55mm f/1.8
# - 焦点距離
# - 55
# - F値
# - 1.8
# - 4.0
#################################################... | ryhoh/exifedit | exifedit.py | exifedit.py | py | 2,931 | python | ja | code | 0 | github-code | 6 | [
{
"api_name": "PIL.Image.open",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "piexif.load",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "piexif.dump",
"line_number":... |
44678119987 | import asyncio
async def async_worker(seconds):
print('Sleep using {}'.format(seconds))
await asyncio.sleep(seconds)
print('Done sleep: {}'.format(seconds))
async def stop_event_loop(loop, seconds):
print('Stop in {}s'.format(seconds))
await asyncio.sleep(seconds)
loop.stop()
print('Stop... | Krimets/Python-Developer-CyberBionic-Systematics | adv/5 asyncio, aiohttp, gevent, Tornado, Twisted/005_examples/example6_event_loop.py | example6_event_loop.py | py | 1,739 | python | uk | code | 0 | github-code | 6 | [
{
"api_name": "asyncio.sleep",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "asyncio.sleep",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "asyncio.sleep",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "asyncio.get_event_loop",
... |
11595007155 | # Web crawl
# Use shutil, urllib , requests , bs4 , urllib.parse
import urllib.request
import shutil
import requests
from urllib.parse import urljoin
from bs4 import BeautifulSoup
def make_soup(url):
req = urllib.request.Request(url, headers={'User-Agent' : "Mozilla/5.0"}) #This class is an abstraction ... | tvanh239/image-crawl | downimg.py | downimg.py | py | 1,798 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "urllib.request.request.Request",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "urllib.request",
"line_number": 9,
"usage_type": "name"
},
{
"api_name":... |
28463881480 | #高阶函数
l = [1,2,3,4,5,6,7,8,9]
new_list = []
def fun(func,i):
for n in i:
if func(n):
new_list.append(n)
return new_list
def fun1(i):
if i % 3 == 0:
return True
return False
def fun2(i):
if i % 2 != 0:
return True
return False
print(fun(fun2,l))
f = lambda x... | hy546880109/python_study | Higher_order_function.py | Higher_order_function.py | py | 726 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "functools.reduce",
"line_number": 42,
"usage_type": "call"
}
] |
43574730475 | import unittest
import sys
import time
from importlib import reload
from geopmdpy import topo
from geopmdpy import pio
from geopmdpy import gffi
class TestPIO(unittest.TestCase):
def setUp(self):
reload(gffi)
reload(topo) # Ensures that the mocked dlopen call does not leak into this test
re... | geopm/geopm | service/geopmdpy_test/TestPIO.py | TestPIO.py | py | 1,791 | python | en | code | 79 | github-code | 6 | [
{
"api_name": "unittest.TestCase",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "importlib.reload",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "geopmdpy.gffi",
"line_number": 11,
"usage_type": "argument"
},
{
"api_name": "importlib.re... |
37342056901 | from github import Github
import os
import errno
import requests
def exist_page(url):
# check if a web page exists
# returns [true , web content] if successes
# otherwise returns [false, error] if it fails
import requests
output = []
try:
pointer = requests.get(url)
if p... | smart-data-models/data-models | utils/20_create_spec_v11.0.py | 20_create_spec_v11.0.py | py | 25,981 | python | en | code | 94 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "urllib.parse.parse.quote",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "urllib.parse.parse",
"line_number": 79,
"usage_type": "attribute"
},
{
"api_name": "urllib.... |
30971884035 | from lxml import etree
from pkg_resources import resource_exists
from pkg_resources import resource_stream
from plone import api
from plone.namedfile.file import NamedBlobImage
from tempfile import TemporaryDirectory
from urllib.parse import unquote
import logging
import requests
import urllib.request
BASE_URL = "ht... | euphorie/osha.oira | src/osha/oira/upgrade/to20.py | to20.py | py | 3,857 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "plone.api.portal.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "plone.api.portal",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "plone.ap... |
34833325244 | import PyPDF2
import matplotlib.pyplot as plt
from collections import Counter
file = open('GEMS_FINAL_SCRIPT.pdf', 'rb')
fileReader = PyPDF2.PdfFileReader(file)
words = ''
for page in range(fileReader.numPages):
pageObj = fileReader.getPage(page)
words += pageObj.extractText()
Counter = Counter(words.lower()... | James-Rocker/py-uncut-gems | pydf_reader.py | pydf_reader.py | py | 406 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "PyPDF2.PdfFileReader",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "collections.Counter.most_common",
"line_number": 14,
"usage_type": "call"
},
{
"api_name"... |
31048750786 | #!/usr/bin/env python3
import base64
import requests
import newrelic.agent
import boto3
from botocore.exceptions import ClientError
newrelic.agent.initialize('newrelic.ini')
app = newrelic.agent.register_application()
def get_secret():
secret_name = "platform/azuredevopstonewrelic/adopoolsstatuspat"
region_n... | partofaplan/pylab | ado_pool_status_call/ado_pool_status_call.py | ado_pool_status_call.py | py | 5,012 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "newrelic.agent.agent.initialize",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "newrelic.agent.agent",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "newrelic.agent",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": ... |
23224826679 | #!/usr/bin/python3
import json, os, bs4
from datetime import datetime
from PIL import Image
tag_colors = {
"lang": ["#4aa54a", "#fff"],
"hardware": ["#4aa54a", "#fff"],
"status-bad": ["#c55", "#fff"],
"status-good": ["#3f9fc6", "#fff"]
}
def parse(args, target, soup, workdir, out_dir):
source_inf... | kholland4/kholland4.github.io | build-tools-py/template_tiles.py | template_tiles.py | py | 5,533 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number":... |
5931394958 | import cv2
import numpy as np
# Create a VideoCapture object to capture frames from the webcam
capture = cv2.VideoCapture(0)
# Check if the webcam is opened successfully
if not capture.isOpened():
print("Unable to open webcam")
exit()
# Loop over frames from the webcam
while True:
# Read a frame from the... | dahanam/ApplyAI_FoundationRecommender | test7.py | test7.py | py | 1,682 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.rectangle",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line_numb... |
1664019380 | import sys
import win32com.client
from PyQt5 import QtWidgets, QtCore
from PyQt5.QtWidgets import QMainWindow, QApplication
from gui_01 import Ui_MainWindow
import os
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication, QTableView
from PyQt5.QtGui import QPalette, QColor
import datetime
from ... | KCO177/Automatic-claim-administration | run_gui.py | run_gui.py | py | 5,276 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "gui_01.Ui_MainWindow",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QApplication",
"line_number": 15,
"usage_type": "call"
},
{
"api... |
48066371 | from typing import *
from collections import deque
class Solution:
def numOfMinutes(self, n: int, headID: int, manager: List[int], informTime: List[int]) -> int:
management = {}
for i, m in enumerate(manager):
management[m] = management.get(m,[])
management[m].append(i)
... | code-cp/leetcode | solutions/1376/main.py | main.py | py | 964 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.deque",
"line_number": 10,
"usage_type": "call"
}
] |
6474810045 | from __future__ import annotations
from os import umask
from typing import Dict, List, Iterator, Iterable
from collections import defaultdict
import itertools
def to_binary(value: int, num_digits: int = 36) -> str:
return f"{value:36b}".replace(" ", "0")
def apply_mask(value: int, mask: str) -> int:
outdigits... | joelgrus/advent2020 | advent2020/day14_v2.py | day14_v2.py | py | 2,620 | python | en | code | 29 | github-code | 6 | [
{
"api_name": "itertools.product",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "typing.Iterator",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "collections.defaultdict... |
20396762470 | '''
Created on Aug 30, 2020
@author: I054127
'''
# if __name__ == '__main__':
# pass
import pandas as pd
from sklearn.tree import DecisionTreeRegressor
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_split
from sklearn.metrics import classification_... | SAP-samples/cloud-platform-ml-deploy | main.py | main.py | py | 2,864 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sklearn.tree.DecisionTreeRegressor",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 50,
"usage_type": "call"
}... |
73815088186 | from django.db import models
from django.utils.translation import gettext_lazy as _
from django.contrib.contenttypes.models import ContentType
from payment.banks.paymentstatuses import PaymentStatus
from payment.banks.paymentstatuses import BankType
class PaymentRecord(models.Model):
order = models.ForeignKey(
... | Python-Crew/base_drf | payment/models.py | models.py | py | 1,745 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "django.db.models.Model",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.db.models.ForeignKey",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": ... |
39961441780 | #!/usr/bin/env python
# -*-coding: utf-8 -*-
import zmq
server_ip = '127.0.0.1'
def get_sub_socket(port):
context = zmq.Context()
socket = context.socket(zmq.SUB)
socket.connect('tcp://'+server_ip+':'+str(port))
socket.setsockopt(zmq.SUBSCRIBE, b'')
return socket
def get_pub_socket(port):
... | 6VV/vr-robot-back | robot/remote.py | remote.py | py | 452 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "zmq.Context",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "zmq.SUB",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "zmq.SUBSCRIBE",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "zmq.Context",
"line_n... |
74414191228 | import numpy as np
import time
from .dataset import Dataset
class NeuronLayer:
def __init__(self,
number_of_neurons,
inputs_connected_to_each_neuron):
# Dimension of the weight matrix
shape = (
inputs_connected_to_each_neuron,
number_of_neu... | ananno/DeepLearning | PatternRecognition/MultiLayerApproach/MultiLayerNetwork.py | MultiLayerNetwork.py | py | 3,711 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.random.random",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "dataset.Dataset",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
... |
74810943226 | from setuptools import setup, find_packages, Command
import os
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.md')).read()
NEWS = open(os.path.join(here, 'NEWS.txt')).read()
version = '0.1.3'
install_requires = [
'DataSounds',
'numpy'
]
class PyTest(Command):
... | DataSounds/OceanSound | setup.py | setup.py | py | 1,588 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "os.path.abspath",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_nu... |
70181327227 | # https://www.tugraz.at/index.php?id=22387
import csv
import os
import shutil
from urllib.parse import unquote, urlparse
import numpy as np
import supervisely as sly
from cv2 import connectedComponents
from dotenv import load_dotenv
from PIL import Image
from supervisely.io.fs import (
dir_exists,
file_exists... | dataset-ninja/semantic-drone | src/convert.py | convert.py | py | 4,140 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "supervisely.Api",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "numpy.int32",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "numpy.unique",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "numpy.split",
... |
44680333924 | import hittable
import hittable_list
from utils import random_int
import ray
import vec3
import aabb
class bvh_node:
def __init__(self, scr_objects: hittable_list, time0: float, time1: float):
# Create a modifiable array of the source scene objects
self.obj_lst = scr_objects
self... | Yunchun/Ray-Tracing | bvh_node.py | bvh_node.py | py | 2,742 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "utils.random_int",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "aabb.surrounding_box",
"line_number": 54,
"usage_type": "call"
}
] |
23503978666 | from flask import g
from flask_api import errors
from random import SystemRandom
from werkzeug._compat import range_type
_sys_rng = SystemRandom()
GEN_NUMBERS = '0123456789'
def update_if_set(item, fields, ignore_fields=[]):
for name in fields:
if name in g.api.json and name not in ignore_fields:
... | markflorence728/Flask-Angular-Base-structure | backend/main/api/tools.py | tools.py | py | 880 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "random.SystemRandom",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.g.api",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "flask.g",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "flask.g.api",
"line_n... |
26483242551 | import requests
import json
import time
import os
import pandas as pd
from datetime import datetime
#Variaveis globais
pct_urnasApuradas = ''
t=5
current_time = datetime.now().strftime("%H:%M:%S")
while(True):
try:
#endpoint site tse com resultado das apuracoes
url = 'https://resultados.tse.jus... | marcussilverio/Eleicao | Resultado_2t.py | Resultado_2t.py | py | 1,987 | python | pt | code | 2 | github-code | 6 | [
{
"api_name": "datetime.datetime.now",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "json.loads",
... |
3763273860 | from copy import copy
from typing import List
import argparse
class CSP:
########################################
# #
# Initialization #
# #
########################################
def __init__(s... | danielorlando97/golang-solution-problem | python/Puzzle/script.py | script.py | py | 8,025 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "copy.copy",
"line_number": 126,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 217,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 228,
"usage_type": "name"
}
] |
34652315136 | import math
import functools
import numpy as np
from .crystal_comparator import CrystalComparator
from .subgroup_enumeration import (enumerate_subgroup_bases,
get_subgroup_elements)
def reduce_gcd(x):
return functools.reduce(math.gcd, x)
class CrystalReducer:
def __init__... | pmla/evgraf | evgraf/crystal_reducer.py | crystal_reducer.py | py | 2,716 | python | en | code | 13 | github-code | 6 | [
{
"api_name": "functools.reduce",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "math.gcd",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "crystal_comparator.CrystalComparator",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "n... |
2737985736 | from cs50 import SQL
from flask import Flask, flash, redirect, render_template, request, session, url_for, jsonify
from flask_session import Session
from passlib.apps import custom_app_context as pwd_context
from tempfile import mkdtemp
import datetime, requests, json, xml.etree.ElementTree, urllib
from helpers import ... | iakirca/BSc-IS | Project_Filmsite-master/application.py | application.py | py | 44,933 | python | nl | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tempfile.mkdtemp",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "flask_session.Session",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "cs50.SQL",
"li... |
32627737754 | import unittest
import pandas as pd
from IPython.core.interactiveshell import InteractiveShell
from nl2pandas.backend.pandas_generator.context.context import Context
from nl2pandas.backend.pandas_generator.definitions import TEST_DATABASE_PATH
from nl2pandas.backend.pandas_generator.manager.manager import PandasManage... | SmoKSmoKk/Memory-NLI | src/nl2pandas/backend/test/pandas_generator/pandas_manager/test_pandas_manager.py | test_pandas_manager.py | py | 5,023 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "unittest.TestCase",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "IPython.core.interactiveshell.InteractiveShell.instance",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "IPython.core.interactiveshell.InteractiveShell",
"line_number"... |
31915070741 | from sbwrapper import Trial
from breedstrats import random_selection, phenotypic_selection
import networkx as nx
from networkx.drawing.nx_agraph import graphviz_layout
import numpy as np
from matplotlib import pyplot as plt
from joblib import dump
from csv import writer
import os
from shutil import rmtree
def generat... | jubbens/popmodels | simpop_random.py | simpop_random.py | py | 6,622 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "networkx.DiGraph",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "networkx.DiGraph",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "sbwrapper.Trial",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "breedstrats.phenoty... |
70730451707 | from portfolio.celery import app
from exchange_rates.models import *
import requests
@app.task
def update_currencies_info():
request = requests.get('https://www.nbrb.by/api/exrates/rates?periodicity=0')
if request.status_code == 200:
for currency_db in Currency.objects.all():
for cur_nb in request.json()... | chur4hella/main_portfolio | portfolio/portfolio/tasks.py | tasks.py | py | 510 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "portfolio.celery.app.task",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "portfolio.celery.app",
"line_number": 5,
"usage_type": "name"
}
] |
40561188085 | import os
import math
import torch
import pickle
import random
import json
import yaml
import numpy as np
import re
import operator
import functools
from torch.optim.lr_scheduler import _LRScheduler
class CosineAnnealingWarmUpRestarts(_LRScheduler):
def __init__(
self, optimizer, T_0, T_mu... | YuJungHeo/kbvqa-public | utils.py | utils.py | py | 5,581 | python | en | code | 31 | github-code | 6 | [
{
"api_name": "torch.optim.lr_scheduler._LRScheduler",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "math.cos",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "math.pi",
"line_number": 51,
"usage_type": "attribute"
},
{
"api_name": "math.log"... |
35314055256 | import cv2
import numpy as np
import matplotlib.pyplot as plt
import tkinter as tk
from tkinter import Tk, Label, Button, ttk
from scipy import signal
import scipy.fftpack as fp
from skimage.draw import disk
class VentanaInicio:
def __init__(self, master):
self.master = master
master.titl... | KarolLMedina/ProyectoInterfaz | Proyecto.py | Proyecto.py | py | 2,992 | python | es | code | 0 | github-code | 6 | [
{
"api_name": "tkinter.Label",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tkinter.Button",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "tkinter.Button",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "tkinter.Tk",
"line_nu... |
71781176189 | # example by "harshgtm01"
import cv2
import matplotlib.pyplot as plt
# read the image
image = cv2.imread(r'../../../../../assets/original.jpg')
# convert it to grayscale image
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
# Using canny edge detector to detect image edges
edges = cv2.Canny(gray, 30, 100) # ... | yptheangel/opencv-starter-pack | python/examples/edge-detection/canny-edge-detection/example2/edge_detector.py | edge_detector.py | py | 687 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "cv2.imread",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "cv2.Canny",
"line_... |
29017039631 | import requests
from __tests__.e2e.api.endpoint import API_BASE_URL
def testResetTests():
print("person resetTests():")
response = requests.post(
f"{API_BASE_URL}/tests/reset"
)
assert response.status_code < 300, f"failure: {response.status_code}, {response.json()}"
def testAll():
print("p... | jazzhammer/jitgurup | __tests__/e2e/api/person/test_post_person.py | test_post_person.py | py | 779 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.post",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "__tests__.e2e.api.endpoint.API_BASE_URL",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "requests.post",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "__t... |
21319109562 | import serial
import struct
import sys
from camera import Camera
import numpy as np
from controller import PID_Controller
import random
class Bluetooth():
def __init__(self, comport, baud_rate, id, timeout=0):
self.comport = comport
self.baud_rate = baud_rate
self.timeout = timeout
... | Morris88826/STM32_Live_Stream_Car | user_interface/bluetooth.py | bluetooth.py | py | 3,005 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "struct.pack",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "struct.pack",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "camera.Camera",
"line_number": 60,
"usage_type": "name"
},
{
"api_name": "camera.WIDTH",
"line_number... |
74321177789 | def calculate_ccf(wld, fxd, wl, fx2,rv_range):
"""
Cross-correlate a given spectrum with a template.
Parameters:
wld (array-like): Clipped wavelength range for the spectrograph to avoid edge effects.
fxd (array-like): Corresponding clipped flux range for the spectrograph.
wl (array-like): Total... | nborsato/transit_emulator | cross_correlate.py | cross_correlate.py | py | 6,492 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "contextlib.redirect_stdout",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "io.StringIO",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "contextlib.redirect_stderr",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tay... |
3589499794 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 21 13:00:57 2020
@author: nk7g14
"""
from pathlib import Path
import glob
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
if __name__ == "__main":
folders = glob.glob('../data/interim/eROSITA_sampling_results/*')
... | nx1/ulx_pop | src/old/eROSITA_results_processor.py | eROSITA_results_processor.py | py | 2,766 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "glob.glob",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"lin... |
855733494 | #!/usr/bin/env python
# This example demonstrates the use of vtkSTLReader to load data into
# VTK from a file. This example also uses vtkLODActor which changes
# its graphical representation of the data to maintain interactive
# performance.
import vtk
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetD... | VisTrails/VisTrails | examples/vtk_examples/IO/stl.py | stl.py | py | 1,113 | python | en | code | 100 | github-code | 6 | [
{
"api_name": "vtk.util.misc.vtkGetDataRoot",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "vtk.vtkSTLReader",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "vtk.vtkPolyDataMapper",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "v... |
70501173629 | import json
from trasto.infrastructure.memory.repositories import (Idd, Idefier,
LoggerRepository)
from trasto.model.entities import Tarea, TareaRepositoryInterface
from trasto.infrastructure.awsmultiprocess.aws import get_queue, TAREAS_NORMALES_QUEUE_NAME, TAREAS... | jpardobl/jpardobl-trastobrain | trasto/infrastructure/awsmultiprocess/tarea_repository.py | tarea_repository.py | py | 3,643 | python | en | code | 18 | github-code | 6 | [
{
"api_name": "trasto.model.entities.TareaRepositoryInterface",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "trasto.infrastructure.memory.repositories.LoggerRepository",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "trasto.infrastructure.awsmultiprocess.a... |
72784574267 | # https://www.codewars.com/kata/569218bc919ccba77000000b
from datetime import datetime, timedelta
def date_nb_days(a0, a, p):
interest = p/36000
c = 0
while a0 < a:
a0 += a0 * interest
c += 1
return (datetime(2016, 1, 1) + timedelta(days=c)).strftime("%Y-%m-%d")
| blzzua/codewars | 7-kyu/target_date.py | target_date.py | py | 302 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "datetime.datetime",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 10,
"usage_type": "call"
}
] |
3401097636 | # -*- coding: utf-8 -*-
import os
from datetime import datetime
from shutil import copyfile
from log import add_loggers
if __name__ == '__main__':
from application import APP
log = APP.web_app.logger
add_loggers(APP)
if not os.path.isfile('local_settings.py.tmpl'):
err_txt = 'Отсутствует ша... | tigal/mooc | run.py | run.py | py | 1,104 | python | ru | code | 0 | github-code | 6 | [
{
"api_name": "application.APP.web_app",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "application.APP",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "log.add_loggers",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "applicat... |
10562993985 | from fastapi import FastAPI
from pydantic import BaseModel
import syntax as Syntax
import task as Task
from fastapi.middleware.cors import CORSMiddleware
app = FastAPI()
origins = [
"http://localhost",
"http://localhost:8000",
"http://localhost:3000",
]
app.add_middleware(
CORSMiddleware,
allow... | andyzg/LearnCode | server/main.py | main.py | py | 1,203 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "fastapi.middleware.cors.CORSMiddleware",
"line_number": 18,
"usage_type": "argument"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 25,
"usage_type": "name"
},
{
"api_... |
30325582062 | from selenium import webdriver
import pytest, allure, moment
from AutomationFrameworkPractice.pages.home import HomePage
from AutomationFrameworkPractice.pages.login import LoginPage
from AutomationFrameworkPractice.utils import utils
@pytest.mark.usefixtures('test_setup')
class TestLogin():
def test_login(self)... | dommie123/SeleniumPythonCourse | AutomationFrameworkPractice/tests/login_test.py | login_test.py | py | 1,909 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "AutomationFrameworkPractice.pages.login.LoginPage",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "AutomationFrameworkPractice.utils.utils.USERNAME",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "AutomationFrameworkPractice.utils.utils",... |
26528539353 | from fastapi import FastAPI
from pydantic.types import PositiveFloat
import tez
import torch
import torch.nn as nn
import transformers
from pydantic import BaseModel
app = FastAPI()
class SentimentPredict(BaseModel):
text: str
threshold: float
class BERTDataset:
def __init__(self, review, target):
... | RashikRahman/Sentiment_Classification_PyTorch_FastApi | api.py | api.py | py | 2,673 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "transformers.BertTokenizer.from_pretrained",
"line_number": 21,
"usage_type": "call"
},
{
"api_... |
14488653562 | import datetime
import time
import os
from decimal import Decimal
__author__ = "Meepo"
class Station:
def __init__(self, station_name, csvfile):
FIELD_CORRECTION = 1
# ############################
# Class function definitions
# ############################
# ############... | dishijn2/GiraffeOfDoom | StackedActivityHeatmap/Station.py | Station.py | py | 15,750 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.isfile",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "decimal.Decimal",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "decimal.Decimal",
"li... |
27518090883 | from PIL import Image
import numpy as np
from math import sin, cos
import os
from os.path import join,isdir,exists,basename,normpath,splitext
import random
def readImage(path,grey=True):
'''
Read image
Args:
-path: path to read from
-grey: output should be greyscale or not
'''
image = Image... | Revess/Shards_Phase_2 | src/image_manipulation/image_processing.py | image_processing.py | py | 11,889 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "PIL.Image.open",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "numpy.copy",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number"... |
27462044668 | import numpy as np
import matplotlib.pyplot as plt
save_directory = "doc/figures/"
nr_threads = [1, 2, 3, 4, 5, 6, 7, 8]
mutual_links1_time = [0.016, 0.0064, 0.00477, 0.00427, 0.00461, 0.00451, 0.00417, 0.00424]
mutual_links2_time = [0.002, 0.00146, 0.00154, 0.00163, 0.00182, 0.00183, 0.00206, 0.00237]
top_n_time = ... | hakontan/IN4200-spring2020 | assignment1/plot_results.py | plot_results.py | py | 914 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.tight_layout",
"line_number": 20,
"usage_type": "call"
},
{
"api_n... |
72168155068 | from setuptools import setup, find_packages
VERSION = open('VERSION', 'r').read().strip()
PROJECT_NAME = 'pynsd'
install_requires = []
setup(name='%s' % PROJECT_NAME,
url='https://github.com/greensec/%s' % PROJECT_NAME,
author="greenSec Solutions",
author_email='meinecke@greensec.de',
keyword... | greensec/pynsd | setup.py | setup.py | py | 805 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "setuptools.setup",
"line_number": 8,
"usage_type": "call"
}
] |
71359829627 | import enum
import subprocess
# Enum for size units
class SIZE_UNIT(enum.Enum):
BYTES = 1
KB = 2
MB = 3
GB = 4
def convert_unit(size_in_bytes, unit):
""" Convert the size from bytes to other units like KB, MB or GB"""
if unit == SIZE_UNIT.KB:
return round(size_in_bytes/1024, 2)
el... | bennischober/MetaDataScraper | src/helper/helpers.py | helpers.py | py | 4,133 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "enum.Enum",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "subprocess.Popen",
"line_number": 143,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line_number": 144,
"usage_type": "attribute"
}
] |
14870897107 | # The textures in blender are sometimes referenced by their absolute path. So moving around the blend file will sometimes break the material reference and procude an empty image.
import sys, os, argparse
sys.path.append(os.path.abspath('..')) # define where python can find tenon
import tenon
import tenon.logging as L
... | qiuwch/tenon | scripts/check_texture_path.py | check_texture_path.py | py | 2,121 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
74914292347 | from time import sleep
from selenium import webdriver
from selenium.webdriver.remote.webdriver import WebDriver
class BasePage:
_base_url = ""
def __init__(self,driver:WebDriver=None):
self._driver=""
#此处对driver进行复用,如果不存在driver,就构造一个新的
if driver is None:
#mian页面需要用,首次使用时构造新... | NeilsDestiny/pytest | pageobject/page/base_pase.py | base_pase.py | py | 806 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.remote.webdriver.WebDriver",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 13,
"usage_type": "name"
},
... |
36093202878 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import unittest
import mock
from napixd.services.methods import Implementation
class TestImplementation(unittest.TestCase):
def setUp(self):
self.mgr = type('M', (object,), {})
def test_nofilter(self):
self... | napix/NapixServer | tests/test_services/test_methods.py | test_methods.py | py | 926 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "unittest.TestCase",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "mock.Mock",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "mock.Mock",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "napixd.services.methods.Im... |
37398452822 | import psycopg2
from datetime import datetime
import pytz
import Adafruit_DHT
import Adafruit_BMP.BMP085 as BMP085
import RPi.GPIO as GPIO
import time
# define pins for sensors
DHT_PIN = 4
BMP_SDA = 3
BMP_SCL = 5
# create sensors objects
dht_sensor = Adafruit_DHT.DHT11
bmp_sensor = BMP085.BMP085(mode=BMP085.BMP085_UL... | Mohammed-Rahman-sherif/Sensor-Dashboard | main.py | main.py | py | 2,181 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "Adafruit_DHT.DHT11",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "Adafruit_BMP.BMP085.BMP085",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "Adafruit_BMP.BMP085",
"line_number": 16,
"usage_type": "name"
},
{
"api_name":... |
18610984405 | from selenium import webdriver
driver = webdriver.Chrome("D:\Automation software\Chromedriver88\chromedriver")
driver.get("http://newtours.demoaut.com/")
driver.maximize_window()
links =driver.find_elements_by_tag_name('a')
# links =driver.find_element_by_attribute('href')
for link in links:
print(link.text)
... | zh-cse18/Selenium_Webdriver_Operation | collect all link from a page.py | collect all link from a page.py | py | 355 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 3,
"usage_type": "name"
}
] |
36724494838 | from django.conf.urls import url
from .views import (
TopicListView,
topic_new,
PostListView,
topic_reply,
PostEditView,
TopicDeleteView
)
urlpatterns = [
url(r'^(?P<pk>\d+)/$',
TopicListView.as_view(),
name='topic-list'),
url(r'^(?P<pk>\d+)/new/$',
topic_new,
... | zawi99/web-boards | boards/urls.py | urls.py | py | 827 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.conf.urls.url",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "views.TopicListView.as_view",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "views.TopicListView",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "... |
15837567557 | # -*- coding: utf-8 -*-
# @Time : 2022/6/14 16:30
# @Author : renyumeng
# @Email : 2035328756@qq.com
# @File : 3.py
# @Project : ProbabilityTheoryAndMathematicalStatisticsExperiments
import math
from typing import Union
class Poisson:
def __init__(self, x: int, _lamb: Union[int, float]) -> None:
self.X: i... | renyumeng1/ProbabilityTheoryAndMathematicalStatisticsExperiments | firstExper/第一题/3.py | 3.py | py | 923 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "typing.Union",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "math.exp",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "typing.Union",
"line_number": ... |
22960012319 | import sys
from pathlib import Path
import uproot
import awkward as ak
import deepdiff
from pprint import pprint
files = sys.argv[1:]
ts = {}
names = []
for f in files:
print(f)
ts[f] = uproot.open(f)["events"]
names.append(set([b.name for b in ts[f].branches]))
if len(names) > 1:
print(deep... | eic/epic-capybara | bara.py | bara.py | py | 2,380 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "uproot.open",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "deepdiff.DeepDiff",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "deepdiff.DeepDiff",
"l... |
25553274468 | import logging
import os
import sys
from distutils.dir_util import remove_tree
from os.path import dirname, join
from typing import List
from setuptools import Command, find_packages, setup
if sys.version_info[0] < 3:
raise Exception(
"pydolphinscheduler does not support Python 2. Please upgrade to Python... | funnyzpc/dolphinscheduler-2.0.5 | dolphinscheduler-python/pydolphinscheduler/setup.py | setup.py | py | 4,318 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "sys.version_info",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "os.path.dirname"... |
16731704674 | from enum import Enum, auto
from typer import Typer, echo
class ConfigFileType(Enum):
dotenv = "dotenv"
settings_config = "dotconfig"
app = Typer()
config_app = Typer()
app.add_typer(config_app, name="config")
@config_app.command("create")
def items_create(file_type: ConfigFileType):
echo(f"Creating ... | autogram/Botkit | cli/main.py | main.py | py | 572 | python | en | code | 10 | github-code | 6 | [
{
"api_name": "enum.Enum",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "typer.Typer",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "typer.Typer",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "typer.echo",
"line_number": 18,
... |
35333748628 | import os
from urllib.parse import urlparse
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
class TwitterParser:
... | yesseyev/mantala-test | python_ex_4/answer.py | answer.py | py | 2,997 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.getenv",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.ChromeOptions",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "seleniu... |
20692285830 | import numpy as np
from numpy import correlate
import matplotlib.pyplot as plt
from obspy import *
from obspy.signal.trigger import recursive_sta_lta
# Akaike Information Criteria (AIC) First Break Identification
file = read("D:/1999-03-04-mw71-celebes-sea.miniseed")
data_idx = file.pop(3)
data_tr = data_idx.data
len... | putupradnya/Event-Identification-Earthquake-Methods | 003_STALTA_SLKURT.py | 003_STALTA_SLKURT.py | py | 4,247 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "numpy.arange",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number":... |
74055971387 |
import numpy as np
import networkx as nx
import copy
from collections import namedtuple
Target = namedtuple(
'Target', [
'name',
'type',
'dim',
]
)
def wrap_vertices(G, dtype='float'):
for u in G.nodes():
G.node[u]['data'] = wrap_tensor(G.node[u]['data'], dtype)
return... | isaachenrion/gcn | old_implementation/data_utils/graph_utils.py | graph_utils.py | py | 2,567 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.namedtuple",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "numpy.concatenate",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
... |
37082256772 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as img
import open3d as o3d
data= np.load('/Users/samiamrouni/Downloads/newdosi_1_200403290A_19870601_ground_truth.npy')
posi = np.empty(3)
inte = np.empty(1)
for i in range(128):
for j in range(32):
for k in range(32):
... | Samox-93/Projet_Informatique | Representation-3D.py | Representation-3D.py | py | 641 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.load",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.empty",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.empty",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 13,
... |
36276975677 | # shopping_cart.py
products = [
{"id":1, "name": "Chocolate Sandwich Cookies", "department": "snacks", "aisle": "cookies cakes", "price": 3.50},
{"id":2, "name": "All-Seasons Salt", "department": "pantry", "aisle": "spices seasonings", "price": 4.99},
{"id":3, "name": "Robust Golden Unsweetened Oolong Tea"... | tani-k123/Point_of_sale_app | shopping_cart.py | shopping_cart.py | py | 5,223 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "datetime.datetime.now",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 42,
"usage_type": "attribute"
}
] |
31932894681 | from pyspark.ml.classification import LinearSVC
from pyspark.sql import SparkSession
spark = SparkSession.builder.getOrCreate()
spark.sparkContext.setLogLevel("ERROR")
training = spark.read.format("libsvm").load("file:///usr/lib/spark/data/mllib/sample_libsvm_data.txt")
lsvc = LinearSVC(maxIter=10, regParam=0.1... | geoffreylink/Projects | 07 Machine Learning/SparkML/sparkML_CL_linearsvc.py | sparkML_CL_linearsvc.py | py | 470 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "pyspark.sql.SparkSession.builder.getOrCreate",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "pyspark.sql.SparkSession",
"line_number": 4,
"usage_type... |
51025434 | """
File for looking up positions in opening and end game data base. Data base files are in ./data/
directory of this repository.
"""
import random
import warnings
import os
import chess
import chess.polyglot
import chess.gaviota
MAX_GAVIOTA_PIECES = 4
def get_catalogue_moves(board):
"""
Query polyglot openi... | stefreschke/Klausfish | source/catalogue.py | catalogue.py | py | 3,283 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.dirname",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "chess.polyglot.open_rea... |
6018004956 | import json
# 剪映自动生成的字幕路径大概是下面的样子,需要自己找一下
sourcePath = r'C:\Users\yl\AppData\Local\JianyingPro\User Data\Projects\com.lveditor.draft\67C1B596-F355-4f94-A004-F53CF58970A4\draft.json'
# 设置生成字幕的路径
outPath = r'C:\Users\yl\Desktop\字幕.srt'
def secToTimecode(t):
s, ms = divmod(t, 1000)
m, s = divmod(s, 60)
h, m... | Yuelioi/Program-Learning | Python/Projects/【数据处理】剪映字幕.py | 【数据处理】剪映字幕.py | py | 1,383 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.loads",
"line_number": 18,
"usage_type": "call"
}
] |
19238784722 | # Dijkstra ! 특정 거리의 도시 찾기
# Dijkstra는 시간 초과가 나고, bfs로 해결해야 한다.
# Dijkstra로 풀이 (시간 초과)
# import sys
# input = sys.stdin.readline
#
# def Dijkstra(s):
# U = [0] * (N+1)
# U[s] = 1
# D[s] = 0
#
# for v in d_li[s]:
# D[v] = 1
#
# while sum(U) != N:
# min_w = 987654321
# for i in... | sdh98429/dj2_alg_study | BAEKJOON/Dijkstra/b18352.py | b18352.py | py | 1,600 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.stdin",
"line_number": 48,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 54,
"usage_type": "call"
}
] |
36145539524 | def get_dataset(opt):
dataset = None
if opt.dataset_mode == 'visDrone':
from data.visDroneDataset import VisDrone
dataset = VisDrone(opt)
else:
raise NotImplementedError('the dataset [%s] is not implemented' % opt.dataset_mode)
# if opt.dataset_mode == 'list':
# from dat... | tonyyang1995/AnchorFree | data/CustomDataset.py | CustomDataset.py | py | 1,390 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "data.visDroneDataset.VisDrone",
"line_number": 5,
"usage_type": "call"
}
] |
7381625135 | import spacy
from nltk.corpus import stopwords
import string
from gensim import corpora
import gensim
import pyLDAvis
import pyLDAvis.gensim_models as gensimvis
import pdb
import huspacy
import os
#huspacy.download()
def hungarian_stopwords():
'''
'''
stops = []
with open(os.getcwd()+'/stopsh... | owaismujtaba/Test0TopicModelling | utils.py | utils.py | py | 2,519 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.getcwd",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "spacy.load",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "gensim.models.Phrases",
"line_number": 88,
"usage_type": "call"
},
{
"api_name": "gensim.models",
"line_... |
6814885175 | import spacy
from Preprocessing.ExtractJsonInfo import pdfparser
docUrl = 'https://diavgeia.gov.gr/doc/ΩΕΚ64653ΠΓ-2ΞΡ'
text = pdfparser(docUrl)
nlp = spacy.load("el_core_news_lg")
doc = nlp(text)
# print(text)
my_doc_cleaned = [token for token in doc if not token.is_stop and not token.is_punct]
# print("\tENTITIE... | IsVeneti/greek-gov-nlp | NamedEntityRecognition/Spacy.py | Spacy.py | py | 801 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "Preprocessing.ExtractJsonInfo.pdfparser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "spacy.load",
"line_number": 8,
"usage_type": "call"
}
] |
16664796240 | #!/usr/bin/env python
import pprint
import boto.sqs
import md5
from time import gmtime, strftime
from boto.sqs.message import Message
conn = boto.sqs.connect_to_region(
"eu-west-1")
q = conn.get_queue("thisIsATest")
m = Message()
m.message_attributes = {
"AttributeA": {
"data_type": "String",
... | Irishsmurf/AWS-Bash-Scripts | sqsAttributes.py | sqsAttributes.py | py | 819 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "boto.sqs.sqs.connect_to_region",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "boto.sqs.sqs",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "boto.sqs",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "boto.sqs.messa... |
33019856356 | import os
import sys
from typing import List
import streamlit as st
# workaround for Streamlit Cloud for importing `melanoma_phd` module correctly
sys.path.append(
os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
) # isort: skip
from melanoma_phd.database.Patient import Patient
from m... | Minor-comments/melanoma-phd | streamlit_app/pages/4_Kinetics_analytics.py | 4_Kinetics_analytics.py | py | 2,222 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
34829911633 | from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
from django.core.exceptions import ObjectDoesNotExist
from django.http import HttpResponseRedirect, Http404
from django.shortcuts import render, get_object_or_404
from django.contrib.auth import views as ... | TolimanStaR/Course-Work-Age-Of-Python | account/views.py | views.py | py | 10,528 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.views.generic.ListView",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "models.User",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "models.User.objects.all",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "mod... |
9355399230 | import serial.tools.list_ports
rate = None
root = None
port = None
def init(irate, iroot) :
global rate, root
# store port data in global scope
root = iroot
rate = irate
def wait() :
global rate, port, root
# wait for a response from any com port
while port == None :
# check for a... | deshan-nawanjana/arduino-py | client/bin/connection.py | connection.py | py | 2,038 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "serial.tools.list_ports.tools.list_ports.comports",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "serial.tools.list_ports.tools",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "serial.tools.list_ports",
"line_number": 18,
"usage_... |
27567204954 | from Project.Self_test.testdb import *
from django.shortcuts import render
from Project.Self_develop.Check_out_DB_OP import *
from Project.Self_develop.Check_out import *
# 简单条件查询
def search(request):
ctx = {}
check_out_search_dict = dict()
if request.POST:
if request.POST.get('customer... | Lxc123151321/NursingHome | Project/Self_develop/Check_out_OP.py | Check_out_OP.py | py | 3,138 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.shortcuts.render",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 42,
"usage_type": "call"
}
] |
38130358782 | from collections import namedtuple
from ef.util.data_class import DataClass
from ef.util.subclasses import get_all_subclasses
class ConfigSection(DataClass):
_section_map = None # dictionary of section_header_string: section class
section = "Section header string goes here"
ContentTuple = namedtuple("Co... | epicf/ef_python | src/ef/config/section.py | section.py | py | 3,297 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "ef.util.data_class.DataClass",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "collections.namedtuple",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "ef.util.subclasses.get_all_subclasses",
"line_number": 16,
"usage_type": "call"
}
] |
10924715528 |
# NavigationController Class
# This is the topMost class on the view tree model.
# All subviews MUST be placed on this view by running "AddSubview" method
# It is recomended to only place objects of Viewcontroller class to this object as they can handle events correctly
# This class was originally implemented before ... | nickw444/NWPi | UI/NWPi/navigationController.py | navigationController.py | py | 6,150 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "pygame.Surface",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "copy.copy",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "copy.copy",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "copy.copy",
"line_number": 72,... |
69999259068 | from fastapi import FastAPI
from fastapi.testclient import TestClient # requires httpx
import sys
import os
import numpy as np
import time
import unittest
from helpers import fiqa_test_data
FILE_PATH = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.join(FILE_PATH, '../../'))
from api.fastapi impo... | Rumman954/spDB | tests/integration/test_fastapi.py | test_fastapi.py | py | 4,022 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.dirname",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"l... |
4730883041 | from __future__ import absolute_import, division, print_function
__metaclass__ = type
from copy import deepcopy
from ansible.module_utils.basic import env_fallback
from ansible.module_utils.urls import fetch_url
from ansible.module_utils._text import to_text
API_URL = 'https://pingping.io/webapi/'
def pingping_argu... | ngine-io/ansible-collection-pingping | plugins/module_utils/pingping.py | pingping.py | py | 3,457 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "ansible.module_utils.basic.env_fallback",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "ansible.module_utils.urls.fetch_url",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "ansible.module_utils._text.to_text",
"line_number": 41,
"usag... |
35192079896 | import unittest
from parameterized import parameterized
from cls_stack.cls_stack import Stack
class TestFunction(unittest.TestCase):
@classmethod
def setUpClass(cls) -> None: # before all tests
cls.sample = Stack()
@classmethod
def tearDownClass(cls) -> None: # after all tests
prin... | sergeMMikh/HW_01.07.2022 | test/test_stack.py | test_stack.py | py | 831 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "unittest.TestCase",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "cls_stack.cls_stack.Stack",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "parameterized.parameterized.expand",
"line_number": 16,
"usage_type": "call"
},
{
... |
72225988669 | import inspect
import logging
import sys
import time
import typing
from fastapi import FastAPI, Request, Response
from starlette.middleware.base import BaseHTTPMiddleware, RequestResponseEndpoint
class ChainFilter(logging.Filter):
"""
Chain Filter for chained logging tools
Params:
- log_format (s... | Danangjoyoo/chain-logging | chain_logging/fastapi.py | fastapi.py | py | 8,468 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.Filter",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "typing.Optional",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "typing.Callable",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "logging... |
32545364639 | """
Colorama implementation of colored logging.
"""
import logging
from colorama import init, Fore
from ..options import OPTIONS
init()
# there are 8 colors, 6 of which ca be used (no white/black)
COLORS = {
'progress':Fore.GREEN,
'get':Fore.YELLOW,
'download':Fore.CYAN,
'error':Fore.RED,
'tag':For... | thesadru/animethemes-dl | animethemes_dl/tools/colors.py | colors.py | py | 1,099 | python | en | code | 20 | github-code | 6 | [
{
"api_name": "colorama.init",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "colorama.Fore.GREEN",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "colorama.Fore",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "colorama.Fore.YEL... |
71861340349 | from __future__ import annotations
import datetime
import os
import pathlib
import shutil
from typing import Any, Callable
from const import db_top_dir, db_top_dir_v1, db_top_dir_v2
from data_struct import ConfigInterface
from log import logger
class DBInterface(ConfigInterface):
time_cmt_millseconds = "%Y-%m-%... | fzls/djc_helper | db_def.py | db_def.py | py | 6,721 | python | en | code | 319 | github-code | 6 | [
{
"api_name": "data_struct.ConfigInterface",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "util.format_now",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "util.format_now",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "util.pars... |
36472089451 | """q_12
Revision ID: ba8d8d6ee708
Revises: 2ce2d137c182
Create Date: 2023-05-23 15:11:01.727551
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'ba8d8d6ee708'
down_revision = '2ce2d137c182'
branch_labels = None
depends_on = None
def upgrade():
# ### comma... | Patrik835/f1_fantasy | migrations/versions/ba8d8d6ee708_q_12.py | ba8d8d6ee708_q_12.py | py | 793 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "alembic.op.batch_alter_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.... |
71157467709 | # tlescraper\scraper.py
from urllib.request import urlopen
import os
import logging
from tlescraper.utils import retry
logger = logging.getLogger(__name__)
CERESTRACK_BASE_URL = "https://celestrak.com/NORAD/elements/"
@retry(max_retry=3, retry_interval=0.1, raise_on=[ValueError])
def get_tle(CATNR: str):
url = ... | medaka0213/TLE-Scaper | tlescraper/scraper.py | scraper.py | py | 1,091 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "urllib.request.urlopen",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "tlescraper.utils.retry",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.pat... |
19422075832 | from types import TracebackType
from typing import Optional, Type
import aiohttp
from imageprobe.errors import DownloadError
class DownloadClient:
"""Wrapper for aiohttp.ClientSession.
It either creates a new private ClientSession instance or uses a pre-existing one if
it is provided at inizialization.... | palt0/imageprobe | imageprobe/client.py | client.py | py | 2,844 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.Optional",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "aiohttp.ClientSession",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "aiohttp.ClientSession",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": ... |
10792351391 | """Module to estimate the clearsky irradiance for a given day and site."""
# Equations from G. Masters, “Renewable and Efficient Electric Power Systems,” Wiley-IEEE Press, 2004.
# Section 7.9 TOTAL CLEAR SKY INSOLATION ON A COLLECTING SURFACE
import datetime
from dateutil import tz
import math
import os
from config i... | sillygoose/multisma2 | multisma2/clearsky.py | clearsky.py | py | 2,567 | python | en | code | 13 | github-code | 6 | [
{
"api_name": "datetime.datetime.fromtimestamp",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "dateutil.tz.gettz",
"line_number": 18,
"usage_type": "call"
},
{
"api_name... |
2284279577 | # Importazione della classe Flask
from flask import Flask
import OggettoSemplice
# Creazione dell'oggetto Flask
app = Flask(__name__)
x = OggettoSemplice.c1.x
print(x)
@app.route("/")
@app.route("/home")
def home():
return f"il valore di c1 {OggettoSemplice.c1.x}"
if __name__ == "__main__":
app... | Carleoinserra/cyberPy | pythonProject2/flaskp.py | flaskp.py | py | 334 | python | it | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "OggettoSemplice.c1",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "OggettoSemplice.c1",
"line_number": 13,
"usage_type": "attribute"
}
] |
5489656682 | import mdevaluate as md
from functools import partial
import numpy as np
# change filename of result file here...
outfile = 'isf.dat'
# Adjust simulation directory and topolgy/trajectory filenames accordingly...
traj = md.open(
directory='/data/niels/sim/water/bulk/260K',
topology='topol.tpr', trajectory='out/traj... | mdevaluate/md-demo-script | isf.py | isf.py | py | 944 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "mdevaluate.open",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "functools.partial",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "mdevaluate.correlation",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "mdevalu... |
73486534587 | from django.urls import path
from . import views
app_name = "produto"
urlpatterns = [
path('listar/', views.listar_produtos, name='listar'),
path('listar_lv/', views.Listar_produtos_lv.as_view(), name='listar_lv'),
path('detalhes/<int:pk>', views.detalhes_produto, name="detalhes"),
path('detalhes_dv/<... | carlafcf/BD_TADS | Produto/urls.py | urls.py | py | 858 | python | pt | code | 1 | github-code | 6 | [
{
"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",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
13109893986 | import pygame
from random import randint
def move(press_flag, list_UDLF, move_range, x, y):
if press_flag[list_UDLF[0]]: y -= move_range
if press_flag[list_UDLF[1]]: y += move_range
if press_flag[list_UDLF[2]]: x -= move_range
if press_flag[list_UDLF[3]]: x += move_range
if x > 1280: x = 0
if... | 39xdgy/Playground_py | fun.py | fun.py | py | 3,209 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.init",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "pygame.displa... |
19772109457 | from __future__ import absolute_import, division, print_function
from os.path import join, exists
import ibeis
from ibeis.other import ibsfuncs
from ibeis.dev import sysres
import multiprocessing
import utool
from vtool.tests import grabdata
print, print_, printDBG, rrr, profile = utool.inject(__name__, '[MAKE_BIG_DB]'... | smenon8/ibeis | _broken/make_big_database.py | make_big_database.py | py | 2,328 | python | en | code | null | github-code | 6 | [
{
"api_name": "utool.inject",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "utool.get_computer_name",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "utool.get_computer_name",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path.j... |
74958810428 | from torch.utils import data
import numpy as np
from datasets import register_dataset
import os
@register_dataset(name="raw_wav_file_dataset")
class RawWavFileDataset(data.Dataset):
def __init__(self, cfg, task_cfg=None, preprocessor_cfg=None):
self.cfg = cfg
manifest_path = cfg.data
manif... | czlwang/BrainBERT | datasets/raw_wav_file_dataset.py | raw_wav_file_dataset.py | py | 1,105 | python | en | code | 21 | github-code | 6 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.utils.data",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
4479107065 | import matplotlib.pyplot as plt
import seaborn as sns
import pandas
import numpy
M=pandas.read_csv("matrix.csv")
lab=pandas.read_csv("labels.csv")
del M["Unnamed: 0"]
M.set_index(lab["Patient_ID"],inplace=True)
M.columns=lab["Patient_ID"]
lab.sort_values('labels',inplace=True)
M=M.reindex(lab['Patient_ID'],axis='index'... | Jayanth-kumar5566/Integrative-Microbiomics | Figures/Figure4/a/clustering.py | clustering.py | py | 885 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.log",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "seaborn.heatmap",
"line_n... |
3703227721 | import csv
from datetime import date
class Registration:
all = []
def __init__(self, name: str, reg_fee: float, deposit: float, age: date):
#Runs validation to the resived arguments
# assert age >= 18,f"{age} is too young 18+ years"
# assert age <= 35, f"Age {age} is old to have an acco... | Timokama/Timo | program/fetha/app/models/Fetha-youth_group/registration.py | registration.py | py | 2,248 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "datetime.date",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "datetime.date.today",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 20,
"usage_type": "name"
}
] |
16409453370 | from keras.layers import Input, Dense
from keras.models import Model
import matplotlib.pyplot as plt
import copy
import numpy as np
import pandas as pd
seed = 123
np.random.seed(seed)
data = pd.read_excel("data.xlsx", index_col=0)
print(data.columns)
plt.figure()
plt.plot(data['S&P 500'])
plt.show()
... | masterfulEJ/pythonProjects | SGTrip/Autoencoders/autoencoders.py | autoencoders.py | py | 2,540 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "numpy.random.seed",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_excel",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.pypl... |
15871117236 | # Import required modules
import json
from Eval.Evaluator import Evaluator
from Eval.QuestionGenerator import AutoQuestionGenerator
from Eval.DataExtractor import DataExtractor
from Loader.LocalDirectoryLoader import LocalDirectoryLoader
from Eval.EvaluationWrappers import BaseEvaluationWrapper
import datetime
import l... | slark-prime/Context-Enhanced-Question-Answering | Eval/EvalPipeline.py | EvalPipeline.py | py | 6,177 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "Eval.EvaluationWrappers.BaseEvaluationWrapper",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "Eval.DataExtractor.DataExtractor",
"line_number": 30,
"usage_type": "call... |
4696617709 | from django.shortcuts import render
from django.http import HttpResponse
from grupo.models import Grupo
def mostrarGrupos(request):
grupos = Grupo.objects.all()
return render(request, "grupo/grupo.html", {"grupos": grupos})
def agregarGrupo(request):
nombreU = request.GET.get("nombre")
descripcionU = ... | frannsanchez/Tercera-pre-entrega-Sanchez | grupo/views.py | views.py | py | 1,264 | python | es | code | 0 | github-code | 6 | [
{
"api_name": "grupo.models.Grupo.objects.all",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "grupo.models.Grupo.objects",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "grupo.models.Grupo",
"line_number": 6,
"usage_type": "name"
},
{
"ap... |
39687527194 | from blog_app import app, miniblog_db
from flask import Flask,render_template,flash,redirect,url_for, request
from blog_app.forms import LoginForm, RegistrationForm, EditProfileForm, PostForm
from flask_login import current_user, login_user, logout_user, login_required
from blog_app.models import User, Post
from werkze... | cmattey/flask_miniblog | blog_app/routes.py | routes.py | py | 6,228 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "blog_app.forms.PostForm",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "blog_app.models.Post",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask_login.current_user",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": ... |
16799457640 | import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--sample', '-s', help='Run with sample data', action='store_true', default=False)
parsed_args = parser.parse_args()
if parsed_args.sample:
print("Using sample data!")
def dprint(*args, **kwargs):
if parsed_args.sample:
print(*ar... | mrkirby153/AdventOfCode2022 | day04/day04.py | day04.py | py | 1,960 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 3,
"usage_type": "call"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.