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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
21998859226 | from typing import List
class Solution:
def deleteAndEarn(self, nums: List[int]) -> int:
max_val = max(nums)
total = [0] * (max_val + 1)
for val in nums:
total[val] += val
def rob(nums):
first = nums[0]
second = max(nums[0], nums[1])
... | hangwudy/leetcode | 700-799/740. 删除并获得点数.py | 740. 删除并获得点数.py | py | 475 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
}
] |
73813844989 | import io
import numpy as np
import sys
from gym.envs.toy_test import discrete
from copy import deepcopy as dc
UP = 0
RIGHT = 1
DOWN = 2
LEFT = 3
class GridworldEnv(discrete.DiscreteEnv):
metadata = {'render.modes': ['human', 'ansi']}
def __init__(self, shape = [4, 4]):
if not isinstance(shape, (li... | hyeonahkimm/RLfrombasic | src/common/gridworld.py | gridworld.py | py | 2,222 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "gym.envs.toy_test.discrete.DiscreteEnv",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "gym.envs.toy_test.discrete",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "numpy.prod",
"line_number": 23,
"usage_type": "call"
},
{
... |
37600184033 | import torch
from safetensors.torch import save_file
import argparse
from pathlib import Path
def main(args):
input_path = Path(args.input_path).resolve()
output_path = args.output_path
overwrite = args.overwrite
if input_path.suffix == ".safetensors":
raise ValueError(
f"{input_p... | p1atdev/sd_ti_merge | to_safetensors.py | to_safetensors.py | py | 1,560 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pathlib.Path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch.load",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "safetensors.torch.save_file",
... |
40458088335 | # general imports for EMISSOR and the BRAIN
from cltl import brain
from emissor.representation.scenario import ImageSignal
# specific imports
from datetime import datetime
import time
import cv2
import pathlib
import emissor_api
#### The next utils are needed for the interaction and creating triples and capsules
impo... | leolani/cltl-chatbots | src/chatbots/bots/episodic_image_memory.py | episodic_image_memory.py | py | 5,114 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "time.time",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "cv2.imwrite",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "chatbots.util.face_util.detect_objects",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "chatbots... |
8926064474 | import pandas as pd
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
import time
import requests
import shutil
import os.path
import docx2txt
from webdriver_manager.chrome import ChromeDriverManager
from datetime import datetime
from selenium.webdriver.support.ui import We... | priyankathakur6321/WebScraping-Automation | ctcfp/main.py | main.py | py | 5,904 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "webdriver_manager.chrome.ChromeDriverManager",
"line_number": 15,
"usage_type": "call"
},
... |
22175885434 | # Author:Zhang Yuan
from MyPackage import *
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import seaborn as sns
import statsmodels.api as sm
from scipy import stats
# ------------------------------------------------------------
__mypath__ = MyPath.MyClass_P... | MuSaCN/PythonProjects2023-02-14 | Project_Papers文章调试/4.如何在MQL5中使用ONNX模型.py | 4.如何在MQL5中使用ONNX模型.py | py | 14,235 | python | zh | code | 1 | github-code | 6 | [
{
"api_name": "tensorflow.__version__",
"line_number": 92,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.config.list_physical_devices",
"line_number": 94,
"usage_type": "call"
},
{
"api_name": "tensorflow.config",
"line_number": 94,
"usage_type": "attribute"
},... |
25503087204 | from django.shortcuts import render, redirect
from django.urls import reverse
from django.contrib.auth.decorators import login_required
from .models import ListingComment, Listing, Bid, Category
from .forms import CreateListingForm
import os
import boto3
def home(request):
listings = Listing.objects.filter(is_ac... | samyarsworld/social-network | auction/views.py | views.py | py | 5,652 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "models.Listing.objects.filter",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "models.Listing.objects",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "models.Listing",
"line_number": 12,
"usage_type": "name"
},
{
"api_name... |
40080606131 | import os
import connexion
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_marshmallow import Marshmallow
from flask_bcrypt import Bcrypt
basedir = os.path.abspath(os.path.dirname(__file__))
# Create the Connexion application instance
connex_app = connexion.App(__name__, specification_dir=... | tuvetula/ApiRestFlask_videos | config.py | config.py | py | 950 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.abspath",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "connexion.App",
"line_n... |
10711040761 | import tensorflow as tf
from tensorflow import keras
import numpy as np
import os
import sys
sys.path.append(os.getcwd())
from utils.prepareReviewDataset import intToWord, return_processed_data_and_labels
def decode_review(text):
return " ".join([intToWord.get(i, "?") for i in text])
train_data, train_labels, test_d... | tung2389/Deep-Learning-projects | Text Classification/trainModel.py | trainModel.py | py | 1,347 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "utils.prepareReviewDataset.intTo... |
24046293426 | # Autor: João PauLo Falcão
# Github: https://github.com/jplfalcao
# Data de criação: 09/10/2023
# Data de modificação:
# Versão: 1.0
# Importando a biblioteca
import yt_dlp
# Endereço do vídeo a ser baixado
url = input("Digite a url do vídeo: ")
# Especificando o formato '.mp4' para o vídeo
ydl_opts = {
'format... | jplfalcao/python | youtube_video_download/ytvd.py | ytvd.py | py | 532 | python | pt | code | 0 | github-code | 6 | [
{
"api_name": "yt_dlp.YoutubeDL",
"line_number": 20,
"usage_type": "call"
}
] |
32623837320 | from base_factor import BaseFactor
from data.data_module import DataModule
class PEFactor(BaseFactor):
def __init__(self):
BaseFactor.__init__(self,'pe')
def compute(self,begin_date,end_date):
print(self.name,flush=True)
dm =DataModule()
df_daily = dm.get_k_data()
prin... | bowenzz/Quant-Trading-System | factor/pe_factor.py | pe_factor.py | py | 403 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "base_factor.BaseFactor",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "base_factor.BaseFactor.__init__",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "base_factor.BaseFactor",
"line_number": 6,
"usage_type": "name"
},
{
"api_na... |
35416294037 |
import rdflib
from rdflib import Graph
from scipy.special import comb, perm
from itertools import combinations
g = Graph()
g.parse(r'/Users/shenghua/Desktop/ontology/ontology.owl')
deleted_str=r"http://www.semanticweb.org/zhou/ontologies/2020/3/untitled-ontology-19#"
len_deleted_st=len(deleted_str)
query = """
SE... | 0AnonymousSite0/Data-and-Codes-for-Integrating-Computer-Vision-and-Traffic-Modelling | 3. Shared codes/Codes for SPARQL query in the CV-TM ontology/Query of CV-TM Ontology.py | Query of CV-TM Ontology.py | py | 5,900 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "rdflib.Graph",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "scipy.special.comb",
"line_number": 166,
"usage_type": "call"
},
{
"api_name": "itertools.combinations",
"line_number": 169,
"usage_type": "call"
}
] |
36025283136 | from ..Model import BootQModel
from Agent import Agent
import random
from chainer import cuda
try:
import cupy
except:
pass
import numpy as np
import logging
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
class BootQAgent(Agent):
"""
Deep Exploration via Bootstrapped DQN
Args:
... | ppaanngggg/DeepRL | DeepRL/Agent/BootQAgent.py | BootQAgent.py | py | 7,856 | python | en | code | 29 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "Agent.Agent",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "Model.BootQModel",
... |
10233643835 | from typing import List, Optional
from twitchio import PartialUser, Client, Channel, CustomReward, parse_timestamp
__all__ = (
"PoolError",
"PoolFull",
"PubSubMessage",
"PubSubBitsMessage",
"PubSubBitsBadgeMessage",
"PubSubChatMessage",
"PubSubBadgeEntitlement",
"PubSubChannelPointsMe... | PythonistaGuild/TwitchIO | twitchio/ext/pubsub/models.py | models.py | py | 15,690 | python | en | code | 714 | github-code | 6 | [
{
"api_name": "twitchio.Client",
"line_number": 92,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 92,
"usage_type": "name"
},
{
"api_name": "twitchio.Client",
"line_number": 119,
"usage_type": "name"
},
{
"api_name": "twitchio.PartialUser... |
6814941665 | from urllib.request import urlopen
from pdfminer.high_level import extract_text
def pdf_to_text(data):
with urlopen(data) as wFile:
text = extract_text(wFile)
return text
docUrl = 'https://diavgeia.gov.gr/doc/ΩΕΚ64653ΠΓ-2ΞΡ'
print(pdf_to_text(docUrl))
| IsVeneti/greek-gov-nlp | Preprocessing/ConvertPdf.py | ConvertPdf.py | py | 280 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pdfminer.high_level.extract_text",
"line_number": 8,
"usage_type": "call"
}
] |
70159895227 | __all__ = [
'points_to_morton',
'morton_to_points',
'points_to_corners',
'coords_to_trilinear',
'unbatched_points_to_octree',
'quantize_points'
]
import torch
from kaolin import _C
def quantize_points(x, level):
r"""Quantize :math:`[-1, 1]` float coordinates in to
:math:`[0, (2^{level... | silence394/GraphicsSamples | Nvida Samples/kaolin/kaolin/ops/spc/points.py | points.py | py | 5,820 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.floor",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "torch.clamp",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "torch.unique",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "torch.sort",
"line_number": ... |
18718175573 | from django.shortcuts import render, HttpResponse, redirect
from .models import Note
from django.urls import reverse
# Create your views here.
def index(request):
context = {
"notes": Note.objects.all(),
}
return render(request, 'notes/index.html', context)
def create(request):
if request.me... | mtjhartley/codingdojo | dojoassignments/python/django/full_stack_django/ajax_notes/apps/notes/views.py | views.py | py | 846 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "models.Note.objects.all",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "models.Note.objects",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "models.Note",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.shor... |
16104264799 | import gatt
import numpy as np
import time
import datetime
class BLE(gatt.Device):
def __init__(self, Age, Height, Gender, Write, manager,mac_address):
super().__init__(manager = manager , mac_address = mac_address)
self.Age = Age
self.Height = Height
self.Gender = Gender
... | sanbuddhacharyas/MEDICAL_CARE | source_code/BLE.py | BLE.py | py | 4,518 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "gatt.Device",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.now",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "datetime... |
30455799471 | import pandas as pd
import tensorflow as tf
import argparse
from . import data
TRAIN_URL = data.TRAIN_URL
TEST_URL = data.TEST_URL
CSV_COLUMN_NAMES = data.CSV_COLUMN_NAMES
LABELS = data.LABELS
def maybe_download():
train_path = tf.keras.utils.get_file(TRAIN_URL.split('/')[-1], TRAIN_URL)
test_path = tf.ker... | RajithaKumara/Best-Fit-Job-ML | classifier/estimator/model.py | model.py | py | 3,077 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "tensorflow.keras.utils.get_file",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.keras.utils.get_file",
"line_number": 16,
"usage_type": "call"
},
{
... |
42924345016 | import sys
import os
import time
import re
import csv
import cv2
import tensorflow as tf
import numpy as np
#import pandas as pd
from PIL import Image
from matplotlib import pyplot as plt
from object_detection.utils import label_map_util
from object_detection.utils import visualization_utils as vis_util
# if len(sys.a... | ppalantir/axjingWorks | AcademicAN/TwoStage/test_batch.py | test_batch.py | py | 5,072 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.walk",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "numpy.ravel",
"line_number": 38... |
3547587015 | import numpy as np
import tensorflow as tf
from structure_vgg import CNN
from datetime import datetime
import os
from tfrecord_reader import tfrecord_read
import config
os.environ['CUDA_VISIBLE_DEVICES'] = '1'
FLAGS = tf.flags.FLAGS
tf.flags.DEFINE_string('dataset', 'dset1', 'Choose dset1 or dset2 for training, defaul... | yikaiw/DL-hw2-CNN | main.py | main.py | py | 4,806 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.environ",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.flags",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.flags.DEFINE_string",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "t... |
43200145217 | """empty message
Revision ID: 5b1f1d56cb45
Revises: 934b5daacc67
Create Date: 2019-06-03 19:02:22.711720
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '5b1f1d56cb45'
down_revision = '934b5daacc67'
branch_labels = None... | tgalvinjr/blog-ip | migrations/versions/5b1f1d56cb45_.py | 5b1f1d56cb45_.py | py | 830 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "alembic.op.alter_column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.dialects.postgresql.TIMESTAMP",
"line_number": 22,
"usage_type": "call"
},
{
"api_n... |
709779467 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import string
import pandas as pd
from gensim.models import KeyedVectors
import time
from sklearn.feature_extraction.stop_words import ENGLISH_STOP_WORDS
#x=find_department('Mortage requirements specified are incorrect', False)
def find_department(single_query,only_depar... | ankitd3/Assist-ANS | NLP/distance.py | distance.py | py | 6,026 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "time.time",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "gensim.models.KeyedVectors.load_word2vec_format",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "gensim.models.KeyedVectors",
"line_number": 15,
"usage_type": "name"
},
{
... |
39252790870 | import time
import logging
from django.contrib import admin
from django.contrib import messages
from django.contrib.admin import helpers
from django.urls import reverse
from django.db import transaction
from django.db.models import Count
from django.template.response import TemplateResponse
from django.utils.html impo... | mangaki/mangaki | mangaki/mangaki/admin.py | admin.py | py | 28,860 | python | en | code | 137 | github-code | 6 | [
{
"api_name": "mangaki.models.ActionType.DO_NOTHING",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "mangaki.models.ActionType",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "mangaki.models.ActionType.JUST_CONFIRM",
"line_number": 33,
"usage_ty... |
39760240581 | # -*- coding: utf-8 -*-
from django.conf.urls import patterns, include, url
urlpatterns = patterns('CiscoDxUketsukeApp.views',
# url(r'^$', 'CiscoDxUketsuke.views.home', name='home'),
# url(r'^getData/' 'CiscoDxUketsuke.views.getData'),
url(r'^member_tsv/$','member_tsv'),
url(r'^member_json/$','member... | fjunya/dxApp | src/CiscoDxUketsukeApp/urls.py | urls.py | py | 1,254 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.conf.urls.patterns",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "djan... |
73968831228 | """Analyzes the MCTS explanations output by run_mcts.py in terms of stress and context entropy."""
import pickle
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import wilcoxon
def analyze_mcts_explanations(explanations_path: Path,
save_dir: ... | swansonk14/MCTS_Interpretability | analyze_mcts_explanations.py | analyze_mcts_explanations.py | py | 6,053 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "pathlib.Path",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "pickle.load",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_numb... |
4206104345 | # pylint: disable=no-member, no-name-in-module, import-error
from __future__ import absolute_import
import glob
import distutils.command.sdist
import distutils.log
import subprocess
from setuptools import Command, setup
import setuptools.command.sdist
# Patch setuptools' sdist behaviour with distutils' sdist behaviou... | jbarlow-mcafee/opendxl-misc | setup.py | setup.py | py | 1,654 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "setuptools.command",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "distutils.command.sdist.command",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "distutils.command.sdist",
"line_number": 12,
"usage_type": "name"
},
{
... |
21738440212 | import cv2
# Problem 4.
# Rescale the video vid1.jpg by 0.5 and display the original video and the rescaled one in separate windows.
def rescaleFrame(frame, scale):
width = int(frame.shape[1] * scale)
height = int(frame.shape[0] * scale)
dimensions = (width, height)
return cv2.resize(frame, dimension... | markhamazaspyan/Python_2_ASDS | opencvHW1/problem4.py | problem4.py | py | 799 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.resize",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.INTER_AREA",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"lin... |
33628818675 | # -*- coding: utf-8 -*-
""" Created by Safa Arıman on 12.12.2018 """
import base64
import json
import urllib.request, urllib.parse, urllib.error
import urllib.request, urllib.error, urllib.parse
import urllib.parse
from ulauncher.api.client.EventListener import EventListener
from ulauncher.api.shared.action.DoNothingAc... | safaariman/ulauncher-jira | jira/listeners/extension_keyword.py | extension_keyword.py | py | 3,484 | python | en | code | 10 | github-code | 6 | [
{
"api_name": "ulauncher.api.client.EventListener.EventListener",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "base64.b64encode",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "urllib.request.parse.urljoin",
"line_number": 32,
"usage_type": "call"
... |
43213705575 | #!/usr/bin/env python3
"""
Program to decode the first sprite of a CTHG 2 file.
Mainly intended as a test for the checking the encoder, but also a
demonstration of how to decode.
"""
_license = """
Copyright (c) 2013 Alberth "Alberth" Hofkamp
Permission is hereby granted, free of charge, to any person obtaining a cop... | CorsixTH/CorsixTH | SpriteEncoder/decode.py | decode.py | py | 5,314 | python | en | code | 2,834 | github-code | 6 | [
{
"api_name": "PIL.Image.new",
"line_number": 104,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 104,
"usage_type": "name"
}
] |
30546132474 | # %%
import matplotlib.pyplot as plt
import networkx as nx
import pandas as pd
import seaborn as sns
from src import consts as const
from src.processing import attribute_builder as ab
from src.processing import plotting, refactor
sns.set(palette="Set2")
# Output Configurations
pd.set_option('display.max_rows', 60)
... | ajmcastro/flight-time-prediction | src/processing/eda.py | eda.py | py | 5,177 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "seaborn.set",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.sty... |
72536666107 | from dataclasses import asdict, dataclass
from functools import cached_property
from time import sleep
from typing import Any, Dict, List, Optional, Union
from airflow import AirflowException
from airflow.models.taskinstance import Context
from airflow.providers.http.hooks.http import HttpHook
from constants import CR... | ksh24865/cryptocurrency-data-pipeline | Airflow/dags/operators/cryptocurrency/price/sourcing_stream.py | sourcing_stream.py | py | 4,859 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "dataclasses.dataclass",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "operators.cryptocurrency.price.base.CryptocurrencyBaseOperator",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "constants.CRYPTO_COMPARE_HTTP_CONN_ID",
"line_number": 2... |
9324466807 | from flask import Blueprint, render_template, url_for
lonely = Blueprint('lonely',
__name__,
template_folder='./',
static_folder='./',
static_url_path='/')
lonely.display_name = 'Lonely'
lonely.published = True
lonely.description = "An interac... | connerxyz/exhibits | cxyz/exhibits/lonely/lonely.py | lonely.py | py | 437 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Blueprint",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 15,
"usage_type": "call"
}
] |
18536492857 | # -*- coding: utf-8 -*-
"""
Created on Wed Dec 11 15:05:36 2019
@author: Ashley
"""
# Manuscript Malezieux, Kees, Mulle submitted to Cell Reports
# Figure S3 - Complex spikes
# Description: changes in complex spikes with theta and LIA, plotted separately
# %% import modules
import os
import numpy as n... | Ashkees/Malezieux_CellRep_2020 | figure_scripts/Malezieux_CellRep_FigS3.py | Malezieux_CellRep_FigS3.py | py | 63,803 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "numpy.concatenate",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.nanmedian",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line... |
28965388899 | from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
from seleni... | krzysztofzajaczkowski/newdemy | utils/WebCrawler/main.py | main.py | py | 5,352 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.support.ui.WebDriverWait",
"line_number": 37,
"usage_type": "call"
},
... |
21881174301 | from selenium import webdriver
from selenium.webdriver.common.by import By
import time
import os
try:
link = "http://suninjuly.github.io/file_input.html"
browser = webdriver.Chrome()
browser.get(link)
elements = browser.find_elements(By.CSS_SELECTOR, ".form-control")
for element in elements:... | Mayurityan/stepik_auto_tests_course | lesson 2.2 send file form.py | lesson 2.2 send file form.py | py | 1,034 | python | ru | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.common.by.By.CSS_SELECTOR",
"line_number": 12,
"usage_type": "attribute"
... |
26257812486 | # Imports
import sqlalchemy as sa
from sqlalchemy.ext.declarative import declarative_base
import users
from datetime import datetime
"""
Модуль для поиска атлетов по парамтрам пользователя
"""
# Variables
Base = declarative_base()
# Class definitions
class Athlette(Base):
__tablename__ = "Athelete"
id = sa.... | vsixtynine/sf-sql-task | find_athlete.py | find_athlete.py | py | 3,609 | python | ru | code | 0 | github-code | 6 | [
{
"api_name": "sqlalchemy.ext.declarative.declarative_base",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.INTEGER",
"line_number": 18,
"usage_type": "attribute"
},
{
... |
25178584436 | from summarize import *
from rbm_dae.deepAE import *
import rouge
def summarize_sentence_vectors(df, vector_set):
"""
Function applying the summarization function to get the ranked sentences.
Parameters:
df: dataframe containing the data to summarize
vector_set: the column name of the ve... | MikaelTornwall/dd2424_project | evaluate.py | evaluate.py | py | 15,618 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "rouge.Rouge",
"line_number": 54,
"usage_type": "call"
}
] |
27483903677 | from django.shortcuts import render, redirect
from django.contrib import messages
from .models import User
from .forms import RegisterForm, LoginForm
from .utils import require_login
def login_page(request):
context = {"reg_form": RegisterForm(), "login_form": LoginForm()}
return render(request, "users/login.html", ... | madjaqk/django_user_dashboard | apps/users/views.py | views.py | py | 2,061 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "forms.RegisterForm",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "forms.LoginForm",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "models.User.u... |
70713803708 | import re
import os
import sys
import nltk
import json
import wandb
import joblib
import datasets
import numpy as np
import pandas as pd
from time import process_time
from nltk import word_tokenize
from nltk.stem import WordNetLemmatizer
from sklearn.svm import LinearSVC
from sklearn.pipeline import make_pipeline
from ... | JesseBrons/Webpageclassification | training/train_model_SVM.py | train_model_SVM.py | py | 3,173 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "numpy.random.seed",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "nltk.stem.WordNetLemmatizer",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "nltk.... |
30367917171 | """Tutorial 8. Putting two plots on the screen
This tutorial sets up for showing how Chaco allows easily opening multiple
views into a single dataspace, which is demonstrated in later tutorials.
"""
from scipy import arange
from scipy.special import jn
from enable.api import ComponentEditor
from traits.api import Ha... | enthought/chaco | examples/tutorials/tutorial8.py | tutorial8.py | py | 1,873 | python | en | code | 286 | github-code | 6 | [
{
"api_name": "traits.api.HasTraits",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "traits.api.Instance",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "chaco.api.HPlotContainer",
"line_number": 19,
"usage_type": "argument"
},
{
"api_name": ... |
72531840829 | """Adds column to use scicrunch alternative
Revision ID: b60363fe438f
Revises: 39fa67f45cc0
Create Date: 2020-12-15 18:26:25.552123+00:00
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "b60363fe438f"
down_revision = "39fa67f45cc0"
branch_labels = None
depends_o... | ITISFoundation/osparc-simcore | packages/postgres-database/src/simcore_postgres_database/migration/versions/b60363fe438f_adds_column_to_use_scicrunch_alternative.py | b60363fe438f_adds_column_to_use_scicrunch_alternative.py | py | 1,066 | python | en | code | 35 | github-code | 6 | [
{
"api_name": "alembic.op.add_column",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Boolean... |
21247913444 | import unittest
from unittest.mock import patch
import os
from typing import Optional
from dataclasses import dataclass
from io import StringIO
from ml_project.train_pipeline import run_train_pipeline
from ml_project.predict_pipeline import run_predict_pipeline
from sklearn.preprocessing import StandardScaler
from m... | made-mlops-2022/alexey_sklyannyy | tests/test_end2end_training.py | test_end2end_training.py | py | 2,397 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "ml_project.entities.SplitParams",
"line_number": 41,
"usage_type": "name"
},
{
"api_name": "ml_project.entities.FeatureParams",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "ml_project.entities.TrainingParams",
"line_number": 49,
"usage_type": "... |
34958665792 | # -*- coding: utf-8 -*-
import numpy as np
import os
import time
import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
import torchvision.transforms as trn
import torchvision.datasets as dset
import torch.nn.functional as F
import json
from attack_methods import pgd
from models.wrn import WideResNet
f... | arthur-qiu/adv_vis | cifar10_wrn_at.py | cifar10_wrn_at.py | py | 10,072 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "option.BaseOptions",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "option.BaseOptions.initialize",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "option.BaseOptions",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "t... |
33245759934 | import time
from collections import OrderedDict
from collections.abc import Callable, Sequence
from typing import Any, NamedTuple
DB = "timeseries"
TABLE_RAW = "paii_raw"
TIME_FIELD = "paii_time"
class Field(NamedTuple):
json_key: str
store_flag: bool
db_name: str
data_type: str
convert: Callable... | PaulSorenson/purpleair_sensor | paii/purple_data.py | purple_data.py | py | 9,065 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "typing.NamedTuple",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "collections.abc.Callable",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "typing.Any",
... |
32941642034 | import numpy as np
import matplotlib
from matplotlib.colors import ListedColormap
SLACred = '#8C1515'
SLACgrey = '#53565A'
SLACblue = '#007C92'
SLACteal = '#279989'
SLACgreen = '#8BC751'
SLACyellow = '#FEDD5C'
SLACorange = '#E04F39'
SLACpurple = '#53284F'
SLAClavender = '#765E99'
SLACbrown = '#5F574F'
SLACcolors = [S... | DanielMDouglas/SLACplots | SLACplots/colors.py | colors.py | py | 1,729 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.cm.register_cmap",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "matplotlib.cm",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.colors.ListedColormap",
"line_number": 33,
"usage_type": "call"
},
{
"a... |
7438577752 | from pathlib import Path
from vesper.tests.test_case import TestCase
from vesper.util.preference_manager import PreferenceManager
import vesper.tests.test_utils as test_utils
_DATA_DIR_PATH = Path(test_utils.get_test_data_dir_path(__file__))
_PREFERENCE_FILE_PATH = _DATA_DIR_PATH / 'Preferences.yaml'
_EMPTY_PREFEREN... | HaroldMills/Vesper | vesper/util/tests/test_preference_manager.py | test_preference_manager.py | py | 2,906 | python | en | code | 47 | github-code | 6 | [
{
"api_name": "pathlib.Path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "vesper.tests.test_utils.get_test_data_dir_path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "vesper.tests.test_utils",
"line_number": 8,
"usage_type": "name"
},
{
"... |
35792097840 | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
from selenium import webdriver
from selenium.webdriver.common.by import By
import time
from selenium.webdriver.support.ui import WebDriverWait
import random
def get_sore_and_Price(store_id,internet_id):
driver = webdriver.Chrome('C:/Users/cunzh/Desktop/chromedriver... | JiyuanZhanglalala/Web-Scraping- | Home Depot Web Scraping Function.py | Home Depot Web Scraping Function.py | py | 2,398 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "random.randin... |
41958018958 | from waterworld.waterworld import env as custom_waterworld
from potential_field.potential_field_policy import PotentialFieldPolicy
from utils import get_frames
from pettingzoo.utils import average_total_reward
from multiprocessing import Pool, cpu_count
import tqdm
import numpy as np
from matplotlib import pyplot as... | ezxzeng/syde750_waterworld | test_policy.py | test_policy.py | py | 4,604 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "waterworld.waterworld.env",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "potential_field.potential_field_policy.PotentialFieldPolicy",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 27,
"usage_type": "call"... |
32840040688 |
from scipy.sparse import csr_matrix
from .text import WordPieceParser
from collections.abc import Mapping, Iterable
class RecordVectorMap(Mapping):
def __init__(self, records, wp_model_path, vec_format='bag-of-words'):
text_parser = WordPieceParser(wp_model_path)
self.rec_seq_map, self.reco... | rmhsiao/CAGNIR | utils/data/record.py | record.py | py | 2,182 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "collections.abc.Mapping",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "text.WordPieceParser",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "scipy.sparse.csr_matrix",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "... |
25860754920 | from typing import Any
from random import randint, random
import pygame as py
from engine.game_engine import Pygame
from engine.color import Color
from engine.game_objects import IGameObject
from engine.game_objects.modules import IAnimationModule, ICollisionModule
from engine.image import SpriteSheet
from engine.ui.t... | XCPika/Pygame-Extension-Framework | main.py | main.py | py | 8,838 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "engine.ui.text.TypeWriterText",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "engine.game_engine.Pygame",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "engine.game_objects.IGameObject",
"line_number": 21,
"usage_type": "name"
},
... |
225835019 | import streamlit as st
import calculator_logic
st.title("Calculator App")
num1 = st.number_input("Enter the first number:")
num2 = st.number_input("Enter the second number:")
operation = st.selectbox("Select an operation", calculator_logic.OPERATIONS)
if st.button("Calculate"):
result = calculator_logic.calculat... | shib1111111/basic_calculator | app.py | app.py | py | 1,113 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "streamlit.title",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "streamlit.number_input",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "streamlit.number_input",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "streamlit.... |
12866597010 | import sys
from collections import defaultdict
def tpsortutil(u, visited, stack, cur):
visited[u] = True
for i in graph[u]:
if not visited[i]:
tpsortutil(i, visited, stack, cur)
elif i in cur:
return
stack.append(u)
def topologicalsort(graph, vertices):
visited ... | tyao117/AlgorithmPractice | TopologicalSort/TopologicalSort.py | TopologicalSort.py | py | 825 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.defaultdict",
"line_number": 26,
"usage_type": "call"
}
] |
32787034238 | """
URL configuration for backend project.
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home... | wncc/SoC-Portal | backend/backend/urls.py | urls.py | py | 2,001 | python | en | code | 12 | github-code | 6 | [
{
"api_name": "drf_yasg.views.get_schema_view",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "drf_yasg.openapi.Info",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "drf_yasg.openapi",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": ... |
33962354417 | import numpy as np
from sklearn.linear_model import LogisticRegression
from random import randrange
from math import ceil, floor
# Загрузка данных из текстового файла
data = np.genfromtxt('данные двумерная модель.txt', skip_header=1) # Пропустить первую строку с названиями столбцов
# Разделение данных на факторы (x)... | IlnazMmm/RKA | 3 lab/prog2.py | prog2.py | py | 1,708 | python | ru | code | 0 | github-code | 6 | [
{
"api_name": "numpy.genfromtxt",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model.LogisticRegression",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "random.randrange",
"line_number": 33,
"usage_type": "call"
},
{
"api_name... |
33124682966 | import json
import os
import docx
with open(f'disciplinas.json') as f:
data = json.load(f)
# print(df.columns.values)
for index, discpln in data.items():
print(f'{discpln["sigla"]} - {discpln["nome"]}')
doc = docx.Document()
doc.add_heading(f'{discpln["sigla"]} - {discpln["nome"]}')
doc.add_hea... | luizeleno/pyjupiter | _python/gera-doc-pdf-unificado.py | gera-doc-pdf-unificado.py | py | 2,978 | python | es | code | 2 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "docx.Document",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.mkdir",
"line_number": 87,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 94,
... |
5432720139 | from sklearn.metrics import pairwise_distances
import numpy as np
import pandas as pd
from scipy.sparse import spmatrix
from anndata import AnnData
from scipy.stats import rankdata
from typing import Optional
from . import logger
from .symbols import NOVEL, REMAIN, UNASSIGN
class Distance():
"""
Class that dea... | Teichlab/cellhint | cellhint/distance.py | distance.py | py | 26,272 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "numpy.ndarray",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "pandas.DataFrame",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "numpy.unique",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "anndata.AnnData... |
25971386553 | """
.. testsetup:: *
from zasim.cagen.utils import *
"""
# This file is part of zasim. zasim is licensed under the BSD 3-clause license.
# See LICENSE.txt for details.
from ..features import HAVE_TUPLE_ARRAY_INDEX
from itertools import product
import numpy as np
if HAVE_TUPLE_ARRAY_INDEX:
def offset_pos(po... | timo/zasim | zasim/cagen/utils.py | utils.py | py | 4,490 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "features.HAVE_TUPLE_ARRAY_INDEX",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "numpy.zeros",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "itertools.product",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "numpy.n... |
71645960508 | from django.urls import path
from . import views
app_name = 'blog'
urlpatterns = [
path('', views.index, name="index"),
path('detalhes/<int:pk>/<slug:slug>', views.detail, name="details"),
path('post/novo/', views.post, name="new_post"),
path('editar/post/<int:pk>', views.edit, name="edit"),
path... | eduardoferreira97/Blog | blog/urls.py | urls.py | py | 553 | python | en | code | 1 | github-code | 6 | [
{
"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",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
25847181178 | import tkinter as tk
import sqlite3
def guardar_palabras():
palabras = [entrada1.get(), entrada2.get(), entrada3.get(), entrada4.get(), entrada5.get()]
# Conexión a la base de datos
conexion = sqlite3.connect('basedatos.db')
cursor = conexion.cursor()
# Crear la tabla "palabras" si no existe
... | AlejandroAntonPineda/ArtPersonality | base_datos.py | base_datos.py | py | 3,754 | python | es | code | 0 | github-code | 6 | [
{
"api_name": "sqlite3.connect",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "tkinter.Tk",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "tkinter.Label",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "tkinter.Entry",
"line_num... |
42937022866 | import datetime
import sqlite3
import os
import sys
from PyQt6.QtWidgets import *
from PyQt6.QtCore import Qt
from docxtpl import DocxTemplate
class mailbackGenWindow(QMainWindow):
def __init__(self):
super().__init__()
self.setWindowTitle("Test Mailback Letter Generator")
self.setFixedSiz... | Centari2013/PublicMailbackGeneratorTest | main.py | main.py | py | 8,527 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sqlite3.connect",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "docxtpl.DocxTemplate",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "docxtpl.DocxTemplate",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "docxtpl.Doc... |
27385560013 | from road import Road
from copy import deepcopy
from collections import deque
from vehicleGenerator import VehicleGenerators
import numpy as np
from scipy.spatial import distance
import random
class Simulator:
def __init__(self, config = {}) -> None:
self.setDefaultConfig()
#update vals
for... | EHAT32/alg_labs_sem_7 | lab3/simulator.py | simulator.py | py | 4,713 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.deque",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "road.Road",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "scipy.spatial.distance.... |
10900131686 | from flask import Flask
from flask import Flask, request, render_template, send_file
app = Flask(__name__)
@app.route('/cookiestealer/', methods=['GET'])
def cookieStealer():
filename = 'cookiemonster.jpg'
print("This is the cookie: \n")
print(request.cookies)
print("")
return send_file(f... | FelixDryselius/SecureDataSystemsGroup17 | lab1/xss/3rd_party_cookie_stealer.py | 3rd_party_cookie_stealer.py | py | 420 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask.request.cookies",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "flask.send_file",... |
74479990587 | import json
from random import uniform
import matplotlib.pyplot as plt
class Scanner:
def __init__(self, data_filename, n_neighbours):
self.data_filename = data_filename
self.n_neighbours = n_neighbours
def scanner(self, visualize_data=False):
f = open(self.data_filename, encoding="u... | SergeyBurik/profitable_apartments_parser | profitable_apartments_parser/scanner/scanner.py | scanner.py | py | 2,832 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.loads",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "random.uniform",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 78,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
43371048993 | import pygame
from pygame.locals import KEYDOWN, K_ESCAPE, QUIT
from os import path
import parameters.enums as en
from Objects.player import Player, Wall
from Objects.map import Map
from Objects.robot import Robot
import numpy as np
from Objects.machinery import Machinery, Destiny
import sys
import torch
from Objects.u... | anfego22/rele | main.py | main.py | py | 3,394 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.sprite",
"line_number": 16,
"usage_type": "attribute"
},
{
"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... |
13321588984 | from airflow.models import Variable
import datetime
from .test_utils import create_test_database, db_connect
from dags.rock.rock_content_items import ContentItem
from dags.rock.rock_content_items_connections import ContentItemConnection
import vcr
create_test_database()
def test_run_fetch_and_save_content_item_conne... | CrossingsCommunityChurch/apollos-shovel | tests/test_rock_content_item_connections.py | test_rock_content_item_connections.py | py | 3,945 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "test_utils.create_test_database",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "airflow.models.Variable",
"line_number": 31,
"usage_type": "argument"
},
{
"api_name": "dags.rock.rock_content_items.ContentItem",
"line_number": 36,
"usage_type": "c... |
35539138268 | from django.http import JsonResponse
from .models import Task
def _get_all_tasks():
task_objects = Task.objects.all()[:30]
tasks = []
for task_obj in task_objects:
task = task_obj.get_as_dict()
tasks.append(task)
return tasks
def index(request):
if request.method == 'GET':
... | bluepostit/django-js-todo | todos/views.py | views.py | py | 2,483 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "models.Task.objects.all",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "models.Task.objects",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "models.Task",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "models.Task... |
74918976186 | import networkx as nx
import re
def read_file(file):
first = set()
second = set()
G = nx.DiGraph()
prog = re.compile("Step ([A-Z]) must be finished before step ([A-Z]) can begin.")
with open(file) as f:
lines = f.readlines()
for line in lines:
r = prog.match(line.strip())
... | aarroyoc/advent-of-code-2018 | python/day7/day7.py | day7.py | py | 3,076 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "networkx.DiGraph",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 8,
"usage_type": "call"
}
] |
34276132086 | """ Initializes Pickly Files"""
import pickle
import json
import requests
import urllib.request
def guiinit(sub):
#Gets information from Reddit
r = urllib.request.urlopen(r'http://www.reddit.com/r/' + sub + '/new/.json', timeout=60).read().decode("utf-8")
data = json.loads(r)
#Creates ists to hold da... | picklesforfingers/FeedMeReddit | pickleinit.py | pickleinit.py | py | 1,069 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "urllib.request.request.urlopen",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "urllib.request",
"line_number": 10,
"usage_type": "name"
},
{
"api_nam... |
14391947993 | import glob
import json
def LoadTweets(directory):
directory = directory +"/*json"
files = glob.glob(directory)[:100]
twts = [a for fl in files for a in json.load(open(fl))]
twts.sort(key=lambda x: x['id'] if 'id' in x else int(x['id_str']) if 'id_str' in x else 0)
twts = [a for a in twts if 'id' i... | datumkg/electweet | ElecTweet/TweetLoader.py | TweetLoader.py | py | 1,092 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "glob.glob",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 25,
"usage_type": "call"
}
] |
33548088967 | import os
from django.core.management.base import BaseCommand, CommandError
from main.settings import BASE_DIR, DEBUG
from costcenter.models import Fund, Source, CostCenter, FundCenter, FinancialStructureManager
from lineitems.models import LineForecast, LineItem
class Command(BaseCommand):
"""
A class to be... | mariostg/bft | encumbrance/management/commands/populate.py | populate.py | py | 5,663 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "main.settings.DEBUG",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "lineitems.models.LineForecast.objects.all",
"line_number": 16,
"usage_type": "... |
12477031144 | import argparse
import os
import importlib.util
import matplotlib.pyplot as plt
import matplotlib.ticker as mticker
import json
from collections import defaultdict
import utils
import transformers
parser = argparse.ArgumentParser()
parser.add_argument('--task')
parser.add_argument('--model')
parser.add_argument('--d... | mariopenglee/llm-metalearning | src/main.py | main.py | py | 3,965 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "importlib.util.util.find_spec",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": ... |
6323470596 | import typing
from typing import (
Union,
Optional,
List,
)
import asyncio
import logging
from datetime import datetime
from hikari import ActionRowComponent, Embed, MessageCreateEvent, embeds
from hikari import ButtonStyle
from hikari.impl.special_endpoints import MessageActionRowBuilder, LinkButtonBuilde... | zp33dy/inu | inu/ext/commands/voice.py | voice.py | py | 3,792 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "core.getLogger",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "lightbulb.Plugin",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "lightbulb.context.Context",
"line_number": 61,
"usage_type": "name"
},
{
"api_name": "hikari.Inte... |
1518966554 | from argparse import ArgumentParser, RawTextHelpFormatter
from glob import glob
from subprocess import check_call
import os
from shutil import rmtree
def compile_clm():
# Define and parse command line arguments
# ---------------------------------------
dsc = "Compile CLM on Piz Daint. A case will be cre... | COSMO-RESM/COSMO_CLM2_tools | COSMO_CLM2_tools/compile_clm.py | compile_clm.py | py | 5,769 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "argparse.RawTextHelpFormatter",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "os... |
22200579634 | #!/usr/bin/env python
from __future__ import absolute_import
import apache_beam as beam
import argparse
import json
import logging
import sys
import urllib
from apache_beam.options.pipeline_options import PipelineOptions
from apache_beam.options.pipeline_options import SetupOptions
from google.cloud import bigquery
f... | mjcastner/edsm_bq | beam_parser.py | beam_parser.py | py | 8,112 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "argparse.Argu... |
36848412423 | import hashlib
import random
import sqlite3
from typing import List, Optional
import more_itertools
import numpy as np
import pandas as pd
import scipy.spatial
import skimage.transform
from carla_real_traffic_scenarios import DT
from carla_real_traffic_scenarios.ngsim import DatasetMode
from carla_real_traffic_scenar... | deepsense-ai/carla-real-traffic-scenarios | carla_real_traffic_scenarios/opendd/recording.py | recording.py | py | 13,416 | python | en | code | 67 | github-code | 6 | [
{
"api_name": "carla_real_traffic_scenarios.utils.transforms.Transform",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "carla_real_traffic_scenarios.utils.transforms.Vector3",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "carla_real_traffic_scenarios.utils.... |
9975379557 | from django.conf.urls import url
from .views import *
urlpatterns = [
# 课程列表
url(r'^list/$', CourseListView.as_view(), name='list'),
# 课程详情
url(r'^detail/(?P<course_id>\d+)/$', DetailView.as_view(), name='detail'),
# 视频信息
url(r'^info/(?P<course_id>\d+)/$', InfoView.as_view(), name='i... | Liyb5/web | EduOnline/BlueSky/apps/courses/urls.py | urls.py | py | 635 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.c... |
72935917627 | import os
from celery import Celery
from celery.schedules import crontab
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings')
app = Celery('backend')
app.config_from_object('django.conf:settings', namespace='CELERY')
app.conf.beat_schedule = {
'check_mail_everyday': {
'task': 'emailServic... | anunayajoshi/futureme | backend/backend/celery.py | celery.py | py | 426 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.environ.setdefault",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "celery.Celery",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "celery.schedules.cro... |
31535390686 | from functools import wraps
def vowel_filter(function):
vowels = ["a", "e", "i", "o", "u", "y"]
found_vowels = []
@wraps(function)
def wrapper():
for ch in function():
if ch.lower() in vowels:
found_vowels.append(ch)
return found_vowels
return wrapper... | iliyan-pigeon/Soft-uni-Courses | pythonProjectOOP/decorators/vowels_filter.py | vowels_filter.py | py | 416 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "functools.wraps",
"line_number": 8,
"usage_type": "call"
}
] |
5549915372 | from django.shortcuts import render, redirect
from django.utils import timezone
from .forms import ActivateSertificateForm
from programs.models import Category
from .models import Sertificate
# Create your views here.
def activate_sertificate(request):
if request.method == "POST":
form = ActivateSertifica... | vladisgrig/babeo | activation/views.py | views.py | py | 1,655 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "forms.ActivateSertificateForm",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "models.Sertificate.objects.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "models.Sertificate.objects",
"line_number": 15,
"usage_type": "attribute"
... |
23380015513 | from gensim.models.doc2vec import Doc2Vec
import pickle
def get_most_similar_docs(test_data, model_path):
# Load the Doc2Vec model
model = Doc2Vec.load(model_path)
# Split the test_data string into a list of words
test_data_words = test_data.split()
# Infer the vector for the test document
inferred... | Tokarevmm/homework5 | homework_6/recommend.py | recommend.py | py | 1,287 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "gensim.models.doc2vec.Doc2Vec.load",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "gensim.models.doc2vec.Doc2Vec",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "pickle.load",
"line_number": 15,
"usage_type": "call"
}
] |
2559703297 | import os
from flask import Flask
from flask_jwt_extended import JWTManager
from flask_login import LoginManager
from .auth import ldap_handler
from .db import database
from .db.models import *
from .messages import messages
from .mocks import fake_ldap_handler
configuration_switch = {
"default": "backend.config... | elliecherrill/diligent | backend/__init__.py | __init__.py | py | 2,021 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.environ.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "flask_login.LoginManager",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "messages.mess... |
22167366155 | import time
from functools import wraps
from MatrixDecomposition import MatrixDecomposition
from MatrixGeneration import MatrixGeneration
def fn_timer(function):
@wraps(function)
def function_timer(*args, **kwargs):
t0 = time.time()
result = function(*args, **kwargs)
t1 = time.time()
... | g3tawayfrom/appmath_lab4 | Analyzer.py | Analyzer.py | py | 1,953 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "time.time",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "functools.wraps",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "MatrixGeneration.MatrixGeneration.... |
44502183300 | from flask_wtf import FlaskForm
from wtforms import StringField, IntegerField
from wtforms.validators import DataRequired, Length, ValidationError
from urllib.parse import urlparse
from app.models import Business
def business_name_exists(form, field):
business_name = field.data
business = Business.query.filte... | stroud91/ReactFlaskProject | app/forms/bussiness_form.py | bussiness_form.py | py | 2,324 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "app.models.Business.query.filter",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "app.models.Business.query",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "app.models.Business",
"line_number": 10,
"usage_type": "name"
},
{
... |
12697223783 | from telegram import Update
from telegram.ext import (
Updater,
CallbackContext,
run_async,
CommandHandler,
)
from utils import Config
from pkgutil import walk_packages
from types import ModuleType
from typing import Dict
from utils import get_filter
submodules: Dict[str, ModuleType] = {
module_n... | finall1008/telegram-pusher-bot | commands/__init__.py | __init__.py | py | 1,483 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "typing.Dict",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "types.ModuleType",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "pkgutil.walk_packages",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "telegram.Update",
... |
18004211915 | import os
import numpy as np
import torch
import transforms3d
def plane2pose(plane_parameters):
r3 = plane_parameters[:3]
r2 = np.zeros_like(r3)
r2[0], r2[1], r2[2] = (-r3[1], r3[0], 0) if r3[2] * r3[2] <= 0.5 else (-r3[2], 0, r3[0])
r1 = np.cross(r2, r3)
pose = np.zeros([4, 4], dtype=np.float32)
... | PKU-EPIC/UniDexGrasp | dexgrasp_policy/dexgrasp/utils/data_info.py | data_info.py | py | 669 | python | en | code | 63 | github-code | 6 | [
{
"api_name": "numpy.zeros_like",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.cross",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_numb... |
21207331986 | from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.auth.mixins import PermissionRequiredMixin
from django.urls import reverse_lazy
from django.shortcuts import render
from django.views.generic import ListView, DetailView, CreateView, UpdateView, DeleteView
from .models import *
from .filters ... | AlexAlexG/SF_lessons | NewsPaper/news/views.py | views.py | py | 3,331 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.views.generic.ListView",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.views.generic.DetailView",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "django.views.generic.ListView",
"line_number": 36,
"usage_type": "name"
}... |
27831010517 | import numpy as np
import netCDF4 as nc4
import net_radiation
import atmospheric_parameters
import wind_shear_velocity
import datetime
# Using TerraClimate
# 2.5 arcminute (1/24 degree) resolution: ~5 km N-S
# Import step
# ... load files here or with a CLI
years = range(1958, 2019)
months_zero_indexed = range(12)
Te... | MNiMORPH/TerraClimate-potential-open-water-evaporation | penman.py | penman.py | py | 5,465 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "numpy.nan",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "netCDF4.Dataset",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "wind_shear_velocity.create_lookup_table_one_step",
"line_number": 34,
"usage_type": "call"
},
{
"a... |
33702704860 | import openpyxl as xl
import xlwings as xw
from Worksheet import Worksheet,QPreviewItem
from Workcell import *
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from copy import copy
#import time
import datetime
##################################################
# class for PS sheet handling
##################... | DericGitHub/excel-operator | model/PSsheet.py | PSsheet.py | py | 6,063 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "Worksheet.Worksheet",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "Worksheet.QPreviewItem",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "Worksheet.QPreviewItem",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "Wor... |
35164165716 | #!/usr/bin/python3
import subprocess
import json
import requests
import time
import logging
import os
#bin Paths
ipfspath = '/usr/local/bin/ipfs'
wgetpath = '/usr/bin/wget'
wcpath = '/usr/bin/wc'
#Basic logging to ipfspodcastnode.log
logging.basicConfig(format="%(asctime)s : %(message)s", datefmt="%Y-%m-%d %H:%M:%S",... | Cameron-IPFSPodcasting/podcastnode-Umbrel | ipfspodcastnode.py | ipfspodcastnode.py | py | 6,566 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "logging.basicConfig",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"l... |
30980411340 | from matplotlib.pyplot import draw
import pygame
from pygame.locals import *
pygame.init()
pygame.mixer.init()
# set screen resolution
resolution = (725,725)
# open a screen of above resolution
screen = pygame.display.set_mode(resolution)
# defining palette colours (global variables) as dictionary
gameColours={
... | jessica-leishman/high-rollers | analysis_static/manual slices/hrStatic3.py | hrStatic3.py | py | 4,288 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.init",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.mixer.init",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pygame.mixer",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.set_mode"... |
15298986512 | #!/usr/bin/python3.6
import requests, json, datetime
from time import sleep
try:
while True:
req = requests.get('https://www.mercadobitcoin.net/api/BTC/ticker/')
cot = json.loads(req.text)
d = datetime.datetime.now()
print(d.strftime('%c'))
print('BTC:', cot['ticker']['buy'][:8])
sleep(10)
... | andreMarqu3s/bit_value | cotacao.py | cotacao.py | py | 387 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"... |
72810210107 | def create_piechart():
# Importamos las dependencias
import pandas as pd
import matplotlib.pyplot as plt
from config import engine
from sqlalchemy.orm import sessionmaker
engine = engine
# Intentamos leer desde la base de datos, la tabla "tabla_1"
try:
with engine.connect() as ... | NebyX1/data-science-engineering-end-to-end-project-bootcamp-milei-twitter-scraping | piechart_script.py | piechart_script.py | py | 1,239 | python | es | code | 0 | github-code | 6 | [
{
"api_name": "config.engine",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "config.engine.connect",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "config.engine",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "pandas.read_sql_tabl... |
25018507922 | import base64
import os
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes, serialization
from cryptography.hazmat.primitives.asymmetric import padding
current_dir = os.path.dirname(os.path.abspath(__file__))
def encrypt_data(data, key_path='public.pem'):
p... | ivana-dodik/Blockchain | EP --zadatak 02/crypto.py | crypto.py | py | 1,898 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.dirname",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_nu... |
8267514816 | from __future__ import annotations
from kombu.pools import producers
from .queues import task_exchange
priority_to_routing_key = {
'high': 'hipri',
'mid': 'midpri',
'low': 'lopri',
}
def send_as_task(connection, fun, args=(), kwargs={}, priority='mid'):
payload = {'fun': fun, 'args': args, 'kwargs'... | celery/kombu | examples/simple_task_queue/client.py | client.py | py | 994 | python | en | code | 2,643 | github-code | 6 | [
{
"api_name": "kombu.pools.producers",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "queues.task_exchange",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "queues.task_exchange",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "kombu... |
70943725628 | import json
import os
class FolderWalker:
"""
Check folder with results. Walk through the folders and define paths to various files.
If any values are not counted in one of the frameworks, they will be excluded in competitors.
Thus, the class ensures consistency of results in the analysis.
"""
... | ITMO-NSS-team/pytsbe | pytsbe/report/walk.py | walk.py | py | 5,028 | python | en | code | 30 | github-code | 6 | [
{
"api_name": "os.path.abspath",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number"... |
23039179017 | import cv2
import numpy as np
from hand import HandRecognizer
from args import OLD_FONT_THRESHOLD
class OldRecognizer(HandRecognizer):
def __init__(self, imname, already_read=False):
super(OldRecognizer, self).__init__(imname, already_read)
self.cal_result()
def loop_process(self, func):
... | sjdeak/RoboMasters2017-RuneDetector | old.py | old.py | py | 1,379 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "hand.HandRecognizer",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "cv2.cvtColor",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "cv2.threshold... |
73535922429 | import numpy as np
import matplotlib.pyplot as plt
from scipy import sparse
def output_result(path, matrix):
f = open(path, "w+")
f.write(str(len(matrix)) + '\n')
for row in matrix:
f.write(str(row)[1:-1])
f.write('\n')
f.close()
def read_buildings(path_to_buildings):
'''
:p... | arsee2/numerical_modelling_diffusion_convection_process | nm_project.py | nm_project.py | py | 6,194 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.zeros",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 85,
"usage_type": "call"
},
{
"api_name": "numpy.max",
"line_number": 105,
"usage_type": "call"
},
{
"api_name": "numpy.abs",
"line_number": 105... |
6253113584 | import torch
import torch.nn as nn
import torch.nn.functional as F
from _polytope_ import Polytope, Face
import utilities as utils
from collections import OrderedDict
import numpy as np
import time
import copy
import convex_adversarial.convex_adversarial as ca
import full_lp as flp
class PLNN(nn.Module):
#TODO: ... | revbucket/geometric-certificates | plnn.py | plnn.py | py | 29,208 | python | en | code | 40 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "torch.FloatTensor",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "collections.Orde... |
39525459958 | import pyttsx3
from gtts import gTTS
import os
#MALE
engine = pyttsx3.init()
engine.say("Hello there")
engine.runAndWait()
#FEMALE
mytext = 'You are welcome to Roles Academy Madam.'
language = 'en'
myobj = gTTS(text=mytext, lang=language, slow=False)
myobj.save("welcome.mp3")
os.system("mpg321 welcome.mp3")
| adesolasamuel/EqualityMachine | texttospeech.py | texttospeech.py | py | 312 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "pyttsx3.init",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "gtts.gTTS",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 15,
"usage_type": "call"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.