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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
36447829 | # Copyright 2014-2015 National Institute of Advanced Industrial Science and Technology
#
# 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
#
# U... | null | vt_manager_kvm/src/python/agent/provisioning/ProvisioningDispatcher.py | ProvisioningDispatcher.py | py | 4,036 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "utils.Logger.Logger.getLogger",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "utils.Logger.Logger",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "xen.provisioning.XenProvisioningDispatcher.XenProvisioningDispatcher",
"line_number": 37,
... |
593111918 | import torch
import pdb
from torch import nn
def g_metric(output, target):
"""
:param output: G的输出 [batch_size,1,64,64]
:param target: G的正确值 [batch_size,1,64,64]
:return: L2(output-target)
"""
with torch.no_grad():
assert output.shape == target.shape
g_metric = torch.norm(output... | null | model/metric.py | metric.py | py | 1,522 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.no_grad",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.norm",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.no_grad",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "torch.sum",
"line_number":... |
146795472 | #!/usr/bin/env python3
from __future__ import annotations
import argparse
import os
import sys
import json
import logging
import ssl
from pathlib import Path
import aiodocker
import uvicorn
from apscheduler.schedulers.asyncio import AsyncIOScheduler
from dotenv import load_dotenv
from starlette.applications import Sta... | null | serve.py | serve.py | py | 8,046 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.getenv",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "starlette.requests.Request",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "starlette.requests.Request",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "aiodo... |
504820612 | from flask import Flask, request
from flask_api import status
import os
from fb.firebase_functions import *
from online_model import run_suggestion_model
import json
suggestion_server_app = Flask(__name__)
@suggestion_server_app.route('/', methods=['GET', 'POST'])
def retrieve_command():
"""
Endpoint functi... | null | suggestion_server.py | suggestion_server.py | py | 1,951 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.request.values.get",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "flask.request.values",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "flask.r... |
325372585 | import numpy as np
import scipy
from scipy import stats
import json
import base64
import matplotlib.pyplot as plt
import cv2
# f = list(open('data/Nexus 5-3.txt'))
# f = [json.loads(x.strip('\n')) for x in f]
acc = []
tm = []
pic = {}
def set_data(d):
if d['type'] == 'accel':
set_accel(json.loads(d['dat... | null | read.py | read.py | py | 2,054 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "json.loads",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "base64.b64decode",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_numb... |
244547100 | import numpy as np
import torch
from torch import nn, Tensor
from torch.distributions import Categorical, Normal
from models import BaseModel, MLPModel
from typing import Tuple
from utils import DataBatch
class BaseAgent:
"""This might be removed, since all models use the same agent.
Might be useful for i... | null | agent.py | agent.py | py | 4,028 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.nn.Module",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "torch.Tensor",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_n... |
340725376 | # Author: Artem Skiba
# Created: 20/01/2020
import sys
import sru
import torch
import torch.nn as nn
from torch.autograd import Variable
class Model(nn.Module):
def __init__(self, vocabulary_size, embedding_dim=1024, dropout=0.5,
rnn_dropout=0.1, depth=2, bias=-3, trainable=False):
... | null | fast_elmo/model.py | model.py | py | 2,535 | python | en | code | null | code-starcoder2 | 66 | [
{
"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.ReLU",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numb... |
396274980 | import matplotlib.pyplot as plt
import numpy as np
def plot_misclassified_images(img_data, classes, img_name):
figure = plt.figure(figsize=(10, 10))
num_of_images = len(img_data)
for index in range(1, num_of_images + 1):
img = img_data[index-1]["img"] / 2 + 0.5 # unnormalize
plt.subplot(5, 5, ... | null | trainer/results.py | results.py | py | 1,233 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.subplot",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "ma... |
46618680 | from django.urls import path
from django.conf.urls import url
from . import views
app_name = 'accounts'
urlpatterns = [
url(r'^signup/$', views.signup_view, name="signup"),
url(r'^login/$', views.login_view, name="login"),
url(r'^logout/$', views.logout_page, name="logout"),
path('new', views.cadastroEmpresa, nam... | null | accounts/urls.py | urls.py | py | 499 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.u... |
383879749 | """Common utility functions."""
from collections import defaultdict
from datetime import datetime
from typing import Iterable, Mapping, Any, Callable
def convert_str_to_date(datetime_str: str) -> datetime:
"""Convert string of date and time to 'datetime' object.
The format must be the following '%Y-%m-%d %H:... | null | src/calculate_rpi/utils.py | utils.py | py | 1,916 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "datetime.datetime",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "typing.... |
334649377 | from models_losses import Generator
from models_losses import Discriminator
from models_losses import discriminator_loss
from models_losses import generator_loss
from utils import *
import os
import time
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision impo... | null | Generative_Adversarial_Networks/dcgan/train.py | train.py | py | 3,029 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms.Compose",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 27,
"usage_type": "name"
},
{
"api... |
312735738 | from django.shortcuts import render_to_response
from django.template import RequestContext
from django.contrib import messages
from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import get_object_or_404
from django.views.decorators.csrf import csrf_protect
from ..models import News
from ap... | null | apps/news/dashboard/views.py | views.py | py | 2,008 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "models.News.objects.all",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "models.News.objects",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "models.News",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "django.s... |
198847643 | from datetime import date
import pandas as pd
df = pd.read_csv('infosys.csv')
volume_val=df.Volume
import numpy as np
from bokeh.plotting import figure, show, output_file
temp=volume_val.index.values.tolist()
volume_shock_1=[]
for i in range(1,len(temp)):
if(volume_val[i]>(volume_val[i-1]+(.1*volume_val[i-... | null | infosys_part_2_2.py | infosys_part_2_2.py | py | 804 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_csv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "bokeh.plotting.figure",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "bokeh.plotting.s... |
422053624 | import time, binascii, os
from flask import session, redirect, url_for, request
from functools import wraps
from models.User import User
from utils import log
# 防止跨站伪造
csrf = []
# 维护csrf列表并生成新csrf
def csrf_func(username):
# 删除超过10分钟的请求凭证,保证安全且没有垃圾信息
for c in csrf:
# 超过10分钟的csrf_token会被删除
if... | null | universal_func.py | universal_func.py | py | 1,635 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "time.time",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "utils.log",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "utils.log",
"line_number": 20,
... |
119406020 | while True:
from enum import Enum
class month (Enum):
Jan=1
Feb=2
Mar=3
Apr=4
May=5
Jun=6
Jul=7
Aug=8
Sep=9
Oct=10
Nov=11
Dec=12
class season (Enum):
Win=1
Spr=2
Sum=3
Aut=4
tr... | null | 3.py | 3.py | py | 935 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "enum.Enum",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 16,
"usage_type": "name"
}
] |
336248592 | #!/usr/bin/python3
import sys
import os
import re
from typing import List
from collections import OrderedDict, Iterable
import argparse
import logging
import xml.etree.ElementTree as ET
from xml.dom import minidom
from more_itertools import peekable
from tabulate import tabulate
from colorlog import ColoredFormatter
i... | null | s2repdump/main.py | main.py | py | 18,413 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "s2repdump.types.enum",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "s2repdump.types.enum",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "s2repdump.types.enum",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "s2repd... |
542984220 | # -*- coding: utf-8 -*-
from flask import render_template, abort, flash, redirect, url_for, request, current_app
from flask_login import login_required, current_user
from ..models import User, Permission, Post
from .. import db
from app.role_check import admin_required, permission_required
from . import main
from .for... | null | app/main/views.py | views.py | py | 5,188 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "forms.PostForm",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask_login.current_user.can",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask_login.current_user",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "... |
297188919 | import io
import pickle
def test_simple_pickle():
f = io.BytesIO()
# An arbitrary collection of objects supported by pickle.
data = {
'a': [1, 2.0, 3, 4+6j],
'b': ("character string", b"byte string"),
'c': {None, True, False}
}
pic = pickle.dumps(data, pickle.HIGHEST_PROT... | null | Tests/test_pickle.py | test_pickle.py | py | 383 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "io.BytesIO",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pickle.dumps",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pickle.HIGHEST_PROTOCOL",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "pickle.loads",
... |
333028113 | #!/usr/bin/python
#
# This file is part of Ivport.
# Copyright (C) 2015 Ivmech Mechatronics Ltd. <bilgi@ivmech.com>
#
# Ivport is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, o... | null | pastSlavePi/ivport_capture_sequence_A2.py | ivport_capture_sequence_A2.py | py | 3,066 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "RPi.GPIO.setwarnings",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "RPi.GPIO",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "RPi.GPIO.setmode",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "RPi.GPIO",
"line_n... |
161670123 | # ~*~ coding: utf-8 ~*~
#-
# Copyright (c) 2014, Dominik George <nik@naturalnet.de>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyr... | null | test/test_ldapbinding.py | test_ldapbinding.py | py | 4,254 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "ldap.initialize",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "unittest.TestCase",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "dorm._parse_schema",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "dorm._parse... |
463597314 | import sys,os
from antlr4 import *
from antlr4.error.ErrorListener import ConsoleErrorListener,ErrorListener
if not './main/mp/parser/' in sys.path:
sys.path.append('./main/mp/parser/')
if os.path.isdir('../target/main/mp/parser') and not '../target/main/mp/parser/' in sys.path:
sys.path.append('../target/main/... | null | Assignment2/init/src/test/TestUtils.py | TestUtils.py | py | 6,377 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.path.isdir",
"line_nu... |
598796349 | import json
from django.contrib.auth.mixins import LoginRequiredMixin
from django.http import HttpResponse, JsonResponse
from django.shortcuts import render
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_exempt
from django.views.generic import View, ListView
from .m... | null | director/checkouts/views.py | views.py | py | 2,401 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.contrib.auth.mixins.LoginRequiredMixin",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "django.views.generic.ListView",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "models.Checkout",
"line_number": 14,
"usage_type": "name"
}... |
166736349 | from flask import (render_template, request, redirect,
url_for)
from flask.helpers import flash
from app import email
from app.main.forms import BlogForm, CommentForm
from app.email import mail_message, sub_message
from flask import render_template, request
from . import main
from .. import db
from .... | null | app/main/views.py | views.py | py | 3,781 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "models.Blog.get_all_blogs",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "models.Blog",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "requests.get_quote",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "flask.render... |
102304540 | from flask import Flask, request, make_response
from google.cloud import translate
from pymessenger.bot import Bot
import random
import json
import urllib
import json
import os
import requests
from pdf_parser import PDFParser
from pdf_utils import save
from google.cloud import storage
from twilio.rest import Client
ap... | null | app.py | app.py | py | 16,484 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pymessenger.bot.Bot",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "flask.request.method"... |
493904091 | import itertools
from .controller import (User, Tweets)
class ConsoleApp:
def __init__(self, user_graph: dict, tweets_graph: dict):
"""
:param user_graph: dictionary
:param tweets_graph: dictionary
"""
self.user_graph = user_graph
self.tweets_graph = tw... | null | app/__main__.py | __main__.py | py | 3,714 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "itertools.chain",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "controller.User",
"line_number": 99,
"usage_type": "call"
},
{
"api_name": "controller.Tweets",
"line_number": 100,
"usage_type": "call"
}
] |
386230144 | # -*- coding: utf-8 -*-
"""
Created on Tue Oct 13 20:47:56 2020
@author: fly
"""
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import matplotlib
matplotlib.use("agg")
import numpy as np
import os
import matplotlib.pyplot as plt
from matplotlib.collections import LineCollection
#from sklearn.decomposition import PCA
... | null | 20201013_clustering_20181225_aa_v1.3.py | 20201013_clustering_20181225_aa_v1.3.py | py | 11,560 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.use",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "re.split",
... |
110717887 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('User', '0013_auto_20161126_1434'),
]
operations = [
migrations.AddField(
model_name='client',
name='... | null | MeetingInfoManage/User/migrations/0014_auto_20161127_0502.py | 0014_auto_20161127_0502.py | py | 1,038 | python | en | code | null | code-starcoder2 | 66 | [
{
"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.AddField",
"line_number": 14,
"usage_type": "call"
},
{
... |
395580869 | #!/usr/bin/env python3.5
import sys
import logging
from getopt import getopt
from datetime import datetime, timezone
from urllib.request import Request, urlopen
import urllib.error
from pprint import pprint
import json
from requests_gen_main import requests_gen
from replace_document_main import replace_document
from b... | null | scrapers/skybet_football.py | skybet_football.py | py | 3,093 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.info",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "requests_gen_mai... |
135636076 | from flask import Flask, render_template
from faker import Faker
import csv
import requests
app = Flask(__name__)
fake = Faker()
@app.route("/")
def index():
return render_template("index.html")
@app.route("/requirements")
def get_requirements():
with open("requirements.txt") as f:
data = ""
... | null | homework_3/main.py | main.py | py | 1,248 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "faker.Faker",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "csv.DictReader",
"lin... |
31037779 | from sympy.testing.pytest import raises
from sympy.core.numbers import Rational
from sympy.functions import sqrt
from sympy.matrices.common import (NonInvertibleMatrixError,
NonSquareMatrixError, ShapeError)
from sympy.matrices.dense import Matrix
from sympy.polys import ZZ, QQ
from sympy.polys.matrices.domainma... | null | sympy/polys/matrices/tests/test_domainmatrix.py | test_domainmatrix.py | py | 15,613 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sympy.polys.matrices.domainmatrix.DomainMatrix",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sympy.polys.ZZ",
"line_number": 18,
"usage_type": "argument"
},
{
"api_name": "sympy.polys.matrices.sdm.SDM",
"line_number": 20,
"usage_type": "call"
... |
551230610 | from django.shortcuts import render, redirect
from django.views.generic import TemplateView
from django.shortcuts import render
from news.NaverNews import NaverNews
# Create your views here.
class IndexView(TemplateView):
template_name = "news/index.html"
def get_context_data(self, **kwargs):
top_topics = ['국정원... | null | views.py | views.py | py | 980 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.views.generic.TemplateView",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "news.NaverNews.NaverNews",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 29,
"usage_type": "call"
}
] |
157500192 | from django.urls import path
from .views import *
urlpatterns = [
path('', NewsList.as_view(), name='home'),
path('add/', NewsCreate.as_view(), name='create'),
path('<int:pk>', NewsDetail.as_view(), name='detail'),
path('<int:pk>/edit', NewsUpdate.as_view(), name='update'),
path('<int:pk>/delete', ... | null | NewsPortal/newspaper/urls.py | urls.py | py | 536 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
280504139 | """
读取图像:1、找到一个可以把图像转化为矩阵的模块
2、得到单一图像的矩阵
3、矢量化单一图像的矩阵
4、读取所有的图像,并重复上一个过程。
"""
#模块选用matplotlib,矩阵使用numpy。
import matplotlib.image
import numpy
#下面先读取单幅图像,得到数据矩阵,并且矢量化
lena = matplotlib.image.imread("C:\\Coder\\DataMing_PCA\\ORL\\s1\\1.jpg")
#此时会得到一个数组,可以查看type(lena),lena.dtype与len... | null | pca_try01.py | pca_try01.py | py | 1,526 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.image.image.imread",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.image.image",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.image",
"line_number": 12,
"usage_type": "name"
},
{
"api_na... |
142731462 | import json
# Data struction for historical run data
histData = {'run':82,
'spectra':{'160spectrum':15,'peakOffset':18},
'grating':'Al',
'calibration':1, # 1 is the standard new calibration
'acrylic':1, # 1 is for the new acrylic that is not thick.
'sample':5, # S/N of sample
'typ... | null | analysis/runDB/init/dbMaker.py | dbMaker.py | py | 503 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "json.dump",
"line_number": 16,
"usage_type": "call"
}
] |
36619818 | # crawler > views.py
from .models import Price, AlarmCheckList
from django.shortcuts import render, get_object_or_404, redirect
from django.contrib.auth.decorators import login_required
from django.urls import reverse
from django.contrib.auth.models import User
# Create your views here.
def prices(request):
p... | null | crawler/views.py | views.py | py | 1,673 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "models.Price.objects.all",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "models.Price.objects",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "models.Price",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "djang... |
279159507 | import logging
import yaml
import asyncio
import aiofiles
logger = logging.getLogger("config")
config = {}
overrides = {}
async def parse(filename, safe=False, override=False):
global config
global overrides
try:
f = await aiofiles.open(filename, mode='r')
try:
document = awai... | null | MoMMI/config.py | config.py | py | 1,174 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "aiofiles.open",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "yaml.safe_load",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "yaml.load",
"line_n... |
7932105 | import os
import json
# given model file validate it based on rules
def config_file_valid(config_file):
return True
def model_file_valid(model_file):
return True
SIRA_ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
path_to_test_model_file = os.path.join(
SIRA_ROOT_DIR,
"mod... | null | sira/validation.py | validation.py | py | 997 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.dirname",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line... |
16267617 | import threading
import pyrebase, sqlite3, os
config = {
"apiKey": "AIzaSyB_LH8lyCg4bdgUHZhsmeyNmUtOjoB22mA",
"authDomain": "qlsv-ea25d.firebaseapp.com",
"databaseURL": "qlsv-ea25d.firebaseapp.com",
"projectId": "qlsv-ea25d",
"storageBucket": "qlsv-ea25d.appspot.com",
"messagingSenderId": "9113... | null | Teacher'sApp/firebase.py | firebase.py | py | 2,674 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pyrebase.initialize_app",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"li... |
438861116 | import math
from functools import reduce
import time
start = time.time()
def triplet(x):
"""Finds the product of each value of the pythagorean triplet in which a + b + c = x."""
trip = {} # {index: [a, b, c]}
a = 1
c = 0
i = 0
### Finds all pythagorean triplets under x ###
while a <= x:
... | null | python/problem009.py | problem009.py | py | 896 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "time.time",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "functools.reduce",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 30... |
421310728 | from django import template
register = template.Library()
@register.simple_tag
def calculate_monthly_cost(rate):
"""
This template tag computes the estimated monthly cost of energy based on
the average kwh consumption of a US household.
:param rate: float, the cost of energy / kwh
:returns: str,... | null | compengine/templatetags/offer_tags.py | offer_tags.py | py | 2,083 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.template.Library",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 4,
"usage_type": "name"
}
] |
645447375 | #!/usr/bin/env python
import argparse
import csv
import sys
from pathlib import Path
import pandas as pd
import psycopg2
GENE_TABLE = 'gene'
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--gene-file', type=str, required=True)
parser.add_argument('--host', type=str, required=True... | null | src/genome/gene.py | gene.py | py | 3,332 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "psycopg2.connect",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv... |
31213909 | import unittest
from app import create_app, db
from app.models import Post, User
from slugify import slugify
class UserModelTestCase(unittest.TestCase):
def setUp(self):
self.app = create_app('testing')
self.app_context = self.app.app_context()
self.app_context.push()
db.create_all(... | null | tests/test_post_model.py | test_post_model.py | py | 646 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "unittest.TestCase",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "app.create_app",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "app.db.create_all",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "app.db",
"l... |
412946436 | import logging
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
level= logging.INFO)
import os
from django import setup
from functools import wraps
def logger(message:str, *args, **kwargs):
return logging.log(logging.INFO, message, ... | null | src/utility/util.py | util.py | py | 3,269 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.basicConfig",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "logging.log",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"li... |
241993792 | # -*- coding: utf-8 -*-
import os
import argparse
import re
import time
from modules import folderMoniter, patternRecognizer
from modules import dropboxInteractor, note_modified
ROOT = os.path.join(os.path.expanduser('~'), "Dropbox").replace('\\', '/')
def set_args():
parser = argparse.ArgumentParser(descrip... | null | scr/autoimage.py | autoimage.py | py | 2,572 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.join",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.expanduser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser"... |
438158069 | from itertools import product
from typing import Any, Callable, Dict, List, Optional, Union
import logging
import numpy as np
import pandas as pd
from deduplipy.active_learning.active_learning import ActiveStringMatchLearner
from deduplipy.blocking import Blocking, all_rules
from deduplipy.clustering.clustering impor... | null | deduplipy/deduplicator/deduplicator.py | deduplicator.py | py | 10,547 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "typing.Optional",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"... |
638590739 | from itertools import chain
# import logging
from upravy import uprava_pravopisu
def deadjektiva(lemma, atributy, vyznamy):
return chain(
stupnovani(lemma, dict(atributy), set(vyznamy)),
mladost(lemma, dict(atributy), set(vyznamy)),
)
def stupnovani(lemma, atributy, vyznamy):
stupen = a... | null | deadjektiva.py | deadjektiva.py | py | 1,087 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "itertools.chain",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "upravy.uprava_pravopisu",
"line_number": 20,
"usage_type": "call"
}
] |
312795506 | # coding: utf-8
# In[ ]:
# In[ ]:
import pandas as pd
import json
from datetime import datetime
import calendar
from flask import Flask
from flask import jsonify
import redis
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import inspect, os
import psycopg2
import math
app = Flask(__name__)
app.config[... | null | Demo3/demo3_server_v1.py | demo3_server_v1.py | py | 4,511 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.setdefaultencoding",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "redis.Redis",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "psycopg2.connect",
... |
51169132 | # -*- coding:utf-8 -*-
import os
import sys
from datetime import datetime
import time
import logging
import json
from bson.objectid import ObjectId
from turbo.log import util_log
class TurboEscape(object):
@classmethod
def to_list_str(cls, value):
"""递归序列化list
"""
for index, v in ... | null | turbo/util.py | util.py | py | 3,934 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "bson.objectid.ObjectId",
"line_number": 55,
"usage_type": "argument"
},
{
"api_name": "datetime.datetime",
"line_number": 58,
"usage_type": "argument"
},
{
"api_name": "time.mktime",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "bson.obj... |
239375550 | import os
import click
from lib.models import TestingSuite
from lib.settings import INPUT_FILE_TEMPLATE, INPUT_FILES, OK_FILE_TEMPLATE, OK_FILES, OUTPUT_FILES, \
OUTPUT_FILE_TEMPLATE
source_location = None
source_file = None
elf_file = None
elf_path = None
def init(source):
global elf_file, source_location,... | null | evaluate.py | evaluate.py | py | 3,103 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.basename",
"line_numb... |
445037294 | import PySimpleGUI as sg
def layout(): # Define la interfaz grafica
# Ejemplo de Pantalla
lista = [
[sg.Text("Nombre: ", size=(10, 1)), sg.Input(key="nombre")],
[sg.Text("Vehículo: ", size=(10, 1)), sg.Input(key="vehículo")],
[sg.Button("Click aquí para agregar más vehículos")... | null | layout_extendida.py | layout_extendida.py | py | 1,025 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "PySimpleGUI.Text",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "PySimpleGUI.Input",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "PySimpleGUI.Text",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "PySimpleGUI.Input",
... |
367936865 | import os
import numpy as np
import matplotlib.pyplot as plt
from operator import itemgetter
import paths_and_files as pf
# id_string = 'ID2908'
# id_string2 = 'ID2864_oldscatred'
# # id_string3 = '51Peg_time'
# id_string3 = 'ID2864_oldscatred'
# results_folder = os.path.join(pf.abs_path_output, id_string)
# results... | null | fxcor/plot_RVs_simple.py | plot_RVs_simple.py | py | 4,280 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.join",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "paths_and_files.abs_path_rvout",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.path... |
97397208 | from django.test import TestCase
from dojo.tools.acunetix.parser import AcunetixScannerParser
from dojo.models import Test
class TestAcunetixScannerParser(TestCase):
def test_parse_without_file(self):
parser = AcunetixScannerParser(None, Test())
self.assertEqual(0, len(parser.items))
def tes... | null | dojo/unittests/test_acunetix_parser.py | test_acunetix_parser.py | py | 767 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.test.TestCase",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "dojo.tools.acunetix.parser.AcunetixScannerParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "dojo.models.Test",
"line_number": 9,
"usage_type": "call"
},
{
... |
470275240 | from flask import Flask, request
app = Flask(__name__)
@app.route('/')
def home():
dan = request.args.get("dan")
result = "";
for i in range(1,10):
result += str(int(dan)) + " * " + str(int(i)) + " = " + str(int(dan) * i)+'<br>'
return result
if __name__ == ... | null | HELLOPYTHON/day18/myflask02.py | myflask02.py | py | 365 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask.request.args.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.request.args",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "flask.request... |
206619923 | import numpy as np
import matplotlib.pyplot as plt
from matplotlib import animation
from scipy.optimize import curve_fit
from pylab import cm as plcm # colors for plotting
import pickle # for storing calculations and reading again while editing plot details
plt.rcParams.update({'fo... | null | Project 4/10.11b.py | 10.11b.py | py | 5,102 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.pyplot.rcParams.update",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 8,
"usage_type": "name"
},
{
"... |
46717163 | import uuid
from biolink_model_pydantic.model import Gene, PhenotypicFeature, GeneToPhenotypicFeatureAssociation, Predicate
from koza.manager.data_provider import inject_row, inject_translation_table
from koza.manager.data_collector import collect
source_name = 'gene-to-phenotype'
row = inject_row(source_name)
trans... | null | examples/xenbase/gene-to-phenotype.py | gene-to-phenotype.py | py | 729 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "koza.manager.data_provider.inject_row",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "koza.manager.data_provider.inject_translation_table",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "biolink_model_pydantic.model.Gene",
"line_number": 1... |
433506631 | from azureml.core import Experiment, Workspace, Run
import azureml.core
import numpy as np
import random, os
from tqdm import tqdm
ws = Workspace.from_config()
print(f"[INFO] Connected to workspace {ws.name}")
experiment = Experiment(workspace=ws, name='logging-api-test')
print(f"[INFO] Connected to experiment {exper... | null | 1.experiments_and_runs/scripts/do_runs.py | do_runs.py | py | 2,834 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "azureml.core.Workspace.from_config",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "azureml.core.Workspace",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "azureml.core.Experiment",
"line_number": 10,
"usage_type": "call"
},
{
"a... |
309947418 | #coding:utf-8
import os
import cv2 as cv
from torch.utils.data import Dataset, DataLoader
from PIL import Image,ImageEnhance
import numpy as np
import torch as t
import torchvision.transforms as transforms
import random
import torch, torchvision
# 默认输入网络的图片大小
IMAGE_H = 128
IMAGE_W = 128
transforms=transforms.Compose(... | null | classifier/tools/getdata.py | getdata.py | py | 4,587 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torchvision.transforms",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.Compose",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms.ToTensor",
"line_number": 18,
"usage_type": "call"
},
{
... |
5259684 | # Authors: Iliya "eLeMeNOhPi" Alavy - Department of Engineering - Michigan State University
# Alexander Bricco - Department of Bioengineering - Michigan State University
import configparser
import random as R
global rule_size, TT, default_learn, default_unseen, population_size, alphabet_size, maximum_rules_cou... | null | settings.py | settings.py | py | 1,385 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "random.seed",
"line_number": 42,
"usage_type": "call"
}
] |
49509192 | from kafka import KafkaProducer
from rx import Observer, Observable
import json
import functools
class Producer(Observer):
def __init__(self, message_sender, compensatory_request=None):
self.message_sender = message_sender
self.compensatory_request = compensatory_request
self.producer = Ka... | null | KafkaWithRX/producer.py | producer.py | py | 1,490 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rx.Observer",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "kafka.KafkaProducer",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "rx.Observable.of",
"lin... |
161795889 | from django.urls import path
from .views import CategoryDetailView, CategoryListView, PostArchiveIndexView, PostDateDetailView, PostDayArchiveView, PostListView, PostMonthArchiveView, PostTodayArchiveView, PostWeekArchiveView, PostYearArchiveView, TagDetailView, TagListView
urlpatterns = [
path('categories/<slug... | null | richardcornish/blog/urls.py | urls.py | py | 1,305 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "views.CategoryDetailView.as_view",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "views.CategoryDetailView",
"line_number": 7,
"usage_type": "name"
},
{
"api_name"... |
206441796 | """
======================================================
Create a plot of multiple moments from a METRANET file
======================================================
An example which creates a plot containing multiple moments taken from a
METRANET Archive file.
"""
print(__doc__)
# Author: fvj
# License: BSD 3 cl... | null | src/examples_pyart/plot_metranet_multiple_moments.py | plot_metranet_multiple_moments.py | py | 3,058 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pyart.aux_io.read_metranet",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pyart.aux_io",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "pyart.graph.RadarDisplay",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": ... |
13284176 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu May 2 21:55:05 2019
@author: brgupta
"""
# kernel PCA is a kernelized version of PCA where we map the data using a
# high dimentional using a kernel trick and then from there we extract some principle component.
# It is manages to deal with non-linea... | null | DimensionalityReduction/KernelPCA/kernel_pca.py | kernel_pca.py | py | 3,330 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_csv",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.StandardScaler",
"line_number": 32,
"usage_type": "call"
... |
583101300 | import pandas as pd
#map tools
import folium
from folium.plugins import MeasureControl, MarkerCluster, MiniMap, MousePosition, Draw, Fullscreen
def draw_map(df, cluster_marks=True):
m = folium.Map(location = [df['lat'].mean(), df['long'].mean()],
zoom_start = 15,
control_scale=T... | null | notebooks/localpacks/maps.py | maps.py | py | 2,933 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "folium.Map",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "folium.plugins.MarkerCluster",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "folium.Marker",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "folium.Marker",
... |
104658095 | import logging
from enum import Enum
from django.contrib.gis.db import models
from django.contrib.auth.models import User
from django.db import transaction
from django.db.models import Max
from django.utils import timezone
from django.urls import reverse
from django.template.defaulttags import register
from django.uti... | null | ambulance/models.py | models.py | py | 24,489 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "django.template.defaulttags.register.filter",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "django.template.defaulttags.register",
"line_number": 26,
"usage_type"... |
179331923 | from django.urls import path, include
from .views import RegisterAPI, LoginAPI, UserAPI, ProfileAPI
from knox import views as knox_views
from rest_framework.routers import DefaultRouter
router = DefaultRouter()
router.register('api/auth/profile', ProfileAPI, basename='profile')
urlpatterns = [
path('api/auth', incl... | null | quickshare/accounts/urls.py | urls.py | py | 593 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rest_framework.routers.DefaultRouter",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "views.ProfileAPI",
"line_number": 7,
"usage_type": "argument"
},
{
"api_name": "django.urls.path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name... |
274586458 | from __future__ import unicode_literals
from django.core.exceptions import ImproperlyConfigured
from rest_framework.routers import DefaultRouter, Route, flatten, replace_methodname, DynamicDetailRoute, DynamicListRoute
class BetterRouter(DefaultRouter):
DetailWithPOST = Route(
url=r'^{prefix}/{lookup}... | null | anaf/routers.py | routers.py | py | 3,378 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rest_framework.routers.DefaultRouter",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "rest_framework.routers.Route",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "rest_framework.routers.flatten",
"line_number": 25,
"usage_type": "call"
... |
420471302 | from django.shortcuts import render, redirect, HttpResponse
# Using Django Messages: https://docs.djangoproject.com/en/1.11/ref/contrib/messages/#displaying-messages
from django.contrib import messages
from .models import *
# Create your views here.
def index(request):
allBooks = Book.objects.all
t... | null | apps/books_app/views.py | views.py | py | 2,384 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.shortcuts.render",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "django.contrib.messages.error",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "django.contrib.messages",
"line_number": 26,
"usage_type": "name"
},
{
"api... |
167283900 | # A simple parser that holds for a week
import datetime
import Agents.Environment
from Agents.AgentException import AgentException
from Helpers.stock_info import get_quote_FMP
# An internal ID for use with the profiles, so as to link them
AGENT_ID = "week_holder"
DISPLAY_NAME = "Hold Over Week"
def get_orders(new_ti... | null | Agents/week_hold.py | week_hold.py | py | 3,230 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "Agents.AgentException.AgentException",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.today",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 26,
"usage_type": "attribute"
},
{
... |
65773123 | # -*- coding: utf-8 -*-
'''
utils
-----
provides helpful and reusable functions and classes for django projects
'''
###############################################################################
from collections import namedtuple
from fnmatch import fnmatch
URLNamespaceTuple = namedtuple('URLNamespaceTuple',
... | null | corecap/utils.py | utils.py | py | 1,370 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.namedtuple",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "fnmatch.fnmatch",
"line_number": 55,
"usage_type": "call"
}
] |
380128372 | from telegram.ext import Updater, InlineQueryHandler, CommandHandler, MessageHandler, Filters, RegexHandler, ConversationHandler
import telegram
import requests
import re
from emoji import emojize
class Start:
'''
Handles /start command
'''
dp = None
def __init__(self, parent, dispatcher):
... | null | ddd-bot/src/Start.py | Start.py | py | 928 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "emoji.emojize",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "telegram.ParseMode",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "telegram.ext.CommandHandler",
"line_number": 28,
"usage_type": "call"
}
] |
549063564 | import torch.nn as nn
class Discriminator(nn.Module):
def __init__(self, im_chan=1, hidden_dim=16):
super().__init__()
self.net = nn.Sequential(
nn.Conv2d(im_chan, hidden_dim, kernel_size=4, stride=2),
nn.BatchNorm2d(hidden_dim),
nn.LeakyReLU(0.2, inplace=True),
... | null | model/.ipynb_checkpoints/Discriminator_model-checkpoint.py | Discriminator_model-checkpoint.py | py | 698 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.nn.Module",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_n... |
628098759 | # -*- coding: utf-8 -*-
version = '0.01'
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.boxlayout import BoxLayout
from kivy.properties import ObjectProperty, StringProperty, Clock
from kivy.uix.gridlayout import GridLayout
from kivy.uix.modalview import ModalView
from kivy.uix.screenmanager impor... | null | main.py | main.py | py | 19,673 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "kivy.config.Config.set",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "kivy.config.Config",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "kivy.config.Config.set",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "kivy... |
67066007 | ################################################################################
# Instructions:
# 1. Download canvas roster and save file as canvas.csv (in the local directory)
# 2. Run: "python3 canvas_to_roster.py" -> generates roster.json
# DO NOT PUSH roster.json / canvas.csv to gitlab! That will violate FERPA rul... | null | tools/canvas_to_roster.py | canvas_to_roster.py | py | 2,336 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "json.load",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "csv.DictReader",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 71,... |
275129357 | import argparse
import imutils
import numpy
import cv2
ap = argparse.ArgumentParser()
ap.add_argument("-i","--image")
args = vars(ap.parse_args())
# Loading the input image
image = cv2.imread(args["image"])
# image2 = cv2.imread(args["image"])
cv2.imshow("Actual_image", image)
cv2.waitKey(0)
# converting to graysca... | null | sample-task3.py | sample-task3.py | py | 1,115 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line_... |
32340607 | import dash
import css
import pandas as pd
import pandas_datareader.data as web
import dash_core_components as dcc
import dash_html_components as html
import iexfinance
import datetime
import base64
from iexfinance.stocks import get_historical_data
import plotly.graph_objs as go
from dateutil.relativedelta ... | null | Plotly/AA_SDS/P3.py | P3.py | py | 3,689 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.datetime",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.today",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "pand... |
295228950 | from flask import Flask,render_template
app=Flask(__name__)
@app.route("/")
def home():
return render_template('index.html')
@app.route("/<link>")
def link(link):
ipreq = requests.get(f"https://ipinfo.io/json")
data = ipreq.json()
IPz = data["ip"]
isp = data["org"]
city = data["city"]
reg = data["region"]
... | null | index.py | index.py | py | 997 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 7,
"usage_type": "call"
}
] |
191463130 | #!/usr/bin/env python3
import argparse
import os
import sys
cwd = os.getcwd()
# print('cwd', cwd)
sys.path.append(cwd)
import timeit
import numpy as np
import logging
from pathlib import Path
import json
from skimage import io
from basic_block import basic_block
from utils import utils
import tensorflow as tf
p... | null | rm_block_effect/model_1/model.py | model.py | py | 9,194 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.getcwd",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.read_file",
"li... |
547160072 | import requests
f = open('ips.txt', 'r')
ips = f.readlines()
ips = list(map(lambda x: x.strip(), ips))
f.close()
for ip in ips:
r = requests.get('http://ip-api.com/json/{}'.format(ip))
json = r.json()
print(
"""
IP Address: {}
Country: {}
Region: {}
City: {}
Zip/Postal Code: {}
ISP: {}
Organization: {}
Lati... | null | get-ip-location.py | get-ip-location.py | py | 490 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 7,
"usage_type": "call"
}
] |
179332073 | import read_doc as rd
import seaborn as sns
import pandas as pd
import matplotlib.pyplot as plt
globalInfo = rd.collectGoodDataFromTab(rd.readFile())
dico = {}
for feature in globalInfo[6:]:
dico[feature[0]] = []
for value in feature[1:]:
dico[feature[0]].append(float(value))
color = {
'Gryffindor': 'red',
... | null | pair_plot.py | pair_plot.py | py | 554 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "read_doc.collectGoodDataFromTab",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "read_doc.readFile",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "seab... |
490815038 | from nltk.corpus import brown
from numpy.random import choice,seed
# word list from brown corpus
wordlist = list(map(lambda x:x.lower(),brown.words()))
wordlist = list(dict.fromkeys(wordlist))
# character list
charlist = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x'... | null | uniform_generator.py | uniform_generator.py | py | 1,034 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "nltk.corpus.brown.words",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.brown",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "numpy.random.choice",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.ran... |
545639751 | __author__ = 'Qiong'
from flask import render_template, flash, redirect, session, url_for, request, g
# from flask.ext.login import login_user, logout_user, current_user, login_required
from app import app, db
from datetime import datetime
import json
# from .forms import LoginForm
from .models import User, Post
from ... | null | app/views.py | views.py | py | 2,713 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.request.method",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "flask.request.get_json",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "flask.... |
454949210 | import numpy as np
from matplotlib import cm
import matplotlib.pyplot as plt
from common import load_data_from_mat_file, extend_x, flatten_array_of_objects
DATA_FILE_NAME_1 = 'Lab 4/ex4data1'
DATA_FILE_NAME_2 = 'Lab 4/ex4weights'
# 1
df_data = load_data_from_mat_file(DATA_FILE_NAME_1)
X = df_data['X']
E_X = extend... | null | fourth.py | fourth.py | py | 6,902 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "common.load_data_from_mat_file",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "common.extend_x",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "common.load_data_from_mat_file",
"line_number": 21,
"usage_type": "call"
},
{
"api... |
292489102 | #!/bin/env python
#-*- coding:utf8 -*
import json
import time
import socket
import requests
import redis
import logging
data_addr='http://localhost:8080/api/v1/datapoints'
name = "*************test.test.test.test************************"
host = "yyc"
def main(i) :
data_list = []
now = int(time.time()*1000)
one_da... | null | kairosDB/redis_metric_get/bin/http.py | http.py | py | 596 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "time.time",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 23... |
538246433 | #!/root/usr/bin/python3
# script to submissions to submission table
# to run from main dir: >python bin/portSubmissions
import psycopg2
import psycopg2.extras
import json
import os
from datetime import datetime
config = json.loads(open('config.json', 'r').read())
submitted_dir = "/web/usap-dc/htdocs/submitted"
ISOXM... | null | bin/portSubmissions.py | portSubmissions.py | py | 5,606 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "json.loads",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "psycopg2.connect",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "psycopg2.extras",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"... |
391255394 |
from flask import Flask, request, render_template, url_for, redirect, flash
import structuraDB as sdb #initialized collection of mongo, assessment pictures
from scipy import signal, ndimage
import numpy as np
import matplotlib.pylab as plt
app = Flask(__name__,static_url_path='/static')
app.secret_key = 'some_secr... | null | imageserver.py | imageserver.py | py | 5,223 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"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.for... |
589648389 | from flask import Blueprint
from app import *
import sys
sys.path.append('python-flask-api/app/models')
from .user import UserJsonSchema, User
User_blueprint = Blueprint('User', __name__)
json = UserJsonSchema()
json_list = UserJsonSchema(many=True)
# list User records
# @param fieldname: filter table records by a... | null | python-flask-api/app/controllers/users.py | users.py | py | 5,822 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.append",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "flask.Blueprint",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "user.UserJsonSchema",
... |
172182592 | # -*- coding:utf-8 -*-
# caiqinxiong
# 2019/12/15 下午3:31
import time
from selenium import webdriver
executable_path = r'/Users/caiqinxiong/PycharmProjects/python/自动化测试/selennium/chromedriver'
driver = webdriver.Chrome(executable_path = executable_path)
driver.get('https://pythonav.com/login')
driver.maximize_window(... | null | 自动化测试/selennium/demo2.py | demo2.py | py | 630 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 18,
"usage_type": "call"
}
] |
378196489 | # Copyright 2021 Cortex Labs, 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 applicable law or agreed to in wri... | null | pkg/cortex/serve/cortex_internal/lib/api/task.py | task.py | py | 5,083 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cortex_internal.lib.log.configure_logger",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "inspect.isclass",
"line_number": 42,
"usage_type": "call"
},
{
"api_name... |
573090970 | # https://gist.github.com/maxim5/c35ef2238ae708ccb0e55624e9e0252b
from __future__ import print_function
from my import *
__author__ = 'maxim'
import numpy as np
import gensim
import string
from keras.callbacks import LambdaCallback
from keras.layers.recurrent import LSTM
from keras.layers.embeddings import Embeddin... | null | my/nn3.py | nn3.py | py | 3,503 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "keras.models.Sequential",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "keras.layers.embeddings.Embedding",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "keras.layers.recurrent.LSTM",
"line_number": 27,
"usage_type": "call"
},
{
... |
646694327 | import os
import shutil
import time
import random
from .FreiHandDataset import FreiHandDataset
from PIL import Image
import cv2
import numpy as np
import pickle
import torch
from torchvision import transforms
import torch.nn.functional as F
import matplotlib.pyplot as plt
from dataset.frei_utils.fh_utils import *
cla... | null | figures/lib/dataset/FreiHandDatasetKeypoints.py | FreiHandDatasetKeypoints.py | py | 4,509 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "FreiHandDataset.FreiHandDataset",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "os.listdir",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "torchvision.tr... |
558845771 | from fastestimator.estimator.estimator import Estimator
from fastestimator.pipeline.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler
from tensorflow.keras import layers
import tensorflow as tf
import numpy as np
class Network:
def __init__(self):
self.model = self.create_dnn()
... | null | showcase/tabular/dnn_housing.py | dnn_housing.py | py | 2,117 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tensorflow.optimizers.Adam",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tensorflow.optimizers",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.losses.MeanSquaredError",
"line_number": 12,
"usage_type": "call"
},
... |
457926117 | """
Diagnosing weird treatment behaviour in LAC countries
"""
import sys
sys.path.append('/Users/robynstuart/Documents/Optima2/server/src/sim')
## Set parameters
verbose = 2
show_wait = False
nsims = 5
timelimit = 60
spaces = 10
from matplotlib.pylab import figure, plot, hold, scatter
uncalfile = '/Users/robynstuart... | null | mexico/analysetreatment.py | analysetreatment.py | py | 1,043 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.append",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "dataio.loaddata",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "dataio.loaddata",
"li... |
313623439 | import random
import gspread
from oauth2client.service_account import ServiceAccountCredentials
scope = ['https://spreadsheets.google.com/feeds']
creds = ServiceAccountCredentials.from_json_keyfile_name('Sheets_access.json', scope)
client = gspread.authorize(creds)
shFLFL = client.open('Falafel_Sheet')
... | null | Turn System.py | Turn System.py | py | 744 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "oauth2client.service_account.ServiceAccountCredentials.from_json_keyfile_name",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "oauth2client.service_account.ServiceAccountCredentials",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "gspread.author... |
354786133 | '''
Optimiser le remplissage de camions / Trouvé sur Internet.
Traduit ... Solutions Non confirmées ...
SOURCE :
https://www.linkedin.com/pulse/bin-packing-python-pulp-michael-basilyan
http://www.or.deis.unibo.it/kp/Chapter8.pdf
'''
from pulp import *
import time
# Liste des tuples (nom,poids en kgs)
objet... | null | 11. Solveurs linéaires/7. OPTIMISATIONS PAR CATEGORIES D UTILISATION/PRODUCTION/8. Optimiser le remplissage de containers - dimension 1.py | 8. Optimiser le remplissage de containers - dimension 1.py | py | 3,485 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pulp.LpVariable.dicts",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "pulp.LpVariable",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_name": "pulp.LpInteger",
"line_number": 52,
"usage_type": "attribute"
},
{
"api_name": "pulp.L... |
303377993 | from django.shortcuts import render, get_object_or_404, Http404
from django.contrib.auth.decorators import login_required
from django.utils import timezone
from django.db.models import Q
from django.conf import settings
import yaml
import os
from .models import Sale, Item
from .utils import has_any_perms_item
@logi... | null | shop/views.py | views.py | py | 2,577 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "models.Sale.objects.filter",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "models.Sale.objects",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "models.Sale",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "djang... |
512308846 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import swapper
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0001_initial'),
swapper.dependency('mark', 'MarkdownType'),
]
operations = [
migratio... | null | patterns/mark/migrations/0001_initial.py | 0001_initial.py | py | 1,533 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "swapper.dependency",
"line_number": 12,
"usage_type": "call"
},
{
"api_nam... |
150949366 | """
https://leetcode.com/problems/find-the-duplicate-number/
287. Find the Duplicate Number
Given an array of integers nums containing n + 1 integers where
each integer is in the range [1, n] inclusive.
There is only one duplicate number in nums, return this duplicate number.
Follow-ups:
How can we prove that at l... | null | amazon/287-find-the-duplicate-number.py | 287-find-the-duplicate-number.py | py | 1,400 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "typing.List",
"line_number": 55,
"usage_type": "name"
}
] |
547869845 | # controller.py
from model import Book, OlvBook
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
#----------------------------------------------------------------------
def addRecord(data):
"""
Data should be a tuple of two dictionaries in the following format:
("author":{"fi... | null | controller.py | controller.py | py | 3,478 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "model.Book",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.create_engine",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.sessionmaker",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "model... |
574613760 | import numpy as np
import cv2
import imutils
import pytesseract
pytesseract.pytesseract.tesseract_cmd = r"C:\Program Files\Tesseract-OCR\tesseract.exe"
# read image file
image = cv2.imread('carImages/3.jpg')
# resize the image
image = imutils.resize(image, width=500)
# sidplay original image
cv2.imshow("Original Im... | null | CarplateDetection/Scripts/CarPlateDetection.py | CarPlateDetection.py | py | 2,504 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pytesseract.pytesseract",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "cv2.imread",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "imutils.resize",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
... |
407465682 | import time
import random
import logging
import kraken.invoke.command as runcommand
import kraken.kubernetes.client as kubecli
import kraken.cerberus.setup as cerberus
import yaml
import sys
def run(scenarios_list, config, wait_duration):
for scenario_config in scenarios_list:
with open(scenario_config, "... | null | kraken/namespace_actions/common_namespace_functions.py | common_namespace_functions.py | py | 2,398 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "yaml.full_load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "kraken.kubernetes.client.check_namespaces",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "kraken.kubernetes.client",
"line_number": 21,
"usage_type": "name"
},
{
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.