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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
29791300711 | # coding=utf-8
# auther:lucas
# date:2019/7/12 10:50
# tools:PyCharm
# Python:3.7.3
import threading
from selenium import webdriver
import time
caps = {'platform': 'ANY',
'browserName': None,
'version': '',
# "enableVNC": True,
# 'javascriptEnabled': True,
'recordVideo': True,
... | lucas234/zalenium-demo | run_parallel.py | run_parallel.py | py | 1,738 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "time.strftime",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "time.gmtime",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "time.strftime",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "time.gmtime",
"line_numbe... |
37059043184 | '''
Calculate distinct keys in the text
python2: please uncomment line 17
python3: leave it commented
'''
# if unable to find pyspark, please install findspark and uncomment the following two lines
# import findspark
# findspark.init()
import re
from pyspark import SparkContext
def splitter(line):
line = re.sub... | nyu-cds/yg1281_assignment3 | distinct_spark.py | distinct_spark.py | py | 808 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "re.sub",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "re.split",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pyspark.SparkContext",
"line_number": 22,
"usage_type": "call"
}
] |
9056127076 | import logging
VERBOSITY_LEVELS = {
0: None, # Equivalent to no logging.
1: logging.WARN, # For simplicity. Includes ERROR, CRITICAL
2: logging.INFO,
3: logging.DEBUG,
4: logging.NOTSET, # Equivalent to no filtering. Everything is logged.
}
LOGGING_LEVELS = {
'NONE': None,
'CRITICAL': l... | brainy-minds/Jterator | src/jterator/logging_util.py | logging_util.py | py | 879 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "logging.WARN",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "logging.INFO",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "logging.DEBUG",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "logging.NOTSET",
... |
24985634576 | import jittor as jt
from jittor import init
from jittor import nn
import numpy as np
from utils import gram_matrix, bgr2yuv
jt.flags.use_cuda = 1
# adversarial loss for generator (LSGAN)
def adv_loss_g(generated_logit):
return jt.mean(jt.sqr(generated_logit-1))
# content loss for generator
def con_loss_g(vgg,rea... | Dreemurr-T/AnimeGanV2 | jittor_version/loss.py | loss.py | py | 2,272 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "jittor.flags",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "jittor.mean",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "jittor.sqr",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "jittor.nn.L1Loss",
"line_... |
9640144870 | #!/usr/bin/env python3
# -*- coding:UTF-8 -*-
# File Name: api.py
# Author: Shechucheng
# Created Time: 2020-05-18 21:35:12
"""
## **腾讯云api签名算法**
** 官方文档链接 **:
- [签名算法](https://cloud.tencent.com/document/api/213/30654)
- [腾讯云API密钥管理](https://console.cloud.tencent.com/cam/capi)
- [腾讯云官方sdk(python)文档](https://cloud.tenc... | shenchucheng/tencentapi | tencentApi/api.py | api.py | py | 4,640 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "hashlib.sha256",
"line_number": 74,
"usage_type": "attribute"
},
{
"api_name": "hashlib.sha1",
"line_number": 76,
"usage_type": "attribute"
},
{
"api_name": "hmac.new",
... |
6431510220 | from django.shortcuts import render, redirect
from apps.library.models import Book
def index(request):
context = {'books': Book.objects.filter(user=request.user)}
return render(request, 'library.html', context)
def book(request, book_id):
"""
Individual book page displaying the progress of its ex... | cschlay/Personal-Data-Manager | apps/library/views.py | views.py | py | 888 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "apps.library.models.Book.objects.filter",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "apps.library.models.Book.objects",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "apps.library.models.Book",
"line_number": 7,
"usage_type": "n... |
23416630128 | #!/usr/bin/env python
# coding=utf-8
from setuptools import setup
package_name = 'spage'
filename = f'spage/__init__.py'
def get_version():
import ast
with open(filename) as input_file:
for line in input_file:
if line.startswith('__version__'):
return ast.parse(line).bo... | grantps/spage | setup.py | setup.py | py | 909 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "ast.parse",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "setuptools.setup",
"line_number": 28,
"usage_type": "call"
}
] |
18249888029 | import os
import io
from jinja2 import Environment, BaseLoader, select_autoescape
try:
import yaml
except ImportError as e:
print (str(e) + " To install it, type:")
print ("pip install PyYAML")
exit(1)
class TemplateLoader(BaseLoader):
"""
Template loader class.
An instance of this class ... | wschang0/trusted-firmware-m-m2351 | tools/tfm_parse_manifest_list.py | tfm_parse_manifest_list.py | py | 3,538 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "jinja2.BaseLoader",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "os.path.isfile",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "yaml.load",
"line_n... |
20260934686 | import numpy as np
import os
import sys
import esutil
import time
from .fgcmUtilities import retrievalFlagDict
from .fgcmUtilities import MaxFitIterations
from .fgcmUtilities import Cheb2dField
from .fgcmUtilities import objFlagDict
from .fgcmNumbaUtilities import numba_test, add_at_1d, add_at_2d, add_at_3d
import m... | erykoff/fgcm | fgcm/fgcmChisq.py | fgcmChisq.py | py | 89,238 | python | en | code | 9 | github-code | 97 | [
{
"api_name": "fgcmNumbaUtilities.numba_test",
"line_number": 99,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 190,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 204,
"usage_type": "call"
},
{
"api_name": "astropy.io.fits... |
42884022935 | # -*- coding: utf-8 -*-
import torch
from torch.utils.data import Dataset
from torch.nn.utils.rnn import pad_sequence
IGNORE_INDEX = -100
PAD = "[PAD]"
CLS = "[CLS]"
SEP = "[SEP]"
ACTION = "[A]"
TOPIC = "[T]"
class BERTDataset(Dataset):
def __init__(self, data, tokenizer, max_seq_len=512, batch_first=True, reward... | rtcpproject/RTCP | backbones/BERT/dataset_bert.py | dataset_bert.py | py | 3,164 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "torch.nn.utils.rnn.pad_sequence",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "torch.tensor",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": ... |
1814437226 | import asyncio
import json
import logging
from random import choice
from sys import argv
from typing import List
import requests
import urllib3
from fake_useragent import UserAgent
from exceptions import AccountBannedException, PostDeletedException
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
... | BurgerBurglar/hupu_bot | send_posts.py | send_posts.py | py | 10,749 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "urllib3.disable_warnings",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "urllib3.exceptions",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "fake_useragent.UserAgent",
"line_number": 19,
"usage_type": "call"
},
{
"api_nam... |
182911825 | #!python3
import os, sys, re, csv, sqlite3, string
from datetime import datetime, timedelta
from time import strptime, strftime
from itertools import chain
maxlinecount = 16000000
linecount = 0
filecount = 0
# Sample LIne
# 192.168.117.1 - - [20/Jun/2013:01:38:40 -0400] "GET /Dkrh8Ycb.htm HTTP/1.0" 404 210 "-" "Mozil... | orlikoski/VariousParsers | Python Parsers/apacheparse.py | apacheparse.py | py | 4,043 | python | en | code | 10 | github-code | 97 | [
{
"api_name": "re.compile",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"li... |
38683119922 | import json
from django.http import JsonResponse
def calculate_similarity(user1, user2):
# age similarity
age_difference = abs(user1['age'] - user2['age'])
age_similarity = 1 / (age_difference + 1) # handling divided by zero
# interest similarity (common interest)
shared_interests = set(user1['in... | Abk2345/DjangoChatApp | djangoChat/friends/views.py | views.py | py | 2,098 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "json.load",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "django.http.JsonResponse",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "django.http.JsonResponse",
"line_number": 73,
"usage_type": "call"
}
] |
12067003729 | #!/usr/bin/env python
from ctypes import *
import random
import os
import cv2
import time
import darknet
import argparse
import rospy
from threading import Thread, enumerate
from queue import Queue
import rospkg
from cv_bridge import CvBridge, CvBridgeError
from robosub_msgs.msg import Detection, DetectionArray
from... | MarinaDaumas/yolov4_ros | src/darknet_video_topic.py | darknet_video_topic.py | py | 5,794 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "rospkg.RosPack",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 67,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"lin... |
31816547910 | from flask import Blueprint
from app import db
from flask import render_template
from models import Post
from .forms import PostForm
from flask import request
from flask import redirect
from flask import url_for
posts = Blueprint('posts', __name__, template_folder='templates')
@posts.route('/create', methods=['POST',... | Daniil1911/WebFlask | posts/blueprint.py | blueprint.py | py | 922 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Blueprint",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "flask.request... |
31601649229 | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
"""This module checks whether the broker responded appropriately to the
auto-scheduler's cue. If it has not, a message(s) is logged with
`severity = 'CRITICAL'` which triggers a GCP alerting policy.
"""
import base64
import os
from google.cloud import logging
from googl... | mwvgroup/Pitt-Google-Broker | broker/cloud_functions/check_cue_response/main.py | main.py | py | 5,308 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "os.getenv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 18,
... |
7206838123 | import argparse
import jinja2
import json
import os
import string
import sys
# Schema: performance_models[data_mode][tps] = [model]
performance_models = {}
def add_performance_model(model):
"""
Adds performance model to the list of performance models.
"""
# process model values
model["avgCpu"] = ... | aws-observability/aws-otel-collector | e2etest/get-performance-model-table.py | get-performance-model-table.py | py | 4,472 | python | en | code | 488 | github-code | 97 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "jinja2.FileSystemLoader",
"line_number": 89,
"usage_type": "call"
},
{
"api_name": "jinja2.Environment",
"line_number": 90,
"usage_type": "call"
},
{
"api_name": "ji... |
26319785774 | import pytest
from opentrons.protocol_api.module_validation_and_errors import (
validate_heater_shaker_temperature,
validate_heater_shaker_speed,
InvalidTargetTemperatureError,
InvalidTargetSpeedError,
)
@pytest.mark.parametrize("valid_celsius_value", [37.0, 37.1, 50, 94.99, 95])
def test_validate_he... | Opentrons/opentrons | api/tests/opentrons/protocol_api_old/test_module_validation_and_errors.py | test_module_validation_and_errors.py | py | 1,550 | python | en | code | 363 | github-code | 97 | [
{
"api_name": "opentrons.protocol_api.module_validation_and_errors.validate_heater_shaker_temperature",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 1... |
28248308681 | # !/usr/bin/env python
# -*-coding:utf-8 -*-
"""
# File : ImageEnhancement.py
# Time :2023/9/12 11:10
# Author :yujia
# version :python 3.6
# Description:
"""
import numbers
import cv2
import numpy as np
from PIL import Image
from utils.utils_aug import CenterCrop, ImageNetPolicy, RandomResizedCrop... | MgArcher/VerificationCodeRecognition | utils/image_enhancement.py | image_enhancement.py | py | 7,454 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "utils.utils_aug.RandomResizedCrop",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "utils.utils_aug.ImageNetPolicy",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "utils.utils_aug.Resize",
"line_number": 24,
"usage_type": "call"
},
... |
31438629817 | from .base import BaseOrder, BaseUserOrder
from datetime import timedelta
from decimal import Decimal
from django.conf import settings
from django.db import models
from django.utils import timezone
from django.utils.translation import ugettext as _
from core.models import Transaction, Currency
from payments.utils imp... | hossamelneily/nexchange | orders/models/instant.py | instant.py | py | 55,620 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "payments.api_clients.safe_charge.SafeChargeAPIClient",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "verification.api_clients.idenfy.IdenfyAPIClient",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "nexchange.api_clients.factory.ApiClientFacto... |
27838333849 | from pathlib import Path
import sys
import openpyxl
import pandas as pd
import pytest
try:
from ..RynekPierwotny import Raport, localisation
except:
sys.path.append(str(Path(sys.path[0]).parent))
from RynekPierwotny import Raport, localisation
def test_raport_read_excel(tmpdir):
df = pd.Data... | jakubc0205/RynekPierwotny | RynekPierwotny/test/test_RynekPierwotny.py | test_RynekPierwotny.py | py | 1,011 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sys.path.append",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"li... |
72666031678 | #!/usr/bin/env python
import json
import os
if __name__ == "__main__":
with open(os.path.join(".vscode", "c_cpp_properties.json"), "r") as f:
props = json.load(f)
configs = {}
for config in props["configurations"]:
configs[config["name"]] = config
for dirname, _, filenames in os.walk("... | zandmd/esp32-projects | cmake/UpdateVsCode.py | UpdateVsCode.py | py | 1,653 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.path.join",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 12,
... |
29274968661 | """pecp_to_pcp
Revision ID: 839af60c1e2d
Revises: cfd5ea7ea8ef
Create Date: 2023-04-10 12:20:50.350342
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '839af60c1e2d'
down_revision = 'cfd5ea7ea8ef'
branch_labels = None
depends_on = None
def upgrade():
# ##... | bcgov/EPIC.track | epictrack-api/migrations/versions/839af60c1e2d_pecp_to_pcp.py | 839af60c1e2d_pecp_to_pcp.py | py | 847 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "alembic.op.execute",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "alembic.op.execute",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"li... |
29050692560 | from dataclasses import dataclass, field
import sigma
from typing import Optional, Set
@dataclass
class ProcessingItemTrackingMixin:
"""
Provides attributes and methods for tracking processing items applied to Sigma rule objects
like detection items and conditions.
"""
applied_processing_items : Se... | nNipsx-Sec/pySigma | sigma/processing/tracking.py | tracking.py | py | 970 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "typing.Set",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "dataclasses.field",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "typing.Optional",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
... |
26413338589 | import os
from robot.libraries.BuiltIn import BuiltIn
from xlrd import open_workbook
class ExcelUtility(object):
ROBOT_LIBRARY_SCOPE = 'GLOBAL'
__instance = None
@staticmethod
def get_instance():
if ExcelUtility.__instance == None:
ExcelUtility()
return ExcelUtility.__ins... | minhhoangvn/RobotFrameworkAbstract | automation-test/Utilities/DataHelper/ExcelExtension.py | ExcelExtension.py | py | 5,664 | python | en | code | 6 | github-code | 97 | [
{
"api_name": "robot.libraries.BuiltIn.BuiltIn",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 108,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 108,
"usage_type": "attribute"
},
{
"api_name": "os.path... |
23218487416 | import torch
import torch.nn as nn
import numpy as np
device = torch.device("cpu")
if torch.cuda.is_available():
device = torch.device("cuda")
class YoloLoss(nn.Module):
def __init__(self):
super(YoloLoss, self).__init__()
self.coords_scale = 1
self.class_scale = 1
self.rescore_confidence = False
... | TheRohitRahul/yolov2pytorch | yolo_loss.py | yolo_loss.py | py | 3,201 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "torch.device",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.device",
... |
15398348151 | #-*- coding: utf8 -*-
from django import template
from staff.models import EducationDepartments, OfficialDepartments, PersonToPosition
register = template.Library()
@register.inclusion_tag('education_departments_list.html', takes_context=True)
def educationDepartments(context):
departments = EducationDepartmen... | spbstu/fuit.spbstu.ru | staff/templatetags/staff_tags.py | staff_tags.py | py | 1,706 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "django.template.Library",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "staff.models.EducationDepartments.objects.all",
"line_number": 12,
"usage_type": "call"
},
{
... |
23955456037 | """
Functions for meetings
"""
import datetime
import uuid
from bson import ObjectId as BaseObjectId
from app.schemas.meetings import MeetingProperty, MeetingDetail
async def create_meeting(db, property_data, property_option: MeetingProperty):
"""
Create meeting and add it to the current property
"""
... | rezmotaqi/wallet | app/core/meetings.py | meetings.py | py | 1,009 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "app.schemas.meetings.MeetingProperty",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 18,
"usage_type": "attribute"
},
{
... |
73982135680 | # -*- coding:utf-8 -*-
# 单纯的使用 logging 将 数据 写入 .log 文件
import logging
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s %(filename)s[line:%(lineno)d] %(levelname)s %(message)s',
datefmt='%a, %d %b %Y %H:%M:%S',
filename='test.log',
... | HeatDeath/fieldwork_test | 2017-05-17/log_test_1.py | log_test_1.py | py | 490 | python | zh | code | 0 | github-code | 97 | [
{
"api_name": "logging.basicConfig",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "logging.debug",
"line_number": 13,
"usage_type": "call"
}
] |
69934972799 | # from flask import Flask, jsonify
# from ably import AblyRest
# app = Flask(__name__)
# ably = AblyRest('WnIRrA.xFlb_Q:m93uJLI1BHRHAotTYtV0XY8keVa6isAZRT8GhXZMbXg')
# @app.route('/data/<path:ticker_symbols>')
# def get_data(ticker_symbols):
# data = {}
# for ticker_symbol in ticker_symbols.split(','... | ParthGoyal08/RealtimestockAnalysis | server.py | server.py | py | 1,502 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "ably.AblyRest",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "ably.channels.get",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "ably.channels",
"... |
1663557765 | from django.shortcuts import render
from django.views.decorators.csrf import csrf_exempt
from django.http import JsonResponse, HttpResponse
from .models import Message
# Create your views here.
@csrf_exempt
def write(request):
if request.method == 'POST':
ds18b20value = request.POST.get('ds18b20value', ''... | mengluo04/mysite | sensor/views.py | views.py | py | 1,644 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "models.Message.objects.filter",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "models.Message.objects",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "models.Message",
"line_number": 15,
"usage_type": "name"
},
{
"api_name... |
26856752766 | from typing import List, Optional, Tuple
import boto3
import botocore
from johnsnowlabs.py_models.install_info import InstallSuite, LocalPy4JLib
from johnsnowlabs.utils.boto_utils import BotoException
from johnsnowlabs.utils.s3_utils import create_bucket, upload_file_to_s3
def create_glue_bucket(boto_session: boto3... | JohnSnowLabs/johnsnowlabs | johnsnowlabs/auto_install/glue/install_utils.py | install_utils.py | py | 2,779 | python | en | code | 33 | github-code | 97 | [
{
"api_name": "boto3.Session",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "johnsnowlabs.utils.s3_utils.create_bucket",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "botocore.exceptions",
"line_number": 25,
"usage_type": "attribute"
},
{
... |
10984631083 | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
dir = "userdata/sessions"
import glob
import os
import json
import cgi
print('Content-Type: text-plain; charset=utf-8\r\n\r\n')
def listdirectory(path):
fichier=[]
l = glob.glob(path+'/*')
for i in l:
if os.path.isdir(i): fichier.extend(listdirect... | jfk93-fr/MyChronoGPS_WebServer | ajax/get_sessions.py | get_sessions.py | py | 1,504 | python | fr | code | 0 | github-code | 97 | [
{
"api_name": "glob.glob",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.stat",
"line_number": 22,... |
18246038637 | #!/usr/bin/env python
import time
import sys
import json
import logging
import RPi.GPIO as GPIO
from messenger import Messenger
logger = logging.getLogger('power_plug')
APPKEY = '5697113d4407a3cd028abead'
ALIAS = 'power_plug'
GPIO_NUM = 4
class PowerPlug(Messenger):
def __init__(self, appkey, alias, customid, ... | yunbademo/yunba-smartoffice | python/power_plug.py | power_plug.py | py | 1,349 | python | en | code | 7 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "messenger.Messenger",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "messenger.Mes... |
38362149082 | from django.utils import timezone
from rest_framework import serializers
from .models import Movie
class MovieSerializer(serializers.ModelSerializer):
title = serializers.CharField(
max_length=100,
min_length=8,
error_messages={
'required': 'The title field is required.',
... | SHAHEEM593/Movie_Rental_service_RestApi | movierental/rentalapp/serializers.py | serializers.py | py | 2,300 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.CharField",
"line_number": 6,
"usage_... |
30048254898 | from typing import Union
from django_opensearch_dsl import Document, fields
from django_opensearch_dsl.registries import registry
from tests.django_dummy_app.models import Article, Source, ArticleKeyword, Author
@registry.register_document
class ArticleDocument(Document):
"""Article document."""
source = fi... | bartmachielsen/django-opensearch-dsl-signals | tests/django_dummy_app/documents.py | documents.py | py | 1,300 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django_opensearch_dsl.Document",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django_opensearch_dsl.fields.ObjectField",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django_opensearch_dsl.fields",
"line_number": 12,
"usage_type": "n... |
5616448206 | from django.contrib.auth import get_user_model
from nens_auth_client.rest_framework import OAuth2TokenAuthentication
from rest_framework.test import APIRequestFactory
import pytest
UserModel = get_user_model()
@pytest.fixture
def r():
return APIRequestFactory().get("/")
@pytest.fixture
def mocked_authenticato... | nens/nens-auth-client | nens_auth_client/tests/test_rest_framework.py | test_rest_framework.py | py | 1,449 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "rest_framework.test.APIRequestFactory",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 10,
"usage_type": "attribute"
}... |
22371879860 |
import cv2
from API import make_detection
# Path to Input image. NOTE : Minimum image size is 512x512
IMAGE_PATH = 'C:/Users/Deepesh/Desktop/Receipt Detection/Resized Receipt Images/image_85.jpg'
# PROVIDE PATH TO LABEL MAP
LABELS_PATH = 'C:/Users\Deepesh/Desktop/Receipt Detection/label_map.pbtxt'
MODEL_PATH = ... | deepeshdm/Receipt_Info_Detection | main.py | main.py | py | 727 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "API.make_detection",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.imwrite",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line_num... |
34384924979 | # -*- coding: utf-8 -*-
# #!/usr/bin/env python
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import... | symlib/gui | iSCSI_CHAP_add.py | iSCSI_CHAP_add.py | py | 4,741 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "unittest.TestCase",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "login_ds.loginFirefox",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "time.sleep",
... |
72268863998 | from io import BytesIO
from asynctest import TestCase
from .utils import parse_response
# compat with old style
def old_simple_app(env, start_response):
start_response('200 OK', [('Content-Type', 'text/plain')])
return ["hello, world!\n"]
# yield response in old style
def old_app_with_yield(env, start_res... | lexdene/necrophos-wsgi | tests/test_app.py | test_app.py | py | 5,160 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "asyncio.sleep",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "io.BytesIO",
"line_number": 116,
"usage_type": "call"
},
{
"api_name": "io.BytesIO",
"line_number": 127,
"usage_type": "call"
},
{
"api_name": "necrophos_wsgi.connection.Conne... |
39953138899 | import logging
from typing import Dict
from antarest.core.config import Config
from antarest.core.interfaces.cache import ICache
from antarest.core.interfaces.eventbus import IEventBus
from antarest.launcher.adapters.abstractlauncher import AbstractLauncher, LauncherCallbacks
from antarest.launcher.adapters.local_laun... | AntaresSimulatorTeam/AntaREST | antarest/launcher/adapters/factory_launcher.py | factory_launcher.py | py | 1,183 | python | en | code | 10 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "antarest.core.config.Config",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "antarest.launcher.adapters.abstractlauncher.LauncherCallbacks",
"line_number": 18,
"usage_t... |
36508967809 | from flask import Flask, render_template, request
from scraper import scrape
app = Flask(__name__)
app.config['TEMPLATES_AUTO_RELOAD'] = True
@app.route('/', methods=['GET', 'POST'])
def home():
if request.method == 'POST':
barcode = request.form['barcode']
scrape(barcode)
return render_template('header.html')... | calbatr0ss/library-books | app.py | app.py | py | 364 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "flask.request.form",... |
36767807642 | from flask import Flask, request
import pika
app = Flask(__name__)
def publish_to_queue(message):
connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
channel = connection.channel()
# Create ExchangeA and ExchangeB
channel.exchange_declare(exchange='FanoutExchangeA', exchange_t... | rapidkomal/rabitmq-docker-flask | fanout_exchange/sender.py | sender.py | py | 1,409 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "pika.BlockingConnection",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pika.ConnectionParameters",
"line_number": 6,
"usage_type": "call"
}
] |
43153977938 | # -*- coding: utf-8 -*-
"""
Created on Fri Oct 23 01:26:17 2020
@author: adil
"""
import telebot
from telebot import types
import random
import pandas as pd
#################
#Файл с исходной перепиской
from PIL import Image
#################
##############
bot=telebot.TeleBot('1337405770:... | Adilkhan13/portfolio | telegram/telegram_bot_marketplace.py | telegram_bot_marketplace.py | py | 7,953 | python | ru | code | 0 | github-code | 97 | [
{
"api_name": "telebot.TeleBot",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "telebot.types.KeyboardButton",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "telebot.types",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "telebot.ty... |
4065063416 | from warnings import warn
import logomaker as lm
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from sklearn.preprocessing import normalize
def plot_logo(
self,
fname=None,
kind="information",
title=True,
ylabel=True,
add_left=0,
ax=None,
):
"""Plot motif logo
... | vanheeringen-lab/gimmemotifs | gimmemotifs/motif/_plotting.py | _plotting.py | py | 7,483 | python | en | code | 106 | github-code | 97 | [
{
"api_name": "numpy.vstack",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.normalize",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "logomak... |
21130213519 | from elasticsearch_dsl import ( # pylint: disable=no-name-in-module
DocType,
Keyword,
Text,
)
class Article(DocType):
title = Text(analyzer="snowball", fields={"raw": Keyword()})
body = Text(analyzer="snowball")
class Meta:
index = "test-index"
dsl_create_statement = {
"mapping... | open-telemetry/opentelemetry-python-contrib | instrumentation/opentelemetry-instrumentation-elasticsearch/tests/helpers_es5.py | helpers_es5.py | py | 833 | python | en | code | 527 | github-code | 97 | [
{
"api_name": "elasticsearch_dsl.DocType",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "elasticsearch_dsl.Text",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "elasticsearch_dsl.Keyword",
"line_number": 9,
"usage_type": "call"
},
{
"api_name"... |
3337152106 | """src/main.py
FastAPI initialization
"""
import logging.config
from fastapi import FastAPI
from fastapi.responses import RedirectResponse
from src.routers import all_routers
app = FastAPI()
logging.config.fileConfig("/app/src/logging.conf", disable_existing_loggers=False)
log = logging.getLogger(__name__)
for ro... | Abrunacci/tech_challenge | src/main.py | main.py | py | 535 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.config.config.fileConfig",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.config.config",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_n... |
34136013863 | import discord
from discord import Embed
from discord.ext import commands
from utils import backend_commands, strings, embed_generator, config, profile_viewer
def setup(bot):
bot.add_cog(ReactionHandler(bot))
async def notify_user_of_match(message: discord.Message, other_user: discord.User):
other_user_id ... | MaybeGreatProgrammer/MatchBot | cogs/reactionhandler.py | reactionhandler.py | py | 7,854 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "discord.Message",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "discord.User",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "utils.backend_commands.get_value_by_discord_id",
"line_number": 14,
"usage_type": "call"
},
{
... |
29510018132 | from collections import Counter
import random
import logging
from django.conf import settings
from mygpo.podcasts.models import Podcast
from mygpo.subscriptions.models import Subscription
from mygpo.pubsub import utils
logger = logging.getLogger(__name__)
def calc_similar_podcasts(podcast, num=20, user_sample=100)... | gpodder/mygpo | mygpo/data/podcast.py | podcast.py | py | 2,340 | python | en | code | 257 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "mygpo.subscriptions.models.Subscription.objects.filter",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "mygpo.subscriptions.models.Subscription.objects",
"line_number": 24,... |
43712440 | ##################################
# Feature Engineering
##################################
# İş Problemi:
# Özellikleri belirtildiğinde kişilerin diyabet hastası olup olmadığını tahmin edilecek bir makine öğrenmesi
# modeli geliştirilmesi istenmektedir. Modeli gelişitirmeden önce gerekli olan veri analizi ve öz... | emreclsr/Feature_Engineering | Diabetes.py | Diabetes.py | py | 10,548 | python | tr | code | 0 | github-code | 97 | [
{
"api_name": "pandas.set_option",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv... |
13980048260 | import os
import glob
import argparse
import cv2
import re
import copy
import shutil
import numpy as np
parser = argparse.ArgumentParser()
parser.add_argument('-path', required=True)
args = parser.parse_args()
path = args.path
class PointDrawer(object):
def __init__(self, img_paths, log_path, folder_path):
... | TurkishPr/pyscripts | point_center_y.py | point_center_y.py | py | 3,150 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.EVENT_LBUTTONDOWN",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "copy.deepcopy",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "cv2.... |
74302348797 | import argparse
import logging as log
import sys
from pathlib import Path
sys.path.append(str(Path(__file__).parent.parent.parent))
from src.model_converters.tensorflow_common import (load_model, convert_with_tensor_rt, is_gpu_available, # noqa
get_input_operation_n... | itlab-vision/dl-benchmark | src/model_converters/tf_converter.py | tf_converter.py | py | 4,541 | python | en | code | 20 | github-code | 97 | [
{
"api_name": "sys.path.append",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
... |
26679939152 | from django.shortcuts import render
from rest_framework import status as rest_status
from rest_framework.response import Response
from rest_framework.views import APIView
from .models import *
from .serializers import *
from .utils import *
def successRequest(data):
"""
Returns a dict and code 200
"""
return Re... | owinckle/Arkalys-OS | Invoicing/views.py | views.py | py | 3,524 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "rest_framework.response.Response",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "rest_framework.status.HTTP_200_OK",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.status",
"line_number": 16,
"usage_type": "name"
... |
70214605118 | import torch
import torch.nn as nn
import torchvision
from torchvision.transforms import transforms
import torch.nn.functional as F
from torchvision.transforms.functional import center_crop
image_dims = (1, 572, 572) # c, h, w
num_classes = 2
class DoubleConv(nn.Module):
def __init__(self, in_channels, out_channe... | aditya-nutakki/pfs | unet/unet_model.py | unet_model.py | py | 3,605 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "torch.nn.Module",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
15383760199 | import os
import sys
from argparse import ArgumentParser
from flask import Flask, request, abort
from linebot import LineBotApi, WebhookHandler
from linebot.exceptions import InvalidSignatureError
from linebot.models import MessageEvent, TextMessage, TextSendMessage
import requests
from bs4 import BeautifulSoup
impor... | ykskks/tigars-bot | app.py | app.py | py | 3,959 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "linebot.LineBotApi",
"line_number... |
22111592764 | """
https://leetcode.com/problems/combination-sum-ii/
backtracking?
"""
from typing import Counter, List
class Solution:
def combinationSum2(self, candidates: List[int], target: int) -> List[List[int]]:
results = set()
candidates.sort()
def backtracking(i, run, S):
if S == ... | kangxie-colorado/leetcode-and-notes | previous_run/193.40.combSum2.py | 193.40.combSum2.py | py | 6,080 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "typing.List",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 80,
"usage_type": "name"
},
{
"api_name": "typing.Counter",
"line_number": 81,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number... |
21870350881 | import asyncio
import websockets
import time
import json
#from simple_dds import SimpleDDS
from threading import Thread, RLock
from flask import Flask, jsonify
FPS = 30
class Obstacle:
def __init__(self):
pass
class Gateway:
def __init__(self):
with open('staticData.json', 'r') as file:
self.staticData = ... | tzachbon/sixeye | sdv/Aman/gateway/gateway.py | gateway.py | py | 4,791 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "json.loads",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "threading.RLock",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "threading.RLock",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "threading.RLock",
"lin... |
71406524479 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import scipy.sparse as ss
import scipy.signal
# some helper functions (internally, images are represented as floats to avoid errors)
def LoadImage(filename):
return mpimg.imread(filename).astype(np.float)
def SaveImage(fi... | zeitunik/CompPhot | Ex5/05-Poisson Blending-framework/PoissonBlending.py | PoissonBlending.py | py | 5,157 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "matplotlib.image.imread",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.image",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "numpy.float",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.... |
70873702398 | import numpy as np
import pytest
from sklearn.compose import make_column_transformer
from sklearn.datasets import load_breast_cancer, make_classification
from sklearn.exceptions import NotFittedError
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import average_precision_score, precision_reca... | enjuichang/PracticalDataScience-ENCA | recommendation_app/venv/lib/python3.8/site-packages/sklearn/metrics/_plot/tests/test_precision_recall_display.py | test_precision_recall_display.py | py | 11,599 | python | en | code | 82 | github-code | 97 | [
{
"api_name": "pytest.mark.filterwarnings",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "sklearn.datasets.make_classification",
"line_number": 26,
"usage_type": "call"
},
{
"... |
70171642238 | #!/home/maghoi/.conda/envs/py37/bin/python
# Removes duplicate sequences in FASTA file
from Bio import SeqIO
import argparse
parser = argparse.ArgumentParser(description="Removes duplicate seqs from input file, writes to input_out")
parser.add_argument("-f", "--fasta", dest="INPUT_FASTA", required=True, help="Input fa... | Magnushhoie/fasta_scripts | fasta_remove_duplicate_seqs.py | fasta_remove_duplicate_seqs.py | py | 1,369 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "Bio.SeqIO.parse",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "Bio.SeqIO",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "Bio.SeqIO.write",
... |
20361702084 | from __future__ import annotations
from dataclasses import dataclass
@dataclass(frozen=True)
class Point:
x: int = 0
y: int = 0
def add(self, p: Point) -> Point:
return Point(x=self.x + p.x, y=self.y + p.y)
LEFT = Point(x=-1)
RIGHT = Point(x=1)
UP = Point(y=1)
DOWN = Point(y=-1)
| tyler-hoffman/aoc-2015 | advent_of_code_2015_python/shared/models.py | models.py | py | 306 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "dataclasses.dataclass",
"line_number": 6,
"usage_type": "call"
}
] |
44425653910 | from django.urls import path, include
from django.contrib import admin
from . import views
urlpatterns = [
path('', views.authen, name='index'),
path('adding/', views.adding, name='adding'),
path('accounts/', include('django.contrib.auth.urls')),
path('info/', views.info, name='info'),
path('info/... | kiboulfy/project1 | Authentific/urls.py | urls.py | py | 446 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.include",... |
39566529407 | # -------------------------------------------------------------------------------- NOTEBOOK-CELL: CODE
import dataiku
from dataiku import pandasutils as pdu
import pandas as pd, numpy as np
# -------------------------------------------------------------------------------- NOTEBOOK-CELL: CODE
from sklearn.pipeline impo... | tylerfreckmann/local_coder_handson_completed | recipes/recipe_from_notebook_custom_random_forest_classification.py | recipe_from_notebook_custom_random_forest_classification.py | py | 4,186 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "dataiku.Dataset",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sklearn.pipeline.Pipeline",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "sklearn.impute.SimpleImputer",
"line_number": 40,
"usage_type": "call"
},
{
"api_name":... |
34589157851 | from collections import deque
def solution(progresses, speeds):
answer = []
p = deque(progresses)
while p:
for i in range(len(p)):
if p[i] >= 100: continue
p[i] += speeds[i]
if p[0] >= 100:
cnt = 0
while p and p[0] >= 100:
... | Jinwoongma/Algorithm | tests/programmers/test.py | test.py | py | 495 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "collections.deque",
"line_number": 6,
"usage_type": "call"
}
] |
21981464019 | #!/usr/bin/env python
import fileinput
from typing import List
def get_input() -> List[int]:
return [int(line.strip()) for line in fileinput.input()]
def main():
entries = get_input()
for entry in entries:
for another_entry in entries:
if entry + another_entry == 2020:
... | Wecros/aoc-2020 | day1/part1.py | part1.py | py | 415 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "fileinput.input",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 7,
"usage_type": "name"
}
] |
36121188084 | import numpy as np
from scipy.optimize import minimize as m
import matplotlib.pyplot as plt
import qutip as qt
np.set_printoptions(linewidth= np.inf)
goal = np.load('hello_world.npy')
goal_tri = np.triu(goal,1)
#import the goal state and just make sure it looks like it should!
# print(goal)
# plt.imshow(goal_tri)... | tantrix10/qiskit_hello_world | set_up/state_optim.py | state_optim.py | py | 1,157 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "numpy.set_printoptions",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.inf",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "numpy.load",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.triu",
"line_... |
1475206702 | from django.db import models
from django.contrib.auth.models import User
class Concurso(models.Model):
nome = models.CharField(max_length=40)
usuario = models.ForeignKey(User , on_delete=models.CASCADE)
class Materia(models.Model):
nome = models.CharField(max_length=40)
especifica = models.BooleanFiel... | moscarpg/Auxiliador | core/models.py | models.py | py | 819 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.db.models.Model",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "... |
39201404951 | from typing import List
from fastapi import APIRouter, Depends, HTTPException, status
from google.cloud.firestore import Client
from app.database.firestore_session import get_session
from app import crud, schemas
from app.models.account import Account, AccountCreate, AccountUpdate
router = APIRouter()
@router.get(""... | tabris2015/simple-finance-tracker | app/api/v1/accounts.py | accounts.py | py | 1,766 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "google.cloud.firestore.Client",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "fastapi.Depends",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "app.da... |
7133126699 | from CrashDiag.Preproc.Database import *
import numpy as np
import matplotlib.pyplot as plt
def ascending(time, error_threshold=5):
diff = np.diff(time)
errors = np.sum(diff < 0)
if errors > error_threshold:
return False
else:
return True
def positive(time):
return np.all(time>0)
... | bHilz/ADoDC | Source/Homework/HW9/sample_rate_histogram.py | sample_rate_histogram.py | py | 1,324 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "numpy.diff",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.all",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 53,
... |
26999546042 | from django.shortcuts import render, redirect
from django.contrib import messages
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from rest_framework import viewsets
from .serializers import UserSerializer
from .... | viniciusnau/SalaryAPI | user/views.py | views.py | py | 2,924 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "models.User.objects.all",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "models.User.objects",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "models.User",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "django.s... |
74984039038 | # Multi GPU Basic example
# code source: Github (2016) Aymeric Damien: https://github.com/aymericdamien/TensorFlow-Examples
'''
This tutorial requires your machine to have 2 GPUs
"/cpu:0": The CPU of your machine.
"/gpu:0": The first GPU of your machine
"/gpu:1": The second GPU of your machine
'''
import tensorflow a... | jorditorresBCN/FirstContactWithTensorFlow-2ndEdition | MultiGPU.py | MultiGPU.py | py | 2,977 | python | en | code | 21 | github-code | 97 | [
{
"api_name": "tensorflow.matmul",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "tensorflow.device",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "tensorflow.random_normal",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "tensorfl... |
40188710232 | import sys
import networkx as nx
from pathlib import Path
import vermouth
import vermouth.forcefield
from vermouth.log_helpers import StyleAdapter, get_logger
# patch to get rid of martinize dependency
try:
from vermouth.file_writer import deferred_open
except ImportError:
from vermouth.file_writer import open
... | marrink-lab/polyply_1.0 | polyply/src/gen_itp.py | gen_itp.py | py | 4,635 | python | en | code | 92 | github-code | 97 | [
{
"api_name": "vermouth.file_writer.deferred_open",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "vermouth.file_writer.open",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "vermouth.log_helpers.StyleAdapter",
"line_number": 21,
"usage_type": "call"
... |
7731692048 | # -*- coding: utf-8 -*-
"""
Created on Thu Aug 13 19:37:14 2020
@author: ETHEL YAYRA HEHETROR
"""
import time
from ctypes import windll, create_unicode_buffer
from datetime import datetime, timedelta
def return_active_window_title():
hWnd = windll.user32.GetForegroundWindow()
length = wind... | hotlynnn/Time-Tracker | Time-Tracking-Program.py | Time-Tracking-Program.py | py | 4,439 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "ctypes.windll.user32.GetForegroundWindow",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "ctypes.windll.user32",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "ctypes.windll",
"line_number": 14,
"usage_type": "name"
},
{
"... |
12823886260 | import requests
import datetime
import dateutil.parser, dateutil.tz
import time
import logging
from http import HTTPStatus
URL = "https://api.crackwatch.com/api/games?&sort_by=crack_date&is_cracked=true"
URL_AAA = "https://api.crackwatch.com/api/games?&sort_by=crack_date&is_cracked=true&is_aaa=true"
LAST_CHECK_DATE ... | dmtrbrlkv/CrackWatcherBot | app/crack_watch.py | crack_watch.py | py | 3,525 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "datetime.datetime.now",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "dateutil.parser.tz.tzlocal",
"line_number": 12,
"usage_type": "call"
},
{
"api_name"... |
36659785309 | import numpy as np
import torch
from typing import Union
EPS = 1e-8
def si_snr(target: Union[torch.tensor, np.ndarray],
estimate: Union[torch.tensor, np.ndarray]) -> torch.tensor:
"""Calculates SI-SNR estiamte from target audio and estiamte audio. The
audio sequene is expected to be a tensor/array ... | IntelLabs/IntelNeuromorphicDNSChallenge | snr.py | snr.py | py | 2,103 | python | en | code | 104 | github-code | 97 | [
{
"api_name": "typing.Union",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "torch.tensor",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "numpy.ndarray",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "typing.Union",
"li... |
23757633443 | import torch
import torch.nn as nn
import torch.optim as optim
import itertools
from nn_atlas.domains.cusp_square import CuspSquare
from nn_atlas.domains.utils import mesh_interior_points
from nn_atlas.nn_extensions.calculus import grad, diff, cross
from nn_atlas.analysis import topological_edges
import matplotlib.p... | MiroK/nn-atlas | nn_atlas/nn_extensions/test.py | test.py | py | 4,184 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "torch.nn.Module",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
10318608601 | import matplotlib.pyplot as plt
import numpy as np
import dislib as ds
from dislib.cluster import GaussianMixture
def main():
# Based on tests.test_gm.GaussianMixtureTest.test_covariance_types
# Copied code START
""" Tests GaussianMixture covariance types """
np.random.seed(0)
n_samples = 600
... | bsc-wdc/dislib | examples/gm_covariance_types_comp.py | gm_covariance_types_comp.py | py | 4,858 | python | en | code | 41 | github-code | 97 | [
{
"api_name": "numpy.random.seed",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.normal",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.random"... |
783330670 | import customtkinter as ctk
class CountEntry(ctk.CTkEntry):
def __init__(self, parent, **kwargs):
super().__init__(
parent,
placeholder_text="Count",
width=250,
height=30,
border_width=2,
corner_radius=10,
font=("Jetbrains... | arisuvade/pyblaster | ui/count_entry.py | count_entry.py | py | 373 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "customtkinter.CTkEntry",
"line_number": 4,
"usage_type": "attribute"
}
] |
24623087056 | # -*- coding: utf-8 -*-
"""
Created on Wed Nov 13 06:51:26 2019
@author: Nate P
"""
import requests
from bs4 import BeautifulSoup as bs
import re
url = 'https://www.azlyrics.com/r/rollingstones.html'
rs_request = requests.get(url).text
rs_soup = bs(rs_request, 'lxml')
""" rs albums found in 'div', cl... | NateLeeP/Rolling-Stones-Project | rs_scrape_albums.py | rs_scrape_albums.py | py | 1,490 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_numb... |
1610282360 | import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import dataloader
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
torch.manual_seed(1)
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
class Evaluater():
... | szktkfm/influence_mf | evaluate.py | evaluate.py | py | 4,582 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "torch.manual_seed",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.device",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
... |
73291724480 | import requests
import sys
api_response = requests.get("https://api.coindesk.com/v1/bpi/currentprice.json")
dump = api_response.json()
#Check if sys args in not less than 2 and handle errors
if len(sys.argv) != 2:
sys.exit("Missing command-line argument")
elif (sys.argv[1]).isalpha():
sys.exit("Command-line a... | bedzon94/CS50_Python | pset4/bitcoin.py | bitcoin.py | py | 589 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 10,
... |
26834632940 | from Bio import SeqIO
import glob
db = 'uniprotkb'
for original_file in glob.glob('../Data/{}/*.mafft.afa'.format(db))[:]:
print(original_file)
records = list(SeqIO.parse(original_file, 'fasta'))
wt_record = records[0]
only_seqs = []
with open(original_file.replace('.mafft.afa', '.mafft.processe... | adamhockenberry/side-chain-couplings | Code/Empirical_coupling_analyses/clean_mafft_output.py | clean_mafft_output.py | py | 1,035 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "glob.glob",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "Bio.SeqIO.parse",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "Bio.SeqIO",
"line_number": 8,
"usage_type": "name"
}
] |
74497128317 | import unittest
import os
from collections import OrderedDict
from breeze import InDirectory, Breeze, NotRequirableError
from . import MockAttr
class TestMain_InDirectory(unittest.TestCase):
def test_in_directory(self):
curdir = os.getcwd()
with InDirectory('/tmp'):
self.assertEqual(... | BasementCat/breeze | tests/test_main.py | test_main.py | py | 6,514 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "unittest.TestCase",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "breeze.InDirectory",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"... |
33762760221 | from pywb.warcserver.inputrequest import DirectWSGIInputRequest, POSTInputRequest, MethodQueryCanonicalizer
from werkzeug.routing import Map, Rule
import webtest
from six.moves.urllib.parse import parse_qsl
from io import BytesIO
from pyamf import AMF3
from pyamf.remoting import Request, Envelope, encode
#==========... | webrecorder/pywb | pywb/warcserver/test/test_inputreq.py | test_inputreq.py | py | 7,468 | python | en | code | 1,241 | github-code | 97 | [
{
"api_name": "werkzeug.routing.Map",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "werkzeug.routing.Rule",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "werkzeug.routing.Rule",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pywb... |
74848277117 | from typing import List, Optional
from sqlalchemy import insert, select, update
from src.database.connection_sql import ConnectionSQLDatabase
from src.models.sql.filter import FilterModelSQL
from src.utils.conflog import logger
class FilterSQLRepository:
def __init__(self) -> None:
self.session = Connec... | anaplopes/bot-huntag | src/repository/sql/filter.py | filter.py | py | 2,434 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "src.database.connection_sql.ConnectionSQLDatabase",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "src.models.sql.filter.FilterModelSQL",
"line_number": 15,
"usage_type": "argument"
},
{
"api_name": "sqlalchemy.insert",
"line_number": 15,
"usage_... |
10368664121 | # -*- coding: utf-8 -*-
# Calendarios
from datetime import timedelta
# import exceptions to use in Python constraints
from odoo import models, fields, api, exceptions
# Modelos (tablas y atributos)
class Course(models.Model):
_name = 'openacademy.course'
name = fields.Char(string="Title", required=True)
... | sigdeletras/odoo | openacademy/models/models.py | models.py | py | 5,622 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "odoo.models.Model",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "odoo.models",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "odoo.fields.Char",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "odoo.fields",
... |
74912351678 | """Pylons application test package
This package assumes the Pylons environment is already loaded, such as
when this script is imported from the `nosetests --with-pylons=test.ini`
command.
This module initializes the application via ``websetup`` (`paster
setup-app`) and provides the base testing objects.
"""
from unit... | NERC-CEH/jules-jasmin | majic/joj/tests/__init__.py | __init__.py | py | 21,282 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "os.path.dirname",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"l... |
3845381876 | import abc
import optparse
import random
import numpy as np
from typing import cast
from scipy import signal
from scipy import fft
from scipy import interpolate
from matplotlib import colormaps
from math import ceil
from pytui import StyledWindow, Plot, Text
from radio import Radio, RtlRadio, PlutoRadio
# returns a m... | smar10s/sigkit | visualizers.py | visualizers.py | py | 16,266 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "matplotlib.colormaps",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.cast",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "math.ceil",
"line_... |
43915449683 | import argparse
from collections import namedtuple
from datetime import datetime
# from typing import NamedTuple
DATETIME_SUPPORTED_FORMATS = ["%d-%m-%Y", "%Y-%m-%d"]
# We could do sth like this to add typing to our src/dst/date attributes
# class Request(NamedTuple):
# src: str
# dst: str
# date: datet... | mmlynarik/pyweekend_ba2021 | scrapers/base/request.py | request.py | py | 1,063 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "collections.namedtuple",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "a... |
29245502357 | import os
import cv2
import numpy as np
import matplotlib.pyplot as plt
import random as rng
def pltShowCV(img, title="img"):
if len(img.shape) == 2:
img = cv2.cvtColor(img, cv2.COLOR_GRAY2RGB)
print('Image is single-channel (grayscale)')
elif len(img.shape) == 3:
print('Image is three... | LittleSheepy/MyMLStudy | ml00project/pj2LG/LG04SZDetect.py | LG04SZDetect.py | py | 14,508 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "cv2.cvtColor",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_GRAY2RGB",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "cv2.cvtColor",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2RGB",... |
17379533072 | from flask import request, jsonify
from models import (
Movie,
Actor,
MovieActor
)
def create_movie():
data_json = request.get_json()
title = data_json.get('title')
genre = data_json.get('genre')
if title is None:
return 'valid title is required', 400
if genre is None:
... | DanialGhofrani/MovieCatalog | server/api/movie.py | movie.py | py | 1,299 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.request.get_json",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.request",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "models.Movie.get_or_create",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "model... |
8403320538 | import pygame, os, turtle, sys, time
pygame.init() #Iniciamos pygame
tiempo = time.time()
def collide_DOWN(jugador): #Funcion para detectar colisiones con los bordes inferiores
choque = False
for i in range (1, largo_jugador):
pixeles_fondo = pygame.Surface.get_at(fondo, (jugador.x + i, jugador.y + 20... | zzFire07/YIG | Version_GIO/laberinto.py | laberinto.py | py | 6,635 | python | es | code | 0 | github-code | 97 | [
{
"api_name": "pygame.init",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pygame.Surface.get_at",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pygame.Surface",
"line_n... |
18271270757 | import numpy as np
import matplotlib.pyplot as plt
lr_dir = './'
f = open(f'{lr_dir}plot_data.txt', 'r')
epochs_eval = []
eval_loss = []
bleu1 = []
bleu2 = []
bs_p = []
bs_r = []
bs_f1 = []
line = f.readline()
while line != '':
tmp = line.split(',')
eval_loss.append(float(tmp[0].split(':')[1]))
bleu1.appe... | ianwu13/Dual-T5-Negotiator | baseline_model/plots/plot_loss.py | plot_loss.py | py | 1,795 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "matpl... |
74052524478 | import openai
openai.api_key = ''
with open("input.txt", "rt") as file:
response = openai.Completion.create(
model="text-davinci-003",
prompt=file.read(),
temperature=0.7,
max_tokens=256,
top_p=1,
frequency_penalty=0,
presence_penalty=0
)
print("\noutput.py\n", respon... | arkadiusznowak1983/python_workspace | openai/main.py | main.py | py | 432 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "openai.api_key",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "openai.Completion.create",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "openai.Completion",
"line_number": 5,
"usage_type": "attribute"
}
] |
34168925967 | # Importing dependencies
import pandas as pd
import datetime
from pathlib import Path
class DF_Processor:
"""
This class reads, processes and returns both regional and non-regional CSVs as DataFrames from the Data directory.
The __init__ (constructor) method sets both the regional and non-regional CSV titl... | SZun/Real-Impact-of-Inflation | processor.py | processor.py | py | 3,638 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "pandas.read_csv",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 64,
"usage_type": "call"
}
] |
27953274820 | import pika
import numpy as np
from src.lib.generators import Meter, Photovoltaic
from src.lib.metermessage import MeterMessage
import threading
import time
class ThreadTimer(object):
# Timer for simulation. Uses a Mutex as it should be shared if simulating multiple households
def __init__(self, init_time=0,... | jjfllr/PV_SIM | src/lib/workers.py | workers.py | py | 5,296 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "threading.Lock",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pika.PlainCredentials",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "src.lib.generators.Meter",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "pika.Bl... |
12212408993 | """initial migration
Revision ID: f52c4f9eb3d5
Revises: c83b808fab81
Create Date: 2017-05-22 13:55:52.981000
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'f52c4f9eb3d5'
down_revision = 'c83b808fab81'
branch_labels = None
depends_on = None
def upgrade():
... | a410202049/flask_mooc | migrations/versions/f52c4f9eb3d5_initial_migration.py | f52c4f9eb3d5_initial_migration.py | py | 1,046 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "alembic.op.add_column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.DateTim... |
72553655358 | import numpy as np
import matplotlib.pyplot as plt
from pathlib import Path
from os import sep
home = str(Path.home())
cur_dir = str(Path.cwd())
layer_number = [2, 4, 8]
neuron_number = [20, 10, 5]
training_number = 100
value_number = 10000
val_range = [np.pi/2-.17, -(np.pi/2-.17)]
#### Print out Variables ####
x = n... | fkrutul/secant-approx | printFiles.py | printFiles.py | py | 2,611 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pathlib.Path.home",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "pathlib.Path.cwd",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line... |
29734442216 | # coding: utf-8
import re
from six import iteritems
from gensim import corpora, models
def get_dict(filepath, dictpath):
f = open(filepath, "r", encoding="utf-8")
dictionary = corpora.Dictionary(line.strip().split() for line in f)
f.close()
stop_words = [word.strip() for word in open("stop_words... | Losmli010/NLP | cluster/lda_cluster.py | lda_cluster.py | py | 3,090 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "gensim.corpora.Dictionary",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "gensim.corpora",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "re.match",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "six.iteritems",
... |
74701230079 | from collections import defaultdict
from functools import partial
from itertools import permutations
from nltk.stem import PorterStemmer
def get_final_feature_descriptors(nltk_features, dep_features):
stemmer = PorterStemmer()
nltk_features_stemmed = [feat.split(' ') for feat in nltk_features]
nltk_featu... | lilywang2110168/pipeline | pipeline/source/depparse.py | depparse.py | py | 3,015 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "nltk.stem.PorterStemmer",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "functools.partial",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "iter... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.