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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
39225990398 | from ddl.tensorflow.cpp_backend import CPPBackend
from ddl.tensorflow import util
from ddl.tensorflow.communicator import Communicator
from tensorflow.python.framework.ops import Tensor
from collections.abc import Iterable
import tensorflow as tf
def allreduce_gradient(
tensor: Tensor or tf.IndexedSlices,
... | LYL232/Experiment-Distributed-Deep-Learning | src/py/ddl/tensorflow/tensor_communicate.py | tensor_communicate.py | py | 3,634 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tensorflow.python.framework.ops.Tensor",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "tensorflow.IndexedSlices",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "ddl.tensorflow.communicator.Communicator",
"line_number": 11,
"usage... |
2054938292 | from pyimagesearch.nn.conv import NeuralStyle
from keras.applications import VGG19
SETTINGS = {
'input_path': 'inputs/quan.jpg',
'style_path': 'inputs/red_chalk.jpg',
'output_path': 'output',
'net': VGG19,
'content_layer': 'block4_conv2',
'style_layer': ['block4_conv1', 'block4_conv2', 'block... | lykhahaha/Mine | PractitionerBundle/practice/style_transfer.py | style_transfer.py | py | 490 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "keras.applications.VGG19",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "pyimagesearch.nn.conv.NeuralStyle",
"line_number": 21,
"usage_type": "call"
}
] |
20481473216 | import json
import logging
import os
from typing import Literal, Optional, TextIO, Union
from uuid import uuid4
import smart_open
from simple_transfer.config import SIMPLE_TRANSFER_CONFIG
from simple_transfer.connection import Column, Connection
class Injector:
"""
Injects extracted data into a destination d... | henryivesjones/simple-transfer | simple_transfer/injector.py | injector.py | py | 5,606 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.TextIO",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "typing.TextIO",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "simple_transfer.connection.Connection",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "typ... |
6112257225 | from __future__ import print_function
import sys
#sys.path.append('/usr/local/Cellar/opencv3/3.2.0/lib/python2.7/site-packages')
sys.path.append("/usr/local/Cellar/opencv3/3.2.0/lib/python3.5/site-packages")
import cv2
import random
import numpy as np
import tensorflow as tf
from six.moves import cPickle as pickle
from... | ltecot/humanMotionClassification | parseFramesNonFlow.py | parseFramesNonFlow.py | py | 2,671 | python | en | code | 4 | 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": "numpy.random.seed",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"lin... |
17270406701 | import json
from random import randrange
from django.http import HttpResponse
from rest_framework.views import APIView
from pyecharts.charts import Line
from pyecharts import options as opts
from django.shortcuts import render
from . import models
class Chart():
def __init__(self, Module):
self.M... | Chunar5354/Django-demos | ChartDemo/chart/views.py | views.py | py | 4,685 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.dumps",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "django.http.HttpResponse",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "pyecharts.charts.Line",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "random.rand... |
45346291783 | import pandas as pd
import datetime as dt
import configparser
import os
from datetime import datetime
from pyspark.sql.functions import udf
from pyspark.sql.functions import min, max
from pyspark.sql.functions import year, month, dayofmonth, hour, weekofyear, date_format, dayofweek
from pyspark.sql import SparkSession
... | pakpoom66/Udacity_Project_DataEngineering_CapstoneProject | CapstoneProject_ETL.py | CapstoneProject_ETL.py | py | 24,166 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "pyspark.sql... |
9868780355 | import pygame
import random
from os import path
from .bullet import Bullet
class Player(pygame.sprite.Sprite):
PLAYER_SPEED = 5
SCREEN_WIDTH = 0
SCREEN_HEIGHT = 0
BULLET_COUNT_1 = 1
BULLET_COUNT_2 = 2
BLACK = (0, 0, 0)
SHOOT_SOUND_1 = None
SHOOT_SOUND_2 = None
SHIELD = 100
SHOOT... | yohanswanepoel/planet_protector_pygame | actors/player.py | player.py | py | 3,812 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.sprite",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pygame.sprite.Sprite.__init__",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pygame.sprite",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "py... |
12772941900 | import json
import math
import string
import numpy as np
import tensorflow as tf
from .transform import sequence_embedding
class SaveModelCallback(tf.keras.callbacks.Callback):
def __init__(
self,
model_path,
metadata_path,
metadata,
monitor='val_loss',
metri... | srom/rna_learn | rna_learn/utilities.py | utilities.py | py | 2,854 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tensorflow.keras",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "numpy.inf",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "json.dump",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "string.ascii_lowercase... |
12280784949 | from django.db import models
from django.utils.translation import gettext as _
from .advertisement import Advertisement
from .profile import Profile
class Application(models.Model):
application_id = models.CharField(
_("Application ID"), unique=True, max_length=17, editable=False
)
date_applied ... | Noor-02/AROL-Project | arol/admission/models/application.py | application.py | py | 1,293 | python | en | code | 0 | 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.CharField",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": ... |
33043334745 | """Test UniFi setup process."""
from unittest.mock import Mock, patch
from homeassistant.components import unifi
from homeassistant.components.unifi.const import DOMAIN as UNIFI_DOMAIN
from homeassistant.setup import async_setup_component
from .test_controller import setup_unifi_integration
from tests.async_mock imp... | 84KaliPleXon3/home-assistant-core | tests/components/unifi/test_init.py | test_init.py | py | 2,528 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "homeassistant.setup.async_setup_component",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "homeassistant.components.unifi.const.DOMAIN",
"line_number": 16,
"usage_type": "argument"
},
{
"api_name": "homeassistant.components.unifi.const.DOMAIN",
"line... |
22576138562 | # AIM: To create a pipeline for predicting the reviews on final trained model.
import string
import re
from os import listdir
from nltk.corpus import stopwords
from keras.preprocessing.text import Tokenizer
from keras.models import load_model
vocab_filename = 'Data/Vocab/vocab_all_occ.txt' # vocab filename with its ... | kaustubhbhavsar/sentiment-analysis | predict_ .py | predict_ .py | py | 4,937 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "re.compile",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "re.escape",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "string.punctuation",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "nltk.corpus.stopwords.wo... |
38460838723 | import pygame
from ui import Components, ClickListener
from utils.grid import Grid
from utils.brush import Brush
import os
import numpy as np
from PIL import Image, ImageDraw, ImageDraw2
pygame.init()
WIDTH, HEIGHT = (800, 800)
WIN_WIDTH, WIN_HEIGHT = (1280, 800)
WIN = pygame.display.set_mode((WIN_WIDTH, WIN_HEIGHT))
... | legit-programmer/bit-texture | main.py | main.py | py | 3,962 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.init",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pygame.time.Cl... |
20854051603 | import os
import sys
import pickle
import time
import datetime
import numpy
import jax
from jax import numpy as jnp
import flax
from flax import serialization
from Receptor2Odorant.odor_embedding.MPNN.loader import Loader, Collate, DatasetBuilder
from Receptor2Odorant.odor_embedding.MPNN.model.base_model import Vanill... | MatejHl/Receptor2Odorant | Receptor2Odorant/odor_embedding/MPNN/main_predict.py | main_predict.py | py | 5,257 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "Receptor2Odorant.odor_embedding.MPNN.model.base_model.VanillaMPNN",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 27,
"usage_type": "attr... |
33548040547 | import pytest
from costcenter.models import CostCenter, CostCenterManager, CostCenterAllocation, Fund, ForecastAdjustment
from encumbrance.management.commands import populate
@pytest.mark.django_db
class TestCostCenterManager:
# Cost Center Tests
def test_cost_center_dataframe_empty(self):
r = CostCen... | mariostg/bft | costcenter/tests/test_costcentermanager.py | test_costcentermanager.py | py | 2,646 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "costcenter.models.CostCenterManager",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "encumbrance.management.commands.populate.Command",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "encumbrance.management.commands.populate",
"line_number"... |
477740183 | import torch as t
import ipdb
import torch.nn.functional as F
def reorder_sequence(sequence_emb, order, batch_first=True):
"""
sequence_emb: [T, B, D] if not batch_first
order: list of sequence length
"""
batch_dim = 0 if batch_first else 1
assert len(order) == sequence_emb.size()[batch_dim]
... | CNDPlab/MSMARCO_Reshaped | Predictor/ModelUtils/custom_rnn.py | custom_rnn.py | py | 5,084 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "torch.LongTensor",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.LongTensor",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "torch.nn.utils.rnn.pack_padded_sequence",
"line_number": 62,
"usage_type": "call"
},
{
"api_nam... |
30763304130 | import itertools
import functools
import random
from datetime import datetime
from pathlib import Path
import shutil
import warnings
import gc
import os
import pytorch_lightning.plugins.environments
from matplotlib import pyplot as plt
import numpy as np
import torch
import pytorch_lightning as pl
from pytorch_light... | karazijal/clevrtex | experiments/framework/base_experiment.py | base_experiment.py | py | 29,167 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "pytorch_lightning.trainer.training_loop.TrainLoop",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "pytorch_lightning.trainer.training_loop",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "pytorch_lightning.core.step_result.Result",
"l... |
37935863754 | import machine, os, ubinascii, ntptime, network, onewire, ds18x20, time
from umqtt.simple import MQTTClient
from machine import Pin, RTC, Timer
import ujson as json
print("Reboot...")
def measure_temp_median():
try:
x = [0.0, 0.0, 0.0]
for i in range(3):
ds.convert_temp()
... | Phidaimonia/temp-iot-ESP8266 | Client/main.py | main.py | py | 5,109 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "machine.lightsleep",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.remove",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "time.gmtime",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "ujson.load",
"line_numbe... |
71623442107 | #!/usr/bin/env python
import monitoring
import random
import time
from flask import Flask
app = Flask(__name__)
metrics = monitoring.create_metrics("requests", "errors")
metrics.export_to(app)
@app.route('/')
def hello_world():
metrics("requests").increment()
time.sleep(random.random())
if not random.randint(0... | dkavassy/monitoring-exercise | server/webserver.py | webserver.py | py | 468 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "monitoring.create_metrics",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "random.random",
"l... |
11004665088 | from typing import List
class Solution:
def validateStackSequences(self, pushed: List[int], popped: List[int]) -> bool:
stack = [None] * len(pushed)
size, j = 0, 0
for i in range(len(pushed)):
stack[size] = pushed[i]
size += 1
while size != 0 and stack[s... | xixihaha1995/CS61B_SP19_SP20 | temp/toy/python/946. Validate Stack Sequences.py | 946. Validate Stack Sequences.py | py | 490 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
}
] |
43864790415 | from file_upload.settings import AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_STORAGE_BUCKET_NAME, AWS_S3_REGION_NAME
import boto3
from boto3.session import Session
from datetime import datetime
from .models import Post
def upload_and_create(request, file_to_upload):
# create client
session = Session(
aws_ac... | Gentleman37/aws-s3-upload | file_upload/uploader/utils.py | utils.py | py | 868 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "boto3.session.Session",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "file_upload.settings.AWS_ACCESS_KEY_ID",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "file_upload.settings.AWS_SECRET_ACCESS_KEY",
"line_number": 11,
"usage_type":... |
45372667296 |
# I'm the L. Ron Hubbard of the cupboard.
import networkx as nx
import requests
base_url = 'https://gps.hackmirror.icu/api'
base_user = raw_input('Username: ')
target_node = 22499
safety = 3
def req_get_maze():
url = base_url + '/map?user=' + base_user
return requests.get(url).json()['graph']
def req_move... | aniiyengar/hackmit18-puzzles | gps.py | gps.py | py | 2,492 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "networkx.algorithms.shortest... |
1463840339 | import cv2 as cv
import numpy as np
import os
import random
class DefectiveGenerator(object):
def __init__(self,dir_Database,shape_Img,Limit_ROI,withDatabase=True):
"""
:param dir_Database: 缺陷ROI路径
:param shape_Img: 图片大小[height,width]
:param Limit_ROI: ROI外接矩形大小[lower ,upper]... | ShuaiLYU/baseline_segment_Resunet_pytorch | utils/data/gen_defect.py | gen_defect.py | py | 2,996 | python | en | code | 27 | github-code | 6 | [
{
"api_name": "os.listdir",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_numbe... |
38381776934 | # 给定一棵二叉树,想象自己站在它的右侧,按照从顶部到底部的顺序,返回从右侧所能看到的节点值。
# 示例:
# 输入: [1,2,3,null,5,null,4]
# 输出: [1, 3, 4]
# 解释:
# 1 <---
# / \
# 2 3 <---
# \ \
# 5 4 <---
from typing import List
# Definition for a binary tree node.
class TreeNode:
def __init__(self, x):
self.val = x
... | 1lch2/PythonExercise | leetcode/binary_tree/199.py | 199.py | py | 1,184 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 22,
"usage_type": "name"
}
] |
23230405667 | # -*- coding: utf-8 -*-
from django.conf import settings
from django.core.exceptions import ValidationError
from django.db import models
from django.utils.text import slugify
from .survey import Survey
try: # pragma: no cover
from _collections import OrderedDict
except ImportError: # pragma: no cover
from ... | alldevic/checklists | backend/lists/models/question.py | question.py | py | 4,580 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.conf.settings.CHOICES_SEPARATOR",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "django.core.exceptions.ValidationError",
"line_number": 33,
"usage_type"... |
23125662452 | import utils.taobaokeUtils
import time
import taobaoOther.config
import config.config
import utils.netUtils
import json
import utils.utils
from requests.packages.urllib3.exceptions import InsecureRequestWarning
import requests
# from taobaoOther.logUtils import logUtils
import gc
requests.packages.urllib3.disable_warni... | tudousiji/pachong | taobaoOther/askEveryBody.py | askEveryBody.py | py | 4,296 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "requests.packages.urllib3.disable_warnings",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.packages.urllib3.exceptions.InsecureRequestWarning",
"line_number": 12,
"usage_type": "argument"
},
{
"api_name": "requests.packages",
"line_number":... |
38284315476 | import cv2
import os
from os import listdir
from os.path import isfile, join
import numpy as np
import glob
import sys
import logger
orb = cv2.ORB_create(nfeatures=500)
LEN_OF_GOODS = 10
def _calculate_location(img1, img2):
# find the keypoints and descriptors with SIFT
kp1, des1 = orb.detectAndCompute(img... | lanardo/Image_processing_server | Pre_process/aligner.py | aligner.py | py | 3,627 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.ORB_create",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.BFMatcher",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "cv2.NORM_HAMMING",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
... |
32515384583 | #!/usr/bin/env python3.6
# -*- coding: utf-8 -*-
import re
import numpy as np
import ujson as json
import tempfile
from charset_normalizer import detect
from fiona import _err as fiona_err
from osgeo.ogr import Open, GetDriverByName, Feature as OgrFeature
from osgeo.osr import SpatialReference, CoordinateTransformation... | riatelab/magrit | magrit_app/helpers/geo.py | geo.py | py | 21,545 | python | en | code | 102 | github-code | 6 | [
{
"api_name": "numpy.argmax",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "osgeo.osr.SpatialReference",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "osgeo.ogr.Open",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "re.compil... |
35409106405 | from flask import Flask,render_template,url_for,redirect
from models import db, connect_db,Pet
from forms import AddPetForm,EditPetForm
from flask_debugtoolbar import DebugToolbarExtension
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql:///adopt'
app.config['SQLALCHEMY_TRACK_MODIFICATI... | Icevolts/flask-adopt | app.py | app.py | py | 1,753 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask_debugtoolbar.DebugToolbarExtension",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "models.connect_db",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": ... |
32899944234 | import numpy as np
from MySpice import MySpice as spice
from CirCreate import create_cir
from compare_ivc import compare_ivc
from matplotlib import pyplot as plt
import copy
xmin_c = 1e-12
xmax_c = 1e-6
xmin_r = 0e0
xmax_r = 1e6
NUMBER = 7
circuit = spice.LoadFile('test_files/test_' + str(NUMBER) + '.cir')
input_data =... | Goncharovush/optimize | gradient.py | gradient.py | py | 3,558 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "MySpice.MySpice.LoadFile",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "MySpice.MySpice",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "MySpice.MySpice.Init_Data",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "My... |
34861282477 | import logging
from django.db.models.signals import post_save
from django.dispatch import receiver
from incidents.models import Incident, IncidentUpdate
from subscribers.models import Subscriber
from utilities.utils import on_transaction_commit, get_mail_domain
@receiver(post_save, sender=Incident)
@on_transaction_... | Status-Page/Status-Page | statuspage/incidents/signals.py | signals.py | py | 3,142 | python | en | code | 45 | github-code | 6 | [
{
"api_name": "incidents.models.Incident",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "subscribers.models",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "subscr... |
34040313239 | import tensorflow as tf
import tensorflow.contrib.slim as slim
import anchor_generator
import anchor_target_layer
import vgg_16
import utils
class regional_proposal_network(object):
def __init__(self, is_training):
self.vgg_16 = vgg_16.vgg_16(is_training=True)
self.is_training = is_training
d... | hx19940102/faster_rcnn | rpn_model.py | rpn_model.py | py | 4,991 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "vgg_16.vgg_16",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tensorflow.variable_scope",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "tensorflow.py_func",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "anchor_gen... |
31066884145 | from django.shortcuts import render, redirect
from django.views.decorators.csrf import csrf_exempt
from django.views import View
from .models import PREDIKSI_PANEN, HASIL_PANEN
from .forms import panenForm, hasil_panenForm, prediksi_panenForm
from tanaman.models import TANAMAN, JENIS_TANAMAN
from datetime import date, ... | mugiwara35/smart-plant | panen/views.py | views.py | py | 15,270 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "math.sqrt",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "forms.panenForm",
"line_number": 108,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 119,
"usage_type": "call"
},
{
"api_name": "models.PREDIKSI... |
11458268961 | from selenium import webdriver
import time
driver = webdriver.Chrome()
driver.get('http://101.133.169.100/yuns/index.php')
# 最大化窗口,如果不最大化窗口,页面有些控件显示不全,做自动化的时候可能定位不到控件
driver.maximize_window()
time.sleep(3)
# driver = webdriver.Firefox()
#
# driver.get('https://www.baidu.com')
# time.sleep(5)
# 六、使用xpath定位控件
# 1、使用xp... | Ailian482/WebSelenium | Auto_Test/6_xpath定位方式1.py | 6_xpath定位方式1.py | py | 3,414 | python | zh | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "time.sleep",
... |
16421488545 | import torch.nn as nn
import torch
import torch.optim as optim
from torch.utils.data import DataLoader
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelEncoder
import os
import math
from datetime import datetime
import pandas as pd
import matplotlib.pyplot as plt... | groundwater98/Miraeasset_Bigdata_Festival | ML/Seq2seq/Seq2seqLSTM.py | Seq2seqLSTM.py | py | 15,814 | python | ko | code | 1 | github-code | 6 | [
{
"api_name": "os.path.abspath",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Module",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"lin... |
35724775166 | import xml.etree.ElementTree as ET
import csv
import pandas as pd
import xlsxwriter
from openpyxl import Workbook
##To convert .xml to excel file
tree = ET.parse("en01_13_Try.xml")
root = tree.getroot()
#Example .xml format
# <ITEM><County>Albany</County><Plan Name>TOTALS:</Plan Name>
# <A Enrolled>21862</A E... | Shaleen-Kalsi/Python_Scripts | xml2xlsx.py | xml2xlsx.py | py | 1,241 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "xml.etree.ElementTree.parse",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "openpyxl.Workbook",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pan... |
72532370749 | # pylint: disable=protected-access
# pylint: disable=redefined-outer-name
# pylint: disable=unused-argument
# pylint: disable=unused-variable
import asyncio
import json
import random
from collections.abc import AsyncIterable
from inspect import signature
from pathlib import Path
from typing import Any, Final
from unit... | ITISFoundation/osparc-simcore | services/dynamic-sidecar/tests/unit/test_api_containers.py | test_api_containers.py | py | 25,298 | python | en | code | 35 | github-code | 6 | [
{
"api_name": "typing.Final",
"line_number": 48,
"usage_type": "name"
},
{
"api_name": "typing.Final",
"line_number": 49,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 59,
"usage_type": "name"
},
{
"api_name": "tenacity.retry.retry_if_exceptio... |
6291123281 | #!/usr/bin/env python
import rospy
import os
import glob
import argparse
import cv2
from cv_bridge import CvBridge, CvBridgeError
import numpy as np
import sys
sys.path.insert(1, '../image-segmentation-keras')
from keras_segmentation import predict
import time
start_time = time.time()
from sensor_msgs.msg import Image... | vigneshrajap/thorvald_hilly_nav | scripts/da_predict.py | da_predict.py | py | 4,801 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.path.insert",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "time.time",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sensor_msgs.msg.Image",
"... |
42563408769 | from random import choice
from typing import Union
from .board import Board
from .statistic import Statistic, GameResult
from .turn import Turn
class Core:
def __init__(self, first_turn: Turn = Turn.Cross) -> None:
self._board: Board = Board()
self._turn: Turn = first_turn if isinstanc... | Vladimir-0/Tic-Tac-Toe | TicTacToe/core.py | core.py | py | 2,410 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "turn.Turn",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "turn.Turn.Cross",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "board.Board",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "turn.Turn",
"line_numb... |
4668835504 | import http
from django.http import HttpResponse
from turbo_response import (
TurboStream,
TurboStreamResponse,
TurboStreamStreamingResponse,
)
from turbo_response.decorators import turbo_stream_response
class TestTurboStreamResponse:
def test_view_returns_response(self, rf):
req = rf.get("/... | hotwire-django/django-turbo-response | tests/test_decorators.py | test_decorators.py | py | 2,329 | python | en | code | 70 | github-code | 6 | [
{
"api_name": "django.http.HttpResponse",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "turbo_response.decorators.turbo_stream_response",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "http.HTTPStatus",
"line_number": 23,
"usage_type": "attribute"
... |
8468460506 | import matplotlib.pyplot as plt
from matplotlib import style
style.use('ggplot')
import numpy as np
from sklearn.cluster import KMeans
X = np.array([1, 2],
[1.5, 1.8],
[10, 15],
[3.3, 5],
[4.1, 5.6],
[5.5, 7])
## plt.scatter(x[: ,0], x[:, 1] s=150)
## p... | kagehina919/Clustering | kmeansSimple.py | kmeansSimple.py | py | 631 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.style.use",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "matplotlib.style",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sklearn.cluster.KMeans... |
22666560216 | import itertools as it
def prime_gen( ):
# An optimized Erastosthenes' sieve function
# erat2 from https://stackoverflow.com/a/3796442
D = { }
yield 2
for q in it.islice(it.count(3), 0, None, 2):
p = D.pop(q, None)
if p is None:
D[q*q] = q
yield q
el... | kakuttaja/project-euler | 051.py | 051.py | py | 2,098 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "itertools.islice",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "itertools.count",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number... |
20594273033 | """empty message
Revision ID: db576644ebc8
Revises: 77e6b97cccd2
Create Date: 2021-06-11 20:24:51.085622
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'db576644ebc8'
down_revision = '77e6b97cccd2'
branch_labels = None
depends_on = None
def upgrade():
# ... | BakeNecko/owasp_top | modules/owasp6/app/migrations/versions/db576644ebc8_.py | db576644ebc8_.py | py | 779 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "alembic.op.add_column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.String"... |
8768920011 | import pytest
import responses
from first.twitch import Twitch, AuthenticatedTwitch
import urllib.parse
import first.config
from first.authdb import TwitchAuthDb, Token
twitch_config = first.config.cfg["twitch"]
@responses.activate
def test_authenticated_request_uses_existing_token():
responses.get(
"http... | strager/First | tests/test_twitch.py | test_twitch.py | py | 2,288 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "first.twitch.config",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "first.twitch",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "responses.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "responses.matchers.... |
20144053067 | import numpy as np
import cv2
import matplotlib.pyplot as plt
# This function shows an image using the matplotlib functionality
def show_with_matplotlib(color_img, title, pos):
# pos - position in the figure plot
# First convert the BGR image to RGB
rgb = color_img[:, :, ::-1] # all items in the array, re... | Raylow00/OpenCV-Tutorials | 2_Opencv_image_processing/8_add_subtract.py | 8_add_subtract.py | py | 1,641 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.subplot",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.imshow",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "... |
14225711370 | from typing import Dict
import numpy as np
import torch
import torch.nn.functional as F
from torch import nn
from util import box_ops
def seq2logits(bbox_logits, text_vocab=50265):
return_bbox = torch.zeros(bbox_logits.shape[0],100,4).float().to(bbox_logits.device)
return_logits = torch.zeros(bbox_logits.sha... | microsoft/UniTAB | models/postprocessors.py | postprocessors.py | py | 6,255 | python | en | code | 76 | github-code | 6 | [
{
"api_name": "torch.zeros",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.zeros",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.tensor",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
"line_numb... |
40426704223 | from flask import (
Blueprint, flash, redirect, render_template, request, session, url_for, g
)
from flask_yttp.helpers import gen_room_code, flash_and_redirect, get_err_msg
from flask_yttp.dynamo_calls import get_item_room, put_item_room, new_room_item
from flask_yttp.youtube_api_calls import get_vid_info, search
... | maxburton/youtube-party-playlist-serverless | flask_yttp/video.py | video.py | py | 3,402 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Blueprint",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "flask.request.... |
39480187255 | import torch
import torch.nn.functional as F
import numpy as np
def get_upper_multiples_16(x: int):
if x % 16 == 0:
return x
else:
return int((x // 16 + 1) * 16)
def enlarge_and_save(t: torch.Tensor, dims ,name: str):
print(f"{name}: {t.shape}")
if len(t.shape) == 1:
old_col =... | zhang677/SparseAcc | train/dgl/utils.py | utils.py | py | 1,538 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.Tensor",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.functional.pad",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.nn.functional",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "numpy.s... |
13323595728 | import pygame
from sys import exit
import random
from random import randint
from pygame import mixer
# game loop
# one while loop which runs when the player moves
# collision of cheese and player score add
# collision of enemy and player game end
# one place where the enemy position resets, so that
# game is more fun... | AlphaAnas/AI_ENEMY_CHASER_GAME | DSA-project-pygame-main/DSA-project-pygame-main/Extra/Extra Codes/FINAL FINAL CODE.py | FINAL FINAL CODE.py | py | 7,304 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.init",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "pygame.displa... |
75385870586 | from keras.callbacks import Callback
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.metrics import roc_auc_score
def train_folds(X, y, fold_count, batch_size, get_model_func):
""" K-Fold Cross-Validation for Keras Models
Inspired by PavelOstyakov
https://github.com/P... | fortiema/toxic-classifier | src/models/train_utils.py | train_utils.py | py | 1,464 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "keras.callbacks.Callback",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "sklearn.metrics.roc_auc_score",
"line_number": 43,
"usage_type": "call"
}
] |
12808471420 | from utils import get_available_gpu
use_cuda = True
gpu_id = str(get_available_gpu())
pretrained_model = "facebook/bart-base"
pretrained_tokenizer = "facebook/bart-base"
pretrained_style_model = "roberta-base"
corpus_mode = "Yelp"
# corpus_mode = "amazon"
# corpus_mode = "GYAFC"
# pseudo_method = "semantic"
pseudo_... | seq-to-mind/semi-style-transfer | global_config.py | global_config.py | py | 909 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "utils.get_available_gpu",
"line_number": 4,
"usage_type": "call"
}
] |
3200106150 | import massParam as P
import matplotlib.pyplot as plt
from control import tf, tf2ss
import control as cnt
import numpy as np
# in this file, you should will need to:
#### 1)define xfer functions for the plant, and the PID controller
#### 2)define specifications (for C_pid * P, and for the final controller C)
#### 3)ma... | mebach/me431 | final/files_for_students2021/python/loopshape_mass.py | loopshape_mass.py | py | 6,461 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "control.tf",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "massParam.m",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "massParam.b",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "massParam.k1",
"line... |
56908399 | #!/usr/bin/env python
import sys
import getopt
import click
from netZooPy.panda.panda import Panda
from netZooPy.lioness import Lioness
from netZooPy.condor import condor_object
#############################################################################
# PANDA ######################################################... | netZoo/netZooPy | netZooPy/command_line.py | command_line.py | py | 15,882 | python | en | code | 71 | github-code | 6 | [
{
"api_name": "netZooPy.panda.panda.Panda",
"line_number": 93,
"usage_type": "call"
},
{
"api_name": "click.command",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "click.option",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "click.option",
... |
11295677407 | from datetime import datetime
import math
# 0: 1: 2: 3: 4:
# aaaa .... aaaa aaaa ....
# b c . c . c . c b c
# b c . c . c . c b c
# .... .... dddd dddd dddd
# e f . f e . . f . f
# e f . f e . . f .... | mykreeve/advent-of-code-2021 | day08.py | day08.py | py | 3,185 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "datetime.datetime.now",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "datetim... |
40606075995 | #!/usr/bin/python3
"""how many subs?"""
import requests
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)\
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36',
'from': 'jesushernandez1843@gmail.com'
}
def number_of_subscribers(subreddit):
"""funct... | jesus4388/holbertonschool-system_engineering-devops | 0x16-api_advanced/0-subs.py | 0-subs.py | py | 613 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 16,
"usage_type": "call"
}
] |
13511459949 | from requests import Response
from selene.core import query
from selene.support.shared import browser
from allure import step
from selene import have
from utils.tools import data_len
def test_single_user_not_found(reqres):
"""SINGLE USER NOT FOUND"""
# GIVEN
with step("SINGLE USER NOT FOUND (API)"):
... | gipercube/qa_guru_python_4_19 | tests/test_reqres_api.py | test_reqres_api.py | py | 1,432 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "allure.step",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "allure.step",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "selene.support.shared.browser.open",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "selene.sup... |
13277922266 | from google.appengine.ext import ndb
class Game(ndb.Model):
"""Models a single Guess Game."""
game_id = ndb.StringProperty()
answer = ndb.StringProperty()
date = ndb.DateTimeProperty(auto_now_add=True)
is_solved = ndb.BooleanProperty(default=False)
@classmethod
def query_game(cls, game_id... | jinglundong/GuessGame | service/model/game.py | game.py | py | 1,115 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "google.appengine.ext.ndb.Model",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "google.appengine.ext.ndb",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "google.appengine.ext.ndb.StringProperty",
"line_number": 6,
"usage_type": "cal... |
7410198247 | import xml.etree.ElementTree as ET
# tree = ET.parse('Akshaya_Table_131023_Aft_seg.xml')
tree = ET.parse('sample_xml.xml')
root = tree.getroot()
# for child in root:
# print(child.tag, child.attrib)
for movie in root.iter('movie'):
print(movie.attrib)
| punith112/thesis | code/learn/kth/xml_parser.py | xml_parser.py | py | 263 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "xml.etree.ElementTree.parse",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 4,
"usage_type": "name"
}
] |
22751429719 | '''
Created on June 29, 2014
@author: oliwa
'''
import argparse
import sys
from helperScripts.scriptutils import startModeIndexFromOne, mkdir_p
import numpy as np
import matplotlib
from numpy import dtype
matplotlib.use('Agg')
import matplotlib.pyplot as plt
class VarargsPlotterGeneric(object):
'''
Plots a v... | Shen-Lab/cNMA | Software/helperScripts/VarargsPlotterGeneric.py | VarargsPlotterGeneric.py | py | 3,515 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "matplotlib.use",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"... |
74197619709 | from rest_framework import serializers
from des.models import Ccd, Exposure
class CcdSerializer(serializers.ModelSerializer):
exposure = serializers.PrimaryKeyRelatedField(
queryset=Exposure.objects.all(), many=False
)
class Meta:
model = Ccd
fields = (
"id",
... | linea-it/tno | backend/des/serializers/ccd.py | ccd.py | py | 811 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.PrimaryKeyRelatedField",
"line_number": 7... |
16824824454 | import time
import multiprocessing
from NeuralNetwork import MNISTDataReader
from NeuralNetwork import MLPBuilder
if __name__ == '__main__':
train_images = MNISTDataReader.load_data("NeuralNetwork/mnist data/train-images.idx3-ubyte")
train_images = train_images.reshape(1000, 60, 784)
# train_labels = MNIS... | Weston-Wallace/Neural-Network-From-Scratch | main.py | main.py | py | 1,428 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "NeuralNetwork.MNISTDataReader.load_data",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "NeuralNetwork.MNISTDataReader",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "NeuralNetwork.MLPBuilder",
"line_number": 27,
"usage_type": "call"
... |
18262814946 | from flask import Flask
from flask import request
import requests
import json
import os
app = Flask(__name__)
@app.route('/calculate', methods=['POST'])
def hello():
# Get the data from the API
data = request.get_json()
# Getting the filename
filename = data["file"]
status = 1
# Valida... | almasfiza/cloud5409 | A1/App1/app1.py | app1.py | py | 1,791 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.request.get_json",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.request",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "os.path.exists",
... |
35615375491 | # Author: Taoz
# Date : 8/25/2018
# Time : 12:13 PM
# FileName: experiment.py
import numpy as np
from example.medusa.algorithm1.player import Player
from game_env import GameEnvironment
from example.medusa.algorithm1.replay_buffer import ReplayBuffer
from example.medusa.algorithm1.q_learning import QLearning
from e... | seekloud/esheep-sdk | esheep-sdk/example/medusa/algorithm1/experiment.py | experiment.py | py | 5,375 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "example.medusa.algorithm1.utils.try_gpu",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "example.medusa.algorithm1.utils",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "mxnet.random.seed",
"line_number": 21,
"usage_type": "call"
},
... |
18991522567 | import gzip
import random, os, sys
import numpy as np
import time
import multiprocessing
import matplotlib.pyplot as plt
from sklearn.metrics import precision_score, f1_score, recall_score
from sklearn.naive_bayes import GaussianNB
from sklearn.svm import SVC
from math import floor
from wrdfn import *
res_f1 = [... | vaarsha/Spam-Filtering | main.py | main.py | py | 5,407 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "gzip.open",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "math.floor",
"line_number": 4... |
7888305513 | from .commute_tube import CommuteTube
import argparse
import os
def main():
parser = argparse.ArgumentParser()
default_config = os.path.expanduser('~/.config/commutetube/config.json')
default_download_archive = os.path.expanduser('~/.config/commutetube/already_downloaded.txt')
parser.add_argument('-... | snipem/commute-tube | commute_tube/__main__.py | __main__.py | py | 1,436 | python | en | code | 21 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path.expanduser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.path.expandus... |
15297681822 | import psycopg2
from psycopg2 import Error
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT
import datetime
import csv
import pandas as pd
a101 = ['Morning_Meds','Read','Cook_Lunch','Eat_Dinner','Eat_Breakfast','Phone','Groom','Wash_Lunch_Dishes','Eat_Lunch','Eat','Cook']
a102 = ['Eat_Dinner', 'Bat... | Piier/activity_forecasting | activity_selection/reduce_activity.py | reduce_activity.py | py | 9,750 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "psycopg2.connect",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "psycopg2.Error",
"line_number": 57,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 105,
"usage_type": "call"
},
{
"api_name": "datetime.... |
3525776450 | import locale
import logging
import os
import stat
from contextlib import contextmanager
from io import BytesIO, StringIO
from typing import (
TYPE_CHECKING,
Callable,
Iterable,
List,
Mapping,
Optional,
Tuple,
Union,
)
from funcy import cached_property
from scmrepo.exceptions import (
... | gshanko125298/Prompt-Engineering-In-context-learning-with-GPT-3-and-LLMs | myenve/Lib/site-packages/scmrepo/git/backend/pygit2.py | pygit2.py | py | 22,033 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "objects.GitObject",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "locale.getpr... |
24227516153 | from __future__ import print_function
from googleapiclient.discovery import build
from apiclient import errors
from email.mime.text import MIMEText
import base64
import pickle
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
import os.path
EMAIL_FROM = ''
EMAIL_... | ckallum/ValentinesEmailSender | send_emails.py | send_emails.py | py | 2,512 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "email.mime.text.MIMEText",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "base64.urlsafe_b64encode",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "apiclient.errors.HttpError",
"line_number": 40,
"usage_type": "attribute"
},
{
... |
5992896542 | from collections import defaultdict
import csv
import dataclasses
import json
import os
import re
import string
from typing import DefaultDict, Dict, Iterable, List, Set, Any
import xlrd
@dataclasses.dataclass
class Field:
name: str
column_index: int
keywords: List[str]
anti_keywords: List[str]
def... | kakxow/bank_parser | bank_parser/registry_parser.py | registry_parser.py | py | 7,236 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "typing.Iterable",
... |
11952362776 | from datetime import datetime
from pathlib import Path
import joblib
import pandas as pd
from pmlb import fetch_data
from sklearn.metrics import accuracy_score, balanced_accuracy_score, confusion_matrix, f1_score, precision_score, recall_score
from sklearn.model_selection import StratifiedShuffleSplit
from joblib impor... | froestiago/K-Fold-Partitioning-Methods | kfoldmethods/experiments/estimate_true_metrics.py | estimate_true_metrics.py | py | 12,437 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.DataFrame.from_records",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 56,
"usage_type": "attribute"
},
{
"api_name": "kfoldmethods.experiments.configs.datasets",
"line_number": 62,
"usage_type": "attribu... |
39410169314 | import logging
import os
import re
from subprocess import Popen, PIPE
from .script_utils import log as log
from .script_utils import whereis
class SamTools:
"""
This class wraps functions from samtools.
The functions in this class pivot around the bam format. i.e if the user has
a sam file, it is ex... | kbaseapps/ReadsAlignmentUtils | lib/ReadsAlignmentUtils/core/sam_tools.py | sam_tools.py | py | 13,535 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 4... |
858851204 | from __future__ import division
import httplib
import urllib2
import ssl
import certifi
from backports.ssl_match_hostname import match_hostname
__all__ = ['VerifiedHTTPSHandler', 'https_handler', 'build_opener']
class CertValidatingHTTPSConnection(httplib.HTTPConnection):
default_port = httplib.HTTPS_PORT
... | VisTrails/VisTrails | vistrails/packages/URL/https.py | https.py | py | 2,226 | python | en | code | 100 | github-code | 6 | [
{
"api_name": "httplib.HTTPConnection",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "httplib.HTTPS_PORT",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "httplib.HTTPConnection.__init__",
"line_number": 19,
"usage_type": "call"
},
{
... |
30691252595 | import argparse
from data_helper import preprocess
from tensorflow.keras.models import load_model
import tensorflow as tf
import numpy as np
from sklearn.metrics import confusion_matrix, accuracy_score, classification_report
from sklearn.utils.multiclass import unique_labels
import matplotlib.pyplot as plt
import os
... | ShaneTian/TextCNN | test.py | test.py | py | 3,618 | python | en | code | 56 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.cm",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "sklearn.metrics.confusion_matrix",
"line_number": 27,
"usage_type": "call"
},
{
"api_... |
18888541299 | # REQUIRED IMPORTS
# PATH MANIPULATION
import os.path
import os
# HIDING LONG PROCESSING OR OUTPUT MESSAGES
from IPython.utils import io
# ARRAY OPERATIONS
import numpy as np
# IMPORT UTILS
# INTERNAL IMPORT
from shock_cooling_curve.utils import utils
# DATAFRAME HANDLING
import pandas as pd
# READ... | padma18-vb/shock_cooling_curve | src/shock_cooling_curve/supernova.py | supernova.py | py | 16,295 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "re.split",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 70,
"usage_type": "attribute"
},
{
"api_name": "configparser.ConfigParser",
"l... |
17930083474 | import requests
class MovieDb:
def __init__(self):
self.apiUrl = "https://api.themoviedb.org/3/"
self.apiKey = "" #api keyi buraya yazın
def getPopulars(self):
response = requests.get(self.apiUrl+"movie/popular?api_key="+self.apiKey+"&language=tr-TR&page=1")
return res... | bilalemirgunay/FilmAPI | filmAPI.py | filmAPI.py | py | 1,488 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
}
] |
37854609612 | import requests
import os
import time
import mmh3
import langdetect
from src.model.commit import Commit
from src.model.file import File
from src.model.issue import Issue
from src.model.patch import Patch
from src.model.repo import Repo
from src.service.githubService import GithubService
class ModelCreationService:
... | vetemi/github-code-collector | src/service/modelCreationService.py | modelCreationService.py | py | 2,573 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "src.service.githubService.GithubService",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "src.model.repo.Repo",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "src.model.issue.Issue",
"line_number": 46,
"usage_type": "call"
},
{
... |
15667860836 | from django.utils.translation import ugettext_lazy as _
DAY_CHOICES = (
(0, _("Monday")),
(1, _("Tuesday")),
(2, _("Wednesday")),
(3, _("Thursday")),
(4, _("Friday")),
(5, _("Saturday")),
(6, _("Sunday"))
)
BITWISE_DAY_CHOICES = (
(1, "Su",_("Sunday")),
(2, "M",_("Monday")),
(4... | chrisherold/django-weekday-field | weekday_field/utils.py | utils.py | py | 729 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "django.utils.translation.ugettext_lazy",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "django.utils.translation.ugettext_lazy",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.utils.translation.ugettext_lazy",
"line_number": 6,
"u... |
15150955697 | import json
import requests
us_ag = {
"user-agent":"Mozilla/5.0 (Linux; U; Android 4.0.2; en-us; Galaxy Nexus Build/ICL53F) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",
"platform": "Mobile", "browser": "No", "device": "Android"
}
response = requests.get(
"https://playground.learnqa.ru... | lebedevOK/LearnQA_PythonAPI | example01/test0.py | test0.py | py | 1,149 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 14,
"usage_type": "call"
}
] |
36108635478 | from cmath import inf
from turtle import color
import numpy as np
import networkx as nx
import matplotlib.pyplot as plt
from matplotlib import cm
adj_matrix = np.load("interpret_csv/adj_mat_alpha_0603.npy")
#adj_matrix = np.transpose(adj_matrix)
graph = nx.from_numpy_matrix(adj_matrix, parallel_edges=True, create_us... | oscarcrowley1/thesis | interpret_csv_bravo/make_graph.py | make_graph.py | py | 1,300 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "numpy.load",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "networkx.from_numpy_matrix",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "networkx.DiGraph",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "matplotlib... |
44915934936 | #!/usr/bin/env python3
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
def ydot(t, y):
g = 9.81
l = 1
z1 = y[1]
z2 = -g/l*np.sin(y[0])
return np.array([z1, z2])
def eulerstep(t, x, h):
return ([x[j]+h*ydot(t,x)[j] for j in range(len(x))])
def ... | Quark3e/Chromebook-projects | teststuff/python/matplotlib/anim_test_1.py | anim_test_1.py | py | 1,380 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "numpy.sin",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
42140519246 | import sys
sys.path.append("../common")
import utils
def get_depths():
content = utils.read_input_file()
contentList = content.splitlines()
return list(map(int, contentList))
def count_increase(depthList):
return len([(i, j)
for i, j in enumerate(depthList)
if (i > 0) and (depth... | wgnrd/AdventOfCode21 | 01/main.py | main.py | py | 785 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "utils.read_input_file",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "utils.display_header... |
7963464065 | # import matplotlib.pyplot as plt
# import matplotlib.colors as colors
# import matplotlib.cm as cmx
# from pandas import read_csv
# import dtw
#
#
# #df = read_csv('iris.csv')
# df = read_csv('DownStair.csv')
#
# # map Name to integer
# #pos = df.loc[:,["Name"]].groupby("Name").count().reset_index()
# pos ... | phongcpt72/Unitmotion-Detection | Unitmotion/Plot/plottest.py | plottest.py | py | 1,909 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.random.seed",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "numpy.sin",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_nu... |
24786654173 | import cv2
from gaze_tracking import GazeTracking
import pandas as pd
import numpy as np
gaze = GazeTracking()
webcam = cv2.VideoCapture(0)
data_list = []
count=0
df = pd.DataFrame(data_list, columns=['quadrant','left_pupil','right_pupil','gaze_center_x', 'gaze_center_y', 'nose_end_points',
... | VikasAL/OnlineExamProctor | facedetection/main.py | main.py | py | 5,063 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "gaze_tracking.GazeTracking",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.arra... |
73943663866 | import os
import torch
import pytorch_lightning as pl
import segmentation_models_pytorch as smp
from segmentation_models_pytorch import utils as smp_utils
from pprint import pprint
from torch.utils.data import DataLoader
from torch import nn
from KSDD import KSDDDataset
# download data
root = "KSDD"
# init train, ... | Alleycat404/segment | train.py | train.py | py | 2,645 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "KSDD.KSDDDataset",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "KSDD.KSDDDataset",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "KSDD.KSDDDataset",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch.utils.data.D... |
41568458583 | from django.urls import path
from . import views
app_name = "blog"
urlpatterns = [
path('', views.blog, name="blogs"),
path('home/', views.HomePageView.as_view(), name="home"), # Notice the URL has been named
path('about/', views.AboutPageView.as_view(), name='about'),
path('cloud/', views.Cl... | subhasishpaul/django-k8s-aws | web/blog/urls.py | urls.py | py | 357 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
5311686277 | import sys
from Bio import SeqIO
import multiprocessing as mp
import pandas as pd
import warnings
from pathlib import Path
import gzip
import os
import itertools
# Usage: python extract_and_check_seqs.py in_dir output_dir metadata threads > log.txt
print(" ".join(sys.argv))
in_dir = str(sys.argv[1])
output_dir = str... | WillNickols/SPreCC | src/extract_and_check_seqs.py | extract_and_check_seqs.py | py | 3,384 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line... |
30138395675 | # !/usr/local/python/bin/python
# -*- coding: utf-8 -*-
# (C) Wu Dong, 2019
# All rights reserved
# @Author: 'Wu Dong <wudong@eastwu.cn>'
# @Time: '2020-03-17 16:02'
import json
import pytest
from flask import Flask
from flask import make_response
from pre_request import pre
from pre_request import Rule
app = Flask... | Eastwu5788/pre-request | tests/conftest.py | conftest.py | py | 6,500 | python | en | code | 55 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "flask.make_response",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pre_request.Rule",
"li... |
36107268954 | import torch
from run.base.train_base_run import TrainBaseRun
import run.pipeline.helper as helper
from model.pipeline.deep_fisheye_pipeline import DeepFisheyePipeline
from util import AverageDict
from util.io import LossLog
from util.image import convert_to_colormap
class PipelineTrainRun(TrainBaseRun):
def setu... | KAIST-HCIL/DeepFisheyeNet | run/pipeline/pipeline_train_run.py | pipeline_train_run.py | py | 1,922 | python | en | code | 27 | github-code | 6 | [
{
"api_name": "run.base.train_base_run.TrainBaseRun",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "model.pipeline.deep_fisheye_pipeline.DeepFisheyePipeline",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "util.AverageDict",
"line_number": 17,
"usag... |
19265186960 | import pytz
import argparse
def retrieve_arguments():
tz_search = argparse.ArgumentParser(description="quick search Python TimeZones")
tz_search.add_argument("-s", "--search",
metavar='search_word',
type=str,
default=False,
... | netmet1/constellation-node-automation | functions/search_timezones.py | search_timezones.py | py | 823 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pytz.all_timezones",
"line_number": 21,
"usage_type": "attribute"
}
] |
22469455849 | from unittest.mock import MagicMock
import pytest
from belvo import resources
from belvo.enums import TaxRetentionType
from belvo.exceptions import BelvoAPIException
def test_tax_retentions(api_session):
tax_retentions = resources.TaxRetentions(api_session)
tax_retentions.session.post = MagicMock()
tax_... | belvo-finance/belvo-python | tests/unit/test_tax_retentions.py | test_tax_retentions.py | py | 1,085 | python | en | code | 15 | github-code | 6 | [
{
"api_name": "belvo.resources.TaxRetentions",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "belvo.resources",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "unittest.mock.MagicMock",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": ... |
40634538955 | ######################################################################
# Association Rule Learning using the Dataset Online Retail II
######################################################################
# Goal: Suggesting products to users at the basket stage
# InvoiceNo: Invoice Number (If this code starts w... | afatsumcemreg/04_recommendation_systems | 07_week_01_association_rule_analysis.py | 07_week_01_association_rule_analysis.py | py | 10,447 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pandas.se... |
26316088645 | import random
from datetime import date
import requests
import data_base
class VkAgent:
def __init__(self, token: str, api_version: str = '5.131', base_url: str = "https://api.vk.com/"):
self.token = token
self.list_of_partner_ids = {}
self.search_params = {}
self.offset_count = {}... | Mymilkashake/VKinder | vk_agent.py | vk_agent.py | py | 8,796 | python | ru | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "data_base.record_user",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "datetime.date.today"... |
70374432829 | import itertools
from typing import Any, Dict, Iterable, Iterator, List, Optional, Tuple
def update_dict(org: Dict[str, Any], update: Dict[str, Any]) -> None:
"""Update dict using dot-notation.
Examples:
>>> x = {"a": 1, "b": {"x": "abc", "y": 2, "z": [0, 1, 2]}}
>>> update_dict(x, {"b": {"z"... | daizutabi/ivory | ivory/utils/params.py | params.py | py | 8,111 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.Dict",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 38,
... |
32506798103 | import logging
from math import ceil
from .. import util
logger = logging.getLogger(__name__)
MIN_BID_PER_BYTE = 1
MIN_BID = 1000
DEFAULT_BUMP_FACTOR = 1.05
MAX_MSG_SIZE = 1050 * 1000 # maximum message size relayed by the satellite API
MAX_BID = 10 * MIN_BID_PER_BYTE * MAX_MSG_SIZE
def suggest_bid(data_size, prev_... | Blockstream/satellite | blocksatcli/api/bidding.py | bidding.py | py | 2,488 | python | en | code | 949 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "math.ceil",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "math.ceil",
"line_number": 31,
"usage_type": "call"
}
] |
38257482845 | # Databricks notebook source
# MAGIC %md
# MAGIC #####Aggregate Functions
# COMMAND ----------
presentation=spark.read.parquet("/mnt/presentation/race_result_2020")
display(presentation)
# COMMAND ----------
from pyspark.sql.functions import count,countDistinct,sum
# COMMAND ----------
# MAGIC %md
# MAGIC ######C... | kpkrishan/Formula-1-Data-Analysis | Learning Modules/1. aggregate_learn.py | 1. aggregate_learn.py | py | 2,555 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pyspark.sql.functions.sum",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.functions.sum",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.functions.count",
"line_number": 103,
"usage_type": "call"
},
{
"... |
36972512774 | from aocd import get_data
from io import StringIO
input = StringIO(get_data(year=2022, day=3))
def get_prio(item):
items = [' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'A', 'B', 'C', 'D', 'E', 'F',... | JustWannaFly/PyAOC | 22/src/day3.py | day3.py | py | 1,234 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "io.StringIO",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "aocd.get_data",
"line_number": 4,
"usage_type": "call"
}
] |
8494330232 | import numpy as np
import pandas as pd
import streamlit as st
import datetime
import lmfit
from pathlib import Path
from PIL import Image
from sklearn.metrics import mean_absolute_error, mean_squared_error
from statsmodels.tsa.holtwinters import ExponentialSmoothing
from statsmodels.tsa.statespace.sarimax import SA... | nicoloverardo/master-degree-thesis | app.py | app.py | py | 50,320 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "os.chdir",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_nu... |
74066421948 | from pyspark.sql import SparkSession
from pyspark.sql.types import StructType, StructField, StringType, DoubleType
from pyspark.sql.functions import *
import sys
spark = SparkSession.builder.appName('retaildata').getOrCreate()
spark.sparkContext.setLogLevel("ERROR")
schema=StructType([
StructField('symbol', S... | Dipanwita-biswas-lab/spark | stocks_spark_streaming.py | stocks_spark_streaming.py | py | 3,599 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pyspark.sql.SparkSession.builder.appName",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pyspark.sql.SparkSession",
"line_number": 8,
"usage_type": "... |
26171584532 | import argparse
import json
import os
import random
import shutil
import time
import math
import logging
import warnings
import numpy as np
import tempfile
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.distributed as dist
import torch.optim
import torch.m... | liuqiangict/isr | src/main.py | main.py | py | 31,089 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.basicConfig",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "models.__dict... |
36005904379 | import os
import json
import pyarrow.parquet as pq
import torch
import torch.optim as optim
from torch import nn
from transformers import GPT2LMHeadModel, GPT2Tokenizer
import time
json_folder = 'json_fold'
def load_data_from_json(json_path):
with open(json_path) as f:
return json.load(f)
... | uglyuglyugly/celest | learning.py | learning.py | py | 2,654 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pyarrow.parquet.read_table",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pyarrow.parquet",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "os.listdir",
... |
13610820475 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import django.db.models.deletion
import taggit.managers
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MOD... | klebercode/sofia | sofia/apps/learn/migrations/0001_initial.py | 0001_initial.py | py | 7,177 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.swappable_dependency",
"line_number": 13,
"usage_type": "ca... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.