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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
622183726 | import cv2
import mediapipe as mp
import time
cap = cv2.VideoCapture("C:\\Users\\pc\\Downloads\\New folder\\Video1.mp4",0)
pTime = 0
mpDraw = mp.solutions.drawing_utils
myFaceMesh = mp.solutions.face_mesh
faceMesh = mpFaceMesh.FaceMesh(max_num_faces = 2)
drawSpec = myDraw.DrawingSpec(thickness=1,circle_radi... | null | face_detection.py | face_detection.py | py | 881 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "mediapipe.solutions",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "mediapipe.solutions",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "cv2.c... |
18131639 | import os
import subprocess
import threading
from shutil import move
from typing import Callable
import papermill as pm # type: ignore
from treebeard.conf import run_path, treebeard_config, treebeard_env
from treebeard.runtime.helper import log, upload_artifact
bucket_name = "treebeard-notebook-outputs"
output_note... | null | treebeard-lib/treebeard/runtime/run.py | run.py | py | 3,026 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.Callable",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "threading.Timer",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "treebeard.runtime.helper.log",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "treebear... |
347642742 | from unittest import mock
from unittest.mock import MagicMock
from django.test import TestCase
from eth_account import Account
from .. import EthereumClient
from ..oracles import (CannotGetPriceFromOracle, KyberOracle, UniswapOracle,
UniswapV2Oracle)
from .ethereum_test_case import EthereumTes... | null | gnosis/eth/tests/test_oracles.py | test_oracles.py | py | 5,376 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "ethereum_test_case.EthereumTestCaseMixin",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "django.test.TestCase",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "utils.just_test_if_mainnet_node",
"line_number": 26,
"usage_type": "call"
... |
101437936 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
data=pd.read_csv('entry.csv',error_bad_lines=False)
print('Total Transfer Amount:',data['Amounts'].sum())
rem=pd.DataFrame(data.groupby('Name').sum())
rem.index
plt.pie(rem['Amounts'],labels=rem.index,autopct='%1.1f%%',radius=1)
plt.legend(data.Nam... | null | name.py | name.py | py | 380 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.pie",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot... |
466511285 | '''寻找control样本集'''
import pandas as pd
import numpy as np
from scipy import stats
def main():
# 记录次数
count = 0
# 读取G表与B表
Gcsv = pd.read_csv('../galpair_AB3_LAMOST_Av_info_class_mass.csv')
Bcsv = pd.read_csv('../before_control_mass_test.csv')
array_z = np.array(Bcsv['z'].tolist())
array_... | null | jzq_数据分析项目01/control/seek.py | seek.py | py | 2,099 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_n... |
464581879 | #import serial
import time
import sys
import os
import math
import requests
import json
from datetime import date, datetime
import Adafruit_DHT
def ReadArduinoLine(sensor, pin):
te = Adafruit_DHT.read_retry(sensor, pin)
return te
def Upload(sensorId, sensorValue):
url = "http://rasPi.b-velop.de:8080... | null | Measure.ClientPiZero/ClientPiZero.py | ClientPiZero.py | py | 1,209 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "Adafruit_DHT.read_retry",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "Adafruit_DHT.DHT11",... |
47576835 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# File name :
# Author :
# Date created :
# Date last modified :
# Python Version : 3.*
import os
import sys
import subprocess
import string
import argparse
msg_warn = "\x1b[1m[\x1b[91mWARN\x1b[0m\x1b[1m]\x1b[0m"
def cleanup_printable(inpu... | null | Python/stack_dumper/stack_dumper.py | stack_dumper.py | py | 4,917 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "string.printable",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "subprocess.Popen",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "subproces... |
163001769 | '''
문제) 다음과 같은 웹 주소에서 파일을 직접 읽어서 조건에 맞게 처리하시오.
조건1> http://databank.worldbank.org/data/download/GDP.csv
조건2> pandas에서 제공되는 read_csv() 이용 파일 읽기
조건3> 행 번호 없이 'Code','Ranking','Nation','GDP' 칼럼만 파일 저장
조건4> 파일 데이터를 읽어와서 상위 20위 국가만 추출하여 변수 저장
조건5> 상위 20위 국가의 GDP 대상으로 차트 그리기
'''
import panda... | null | Basic2/chap04_Pandas_dataIO/example.py | example.py | py | 2,211 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plo... |
239608766 | #!/usr/local/bin/python
# Fetch current Top 100 lists and output the XML
# DEPRECATED for Perl/DBIC equivalent
from datetime import date
import urllib2
CRETE_TOP100_URL = r'http://www.piratekingonline.com/uploadfile/rankXML/Crete.xml'
AZOV_TOP100_URL = r'http://www.piratekingonline.com/uploadfile/rankXML/Azov.xml'
O... | null | util/fetch_current_top100.py | fetch_current_top100.py | py | 779 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.date.today",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "urllib2.urlopen",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "urllib2.urlopen",
... |
164909239 | import logging
_log_format = f"%(asctime)s - [%(levelname)s] - %(name)s - (%(filename)s).%(funcName)s(%(lineno)d) - %(message)s"
def get_handler_warnign():
file_handler = logging.FileHandler("warning_orm.log")
file_handler.setLevel(logging.WARNING)
file_handler.setFormatter(logging.Formatter(_log_format))... | null | orm_logger.py | orm_logger.py | py | 749 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.FileHandler",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "logging.WARNING",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "logging.Formatter",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "logging.FileH... |
439875331 | import json
import os
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.wait import WebDriverWait
# noinspection SpellCheckingInspection
class KMKZ:
def __init__(self):
self.driver = ... | null | src/crawler_pool/crawlers/kmkz/__init__.py | __init__.py | py | 2,038 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.common.by.By.CSS_SELECTOR",
"line_number": 25,
"usage_type": "attribute"
... |
281307837 | import os
import sys
from collections import Counter
def main(path):
#training = open('trainingPDTB.txt', 'w')
#explicitTraining = open('explicitTrainPDTB.txt', 'w')
implicitTraining = open('implicitTrainPDTB.txt', 'w')
#development = open('developmentPDTB.txt', 'w')
#explicitDev = open('devExplicitPDTB.txt', 'w... | null | Data/PDTB_implicit/PDTB-test.py | PDTB-test.py | py | 1,816 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.Counter",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_numb... |
406208417 | # Running tests on Firefox first
from selenium import webdriver
class RunFFTests:
def test(self):
# Initiate driver instance
driver = webdriver.Firefox(
executable_path="C:\\Python\\Drivers\\Gecko\\geckodriver-v0.26.0-win32\\geckodriver.exe")
# Open the provided URL
... | null | Basics/RunFFTests.py | RunFFTests.py | py | 390 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "selenium.webdriver.Firefox",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 10,
"usage_type": "name"
}
] |
530595731 | from django.shortcuts import render,get_object_or_404
from django.http import HttpResponse,HttpResponseRedirect
from django.contrib import auth
from django.contrib.auth.decorators import login_required
from Sign.models import Event,Guest
from django.core.paginator import Paginator,EmptyPage,PageNotAnInteger
# Create y... | null | Sign/views.py | views.py | py | 5,608 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.shortcuts.render",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.authenticate",
"line_number": 20,
"usage_type": "call"
},
{
"... |
234762350 | import operator
import re
from django.db import models
from django.utils.six.moves import reduce
from rest_framework.filters import BaseFilterBackend
from rest_framework.settings import api_settings
from django.utils.translation import ugettext_lazy as _
from django.utils import six
from django.db.models.constants imp... | null | app/server/filters.py | filters.py | py | 6,605 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "rest_framework.filters.BaseFilterBackend",
"line_number": 55,
"usage_type": "name"
},
{
"api_name": "rest_framework.settings.api_settings.SEARCH_PARAM",
"line_number": 57,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.settings.api_settings",
"line_... |
104777025 | """Open ports in your router for Home Assistant and provide statistics."""
from __future__ import annotations
import asyncio
from collections.abc import Mapping
from dataclasses import dataclass
from datetime import timedelta
from ipaddress import ip_address
from typing import Any
from async_upnp_client.exceptions im... | null | homeassistant/components/upnp/__init__.py | __init__.py | py | 10,088 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "homeassistant.const.Platform.BINARY_SENSOR",
"line_number": 47,
"usage_type": "attribute"
},
{
"api_name": "homeassistant.const.Platform",
"line_number": 47,
"usage_type": "name"
},
{
"api_name": "homeassistant.const.Platform.SENSOR",
"line_number": 47,
"us... |
96849155 | from django.test import TestCase, Client
from django.urls import reverse
from api.models import Ships, Positions
import json
class TestViews(TestCase):
def setUp(self):
self.client = Client()
self.ships_url = reverse('ships')
self.positions_url = reverse('positions')
self.pos_imo_u... | null | vessel_locator/api/tests/test_views.py | test_views.py | py | 1,357 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.test.TestCase",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.test.Client",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.reverse",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.urls... |
275285291 | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
import datetime
AUTHOR = u"Andy Pearce"
SITENAME = u"That's Good Enough"
SITESUBTITLE = u"Gilding lilies might be fun, but gold leaf doesn't grow on trees."
COPYRIGHT = u"© Copyright 2012-%d, Andy Pearce." % (datetime.date.today().year,)
SITEURL = 'http://www.andy-... | null | pelicanconf.py | pelicanconf.py | py | 3,042 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.date.today",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 9,
"usage_type": "attribute"
}
] |
238157012 | import numpy as np
import xarray as xr
from datetime import datetime, timedelta
from skyfield.api import utc
from scipy.interpolate.interpolate import interp1d
from collections import namedtuple
from adcsim.CubeSat_model import CubeSat
class OrbitData:
def __init__(self, sim_params: dict, saved_data: xr.Dataset):... | null | adcsim/containers.py | containers.py | py | 4,247 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "xarray.Dataset",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "numpy.datetime64",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.timedelta64",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.where",
... |
208561517 | import torch
import torch.nn as nn
import torch.optim as optim
import torchvision.transforms as transforms
import time
import os
import numpy as np
import configure as c
import pandas as pd
import matplotlib.pyplot as plt
import datetime
from DB_wav_reader import read_train_feats_structure, read_train_feats_... | null | .ipynb_checkpoints/train_df-checkpoint.py | train_df-checkpoint.py | py | 10,435 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "configure.TRAIN_FEAT_DIR",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "SR_Dataset.read_MFB",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.Compose",
"line_number": 22,
"usage_type": "call"
},
{
"... |
366399543 | import pickle
from keras.models import load_model
import numpy as np
def translate_sentence(input_):
encoder_model = load_model('french_encoder_models.h5')
decoder_model = load_model('decoder_model.h5')
word2idx_outputs = pickle.load(open('word2idx_outputs', 'rb'))
word2idx_inputs = pickle.load(open("... | null | functions.py | functions.py | py | 1,292 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "keras.models.load_model",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "keras.models.load_model",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pickle.load"... |
381952483 | #
import datetime
from django.http import HttpResponse,HttpResponseRedirect
from django.shortcuts import render, get_object_or_404
from notification.models import *
from django.core.urlresolvers import reverse
# Task Created by the manager => send a notification to the task_manager 1
# SubTask Created by... | null | notification/utils.py | utils.py | py | 3,973 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.core.urlresolvers.reverse",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "django.core.urlresolvers.reverse",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "django.core.urlresolvers.reverse",
"line_number": 51,
"usage_type": "ca... |
305669195 | import os
from flask import Blueprint, render_template
bathroom_view = Blueprint('bathroom_view', __name__)
def get_bathroom_images():
images = []
for i in os.listdir(os.path.split(os.path.realpath(__file__))[0].replace('/views', '')+'/static/gallery/bathrooms'):
if i != '.DS_Store':
images.append("gall... | null | app/views/bathroom.py | bathroom.py | py | 501 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Blueprint",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.split",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,... |
212116925 | import re
import sqlalchemy as sqla
import json
import api.references
# debug
import sys
import traceback
import parser
from api.parser import is_pg_qual, read_bool, read_pgid
from sqlalchemy.engine import reflection
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
import... | null | api/actions.py | actions.py | py | 18,818 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.compile",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.ext.declarative.declarative_base",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.MetaData",
"line_number": 26,
"usage_type": "call"
},
{
"api_na... |
347969325 | from django.shortcuts import render,get_object_or_404,redirect
from .models import Item,orderitem,order,order_details,userprofile,loyaltycoins
from django.contrib.auth.models import User,auth
from django.contrib import messages
from django.utils import timezone
from django.views.generic import ListView, DetailView, Vie... | null | loyaltypoints/views.py | views.py | py | 10,037 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "string.digits",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "random.choice",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "models.Item.objects.all",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "models.Item.... |
455203767 | from lib.log import logger
from lib.dataset import builder, load_dataset, save_symbol_dataset
from statsmodels.tsa.seasonal import STL
from statsmodels.tsa.stattools import adfuller
import pandas as pd
import numpy as np
def build(source_index, dest_index, W=10):
_dataset = load_dataset(source_index, return_index... | null | processors/decomposed.py | decomposed.py | py | 3,634 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "lib.dataset.load_dataset",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "statsmodels.... |
629342641 |
from __future__ import print_function
import phizz
import hpo_similarity
from hpo_similarity.ontology import Ontology
import sys
import json
from StringIO import StringIO
import pymongo
mongo_host='localhost'
mongo_port=27017
client = pymongo.MongoClient(host=mongo_host, port=int(mongo_port))
db=client['patients']
... | null | patients.py | patients.py | py | 1,774 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "hpo_similarity.ontology.Ontology",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sys.stdin.readlines",
"line_number": 26,
"usage_type": "call"
},
{
"api_name... |
370516292 | #-*- coding:utf-8 -*-
from django.db import models
class Arquivo(models.Model):
"""
Classe que define a estrutura de dados relacionado a um arquivo.
"""
class Meta:
"""
Configurações de meta class.
"""
verbose_name = u'Arquivo'
verbose_name_plural = u'Arquivos'
... | null | desafioprogramacao/compra/models.py | models.py | py | 2,517 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.models.Model",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.db.models.FileField",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": ... |
265662732 | # -*- coding: utf-8 -*-
"""
Created on Sun Jun 2 08:58:33 2019
@author: AdminisStrator
"""
import import_data
import functions
import numpy as np
import pandas as pd
from scipy import signal
from keras.models import Sequential
from keras.layers import Dense, LSTM
from keras.models import load_model
from keras.callb... | null | python/demo_nn_pm10_LTSM.py | demo_nn_pm10_LTSM.py | py | 3,106 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.rc",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "matplotlib.rc",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.rcParams.update",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "matplot... |
255302940 | from distutils.core import setup
import sys
from cx_Freeze import setup, Executable
base = None
if sys.platform == 'win32':
base = 'Win32GUI'
options = {
'build_exe': {
'compressed': True,
'includes': [
# 'exportfile',
# 'importfile',
# 'lotterywindows',
... | null | setup.py | setup.py | py | 914 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.platform",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "sys.path",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "cx_Freeze.Executable",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "cx_Freeze.setup",... |
540821376 | import glob
import os
import sys
import traceback
from typing import Tuple
import cv2
import jinja2
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.cluster import k_means
sys.path.append('/git/sferes2/exp/aurora/submodules/figure_generator')
sys.path.append('/git/sferes2/exp/auro... | null | analysis/sequential.py | sequential.py | py | 6,264 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_nu... |
204350719 | import os
from os import link, path
from re import fullmatch
import subprocess
import argparse
import re
import sys
from tqdm import tqdm
import logging
import colorlog
import json
import signal
log_colors_config = {
'DEBUG': 'white', # cyan white
'INFO': 'green',
'WARNING': 'yellow',
'ERROR': 'red',
... | null | scripts/test.py | test.py | py | 11,659 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "logging.StreamHandler",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "logging.FileHandler",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "logging.D... |
493246812 | import typing
import asyncio
from media_downloader.infrastructure.crawling_lib import Downloader
from media_downloader.infrastructure.dependency_injection import Metaclass
from media_downloader.infrastructure.log import log
from media_downloader import config
class DownloaderManager(metaclass=Metaclass):
def __... | null | src/main/python/media_downloader/application/manager/downloader_manager.py | downloader_manager.py | py | 1,664 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "media_downloader.infrastructure.dependency_injection.Metaclass",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "media_downloader.infrastructure.crawling_lib.Downloader",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "media_downloader.config.RE... |
394002811 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from lxml import etree
import datetime
import requests
# option 1
# edit this ip address and port ,aslo include username/password
#
cfg_srx='http://10.208.168.16:8080/api/userfw/v1/post-entry'
cfg_auth=('root','Embe1mpls')
# option 2
# edit this XML configur... | null | xml.py | xml.py | py | 4,700 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.datetime.now",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 50,
"usage_type": "attribute"
},
{
"api_name": "lxml.etree.Element",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "lxml.... |
421838673 | #code:utf-8
import requests
from bs4 import BeautifulSoup
import json
session = requests.session()
url = ''
filename = "urls.txt"
def download(userid,count):
url = 'https://www.douyin.com/aweme/v1/aweme/favorite/?user_id='+str(userid)+'&count='+str(count)+'&max_cursor=0&aid=1128'
resp = session.get(url)
sou... | null | douyin.py | douyin.py | py | 738 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.session",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 12,
"usage_type": "call"
}
] |
35825368 | #! /usr/bin/env python
#-* coding: utf-8 -*
# Official packages
import os
import random
from socket import timeout
# 3rd-party Packages
import paramiko
# Local Packages
# CONST
desc_proxy = dict(
hostname = '61.240.30.142',
port = 60000,
username = 'root',
pkey = paramiko.RSAKey.from_private_key_file... | null | api/study/ssh-proxy-study.py | ssh-proxy-study.py | py | 1,115 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "paramiko.RSAKey.from_private_key_file",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "paramiko.RSAKey",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "paramiko.SSHClient",
"line_number": 30,
"usage_type": "call"
},
{
"api... |
111847266 | from LazierGreedy import *
from pickle import dump,load
import sys
from sys import argv
from datetime import datetime
from os import mkdir
from os.path import exists
if not exists("SimBA"):
mkdir("SimBA")
path="SimBA/"+str(datetime.now())+"/"
mkdir(path)
sys.stdout=open(path+"log.txt","w")
Data={}
succ=0
tot=0
if a... | null | SVHN/testSimba.py | testSimba.py | py | 1,046 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.exists",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.mkdir",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"... |
602158542 | #codind:utf-8
import wx
class MainFrame(wx.Frame):
def __init__(self):
super(MainFrame,self).__init__(None,title="test04",size=(800,600))
self.Center()
pn=wx.Panel(self)
pn.SetBackgroundColour("White")
class ThisApp(wx.App):
def OnInit(self):
f=MainFrame()
... | null | src/main.py | main.py | py | 448 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "wx.Frame",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "wx.Panel",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "wx.App",
"line_number": 13,
"usage_type": "attribute"
}
] |
365329166 | import pygame
from settings import Settings
from ship import Ship
import game_functions as gf
from pygame.sprite import Group
from game_stats import GameStats
from button import Button
from scoreboard import Scoreboard
import json
pygame.mixer.init()
def run_game():
#start the pygame surface
pyg... | null | alien_invasion.py | alien_invasion.py | py | 1,633 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pygame.mixer.init",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pygame.mixer",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pygame.init",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "settings.Settings",
... |
200645901 | import sys
import numpy as np
import cv2
import math
def hough_line_segments():
src = cv2.imread('res/building.jpg', cv2.IMREAD_GRAYSCALE)
if src is None:
print('Image load failed')
return
edge = cv2.Canny(src, 50, 150)
lines = cv2.HoughLinesP(edge, 1, math.pi / 180, 160, minLineLe... | null | hough_line_segments.py | hough_line_segments.py | py | 792 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.imread",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.IMREAD_GRAYSCALE",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "cv2.Canny",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.HoughLinesP",
"l... |
360188694 | from lxml import etree
import urllib.request
import shutil
url = "http://feeds.bbci.co.uk/news/rss.xml?edition=int"
#url = "http://feeds.bbci.co.uk/news/video_and_audio/technology/rss.xml"
with urllib.request.urlopen(url) as response, open('bbc_rss1.xml', 'wb') as out_file:
shutil.copyfileobj(response, out_file)
... | null | rss_read.py | rss_read.py | py | 774 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "urllib.request.request.urlopen",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "urllib.request",
"line_number": 8,
"usage_type": "name"
},
{
"api_name":... |
623810688 | from __future__ import absolute_import
import sys
import warnings
import eventlet
import eventlet.event
import eventlet.queue
from pykka import Actor, Future, Timeout
__all__ = ['EventletActor', 'EventletEvent', 'EventletFuture']
warnings.warn(
"eventlet support is deprecated and will be removed in Pykka 3.0... | null | pykka/eventlet.py | eventlet.py | py | 2,708 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "warnings.warn",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "eventlet.event",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "eventlet.Timeout",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "eventlet.Timeout",... |
502468606 | import math,pyperclip
### Этот коммент из другой ветки
def main():
myMessage='Hwleoodl r'
myKey=3
plaintext=decryptMessage(myKey,myMessage)
print(plaintext + '|')
pyperclip.copy(plaintext)
def decryptMessage(key,message):
numOfColumns=math.ceil(len(message)/key)
numOfRows=key
... | null | TranspositionDecryption.py | TranspositionDecryption.py | py | 834 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pyperclip.copy",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "math.ceil",
"line_number": 12,
"usage_type": "call"
}
] |
338844208 | from pandac.PandaModules import *
from direct.task import Task
from math import pi, sin, cos
from direct.showbase.ShowBase import ShowBase
from direct.actor.Actor import Actor
from pandac.PandaModules import *
from direct.interval.IntervalGlobal import Sequence
from pandac.PandaModules import Point3
from pandac... | null | Doomsday_TTCScene.py | Doomsday_TTCScene.py | py | 8,093 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "direct.showbase.ShowBase.ShowBase",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "direct.showbase.ShowBase.ShowBase.__init__",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "direct.showbase.ShowBase.ShowBase",
"line_number": 37,
"usag... |
478883458 | # -*- coding: utf-8 -*-
from django.shortcuts import render
from django.views.decorators.csrf import csrf_exempt
from django.conf import settings
from maiziserver.tools import views_tools
from maiziserver.db.api.assistant import assistant as api_assistant
from django.http import HttpResponseNotFound,HttpResponseServer... | null | maiziserver/maiziserver/maiziserver/website/admin/views_assistant.py | views_assistant.py | py | 3,110 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "maiziserver.db.api.assistant.assistant.list_assistant",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "maiziserver.db.api.assistant.assistant",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "django.http.HttpResponseServerError",
"line_numb... |
654262077 | from typing import List
from darkseer.http import AsyncThrottledClient, AsyncRateLimiter
class SQLQueryError(Exception):
"""
Raised when an error occurs when compiling the SQL query.
Attributes
----------
msg : str
exception message
query : str
attempted query sent in the re... | null | darkseer/informants/opendota/api.py | api.py | py | 1,846 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "darkseer.http.AsyncThrottledClient",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "darkseer.http.AsyncRateLimiter",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 44,
"usage_type": "name"
}
] |
414302344 | import sys
import datetime
import os
__author__ = 'peter'
"""
For dealing with files in a uniform way between machines, we have a local directory for data.
The idea is that be able to put things in the code like:
mnist = pkl.read(open('data/mnist.pkl'))
Where the path is referenced relative to the data director... | null | fileman/local_dir.py | local_dir.py | py | 3,441 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.platform",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.getenv",
"line_num... |
210845546 | #!/usr/bin/env python2
# Copyright (c) 2017-present, Facebook, Inc.
#
# 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 ... | null | tools/infer_simple.py | infer_simple.py | py | 6,061 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "utils.c2.import_detectron_ops",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "utils.c2",
"line_number": 51,
"usage_type": "name"
},
{
"api_name": "cv2.ocl.setUseOpenCL",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "cv2.ocl",... |
298828635 | from typing import Dict, List, Tuple
from django.forms.models import model_to_dict
from posthog.constants import AUTOCAPTURE_EVENT, TREND_FILTER_TYPE_ACTIONS
from posthog.models import Action, Entity, Filter
from posthog.models.action_step import ActionStep
def format_action_filter(
action: Action, prepend: str... | null | ee/clickhouse/models/action.py | action.py | py | 4,030 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "posthog.models.Action",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "posthog.constants.AUTOCAPTURE_EVENT",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": ... |
462343975 |
from .forms import *
from django.shortcuts import render, redirect
from django.urls import reverse_lazy
from django.views.generic import View, UpdateView
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required , user_passes_test
from django.contrib import m... | null | cHowTVbooks/novel/views.py | views.py | py | 2,608 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.shortcuts.render",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.decorators.login_required",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 65,
"usage_type": "call"
... |
59728443 | import re
from django.http import HttpResponse
from rest_framework import generics
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from api.bungalow.models import House
from .serializers import HouseSerializer
def home(request):
return Htt... | null | api/bungalow/views.py | views.py | py | 2,701 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.http.HttpResponse",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "rest_framework.views.APIView",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "api.bungalow.models.House.objects.all",
"line_number": 21,
"usage_type": "call"
}... |
566236382 | from bottle import route, run, template, request, abort, redirect, static_file
from model import Model
model = Model('vprasanja.json', 'Star_Wars_Junaki.json')
@route('/res/<filename:path>')
def resource(filename):
return static_file(filename, root='res/')
@route('/vprasanje/<id>')
def vprasanje(id):
id = i... | null | applikacija.py | applikacija.py | py | 1,381 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "model.Model",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "bottle.static_file",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "bottle.route",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "model.dobljena_vprasanja",
... |
372077821 | import json
import media
import fresh_tomatoes
movies = {}
with open('movie_data.json') as data_file:
# imports json file
data = json.load(data_file)
def data_to_movie(movie_info):
# loops over movies dictionary after import from json
for movie in movie_info['movies']:
# instatiates Movie th... | null | entertainment_center.py | entertainment_center.py | py | 507 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "json.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "media.Movie",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "fresh_tomatoes.open_movies_page",
"line_number": 20,
"usage_type": "call"
}
] |
460150133 | import os
import shutil
import json
from collections import defaultdict
import requests
import keys
def parse_steps(steps, directory):
point_images = defaultdict(dict)
def parse_point(point):
if 'resource' in point:
del point['resource']
if 'images' not in point:
poi... | null | parse.py | parse.py | py | 1,961 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.defaultdict",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line... |
401103580 | import os
import random
import skimage.data
import skimage.transform
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
import time
from datetime import timedelta
import math
'''
http://www.jianshu.com/p/3c7f329b29ee
'''
#images_ph = tf.placeholder(tf.float32, [None, 32,... | null | BelgiumTS-lenet5/Train.py | Train.py | py | 15,412 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.listdir",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number... |
64504309 | from setuptools import setup, find_packages
from os.path import join, dirname
import sys
import pitstop
def get_install_requires():
install_requires2 = [
'Flask >= 0.8',
]
install_requires3 = [
'Flask>=1.0',
]
if sys.version_info.major >= 3:
return install_requires3
els... | null | setup.py | setup.py | py | 835 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.version_info",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "setuptools.setup",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pitstop.__version__",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "setup... |
516389594 | import numpy as np
from PIL import Image
from backend import demosaicing
from rapport_snippets.figs import *
def compile(output_dir="demosaic"):
"""
Compiles a .tex file for the demosaic function
Parameters
----------
output_dir : str
the location to store the .tex with images
"""
... | null | src/rapport_snippets/demosaic.py | demosaic.py | py | 3,000 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "backend.demosaicing.Demosaic",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "backend.demosaicing",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "PIL.Image.fromarray",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "... |
420668610 | import argparse, os
import numpy as np
import matplotlib.pyplot as plt
plt.style.use("ggplot")
def main(args):
# get all runs
file_names = os.listdir(args.folder)
for file_name in file_names:
assert file_name[:3] == "run"
# assert correct directory structure
file_paths = [os.path.join(a... | null | scripts/plot/plot_curriculum.py | plot_curriculum.py | py | 2,980 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.pyplot.style.use",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 4,
"usage_type": "name"
},
{
"api_name"... |
484066539 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
from django.conf.urls import url
from django.contrib import admin
from django.views.generic import CreateView
from django.views.generic import DeleteView
from django.views.generic import UpdateView
from tests.test_app.models import (
... | null | tests/urls.py | urls.py | py | 2,323 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.urls.url",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 15,
"usage_type": "name"
},
{
"api_name... |
644613627 | from unittest.mock import Mock, patch
from scripts.assign_container_name import AssignContainerName
from tests.test_common import TestEPP, NamedMock
def fake_output(output_type):
return Mock(
output_type=output_type,
samples=[Mock(project=NamedMock(real_name='a_project_'))],
container=Name... | null | tests/test_assign_container_name.py | test_assign_container_name.py | py | 1,963 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "unittest.mock.Mock",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "unittest.mock.Mock",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "tests.test_common.NamedMock",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "tests.... |
39625393 | import datetime
import picamera
camera = picamera.PiCamera()
now = datetime.datetime.now()
now = str(now)
now += '.h264'
camera.resolution = (640,480)
camera.start_recording(now)
camera.wait_recording(1000)
camera.stop_recording()
| null | dashcam.py | dashcam.py | py | 232 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "picamera.PiCamera",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 5,
"usage_type": "attribute"
}
] |
643406867 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2020 Gerasimov Alexander <samik.mechanic@gmail.com>
#
# Class and methods representing pre-check for Guild war
#
import pickle
from logger import get_logger
from telebot import types
import common
from common import bot
from icons import *
from commands impo... | null | checks/warprecheck.py | warprecheck.py | py | 10,853 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logger.get_logger",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "statistics.User",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "callbacks.PRECHECK_CALLBACK_PREFIX",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_nam... |
60784784 | #!/usr/bin/env python
import datetime, subprocess, cv2, getpass, socket, os, sys
import scipy.signal
from scipy import ndimage
import Modules.LogParser as LP
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from skimage import morphology
np.warnings.filterwarnings('ignore')
class DepthProcesso... | null | depthSensing/spatialRepeatability/DepthProcessor.py | DepthProcessor.py | py | 25,639 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.warnings.filterwarnings",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.warnings",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "Modules.LogParser.LogParser",
"line_number": 26,
"usage_type": "call"
},
{
"api... |
198454036 | import random
import time
from . import core as ewutils
from . import frontend as fe_utils
from . import item as itm_utils
from ..backend import core as bknd_core
from ..backend import item as bknd_item
from ..backend.item import EwItem
from ..backend.user import EwUserBase as EwUser
from ..static import cfg as ewcfg
... | null | ew/utils/prank.py | prank.py | py | 15,253 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "backend.user.EwUserBase",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "static.cfg.life_state_corpse",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "static.cfg",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "... |
224607761 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Dummy',
fields=[
('id', models.AutoField(primar... | null | wsgi/StartUpGuwahati/playground/migrations/0001_initial.py | 0001_initial.py | py | 793 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.CreateModel",
"line_number": 13,
"usage_type": "call"
},
... |
341775497 | from django.shortcuts import render_to_response, get_object_or_404
from django.http import HttpResponseRedirect, Http404
from django.template import RequestContext
from django.conf import settings
from django.views.generic import date_based, list_detail
from django.contrib.auth.decorators import login_required
from w... | null | apps/work/views.py | views.py | py | 3,991 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.settings",
"line_number": 13,
"usage_type": "argument"
},
{
"api_name": "django.views.generic.list_detail.object_list",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django.views.generic.list_detail",
"line_number": 14,
"usage_type":... |
257052921 | import json
import os
import shutil
from subprocess import CalledProcessError
import sqlalchemy
import sqlalchemy.engine.url
from build import gen_working_dir
from app_config import App, CLOUD_RUN_DEPLOY_TYPES
from common.rpc.hosted import add_domain, new
from common.rpc.secrets import create_master_secret, get_secre... | null | buildserver/deploy.py | deploy.py | py | 9,322 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "app_config.App",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "common.rpc.secrets.create_master_secret",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "app_config.App",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": ... |
624531363 | from django import template
from django.template import Template
from dashboard.models import Products , Images
register=template.Library()
@register.simple_tag
def image_categories(category,thumb_size):
url="/media/categories/"
if category.image_name:
image_path=url+str(category.id)+"/"+str(thumb_size)+"_"+catego... | null | frontend/templatetags/image_tags.py | image_tags.py | py | 973 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.template.Library",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 4,
"usage_type": "name"
}
] |
367572075 | import torch
import math
import torch.nn as nn
import torch.nn.functional as F
from torch_connectomics.libs.sync import SynchronizedBatchNorm1d, SynchronizedBatchNorm2d, SynchronizedBatchNorm3d
def conv3d_pad(in_planes, out_planes, kernel_size=(3,3,3), stride=1,
dilation=(1,1,1), padding=(1,1,1)... | null | torch_connectomics/model/model_zoo/fpn1_py.py | fpn1_py.py | py | 8,141 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.nn.Sequential",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "torch.nn.ReplicationPad3d",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.nn",
... |
553916191 | import concurrent.futures
import datetime
import logging
import re
import time
from typing import Tuple, Optional, TypedDict, List
import base58
from redis import Redis
from sqlalchemy.orm.session import Session
from sqlalchemy import desc, and_
from solana.publickey import PublicKey
from src.tasks.celery_app import ce... | null | discovery-provider/src/tasks/index_user_bank.py | index_user_bank.py | py | 14,839 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "src.utils.config.shared_config",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "src.utils.config.shared_config",
"line_number": 34,
"usage_type": "name"
},
{
"a... |
502679375 | from optparse import make_option
from django.core.management.base import BaseCommand
from django.conf import settings
from wagtail.wagtailsearch.index import get_indexed_models
from wagtail.wagtailsearch.backends import get_search_backend
class Command(BaseCommand):
def get_object_list(self):
# Return l... | null | wagtail/wagtailsearch/management/commands/update_index.py | update_index.py | py | 2,192 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "wagtail.wagtailsearch.index.get_indexed_models",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "wagtail.wagtailsearch.backends.get_search_backend",
"l... |
85918619 | import dataset
from datetime import datetime
create = """
CREATE TABLE notes (
id INTEGER NOT NULL, date DATETIME, note VARCHAR(1024), done VARCHAR(8),
PRIMARY KEY (id)
)
"""
class Database(object):
def __init__(self):
self.db = dataset.connect('sqlite:///database/noted.db')
self.notes = self.d... | null | noted/db.py | db.py | py | 3,644 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "dataset.connect",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 45,
"usage_type": "name"
}
] |
80216788 | from math import sqrt
def gen123():
yield 1
yield 2
yield 3
g = gen123() #<generator object gen123 at 0x0246E120>
next(g) # 1
next(g) # 2
next(g) # 3
#next(g) # StopIteration
for v in gen123():
print(v)
# 1
# 2
# 3
h = gen123()
i = gen123()
#h and i are different
h is i # False
next(h) # 1
next(h)... | null | main/06-iterables/05-generators.py | 05-generators.py | py | 2,328 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "math.sqrt",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "itertools.islice",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "itertools.count",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "itertools.islice",
"li... |
308845633 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import Categorical
from torch.autograd import Variable
from itertools import count
import numpy as np
import math
import random
import os
import gym
# init a task generator for data fetching
env = gym.make("CartPole-v0")
## Hy... | null | ppo.py | ppo.py | py | 5,794 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "gym.make",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.FloatTensor",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "torch.LongTensor",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "torch.ByteTenso... |
416595840 | #!/usr/bin/python
import dns.resolver
import dns.query
import dns.zone
import os
from multiprocessing import Pool
DATAPATH = "zones"
def checkaxfr(domain):
domain = domain.strip()
try:
ns_query = dns.resolver.query(domain,'NS')
for ns in ns_query.rrset:
nameserver = str(ns)[:-1]
if nameserver... | null | axfr-test.py | axfr-test.py | py | 1,352 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "dns.resolver.resolver.query",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "dns.resolver.resolver",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "dns.resolver",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "o... |
579134538 | import baseline as bl
import argparse
import os
from baseline.utils import str2bool
parser = argparse.ArgumentParser(description='Tag text with a model')
parser.add_argument('--model', help='A tagger model with extended features', required=True, type=str)
parser.add_argument('--text', help='raw value', type=str)
pars... | null | api-examples/tag-text.py | tag-text.py | py | 3,175 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "baseline.utils.str2bool",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "os.path.exists",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "os.path... |
505706630 | """
Train an n-gram model.
Usage:
train.py -n <n> [-m <model>] -o <file>
train.py -h | --help
Options:
-n <n> Order of the model.
-m <model> Model to use [default: ngram]:
ngram: Unsmoothed n-grams.
addone: N-grams with add-one smoothing.
inter: ... | null | languagemodeling/scripts/train.py | train.py | py | 2,369 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "docopt.docopt",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "nltk.tokenize.RegexpTokenizer",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.PlaintextCorpusReader",
"line_number": 45,
"usage_type": "call"
},
{
"api... |
228898948 | import os
import time
import re
import requests
from slackclient import SlackClient
# instantiate Slack client
slack_client = SlackClient(os.environ.get('SLACK_BOT_TOKEN'))
# radbbot's user ID in Slack: value is assigned after the bot starts up
radbbot_id = None
# constants
RTM_READ_DELAY = 1 # 1 second delay between... | null | radbbot.py | radbbot.py | py | 4,089 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "slackclient.SlackClient",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "re.search",
"... |
235829009 | #!/usr/bin/env python
# coding: utf-8
import xlsxwriter
from datetime import datetime
from datetime import time
def get_xlsx(fname, download_folder):
with open(fname) as f:
content = f.readlines()
columns = content[0].split()
data = content[1:]
t_i = data[0].split()[0]
t_i = [1,1,1] +... | null | src/main/python/extract.py | extract.py | py | 1,066 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.datetime",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "xlsxwriter.Workbook",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 37,
"usage_type": "call"
}
] |
412804176 | from datetime import datetime
import discord
from discord.ext import commands
import helpers.tokens as t
from helpers import descriptions as desc, checks, settings
bot = commands.Bot(command_prefix='!', description=desc.main, pm_help=True)
@bot.event
async def on_ready():
"""After logging in"""
print(bot.u... | null | main.py | main.py | py | 2,407 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "discord.ext.commands.Bot",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "helpers.descriptions.main",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_nam... |
621736171 | #!/usr/env python3
import math, random, scipy, matplotlib
import numpy as np
from scipy.optimize import minimize
from matplotlib import pyplot as plt
N= 20
C = 100
def_kernel = 'radial'
def_factor = 2
classA = []
classB = []
def generate_data():
global classA, classB
classA = np.concatenate((np.random.ran... | null | Machine_Learning/Assignment 2/SVM/lab2.py | lab2.py | py | 2,871 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.concatenate",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.random.randn",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.r... |
114444776 | from keras.models import Sequential, Model, load_model
from keras import applications
from keras import optimizers
from keras.layers import Dropout, Flatten, Dense
#workingworkingVGG
import cv2
import numpy as np
import pandas as pd
import os
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
impor... | null | VGG/VGG_1_Dense_all_trainable.py | VGG_1_Dense_all_trainable.py | py | 6,967 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.connectedComponentsWithStats",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "cv2.CV_32S",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.ze... |
19174623 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
read the configuration information from the configuration file such as conf.xml
"""
import configer
import xml.etree.cElementTree as ET
from fabric.api import env
class XMLConfiger(configer):
def config(self):
file_path = "../conf/conf.xml"
tree... | null | bases/XMLConfiger.py | XMLConfiger.py | py | 1,059 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "xml.etree.cElementTree.ElementTree",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "xml.etree.cElementTree",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "fabric.api.env.roledefs",
"line_number": 22,
"usage_type": "attribute"
},
{... |
600047931 | # -*- coding: utf-8 -*-
"""
Created on Tue May 19 18:42:15 2020
@author: Mingrui
"""
import torch
import torch.nn as nn
class Vgg_m_face_bn_dag(nn.Module):
def __init__(self):
super(Vgg_m_face_bn_dag, self).__init__()
self.meta = {'mean': [131.45376586914062, 103.98748016357422, 91.462348937988... | null | models/Vgg_m_face_bn_dag.py | Vgg_m_face_bn_dag.py | py | 3,626 | python | en | code | null | code-starcoder2 | 76 | [
{
"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.Conv2d",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
604311883 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
**Project Name:** MakeHuman
**Product Home Page:** http://www.makehuman.org/
**Code Home Page:** https://bitbucket.org/MakeHuman/makehuman/
**Authors:** Thomas Larsson
**Copyright(c):** MakeHuman Team 2001-2014
**Licensing:** AGPL3 (http... | null | All_In_One/addons/makeclothes/__init__.py | __init__.py | py | 19,344 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "imp.reload",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "imp.reload",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "imp.reload",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "imp.reload",
"line_number": 59,
... |
254682190 | import sys
src = sys.argv[1]
dst = sys.argv[2]
# src = "C:/Scripting/Git/clashTestBuilder/CNEB_SearchSets.xml"
# tmp = "C:/Scripting/Git/clashTestBuilder/template.xml"
# dst = "C:/Scripting/Git/clashTestBuilder/output.xml"
import xml.etree.ElementTree as ET
# import copy
sroot = ET.parse(src).getroot()
ssets = []
fo... | null | options/CTB_noviewfolder.py | CTB_noviewfolder.py | py | 2,782 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.argv",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "xml.etree.ElementTree.parse",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "xml.etree.Eleme... |
297957019 | from loguru import logger
import os
import sys
from bittensor.subtensor.interface import Keypair
from transformers import GPT2Tokenizer
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from bittensor.config import Config
from bittensor.session import Session
# Bittensor code and protocol ... | null | bittensor/__init__.py | __init__.py | py | 1,410 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
401439391 | #
# websocket for tiny_db
#
#from tornado.websocket import WebSocketHandler
from handlers.powwshandler import PowWsHandler
import simplejson as json
from redmonty.models.tinydb.tdbmodel import Tdbmodel
from redmonty.models.tinydb.connections import Connections
import datetime
from redmonty.config import myapp, redisu... | null | handlers/ws_tiny_handler.py | ws_tiny_handler.py | py | 10,229 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "handlers.powwshandler.PowWsHandler",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "redmonty.models.tinydb.tdbmodel.Tdbmodel",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "simplejson.loads",
"line_number": 44,
"usage_type": "call"
... |
523993411 | from typing import List
class Solution:
def combinationSum2(self, candidates: List[int], target: int) -> List[List[int]]:
size = len(candidates)
if size == 0:
return []
candidates.sort()
res = []
self.__dfs(candidates, size, 0, [], target, res)
return r... | null | 01-系列问题/组合问题/0040-组合总和 II.py | 0040-组合总和 II.py | py | 1,593 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
}
] |
206096530 | from datetime import datetime
from time import sleep
from unittest.mock import Mock
from unittest.mock import mock_open
from unittest.mock import patch
from dateutil import rrule
import pytest
class MyDummyComponent:
def __init__(self, arg1, arg2='blargh', subcomponent=None):
self.arg1 = arg1
sel... | null | palladium/tests/test_util.py | test_util.py | py | 15,158 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "palladium.util.create_component",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pytest.raises",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "palladium.util.Config",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "p... |
117561750 | """
Author: Madis Fuks 142297 IAPB 11
"""
import networkx as nx
from random import randint
def graph(size, p, seed):
G = nx.fast_gnp_random_graph(size, p, seed)
D = {}
for i, j in enumerate(G.adjacency_list()):
D[i] = set(j)
return D
def dfs1(source, target, G):
S = [source]
discovered... | null | IAPB11_suvendatud/dfs.py | dfs.py | py | 1,251 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "networkx.fast_gnp_random_graph",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 41,
"usage_type": "call"
}
] |
24253903 | import boto3
from chalice import Chalice
import sys
import logging
import rds_config
import pymysql
import json
import datetime
app = Chalice(app_name='TestDB-Chalice-dev')
host = "hmi-poc.c15lzdctuff2.us-east-1.rds.amazonaws.com"
db_name = "hmi_poc"
name = "master"
password = rds_config.db_password
logging.basicCo... | null | apis/TestDB-Chalice/app.py | app.py | py | 6,295 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "chalice.Chalice",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "rds_config.db_password",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "logging.basicConfig",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "loggi... |
390119488 | # -*- coding: utf-8 -*-
"""
Created on Wed Mar 11 15:41:34 2020
@author: andre
"""
import numpy as np
import matplotlib.pyplot as plt
def f(x):
return np.log((x + 2)/(x + 1))
xi = np.array([1, 1.5, 2])
V = np.vander(xi, increasing= True)
yi = np.zeros(3)
for i in range(3):
yi[... | null | Assignment4/Q1.py | Q1.py | py | 765 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.log",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.vander",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 1... |
639126283 | from django.conf.urls import url
from KimSoungRyoulApp import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^pratice/$', views.pratice, name='pratice'),
url(r'^css/$', views.style_practice, name='style_practice'),
url(r'^lecture9/$', views.lecture9, name='style_practice2'),
ur... | null | KimSoungRyoulApp/urls.py | urls.py | py | 432 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "KimSoungRyoulApp.views.index",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "KimSoungRyoulApp.views",
"line_number": 6,
"usage_type": "name"
},
{
"api_na... |
577261898 | import tensorflow as tf
#from tensorflow.python.ops import ctc_ops as ctc
import warpctc_tensorflow
import numpy as np
import random
import time
import datetime
from PIL import Image
from tools import DataLoader
#learning parameters
learning_rate = 0.001
beta1 = 0.9
beta2 = 0.99
epochs = 100
batch_size = 32
validat... | null | dcscn+lstm+ctc/train_convlstm.py | train_convlstm.py | py | 11,632 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tools.DataLoader.data_loader",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "tools.DataLoader",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "tools.DataLoader.data_loader",
"line_number": 38,
"usage_type": "call"
},
{
"api_na... |
353369879 | from tkinter import *
from PIL import ImageTk, Image
root = Tk()
root.title("Q (Barton, 1974)")
root.geometry("400x400+200+200")
#Introducción al programa
label = Label(root, text="Clasificar del macizo rocoso según la clasificación Q:", font=("", "12"))
label.place(x=10,y=0)
#Parámetros
rqd = Label(ro... | null | Q_GUI.py | Q_GUI.py | py | 4,239 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PIL.Image.open",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "PIL.Image.ANTIALIAS",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image",
"li... |
511928947 | '''
Created on 21-Jun-2016
@author: devivar
'''
from os.path import os
import re
import sys
import tempfile
from urllib.request import URLopener
from urllib.request import urlopen
import webbrowser
import zipfile
from bs4 import BeautifulSoup
import unicodedata;
from _datetime import date
downl... | null | src/mp3downloader.py | mp3downloader.py | py | 18,997 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.argv",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number... |
22390141 | # Project Advanced Lane Finding
# necessary imports
import cv2
import numpy as np
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
import glob
import os
from moviepy.editor import VideoFileClip
# change working dir to path containing this file
os.chdir(os.path.dirname('C:/Users/P325748/Doc... | null | src/Advanced_Lane_Finding.py | Advanced_Lane_Finding.py | py | 28,312 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.chdir",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "numpy.ndarray",
"line_numbe... |
461212524 | # -*- coding: utf-8 -*-
"""
Created on Tue Jan 26 15:00:27 2021
@author: 66441
仅为一张图片的人脸裁剪及提取特征值,之后与读取图片进行衔接
"""
from PIL import Image
import cv2
import numpy as np
from sklearn.decomposition import PCA
import copy
import uuid
uuid_str = uuid.uuid4().hex
import warnings
warnings.filterwarnings("ignore")
# 将裁剪人脸缩放为... | null | chuli.py | chuli.py | py | 1,882 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "uuid.uuid4",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "warnings.filterwarnings",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"li... |
314616129 | #-*- coding: utf-8 -*-
# Libraries
import keras
import tensorflow
from keras.models import Model, Sequential
from keras.layers import Dense, Dropout, Flatten, BatchNormalization
from keras.callbacks import ModelCheckpoint, CSVLogger, Callback
from keras.optimizers import SGD, rmsprop
from keras.regularizers import l2... | null | code/DenseNet_prediction.py | DenseNet_prediction.py | py | 3,278 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "keras.applications.densenet.DenseNet121",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "keras.models.Sequential",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "keras.layers.Flatten",
"line_number": 49,
"usage_type": "call"
},
{
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.