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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
33745872733 | from flask import Flask, render_template, request , redirect , url_for , flash, session
import mysql.connector
import random
import hashlib
db=mysql.connector.connect(host="localhost", user="root", passwd="your password") ##add your root password
cursor=db.cursor(buffered=True)
flag = 0
# USING DATABASE
cursor.exec... | shreysharma13/NOTEBOOK-CSD317 | main.py | main.py | py | 10,346 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "mysql.connector.connector.connect",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "mysql.connector.connector",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "mysql.connector",
"line_number": 6,
"usage_type": "name"
},
{
"api... |
39778700761 | #!/usr/bin/env python3
# This is a init file common to all tests. It is automatically sourced
# by pytest et al.
# Define common constants (e.g., paths to test data) and fixtures (e.g.,
# transport network) here.
# explicitly importing fiona before geopandas fixes issue #156
import fiona # noqa: F401
import datet... | r5py/r5py | tests/conftest.py | conftest.py | py | 8,846 | python | en | code | 90 | github-code | 18 | [
{
"api_name": "pathlib.Path",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 66,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime",
"line_number": 87,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
... |
23375839508 | from utils import DotDict
class Defaults:
DateFormats = DotDict({"NumberDate": "%Y-%m-%d", "MonthYear": "%m/%Y"})
class Models:
BudgetDate = DotDict(
{
"Source": {
"io": "../src/Inputs.xlsx",
"sheet_name": "Dates",
"header": 1,
... | coperyan/personal-budget-builder | personal_budget_tool/constants.py | constants.py | py | 3,735 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "utils.DotDict",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "utils.DotDict",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "utils.DotDict",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "utils.DotDict",
"line_num... |
2304049837 |
from __future__ import print_function
import random
import boto3
from boto3.dynamodb.conditions import Attr
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
def build_speechlet_response(title, output, reprompt_text, should_end_session):
return {
'outputSp... | Abhilash-as/Alexa-code | lambda_function.py | lambda_function.py | py | 6,026 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "boto3.resource",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "boto3.dynamodb.conditions.Attr",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "smtplib.SMTP",
"line_number": 94,
"usage_type": "call"
},
{
"api_name": "email.mime... |
4006787624 | import os
import pathlib
import time
import numpy as np
from tensorflow.core.protobuf import config_pb2
from tensorflow.python.checkpoint import checkpoint as trackable_utils
from tensorflow.python.client import session as session_lib
from tensorflow.python.framework import dtypes
from tensorflow.python.framework imp... | tensorflow/tensorflow | tensorflow/python/training/checkpoint_utils_test.py | checkpoint_utils_test.py | py | 20,252 | python | en | code | 178,918 | github-code | 18 | [
{
"api_name": "os.path.join",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.python.ops.variable_scope.get_variable",
"line_number": 28,
"usage_type": "call"
},
{
"api_n... |
24458193200 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.utils.data as Data # to make Loader
import torchvision
import torchvision.transforms as transforms
import matplotlib.pyplot as plt
import os
import numpy as np
import time
import csv
# hyper Pa... | aishan224/SYSUAI-Exer | Exer3/cifarCNN.py | cifarCNN.py | py | 9,838 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "torch.device",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "torchvision.tran... |
30244891701 | from BuildData import BuildData
from kafka import KafkaProducer
import json
MessagesToSend = 0
if __name__ == '__main__':
producer = KafkaProducer(bootstrap_servers='[Your Public Ip Address]:9092')
buildData = BuildData()
template = buildData.loadTemplate("template.json")
x = 0
while(... | Microshak/SimplePythonKafkaStreamer | kafkasender.py | kafkasender.py | py | 582 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "kafka.KafkaProducer",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "BuildData.BuildData",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 20,
"usage_type": "call"
}
] |
26516462835 | from typing import Dict
from dm_env import specs
import numpy as np
from dm_env_rpc.v1 import dm_env_rpc_pb2
from dm_env_rpc.v1 import spec_manager as dm_env_rpc_spec_manager
from dm_env_rpc.v1 import tensor_spec_utils
from dm_env_rpc.v1 import tensor_utils
def tensor_spec_to_dm_env_spec(
tensor_spec: dm_env_rpc... | deepmind/dm_env_rpc | dm_env_rpc/v1/dm_env_utils.py | dm_env_utils.py | py | 2,651 | python | en | code | 81 | github-code | 18 | [
{
"api_name": "dm_env_rpc.v1.dm_env_rpc_pb2.TensorSpec",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "dm_env_rpc.v1.dm_env_rpc_pb2",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "dm_env_rpc.v1.tensor_utils.data_type_to_np_type",
"line_number": 22... |
34314942306 | #
# @lc app=leetcode id=88 lang=python3
#
# [88] Merge Sorted Array
#
# @lc code=start
from typing import List
class Solution:
def merge(self, nums1: List[int], m: int, nums2: List[int], n: int) -> None:
for i in range(0,len(nums2)):
nums1[m+i] = nums2[i]
for i in range(1,len(nums1)):... | krishhsuri/leetcode- | 88.merge-sorted-array.py | 88.merge-sorted-array.py | py | 540 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "typing.List",
"line_number": 12,
"usage_type": "name"
}
] |
73024855719 | # /!usr/bin/env python3
"""
Plotting functionality
"""
import copy
import logging
import os
from os.path import join as pjoin
from multiprocessing import Process
import matplotlib.markers as mmarkers
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib.colors i... | bethgelab/model-vs-human | modelvshuman/plotting/plot.py | plot.py | py | 48,579 | python | en | code | 300 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Process",
"line_number": 85,
"usage_type": "call"
},
{
"api_name": "helper.plotting_helper.crop_pdfs_in_directory",
"line_number": 97,
"usage_type": "call"
},
... |
17988638215 | # %% [markdown]
# ## Retrieving recent week's tweets (search results for sustainability)
# ### Ehsan Moradi, Ph.D. Candidate
# %% [markdown]
# ### Load required libraries
import tweepy
import json
import csv
# %% [markdown]
# ### API credentials, target keyword, and other settings
CONSUMER_KEY = "R5XxaBpbym5AVZTcORT0... | esnmrdi/sustainabilitydefinition | tweets.py | tweets.py | py | 3,676 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "tweepy.OAuthHandler",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "tweepy.API",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "csv.QUOTE_ALL",
"line_n... |
27179736134 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import numpy as np
from source.tf_transforms import my_stft, my_istft, norm_synthesis_window
from source.metrics import get_separation_score
import scipy
from scipy import signal
import librosa
__author__ = 'Paul Magron -- IRIT'
__docformat__ = 'reStructuredTe... | magronp/omisi | source/algorithms.py | algorithms.py | py | 14,164 | python | en | code | 9 | github-code | 18 | [
{
"api_name": "source.tf_transforms.my_istft",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "numpy.repeat",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "numpy.newaxis",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_name": "source.... |
8913049042 | from operator import or_
from sqlalchemy.orm import exc
from ideas.database.Databases import Databases
from ideas.database.PMPapers import PMPapers
from ideas.database.graph import Graph
from ideas.database.WebLink import WebLink
from sqlalchemy import or_
import datetime
from ideas import db
import time
from CatchMed... | yjxuser/Medicineweb | server/houduan/SQL_Todo.py | SQL_Todo.py | py | 5,569 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "datetime.datetime.now",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "ideas.database.Databases.Databases",
"line_number": 19,
"usage_type": "call"
},
{
"a... |
35113038502 | """Support for Vivint garage doors."""
from typing import Any
from vivintpy.devices.garage_door import GarageDoor
from homeassistant.components.cover import (
CoverDeviceClass,
CoverEntity,
CoverEntityFeature,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssist... | natekspencer/hacs-vivint | custom_components/vivint/cover.py | cover.py | py | 2,139 | python | en | code | 45 | github-code | 18 | [
{
"api_name": "homeassistant.core.HomeAssistant",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "homeassistant.config_entries.ConfigEntry",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "homeassistant.helpers.entity_platform.AddEntitiesCallback",
"line_n... |
41944309544 | import openai
import re
openai.api_key = ''
def get_manual_prompts(DATASET):
prompts_choose = []
path_manual_prompts = '/media/pwq/project/CoOp/manualprompt/prompts_manual_' + DATASET + '.txt'
with open(path_manual_prompts,'r') as f:
lines = f.readlines()
for line in lines:
pro... | pwq111111/CSHP | manualprompt/prompt_choose.py | prompt_choose.py | py | 1,247 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "openai.api_key",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "openai.ChatCompletion.create",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "openai.ChatCompletion",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_na... |
5453448203 | ############# DRAWING IN PYGAME #############
##### INITIALISATION #####
import pygame
pygame.init()
BLACK = (0, 0, 0)
GREEN = (0, 255, 0)
BLUE = (0, 0, 255)
RED = (255, 0, 0)
PINK = (255, 0, 255)
WINDOW = pygame.display.set_mode((750, 750))
pygame.display.set_caption("DRAWING WINDO... | HaythemBH2003/Pygame-Course | Chapter3.py | Chapter3.py | py | 2,773 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pygame.init",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pygame.display... |
13876015743 | import random
from smtplib import SMTPException
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.models import User
from django.core.mail import send_mail
from django.core.paginator import Paginator
from django.http import HttpResponse
from django.shortcuts import render, redirect
f... | krapovskik/djangoCinema | cinema/views.py | views.py | py | 5,415 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.views.generic.ListView",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "django.views.generic",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "models.Movie",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "... |
13979467765 | import os
import itertools
import numpy as np
from PIL import Image
import torchvision.transforms as transforms
from torch.utils.data.sampler import Sampler
NO_LABEL = -1
def cifar10():
channel_stats = dict(mean=[0.4914, 0.4822, 0.4465],
std=[0.2470, 0.2435, 0.2616])
tra... | iBelieveCJM/pseudo_label-pytorch | util/datasets.py | datasets.py | py | 5,043 | python | en | code | 318 | github-code | 18 | [
{
"api_name": "torchvision.transforms.Compose",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.RandomHorizontalFlip",
"line_number": 15,
"usage_type": "cal... |
74920719078 | import numpy as np
import torch
from .base import FactorCollection
from .base import VideoWrapper
from .factor import TensorFactor
class Video(VideoWrapper):
""" Manages Unrolled Tensor and multiplication with a Full Video """
def __init__(self,
video_shape,
device='cuda'):
... | ikinsella/locaNMF | locanmf/video.py | video.py | py | 7,974 | python | en | code | 28 | github-code | 18 | [
{
"api_name": "base.VideoWrapper",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "factor.TensorFactor",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "torch.float32",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "torch.matmul"... |
73701111080 | import functools
import inspect
import json
import typing
from django.db import transaction
from django.http.response import (
Http404,
HttpResponse,
HttpResponseBadRequest,
StreamingHttpResponse,
)
from django.shortcuts import get_object_or_404
from django.utils.translation import gettext as _
from dj... | jlaunonen/kirppu | kirppu/ajax_util.py | ajax_util.py | py | 10,106 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.http.response.HttpResponse",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "typing.Dict",
"line_number": 64,
"usage_type": "attribute"
},
{
"api_name": "django.views.decorators.http.require_http_methods",
"line_number": 101,
"usage_type": ... |
12194015066 | import openpyxl as xl
# loading Workbook
wb = xl.load_workbook('transactions.xlsx')
# loading a singular sheet
sheet = wb["Sheet1"]
# assigning a variable the cell value
cell = sheet["a1"] # or "cell = sheet.cell(1, 1)"
# printing rows and cols and also the assigned value
# print(sheet.max_row)
# print(sheet.max_colu... | SatyamVyas04/LearningPythonPkgs | Openpyxl/app.py | app.py | py | 1,010 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "openpyxl.load_workbook",
"line_number": 3,
"usage_type": "call"
}
] |
71596839079 | import pathlib
import tools.bundle_management as bm
import tools.app_data as app_data
import tools.ios_app as ios_apps
import paramiko
import socket
import tools.utils as utils
from paramiko.channel import ChannelFile
from socket import gaierror
from time import sleep
from re import findall, sub
# Utilities for conn... | cdelaof26/ssh_decrypt_automation_tool | tools/ssh_connection.py | ssh_connection.py | py | 19,321 | python | en | code | 28 | github-code | 18 | [
{
"api_name": "paramiko.SSHClient",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "paramiko.AutoAddPolicy",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "paramiko.SSHClient",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "par... |
27129903809 | import datetime
import time
import uuid
from typing import Any
from unittest import mock
import pytest
from sched_slack_bot.model.reminder import Reminder
from sched_slack_bot.model.schedule import Schedule
from sched_slack_bot.reminder.scheduler import ReminderScheduler
from sched_slack_bot.reminder.sender import Re... | Germandrummer92/SchedSlackBot | test_sched_slack_bot/reminder/test_scheduler.py | test_scheduler.py | py | 4,529 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "typing.Any",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "unittest.mock.MagicMock",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "unittest.mock",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "sched_slack_bot... |
75058577319 | from collections import Counter # counter
from skimage import io # library to read images
import matplotlib.pyplot as plt # library to show image to user
import numpy as np # used to process image to arrays
import imutils # basic image processing
import cv2 # advanced for image processing
import re # regex
impor... | patrickfriedman/Braille2Text | app/src/main/python/brailleProcessingLib.py | brailleProcessingLib.py | py | 11,475 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "skimage.io.imread",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "skimage.io",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "imutils.resize",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_n... |
39911586935 | import re
from bs4 import BeautifulSoup
import requests
from Library.book import Book
from urlparse import urljoin
from Link_Builder.website import WebSite
from Link_Builder.linkbuilder import LinkBuilder
from Arg_Parser.arg_parser import Arg_Parser
from Filter.Filter import Filter
# This is the default link... | deyanlaf0409/Web-Scraper | Scraping/scraper.py | scraper.py | py | 4,448 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "re.findall",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "Arg_Parser.arg_parser.Arg_Parser",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "Filter.Filter.Filter",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "Link... |
71427003880 | import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
from sklearn.model_selection import train_test_split
from sklearn.metrics import roc_auc_score
from sklearn.ensemble import RandomForestClassifier
import os
print(os.listdir("../input"))
train_df = pd.read... | aorursy/new-nb-3 | hakeydotcom_check-train-test-covariate-shift.py | hakeydotcom_check-train-test-covariate-shift.py | py | 1,239 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.listdir",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_... |
13058344513 | import os
from shutil import copytree
import re
import json
from pathlib import Path
import pandas as pd
import numpy as np
from bs4 import BeautifulSoup
from bs4.element import Tag
import click
from bids import BIDSLayout
from bids.tests import get_test_data_path
from ._html_snippets import _generate_html_head, html_f... | transatlantic-comppsych/fmriprep-group-report | fmriprepgr/reports.py | reports.py | py | 23,952 | python | en | code | 12 | github-code | 18 | [
{
"api_name": "bids.BIDSLayout",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "bids.tests.get_test_data_path",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pathlib.Pa... |
71758341801 | """
Filename: lane_detection/simple_lane_detection.py
Description: Contains functionality for detecting simple lanes from an image
Author: Domhnall Boyle
Maintained by: Domhnall Boyle
Email: dboyle25@qub.ac.uk
Python Version: 3.6
"""
# standard and 3rd party library imports
import argparse
impo... | DomhnallBoyle/Research-Project | src/lane_detection/simple_lane_detection.py | simple_lane_detection.py | py | 10,206 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sys.path.append",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
4191544902 |
from statsmodels.stats.diagnostic import het_white
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.feature_selection import RFE
from sklearn.linear_model import LinearRegression
from statsmodels.stats.outliers_influence import variance_inflation_... | DIEGOTEC18/DataScienceAndAnalytics_class | cleansing_statistics_regresions_optimizations_testing.py | cleansing_statistics_regresions_optimizations_testing.py | py | 10,876 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "numpy.linspace",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "statsmode... |
13048655036 | #날짜/시간과 관련된 기능 가져오기
import datetime
#현재 날짜/시간 구하기
now = datetime.datetime.now()
#오전 구분
if now.hour < 12 :
print("현재 시각은 {}시로 오전입니다.".format(now.hour))
#오후 구분
if now.hour >=12 :
print("현재 시각은 {}시로 오후입니다.".format(now.hour)) | duwn55/coding-practice | python/CONDITION/datetime03.py | datetime03.py | py | 342 | python | ko | code | 0 | github-code | 18 | [
{
"api_name": "datetime.datetime.now",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 5,
"usage_type": "attribute"
}
] |
23549247668 |
from .component import Component
from ..astline import ASTLine
from argparse import ArgumentParser
class ContributorDocumentation(Component):
parse_group_description = 'Contributor Documentation parameters'
name = 'contributordoc'
@classmethod
def cmdline_documentation(cls, parser: ArgumentParser)... | owrel/clindoc | clindoc/builder/contributodocumentation.py | contributodocumentation.py | py | 5,957 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "component.Component",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "astline.ASTLine",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "astline.AS... |
72394719079 | from flask import session
from models.users import Users
from flask.json import jsonify
from auth.auth import is_authenticated, is_admin
from models.users import db
def get_dashboard_data():
user_id = session.get("user_id")
# Check if session exist
if not is_authenticated(user_id):
return jsonify... | carloschiongbian/DeployMemores | flask-server/controllers/manage/get_dashboard_data.py | get_dashboard_data.py | py | 1,005 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "flask.session.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.session",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "auth.auth.is_authenticated",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask.json... |
11244262311 | import csv
from django.core.management.base import BaseCommand
from recipes.models import Ingredient
class Command(BaseCommand):
DATA = {
Ingredient: "ingredients.csv",
}
def add_arguments(self, parser):
parser.add_argument("--data_directory", type=str)
def handle(self, *args, **opt... | RabcriN/foodgram-project-react | backend/foodgram/recipes/management/commands/filldb.py | filldb.py | py | 937 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "recipes.models.Ingredient",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "csv.reader",
"line_number": 23,
"usage_type": "call"
}
] |
2270481326 | #!/usr/bin/env python
# coding: utf-8
# In[2]:
import warnings
warnings.filterwarnings('ignore')
import os
import sys
import json
import datetime
import numpy as np
import skimage.draw
import cv2
import random
import math
import re
import time
import tensorflow as tf
import matplotlib.pyplot as plt
import matplotlib... | Qtonium/Strawberry-Ripeness-and-Count-Detection | Model - 1/train.py | train.py | py | 5,451 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "os.path",
"li... |
36519701200 | import random
import heapq
import datetime
import networkx as nx
import math
import argparse
import matplotlib.pyplot as plt
import time
import pickle
import numpy as np
import operator
save_dir = '../datasets/Flickr/'
def featureUniform(dimension, scale):
vector = np.array([random.random() for i in ran... | HCDM/BanditLib | OnlineInfluenceMaximization/SampleFeature/GenerateNodeFeature.py | GenerateNodeFeature.py | py | 1,192 | python | en | code | 314 | github-code | 18 | [
{
"api_name": "numpy.array",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "random.random",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.norm",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"line_... |
9939423917 | from config.config import ALPHABET, Wiring
from config.pygame_config import (
COMPONENT_BORDER_RADIUS,
COMPONENT_LETTERS_COLOR,
COMPONENT_BORDER_COLOR,
COMPONENT_BORDER_WIDTH,
)
import pygame
class Reflector:
def __init__(self, wiring: Wiring, name: str) -> None:
self.left = ALPHABET
... | RDonnelly88/enigma | components/reflector.py | reflector.py | py | 1,204 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "config.config.Wiring",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "config.config.ALPHABET",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "pygame.surface",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "pygam... |
1894973467 | import torch
import numpy as np
import torch.nn as nn
from code.config import Hyper
class SampleDropout:
def __init__(self, hyper: Hyper):
self.p = hyper.prob
self.dropout_ratio = nn.Embedding(hyper.n, 1)
self.dropout_ratio = self.dropout_ratio.cuda(hyper.gpu)
self._init_dropout(... | Buted/RBDEF | code/layers/sample_dropout.py | sample_dropout.py | py | 1,094 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "code.config.Hyper",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "torch.nn.Embedding",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line... |
9672323151 | from django import VERSION as DJANGO_VERSION
from django.core.exceptions import ValidationError
from django.db import DataError, models, transaction
from django.test import TestCase, override_settings
from django.utils.translation import override
from modeltrans.fields import TranslationField
from .app.models import ... | zostera/django-modeltrans | tests/test_models.py | test_models.py | py | 14,192 | python | en | code | 47 | github-code | 18 | [
{
"api_name": "django.test.TestCase",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "app.models.Blog",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "django.utils.translation.override",
"line_number": 25,
"usage_type": "call"
},
{
"api_name":... |
6423072155 | from __future__ import absolute_import, division, print_function
import os
import skimage.transform
import numpy as np
import PIL.Image as pil
from .mono_dataset import MonoDataset
class NYUv2Dataset(MonoDataset):
def __init__(self, *args, **kwargs):
super(NYUv2Dataset, self).__init__(*args, **kwargs)
self.K =... | bmV3Qmll/monodepth2Replicate | datasets/nyuv2_dataset.py | nyuv2_dataset.py | py | 1,586 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "mono_dataset.MonoDataset",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.join"... |
16209031222 | import numpy as np
import matplotlib.pyplot as plt
import mopc as mop
'''choose halo redshift and mass [Msun]
'''
z = 0.57
m = 2e13
'''choose radial range (x = r/rvir)
'''
x = np.logspace(np.log10(0.1),np.log10(10),100)
'''choose angular range [eg. arcmin]
'''
theta = np.arange(100)*0.05 + 0.5
theta = np.linspace... | samodeo/Mop-c-GT | example_mopc.py | example_mopc.py | py | 2,328 | python | en | code | 10 | github-code | 18 | [
{
"api_name": "numpy.logspace",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.log10",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_nu... |
19447594681 | import functools
import glob
import json
import os
import mock
import pytest
from google.protobuf import text_format
from google.cloud.firestore_v1beta1.proto import firestore_pb2
from google.cloud.firestore_v1beta1.proto import test_pb2
from google.cloud.firestore_v1beta1.proto import write_pb2
_UNIMPLEMENTED_FEATU... | theacodes/google-cloud-python | firestore/tests/unit/test_cross_language.py | test_cross_language.py | py | 9,712 | python | en | code | null | github-code | 18 | [
{
"api_name": "google.cloud.firestore_v1beta1.proto.test_pb2.Test",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "google.cloud.firestore_v1beta1.proto.test_pb2",
"line_number": 68,
"usage_type": "name"
},
{
"api_name": "google.protobuf.text_format.Merge",
"line_nu... |
6620770914 | # -*- coding: utf-8 -*-
"""
@ Instituto Tecnologico y de Estudios Superiores de Occidente
@author: Adrian Ramos Perez
"""
from matplotlib import pyplot as plt
import numpy as np
from scipy import signal as sig
from sklearn.datasets import make_blobs
from sklearn.model_selection import train_test_split
fro... | AdrianRamosDS/Thesis | code/Thesis_ARP.py | Thesis_ARP.py | py | 13,643 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "librosa.load",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "IPython.display.Audio",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "librosa.load",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "librosa.load",
"l... |
75169345641 | """setup script for yodl
"""
from setuptools import setup
with open('requirements.txt') as handle:
REQUIREMENTS = handle.readlines()
setup(
name='yodl',
version='0.0.1',
packages=['yodl'],
description='Django models from YAML!',
author='Bruno Lange',
author_email='blangeram@gmail.com',
... | brunolange/yodl | setup.py | setup.py | py | 428 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "setuptools.setup",
"line_number": 9,
"usage_type": "call"
}
] |
9327968090 | from flask import render_template, Blueprint, jsonify, current_app
from flask_login import current_user
from noirart.notifications import push_follow_notification, push_collect_notification
from noirart.models import User, Notification, Photo
ajax_bp = Blueprint('ajax', __name__)
@ajax_bp.route('/profile/<int:user_... | youyuge34/Noir_Art | noirart/blueprints/ajax.py | ajax.py | py | 2,254 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "flask.Blueprint",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "noirart.models.User.query.get_or_404",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "noirart.models.User.query",
"line_number": 12,
"usage_type": "attribute"
},
{
... |
28959418711 | # -*- coding: utf-8 -*-
import re
from datetime import timedelta
from pyload.core.utils.convert import to_bytes
from ..base.simple_downloader import SimpleDownloader
class FastshareCz(SimpleDownloader):
__name__ = "FastshareCz"
__type__ = "downloader"
__version__ = "0.45"
__status__ = "testing"
... | pyload/pyload | src/pyload/plugins/downloaders/FastshareCz.py | FastshareCz.py | py | 3,355 | python | en | code | 3,038 | github-code | 18 | [
{
"api_name": "base.simple_downloader.SimpleDownloader",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "re.search",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "re.compi... |
9870939136 | import time
import numpy as np
import pymongo
import matplotlib.pyplot as plt
from env.core import AircraftAgentSet
from env.load import load_data_set, load_and_split_data
from env.model import Routing, FlightPlan, Aircraft
from env.render import plot_line, make_random_color, make_color, draw
from env.utils import pn... | Lydia-Yahuhe/cdr_gail | make_scenarios.py | make_scenarios.py | py | 13,924 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "env.load.load_data_set",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "simplekml.Kml",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "env.render.plot_line",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "env.render.... |
35023305384 | """
LanguageParser is a rudimentary natural language parser for forming SQL-like queries
for use against Pandas dataframe objects.
The language parser takes input as such that:
`my column value is greater than another column value and my column is not equal yet another column`
This would then be parsed and become:
... | mproffitt/pyccata | src/pyccata/core/parser.py | parser.py | py | 16,919 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pyccata.core.decorators.accepts",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "re.subn",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "re.IGNORECASE",
"line_number": 58,
"usage_type": "attribute"
},
{
"api_name": "re.subn",
... |
29256190104 | import json
from .. import get_user_preferences
from .save_load_util import import_lint_rules, get_config_filepath
def reload_issues(context):
"""Reload issues"""
issues_collection = context.window_manager.lint_issues
rules = get_user_preferences(context).lint_rules
issues_collection.clear()
for ... | semagnum/blint | save_load/reload.py | reload.py | py | 1,456 | python | en | code | 13 | github-code | 18 | [
{
"api_name": "save_load_util.get_config_filepath",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "save_load_util.import_lint_rules",
"line_number": 40,
"usage_type": "call"
}
] |
39430431918 | import sqlite3
import sqlalchemy as db
import pandas as pd
df = []
'''
#option 1
cnx = sqlite3.connect(':memory')
df.to_sql(name='df',con=cnx)
p2 = pd.read_sql('select * from df', cnx)
'''
'''
#option 2
engine = db.create_engine('sqlite:///save_pandas.db', echo=True)
sqlite_connection = engine.connect()
metadata =... | thyaravind/Impakter | CORE/Services/Dev/Notes/sqlite.py | sqlite.py | py | 1,361 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sqlite3.connect",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "pandas.read_sql",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 63,
"usage_type": "call"
}
] |
18064490831 | import pandas as pd
import numpy as np
from sklearn.linear_model import Ridge, LinearRegression
from sklearn.metrics import r2_score, precision_score, recall_score, accuracy_score
class Backtest():
def __init__(self, z: int=1000, T: int=12, use_type=np.float32):
self.z = z
self.T = T
self.u... | Nickkontschak/replicating_the_virtue_of_complexity_in_machine_learning_portfolios | backtest.py | backtest.py | py | 3,928 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "numpy.float32",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "numpy.float32",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "sklearn.linear_... |
72853168040 | #!/usr/bin/python
"""Usage: $ python A_store_credit.py inputFile [outputFile]"""
import sys, datetime
def solve(credit, items, price_list):
"""You receive a credit C at a local store and would like to buy two items.
You first walk through the store and create a list L of all available items.
From ... | Hawk94/code_jam | 2010/A_store_credit.py | A_store_credit.py | py | 3,141 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sys.argv",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.now",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",... |
3687032637 | """ Unit processing_components for rascil advise
"""
import logging
import unittest
import shutil
import numpy
from astropy import units as u
from astropy.coordinates import SkyCoord
from rascil.apps.rascil_advise import cli_parser, advise
from rascil.data_models.parameters import rascil_path
from rascil.data_models... | NLESC-quantum/rascil | tests/apps/test_rascil_advise.py | test_rascil_advise.py | py | 3,497 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "logging.WARNING",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "unittest.TestCase",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "rascil.... |
157037266 | # -*- coding: utf-8 -*-
"""
Created on 2021/7/8 23:35
Filename : ex06_kernel_svm.py
Author : Taosy.W
Zhihu : https://www.zhihu.com/people/1105936347
Github : https://github.com/AFei19911012/PythonSamples
Description:
"""
# =======================================================
import numpy as np
... | AFei19911012/PythonSamples | sklearn/Supervised_learning/Support_Vector_Machines/ex06_kernel_svm.py | ex06_kernel_svm.py | py | 8,019 | python | en | code | 12 | github-code | 18 | [
{
"api_name": "matplotlib.colors.Normalize",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "matplotlib.colors.Normalize.__init__",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "matplotlib.colors.Normalize",
"line_number": 33,
"usage_type": "name"
... |
71532805799 | from datetime import datetime, date, timedelta, time
from django.utils.safestring import mark_safe
from djaveDT import tz_dt_to_str, time_to_time_str, d_to_str, tz_dt_to_tz_dt
from djmoney.money import Money
class CellContent(object):
def as_html(self):
raise NotImplementedError('as_html')
def as_csv(self):... | dasmith2/djaveTable | djaveTable/cell_content.py | cell_content.py | py | 7,339 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.utils.safestring.mark_safe",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "django.utils.safestring.mark_safe",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "django.utils.safestring.mark_safe",
"line_number": 83,
"usage_type": ... |
35960686919 | import tensorflow as tf
import numpy as np
from datetime import datetime
from sys import stdout
import shutil
import os
from data_reader import AsyncReader, ReaderOpts
from transformations import make_transformation_matrix, concat_images
from loss import LossLayer
from models import build_depth_net, build_pose_net
fro... | xianlopez/monodepth2_tf2 | train.py | train.py | py | 7,929 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.path.join",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_nu... |
17889796853 | """The main file for the application"""
from fastapi import FastAPI
app = FastAPI(title="Blog Application",
description="This is a blog application", version="0.1.0")
@app.get("/")
async def root() -> dict[str, str]:
"""The root endpoint for the application
Returns:
dict[str, str]: The... | KennedyMungai/BlogBackend | app/main.py | main.py | py | 389 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 4,
"usage_type": "call"
}
] |
6831903564 | # MatPlotLib_Exercises.py
# - Jim
import numpy as np
import matplotlib.pyplot as plt
x = np.arange(0, 100)
y = x * 2
z = x ** 2
fig1 = plt.figure()
fig1_axes1 = fig1.add_axes([0.1, 0.1, 0.85, 0.85])
fig1_axes1.plot(x, y, "r")
fig1_axes1.set_xlabel("x")
fig1_axes1.set_ylabel("y = x *2")
fig1_axes1.set_title("title"... | bjamesm70/Python_Examples | PandasVisualization/MatPlotLib_Exercises.py | MatPlotLib_Exercises.py | py | 1,322 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.arange",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyp... |
27847146748 | import base64
import os
import zlib
from pathlib import Path
from typing import List
import cv2
import jsonpickle
import matplotlib.pyplot as plt
import numpy as np
import xmltodict
from sklearn.metrics import precision_recall_fscore_support
from core.Rect import get_overlap_clusters, Point, Rect
from core.comicspage... | aamatevosyan/researchWorkCW3 | core/utils.py | utils.py | py | 7,361 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "jsonpickle.set_preferred_backend",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "jsonpickle.set_encoder_options",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 20,
"usage_type": "call"
},
{
"api_... |
9504986319 | from pynput.keyboard import Listener
from time import ctime
from time import ctime
def wtf(key):
ctr=0
a=ctime()
a=str(a)
a+='\n'
keydata=str(key)
keydata=keydata.replace("'","")
if keydata=='key.enter':
keydata="\n"
ctr=1
else:
pass
if ctr==1:
with open("log.txt",'a') as f:
... | themockingjester/private-1 | keylogger using python.py | keylogger using python.py | py | 471 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "time.ctime",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pynput.keyboard.Listener",
"line_number": 25,
"usage_type": "call"
}
] |
26825350078 | import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import os
import pickle
distributions = pickle.load(open("distributions.pkl", "rb"))
infoDist = [[0.25, 0.25, 0.25, 0.25],
[0.233, 0.233, 0.3, 0.233],
[0.217, 0.217, 0.35, 0.217],
[0.2, 0.2, 0.4, 0.2],
... | yxy92/CS5424 | Result/Jobs_SIR_V2/plotDistributions.py | plotDistributions.py | py | 920 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pickle.load",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "matplotlib.pypl... |
38879646348 | # -*- coding: utf8 -*-
from .Config import Config
from ..core.Mojang import Mojang
from .Constants import *
from ..utils.utils import hint
from ..utils.RichText import RichText
import os
import json
class Console:
def __init__(self, config):
'''初始化控制台实例'''
self.config = config
de... | OrzGeeker/OrzMC | OrzMC/app/Console.py | Console.py | py | 4,784 | python | en | code | 8 | github-code | 18 | [
{
"api_name": "Config.Config.GAME_DEFAULT_USERNAME",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "Config.Config",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "core.Mojang.Mojang.get_release_version_id_list",
"line_number": 33,
"usage_type": ... |
540251976 | import qutip as qt
import numpy as np
import matplotlib.animation as animation
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
fig = plt.figure()
ax = Axes3D(fig, azim=-40, elev=30)
sphere = qt.Bloch(axes=ax)
n_qbits = 8
ts = 200
T2 = 150
sx = np.zeros((n_qbits, ts))
sy = np.zeros((n_qbits, t... | inigoliz/HahnEchoes | animations_example.py | animations_example.py | py | 1,708 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "mpl_toolkits.mplot3d.Axes3D",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "q... |
18311777150 | import run
import torch
import plot
import numpy as np
from collections import defaultdict
sent_len_label = (
lambda i, ds: f"{run.SENT_LENGTH_BREAKPOINTS[i]} <= len < {run.SENT_LENGTH_BREAKPOINTS[i+1]} (# samples: {len(ds[i])})"
)
sent_dataset_name2data = {
sent_len_label(i, run.test_data_binned): (
... | paulodder/nlp-code | evaluate.py | evaluate.py | py | 3,334 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "run.SENT_LENGTH_BREAKPOINTS",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "run.test_data_binned",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "run.dev_data_binned",
"line_number": 12,
"usage_type": "attribute"
},
{
... |
41902848578 | # client2.py
import socket
import stun
server = 'stun.l.google.com', 19302
client_port = 8001
client_addr = stun.get_ip_info()[0]
s = socket.socket(family=socket.AF_INET, type=socket.SOCK_DGRAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind((client_addr, client_port))
nat_type, _, host, port = stun.... | arrdguez/network-test | peer-to-peer/client2.py | client2.py | py | 694 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "stun.get_ip_info",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "socket.socket",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_DGRAM",
... |
75329553320 | import pprint
import glob
from mkdocs.structure.files import File
import logging
import os
from datetime import datetime
log = logging.getLogger(__name__)
def add_hidden_files(files, config):
#print("------ from on_pre_build")
#pp = pprint.PrettyPrinter(indent=4)
hidden_files_globs = [
".ladoc/api_helpers/... | lasssim/ladoc | mkdocs/ladoc_hooks.py | ladoc_hooks.py | py | 1,276 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "glob.glob",
"line_numb... |
15524412602 | # _*_ coding:utf-8 _*_
# Lee 2022-05-26 10:21 self_lr
# Note:
import torch
from torch.optim import lr_scheduler, Adam
import matplotlib.pyplot as plt
import torch.nn as nn
import math
class net(nn.Module):
def __init__(self):
super(net, self).__init__()
self.fc = nn.Linear(1, 10)
... | Lee1025-cpu/SegRCC | segmentation/code_in_test/self_lr.py | self_lr.py | py | 1,216 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "torch.nn.Module",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
6449111181 | from django.urls import path
from . import views
app_name = "auctions"
urlpatterns = [
path("", views.index, name="index"),
path("login", views.login_view, name="login"),
path("logout", views.logout_view, name="logout"),
path("register", views.register, name="register"),
path("add_listing", views... | JoseDRamirezM/backup_CS50 | Proyect2/commerce/auctions/urls.py | urls.py | py | 1,334 | python | en | code | 0 | github-code | 18 | [
{
"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",
... |
20720370876 | # Databricks notebook source
# MAGIC %md
# MAGIC ##### Welcome to Azurelib Academy By Deepak Goyal
# MAGIC ##### You can master the Databricks here: <a href='https://adeus.azurelib.com' target='_blank'>www.adeus.azurelib.com</a>
# MAGIC ##### Author of this blog: Arud Seka Berne S <a href="https://www.linkedin.com/in/... | azurelib-academy/azure-databricks-pyspark-examples | 94. Create Pyspark Rdd/Create Pyspark Rdd - Notebook.py | Create Pyspark Rdd - Notebook.py | py | 1,719 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pyspark.sql.session.SparkSession.builder.master",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.session.SparkSession.builder",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "pyspark.sql.session.SparkSession",
"line_number... |
8017448433 | import yaml
import multiprocessing
wsgi_app = "main:app"
bind = "0.0.0.0:8888"
worker_class = "uvicorn.workers.UvicornWorker"
workers = multiprocessing.cpu_count() * 2 + 1
# thread =
accesslog = "/var/log/gunicorn/access.log"
errorlog = "/var/log/gunicorn/error.log"
loglevel = "debug"
with open("./logging.yaml", "... | terib0l/genicons | tmp/gunicorn.conf.py | gunicorn.conf.py | py | 544 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "multiprocessing.cpu_count",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "yaml.safe_load",
"line_number": 17,
"usage_type": "call"
}
] |
7537313022 | import datetime
from django.utils.translation import ungettext as _
from django.utils.timezone import utc, get_current_timezone, now
def timesince(d):
"""
Takes a datetime object and returns the time between d and now
as a nicely formatted string, e.g. "10 minutes".
Adapted from django.utils.timesin... | GetBlimp/boards-backend | blimp_boards/utils/date.py | date.py | py | 1,579 | python | en | code | 16 | github-code | 18 | [
{
"api_name": "django.utils.timezone.get_current_timezone",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django.utils.timezone.now",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 18,
"usage_type": "call"
},
{... |
8341547875 | import boto3
import base64
import os
import json
from botocore.exceptions import ClientError
ddb = boto3.resource('dynamodb')
def getAddressList(tableName):
try:
table = ddb.Table(tableName)
response = table.scan()
return response['Items']
except ClientError as err:
print(err.response['Error'])
... | sparsh-ai/recohut | docs/12-capstones/smartcity/02-firehose/KDFLookupAddressTransform.py | KDFLookupAddressTransform.py | py | 1,218 | python | en | code | 91 | github-code | 18 | [
{
"api_name": "boto3.resource",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "botocore.exceptions.ClientError",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "os.environ",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "json.lo... |
1874104438 | from typing import List, Optional
from fastapi import APIRouter
from app.apis import topic_views
from app.apis.util_routes import search
from app.utils.database import es_client, mongo_epigraphdb_web
from app.utils.logging import logger
router = APIRouter()
ES_EXCLUDE_PREFIX = ["embeddings-", ".apm-", ".kibana_"]
... | MRCIEU/epigraphdb_web | backend/app/apis/util_routes/utils/__init__.py | __init__.py | py | 4,239 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "app.utils.database.mongo_epigraphdb_web.list_collection_names",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "app.utils.database.mongo_epigraphdb_web",
"line_number": 18,
... |
71940426280 | import logbook
import pandas as pd
import zipline as zl
from datetime import datetime, timedelta
import pathlib
import azul
import numpy as np
from typing import List, Tuple
log = logbook.Logger('BasePriceManager')
class BasePriceManager(object):
def __init__(self, calendar_name='NYSE'):
self._calendar ... | brettelliot/azul | azul/base_price_manager.py | base_price_manager.py | py | 9,962 | python | en | code | 7 | github-code | 18 | [
{
"api_name": "logbook.Logger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "zipline.get_calendar",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "datetime.datetime",
... |
31502870200 | import pytest
import requests
from pytest_bdd import scenarios, when, then
# public api to get random single or two-part jokes of a random category
JOKES_API = "https://v2.jokeapi.dev/joke/Any"
# path to feature file
scenarios("../features/multiple_jokes.feature", example_converters=dict(number_of_jokes=int,
... | dcfernandez1023/BDD | step_definitions/test_multiple_jokes.py | test_multiple_jokes.py | py | 1,466 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pytest_bdd.scenarios",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "pytest_bdd.when"... |
564348898 | import os,sys
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import skimage
import numpy as np
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import edge_detection
from skimage import io
from skimage import feature
from scipy.ndimage.morphology import binary_fill_holes
from skima... | jrodguez/musical-robot | musicalrobot/pixel_analysis.py | pixel_analysis.py | py | 8,185 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "sys.path.append",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
36530006664 | from web3 import Web3
import os.path
import json
import sys
import glob
import sys
import json
import rlp
from subprocess import Popen, PIPE, STDOUT
from values import MyGlobals
from blockchain import *
def compile_contract(filename):
print('\033[1m[ ] Compiling Solidity contract from the file %s ... \033[0m' % f... | alegritz/MaianUpdated | MAIAN-master/tool/contracts.py | contracts.py | py | 4,923 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.path.path.isfile",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "subprocess.Popen",
... |
75335082919 | import zmq
import json
import os
import sys
import glob
import random
import string
import hashlib
COMMANDS = ['first', 'connect']
# UTILS------------------------------------
def random_string():
chars = string.ascii_lowercase
return ''.join((random.choice(chars)) for x in range(30))
def hash_string(cadena)... | judacave/FileSystemHash | Servidor/server.py | server.py | py | 11,372 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "string.ascii_lowercase",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "random.choice",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "hashlib.sha1",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
... |
29355211768 | import os
import shutil
import sys
import time
import warnings
from random import sample
import numpy as np
import torch
import torch.nn as nn
import torch.optim as opt
from sklearn import metrics
from torch.autograd import Variable
from torch.optim.lr_scheduler import MultiStepLR
from cgcnn.data import CIFData_nocif... | DuwYAnne/SPIN_materials | cgcnn/train.py | train.py | py | 17,807 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 57,
"usage_type": "attribute"
},
{
"api_name": "cgcnn.data.collate_pool",
"line_number": 59,
"usage_type": "name"
},
{
"api_name": "cgcnn... |
9320363382 | from matplotlib import pyplot as plt
import numpy as np
def draw_graph():
# открыть файл со всеми данными и извлечь из них время и 1/1-p
time = []
rate = []
with open('final_data.txt') as file:
lines = file.read().split("\n")
for line in lines[:-1]:
time.append(float(line.split(" ")[0]))
rate.append(floa... | mawansui/misc | labwork_polycondensation/draw_graph_1.py | draw_graph_1.py | py | 1,504 | python | ru | code | 0 | github-code | 18 | [
{
"api_name": "numpy.polyfit",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot"... |
19263493771 | """Sort CSV files"""
import csv
import argparse
def readfile(inputfile: str) -> list:
"""Read a given file and return a list of column values"""
inputlist = []
with open(inputfile, "r", newline="") as readable:
csv_read = csv.reader(readable, delimiter=",")
for line in csv_read:
... | NathanielChavdarov/csvsort | csvproject.py | csvproject.py | py | 1,676 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "csv.reader",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 42,
"usage_type": "call"
}
] |
18392832235 | import sqlite3
# ======= creating connection and cursor ======
connection = sqlite3.connect('DB.sqlite')
cursor = connection.cursor()
# working with database
query = ('CREATE TABLE IF NOT EXISTS users ('
'id INTEGER PRIMARY KEY AUTOINCREMENT,'
'first_name TEXT,'
'last_name TEXT,'
... | MayHoax/robot_dreams_homework | R_D_HW_20/homework 20.py | homework 20.py | py | 993 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sqlite3.connect",
"line_number": 4,
"usage_type": "call"
}
] |
4240150504 | from django.urls import path
from . import views
urlpatterns = [
path('', views.tender_list),
path('cfo_true/', views.tender_cfo_true),
path('cfo_false/', views.tender_cfo_false),
path('cfo_null/', views.tender_cfo_null),
path('<int:tender_id>/', views.tender_detail),
path('add/', views.tender... | AlexTheMaggot/sagsystem | sagsystem/tender/urls.py | urls.py | py | 2,358 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
31229012059 | from lib.scrappers.base.base_scrapper import BaseScrapper
from lib.utils import fetch
class SteamGameDeals(BaseScrapper):
def __init__(self, currency="€"):
self._target_uri = self._get_target_uri()
self._currency = currency
super(SteamGameDeals, self).__init__()
def scrap(self, *args... | epaezrubio/web-scrappers | lib/scrappers/steampowered/game_deals.py | game_deals.py | py | 1,195 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "lib.scrappers.base.base_scrapper.BaseScrapper",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "lib.utils.fetch.fetch_html",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "lib.utils.fetch",
"line_number": 13,
"usage_type": "name"
}
] |
72852073961 | from datetime import datetime, timedelta
from rest_framework import status
from rest_framework.reverse import reverse
from rest_framework.test import APITestCase
from accounts.models import TemporarilyVerifyCode, InviteCode, AuthModel, CustomSession
class AuthTests(APITestCase):
def parametrize_authorization(se... | MercyClassic/phone_auth_test_ex | src/accounts/tests.py | tests.py | py | 5,170 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "rest_framework.test.APITestCase",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "rest_framework.reverse.reverse",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "rest_framework.status.HTTP_400_BAD_REQUEST",
"line_number": 21,
"usage_typ... |
32633910195 | #!/usr/bin/python
import os
import sys
import cv2
import numpy as np
from scipy import ndimage
from scipy.stats import pearsonr
import math
import re
def check_if_int(s):
try:
return int(s)
except:
return s
def split_to_numbers_and_words(s):
return [check_if_int(c) for c in re.split('([0... | thieminho/Matching_parts_of_rectangles | main.py | main.py | py | 4,489 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "re.split",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "cv2.Canny",
"line_n... |
41701550590 | from django.urls import path
from . import views
# teste
# from django.http import HttpResponse
# def my_views(request):
# return HttpResponse("um string")
urlpatterns = [
path('', views.home),
path('contato/', views.contato),
path('sobre/', views.sobre),
path('recipes/<int:id>/', views.recipe)... | alasporci/django-base | recipes/urls.py | urls.py | py | 329 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.urls.path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django.urls.path",... |
71426969320 | # This Python 3 environment comes with many helpful analytics libraries installed
# It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python
# For example, here's several helpful packages to load in
import numpy as np # linear algebra
import pandas as pd # data processing, CSV fil... | aorursy/new-nb-3 | guntherthepenguin_adversarial-validation.py | guntherthepenguin_adversarial-validation.py | py | 5,120 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.listdir",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "warnings.simplefilter",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"... |
31397653539 | ### capture camera by video ###
import uuid, cv2, time, os
cam = cv2.VideoCapture(0) # open camera 0
# set size camera
cam.set(cv2.CAP_PROP_FRAME_WIDTH, 1920)
cam.set(cv2.CAP_PROP_FRAME_HEIGHT, 1080)
start = time.time()
name_folder = "dataset_img"
if not os.path.isdir(name_folder):
os.makedirs(name_folder)
whi... | DonXI/sorting_fish_project | capture_camera.py | capture_camera.py | py | 929 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.CAP_PROP_FRAME_WIDTH",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "cv2.CAP_PROP_FRAME_HEIGHT",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_na... |
7601778874 | import argparse
import asyncio
import aiohttp
import chess
import chess.pgn
import glob
from io import StringIO
import time
from urllib.parse import urlparse
from collections import defaultdict
from lichess import (
clock_from_comment,
clock_from_seconds,
move_to_path_id,
Lichess,
LoginError,
... | lakinwecker/pgnstudyrelay | pgnstudyrelay.py | pgnstudyrelay.py | py | 9,389 | python | en | code | 7 | github-code | 18 | [
{
"api_name": "collections.defaultdict",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "io.StringIO",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "chess.pgn... |
15332128716 | # -*- coding: utf-8 -*-
import requests
from .hammer import prepare, make_query
from .models import *
API_BASE = "https://www.kaskus.co.id/api/oauth"
HEADERS = {
"User-Agent": "Kaskus Android App 3.74.3",
"Return-type": "text/json",
}
class Kaskus(object):
"""A Kaskus private API wrapper"""
def __i... | teambotmax/botlogin | KhieBots/core.py | core.py | py | 4,928 | python | en | code | 4 | github-code | 18 | [
{
"api_name": "hammer.prepare",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "hammer.prepare",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_... |
44124016468 | # All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | lianzhang132/ironic | ironic/api/controllers/v1/__init__.py | __init__.py | py | 9,904 | python | en | code | null | github-code | 18 | [
{
"api_name": "ironic.api.controllers.v1.versions.BASE_VERSION",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "ironic.api.controllers.v1.versions",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "ironic.api.controllers.base.Version",
"line_number": ... |
32989280716 | # Credits: https://github.com/thuml/Transfer-Learning-Library
import random
import time
import warnings
import sys
import argparse
import shutil
import os.path as osp
import os
import wandb
import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
from torch.utils.data import DataLoader
import torch.nn.f... | lhoyer/MIC | cls/examples/eval.py | eval.py | py | 6,322 | python | en | code | 200 | github-code | 18 | [
{
"api_name": "sys.path.append",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_nu... |
1214220710 | # -*- coding: utf-8 -*-
"""
Created on Mon Jan 4 18:14:18 2016
@author: ethansolomon
"""
import os
from mayavi.core.api import Engine
from mayavi.sources.vtk_file_reader import VTKFileReader
from mayavi.modules.surface import Surface
vtkFile_l = 'lh.vtk'
vtkFile_r = 'rh.vtk'
# Create the MayaVi engine and start it... | esolomon/pyEEGToolbox | mayavi_stuff/display_vtk.py | display_vtk.py | py | 920 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "mayavi.core.api.Engine",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "mayavi.sources.vtk_file_reader.VTKFileReader",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "mayavi.sources.vtk_file_reader.VTKFileReader",
"line_number": 26,
"us... |
13551260022 | import datetime
import httplib
import json
import urlparse
from google.appengine.ext import webapp
from model import client as client_db
from model import datum as datum_db
from model import metric as metric_db
from model import product as product_db
class DatumHandler(webapp.RequestHandler):
"""A class to handle c... | sigurasg/sawbuck | syzygy/dashboard/handler/datum.py | datum.py | py | 9,266 | python | en | code | 4 | github-code | 18 | [
{
"api_name": "google.appengine.ext.webapp.RequestHandler",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "google.appengine.ext.webapp",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 33,
"usage_type":... |
40343808060 | import scipy.io
import os
import cv2
count = 0
index = 0
picNum = 0
RandCor = []
FaceCor = []
imagePath = 'G:/baiduyun/faceresource/wider/WIDER_train/images/'
data = scipy.io.loadmat("G:/baiduyun/faceresource/wider/wider_face_split/wider_face_train.mat")
FileName = data['file_list']
FileValue = data['face_bbx_list']
F... | wangtianrui/wider_face_code | getFace.py | getFace.py | py | 3,380 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "scipy.io.io.loadmat",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "scipy.io.io",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "scipy.io",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "os.walk",
"line_num... |
1806862591 | import argparse
import torch
import os
import DistGNN
import time
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--root',
default='dataset/',
help='Path of the dataset.')
parser.add_argument(
"--dataset",
de... | CommediaJW/Graph-Part-bench | part/metis_format_partition_mask.py | metis_format_partition_mask.py | py | 2,329 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "DistGNN.dataloading.load_dataset",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "Dis... |
34152606108 | import http.server
import socketserver
import termcolor #if we have it in gery it means we are not using the module yet
from pathlib import Path
import jinja2 as j
from urllib.parse import parse_qs, urlparse
HTML_FOLDER = ".html/"
LIST_SEQUENCES = ["AGTTAACCAAGAT", "AGGAATTACA", "ATTTACCAGAATA",
"GG... | claurodriguezg/2021-2022-PNE-Practices | P6/server-P6.py | server-P6.py | py | 3,337 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pathlib.Path",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "jinja2.Template",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "socketserver.TCPServer",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "http.server.... |
16802385872 | import numpy as np
import cv2
#i have no idea for this code. I found it in the Internet and revised for my homework
def bitplaneslicing(inimg, bitplaneNumber):
gray = cv2.imread(inimg,0)
height,width = gray.shape[:2]
lst = []
for i in range(height):
for j in range(width):
... | enesfbaslik/imageprocessing | Basics/bitplaneslicing.py | bitplaneslicing.py | py | 595 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "cv2.imread",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.binary_repr",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_numbe... |
18879316045 | import numpy as np
from scipy.optimize import minimize
from scipy.io import loadmat
from numpy.linalg import det, inv
from math import sqrt, pi
import scipy.io
import matplotlib.pyplot as plt
import pickle
import sys
def getUniqueY(y):
uniqueY = np.unique(y) #returns vector of unique results
return uniqu... | justiswa/MachinePart2 | script.py | script.py | py | 15,084 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.unique",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.matmul",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.transpose",
"line_num... |
27590531414 | from fastsklearnfeature.transformations.BinaryTransformation import BinaryTransformation
from sklearn.base import BaseEstimator, TransformerMixin
import numpy as np
import sympy
from fastsklearnfeature.candidates.CandidateFeature import CandidateFeature
from typing import List
class NonCommutativeBinaryTransformation(... | BigDaMa/DFS | new_project/fastsklearnfeature/transformations/binary/NonCommutativeBinaryTransformation.py | NonCommutativeBinaryTransformation.py | py | 2,389 | python | en | code | 12 | github-code | 18 | [
{
"api_name": "sklearn.base.BaseEstimator",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "sklearn.base.TransformerMixin",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "fastsklearnfeature.transformations.BinaryTransformation.BinaryTransformation",
"line_n... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.