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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
558332706 | from django.conf.urls.defaults import patterns, include, url
from django.conf import settings
from django.contrib import admin
admin.autodiscover()
handler500 = 'mainsite.views.error500'
handler404 = 'mainsite.views.error404'
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'', i... | null | apps/mainsite/urls.py | urls.py | py | 350 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.contrib.admin.autodiscover",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.conf.urls.defaults.patterns",
"line_number": 11,
"usage_type": "call"
},
... |
180533477 | import sys
from PyQt5.QtWidgets import QFrame, QLabel, QVBoxLayout
from PyQt5.QtGui import QCursor
from PyQt5.QtCore import Qt
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
import matplotlib.pyplot as plt
import math
import numpy as np
from matplotlib import font_manager as fm
class... | null | src/MSAView/MSAMainWindow/IHMTool/MSAPlottingBoard.py | MSAPlottingBoard.py | py | 14,478 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PyQt5.QtWidgets.QFrame",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 50,
"usage_type": "name"
},
{
"api_name": "mat... |
362549027 | import requests
import json
import random
import string
import time
def create_topic(topic_name, bot_id, channel, env):
""" Create topic using topic name through INTENT post API"""
payload = {"botId":""+bot_id+"","env":"SANDBOX","intent":{"displayName":""+topic_name+"","skill":{"id": "c5b80692-de8a-4801-a7f... | null | common/intent_api.py | intent_api.py | py | 5,438 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.post",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number":... |
572226324 | import collections
n = int(input())
v = [int(i) for i in input().split()]
odd = collections.Counter(v[1::2])
even = collections.Counter(v[0::2])
# print(odd)
max_odd = max(odd, key=odd.get)
# print(max_odd)
max_even = max(even, key=even.get)
# print(max_even)
max_odd_v = odd[max_odd]
max_even_v = even[max_even]
if ... | null | atcoder/abc111/vvv.py | vvv.py | py | 857 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.Counter",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 6,
"usage_type": "call"
}
] |
315536020 | import sys
import requests
import hashlib
import os
import time
from mail_utils import MailUtils
from company_parser import CompanyParser
from settings import from_mail, to_mail, sleep_time, company_url, tnp_pwd, entry_no, login_url
hash_file_name = 'hash_company'
while True:
mailer = None
session = None
t... | null | companies_sync.py | companies_sync.py | py | 2,246 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "mail_utils.MailUtils",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "settings.from_mail",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "settings.to_mail",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "requests.Ses... |
240557267 | import cv2
import numpy as np
import pyautogui as pg
import time
pg.FAILSAFE=False
W,H=pg.size()
print(W,H)
pic=pg.screenshot("my_test_screenshot.png")
img = cv2.cvtColor(np.array(pic),cv2.COLOR_RGB2BGR)
def ready():
global img
pic=pg.screenshot("my_test_screenshot.png")
img = cv2.cvtColor(np.ar... | null | students/zhuzhemin/0422/homework0422.py | homework0422.py | py | 1,993 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pyautogui.FAILSAFE",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "pyautogui.size",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pyautogui.screenshot",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor... |
271344757 | import matplotlib
from django.shortcuts import redirect, render
from sklearn import metrics
from sklearn.metrics import mean_absolute_error, mean_squared_error, r2_score
from sklearn.model_selection import train_test_split
from django.template import Context
from accounts.models import Mezun
import numpy as np
import ... | null | machine/views.py | views.py | py | 20,944 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.use",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "accounts.models.Mezun.objects.filter",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "accounts.models.Mezun.objects",
"line_number": 23,
"usage_type": "attribute"
},
{... |
615370015 | import io
import os
import site
import subprocess
import sys
import tempfile
import urllib.request
import zipfile
subprocess.check_call([
sys.executable, "-m", "pip", "install", "--upgrade", "pip"])
subprocess.check_call([
sys.executable, "-m", "pip", "install", "--user", "--upgrade",
"requests", "setupto... | null | .ci/wheels/install.py | install.py | py | 1,496 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "subprocess.check_call",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.executable",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "subprocess.check_call",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.e... |
246119168 | from django.test import TestCase
from django.test.utils import override_settings
from django.template import Template, Context
@override_settings(TAG_CONSTANTS={'A_CONSTANT': 'A VALUE'},
SECRET='A SECRET')
class ConstantTagTests(TestCase):
"""test cases for the 'constant' template tag."""
... | null | myenv/lib/python3.6/site-packages/tagconstants/tests.py | tests.py | py | 1,339 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.test.TestCase",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.template.Template",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.template.Context",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "... |
299411250 | from multiprocessing import Pool, Manager
import os,time
def copy_file(name, old_path, old_name, new_path, new_name, q):
fr = open(old_path + old_name + '/' + name)
fw = open(new_path + new_name + '/' + name, 'w')
content = fr.read()
fw.write(content)
time.sleep(0.1)
fr.close()
fw.close... | null | 就业/linux网络编程/06/file_copy.py | file_copy.py | py | 1,279 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "time.sleep",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.mkdir",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Pool",
"line_numbe... |
96003585 | '''
http://127.0.0.1/1/Less-9/?id=1%27%20and%20if(left(version(),1)=4,1,sleep(5))%23
http://127.0.0.1/1/Less-9/?id=1%27%20and%20if(ascii(substr((select%20table_name%20from%20information_schema.tables%20where%20table_schema=%27security%27%20limit%200,1),1,1))=101,1,sleep(5))%23
http://127.0.0.1/1/Less-9/?id=1%27%20and%2... | null | sqlib9.py | sqlib9.py | py | 1,451 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "time.time",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 15,
"usage_type": "call"
}
] |
339811810 | import pandas as pd
from params_proto import cli_parse
from tqdm import tqdm
from typing import Sequence
@cli_parse
class Config:
sweep_root = "geyang/plan2vec/2019/07-22/streetlearn/supervised_value_fn"
def single_run_stats(exp_path, x_key, y_key, x_bin_size=100):
import numpy as np
from ml_logger impo... | null | plan2vec_experiments/streetlearn/supervised_value_fn/analysis.py | analysis.py | py | 8,060 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "params_proto.cli_parse",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "pandas.DataFrame",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "ml_logger.logger.load_pkl",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "ml_l... |
571317461 | import os
#
import networkx as nx
import json
from networkx.readwrite import json_graph
import sys
import networkx as nx
from networkx.exception import NetworkXError
from networkx.utils import not_implemented_for
import json
from networkx.readwrite import json_graph
import numpy as np
from networkx.algorithms import bi... | null | MaxCover-20200616T101530Z-001/MaxCover/GraphSAGE-master/real_data/create_bp.py | create_bp.py | py | 4,337 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "networkx.Graph",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "networkx.algorithms.bipartite.sets",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "networkx.algorithms.bipartite",
"line_number": 39,
"usage_type": "name"
},
{
"a... |
560240320 | #!/usr/bin/env python
import pika
conn = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
chan = conn.channel()
chan.exchange_declare(exchange='logs', type='fanout')
result = chan.queue_declare(exclusive=True)
queue_name = result.method.queue
chan.queue_bind(exchange='logs', queue=queue_name)
print(... | null | 03-publish-subscribe/receive_logs.py | receive_logs.py | py | 533 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pika.BlockingConnection",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pika.ConnectionParameters",
"line_number": 4,
"usage_type": "call"
}
] |
160746697 | # Append current path to path.
import sys, os
sys.path.append(os.path.dirname(__file__))
sys.path.append(os.path.dirname(__file__) + '/IOPi')
import bottle
from bottle import route, request, abort
import scoreboard
import testscoreboard
import logging
import logging.config
import json
# ... build or import your bott... | null | scoreboard.wsgi | scoreboard.wsgi | wsgi | 1,591 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
109621002 | import pandas as pd
import matplotlib.pyplot as plt
from sklearn import svm
from sklearn import metrics
import joblib
import numpy as np
from sklearn.utils import shuffle
'''
train= pd.read_csv('csv/mnist_train.csv')
#dataframe = dataframe.sample(frac=1).reset_index(drop=True)
test=pd.read_csv('csv/mnist_test.csv')
X... | null | practice.py | practice.py | py | 1,230 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.imshow",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "matplotlib... |
386989877 | from flask import Flask, request, render_template, redirect, session, flash, url_for
# import the function connectToMySQL from the file mysqlconnection.py
from mysqlconnection import connectToMySQL
mysql = connectToMySQL("email_validation") #
import re
from datetime import datetime, date, time
EMAIL_REGEX = re.compile(... | null | server.py | server.py | py | 1,719 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "mysqlconnection.connectToMySQL",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"... |
108019966 | from google.cloud import storage
from scrapy.crawler import CrawlerProcess
from datetime import datetime
import scrapy
import json
import tempfile
import googlemaps
TEMPORARY_FILE = tempfile.NamedTemporaryFile(delete=False, mode='w+t')
APIKEY = 'ENTERAPIKEYHERE'
gmaps = googlemaps.Client(key=APIKEY)
def upload_file_... | null | cloud_functions/crawler.py | crawler.py | py | 2,875 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tempfile.NamedTemporaryFile",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "googlemaps.Client",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "google.cloud.storage.Client",
"line_number": 16,
"usage_type": "call"
},
{
"api_nam... |
159049071 | import requests
import configparser
import telegram
from flask import Flask, request
from telegram.ext import Dispatcher, MessageHandler, Filters, CommandHandler
from telegram import ReplyKeyboardMarkup
from fugle_realtime import intraday
from idea.func import Func
config = configparser.ConfigParser()
conf... | null | HW1/DEMO.py | DEMO.py | py | 1,940 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
... |
179679238 | from graphene import ObjectType, Mutation as ObjectMutation, Boolean, List, String, ID
from .import USER_FOLLOWING_RELATIONSHIP_COLLECTION
import logging
from ..utils.utils import increase_or_decrease_a_document_field, remove_documents_from_a_collection
from ..user import USER_COLLECTION
from ..shop import SHOP_COLLECT... | null | social_api/models/following_relationship/mutation.py | mutation.py | py | 7,917 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "graphene.Mutation",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "graphene.Boolean",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "graphene.List",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "graphene.String",
... |
39631219 | import sys
import glob
import os.path
import plotly
import plotly.plotly as py
import plotly.graph_objs as go
def files_path(dir_path):
paths = glob.glob(dir_path + '/*')
file_paths = [path for path in paths if not(os.path.isdir(path))]
return file_paths
def parse_qrel(path):
qrel = []
nb_perti =... | null | eval/eval.py | eval.py | py | 3,508 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "glob.glob",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.path.isdir",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"line_nu... |
282232893 | import torch
class LSMKNNBuffer:
def __init__(self, capacity:int, n_dim:int, dtype=torch.float32):
self.capacity = capacity
self.n_dim = n_dim
self.device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
self.dtype = dtype
assert n_dim is not None
a... | null | lsm_knn_buffer.py | lsm_knn_buffer.py | py | 1,604 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.float32",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.device",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
... |
531582285 | from lib.template.template import TemplateUtils, Template
class AdminControllerTemplate(Template):
def __init__(self, datas):
super(self.__class__, self).__init__(datas)
def execute(self):
datas = self.getDatas()
name = datas["name"]
columns = "\"entity.id\""
... | null | lib/template/model/admincontroller.py | admincontroller.py | py | 888 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "lib.template.template.Template",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "lib.template.template.TemplateUtils.splitCamel",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "lib.template.template.TemplateUtils",
"line_number": 16,
"us... |
100519732 | from datetime import datetime
from dash import dcc
import dash_bootstrap_components as dbc
from dash import html
from dash import dash_table
from covigator.dashboard.tabs import get_mini_container, print_number
from dash.dependencies import Output, Input, State
from sqlalchemy.orm import Session
import pandas as pd
f... | null | covigator/dashboard/tabs/intrahost_mutations.py | intrahost_mutations.py | py | 11,070 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "covigator.database.queries.Queries",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "dash_bootstrap_components.CardBody",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "dash.html.Div",
"line_number": 37,
"usage_type": "call"
},
{
... |
191598217 | import numpy as np
from scipy import constants
from my_pytools.my_h5py import write_over
from my_pytools.my_numpy.array import atleast
import h5py
class electrostatics:
def __init__(self, particles, charges):
self.particles = particles
self.charges = atleast(charges, dim=1, length=particles.Npartic... | null | dynamics/electrostatics.py | electrostatics.py | py | 1,303 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "my_pytools.my_numpy.array.atleast",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "h5py.File",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "my_pytools.my_h5py.write_over",
"line_number": 15,
"usage_type": "call"
},
{
"api_nam... |
653575122 | from PySide2.QtWidgets import QAction
colorMode = "light"
mainWindowColor = {"dark": "background-color: #31363b; color: white;",
"light": "background-color: #e8e8e7; color: black;"}
textEditColor = {"dark": "background-color: gray;",
"light": "background-color: white;"}
def change... | null | examples/08_plugins/plugin_darkmode.py | plugin_darkmode.py | py | 983 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PySide2.QtWidgets.QAction",
"line_number": 25,
"usage_type": "call"
}
] |
265849391 | # -*- encoding:utf-8 -*-
from tools.utils import getLogger
from .models import Permission
def init_permissions():
"""
初始化CMDB权限
"""
ALL = "ALL"
READ_ALL = "READ_ALL"
HISTORY = "HISTORY"
READ_INSTANCE = "READ_INSTANCE"
READ_RELATION_INSTANCE = "READ_RELATION_INSTANCE"
READ_VIEW_DAT... | null | WiseEye/iam/cmdb/__init__.py | __init__.py | py | 6,934 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tools.utils.getLogger",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "models.Permission.objects.get_or_create",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "models.Permission.objects",
"line_number": 62,
"usage_type": "attribute"
... |
303157394 | import numpy as np
import numpy.linalg as lin
import pandas as pd
import matplotlib.pyplot as plt
from pandas.compat import range, lrange, lmap, map, zip
from pandas.tools.plotting import scatter_matrix,autocorrelation_plot
def load_avg_data () :
with open('/home/mhkim/data/numpy/sampyo/sampyo_6_data_average', 'r'... | null | exam2.py | exam2.py | py | 3,485 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.compat.range",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.vstack",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_nu... |
475667554 | from stats_count import naic_count
from db_functions import get_sorted_naics_count
import sys
sys.path.insert(0, '/Users/ryangedwill/codez/fbg/random')
from db_settings import DATABASE_CONNECTOR
from openpyxl import Workbook
# dict of naics counts in vendors table
vendor_naic_counts = dict(naic_count())
# list of ... | null | fbg_analysis/contracts/match_structure.py | match_structure.py | py | 5,206 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.insert",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "stats_count.naic_count",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "db_functions.get_s... |
158364068 | # _*_ coding:utf8 _*_
from django.shortcuts import render
from django.views.generic.base import View
from django.http import HttpResponse
from django.db.models import Q
from pure_pagination import Paginator, EmptyPage, PageNotAnInteger
from .models import *
from .forms import *
from operation.models import UserFavori... | null | apps/organization/views.py | views.py | py | 9,757 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "operation.models.UserFavorite.objects.filter",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "operation.models.UserFavorite.objects",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "operation.models.UserFavorite",
"line_number": 17,
... |
67970168 | # SPDX-License-Identifier: BSD
#
# This file is part of Pyosmium.
#
# Copyright (C) 2022 Sarah Hoffmann.
""" Tests for the pyosmium-get-changes script.
"""
from io import BytesIO
from pathlib import Path
from textwrap import dedent
import pytest
import osmium.replication.server
try:
import http.cookiejar as cooki... | null | test/test_pyosmium_get_changes.py | test_pyosmium_get_changes.py | py | 3,351 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "io.BytesIO",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "osmium.replication.server.repl... |
518980612 | import pandas as pd
from math import pi
import matplotlib.pyplot as plt
from soccerplots.radar_chart import Radar
# Criteria & Rating \\\midrule
# Lane keeping/Drive straight & 4 \\
# Gradual acceleration increase & 4\\
# Smooth braking behaviour observed & 2 \\
# Smooth steering control at high sp... | null | code/evaluation/plot_spiderchart2.py | plot_spiderchart2.py | py | 2,488 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 60,
"usage_type": "name"
},
{
"api_name": "soccerplots.radar_chart.Radar",
"line_number": 63,
"usage_type": "call"
},
{
"api_na... |
542614484 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('goal', '0019_auto_20150901_1256'),
]
operations = [
migrations.AlterField(
model_name='report',
name... | null | goal/migrations2/0020_auto_20150901_1451.py | 0020_auto_20150901_1451.py | py | 865 | 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.AlterField",
"line_number": 14,
"usage_type": "call"
},
{... |
146919050 | #!/usr/bin/env python
import webapp2
import json
import os
import config
import libs
import jwt
from google.appengine.api import users
from model.model import UserData
from util.json_serializer import JsonSerializer
ALLOWED_APP_IDS = ['localhosters-api']
ALLOW_ORIGIN_HEADER = 'Access-Control-Allow-Origin'
ALLOW_... | null | controllers/base.py | base.py | py | 5,778 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "jwt.decode",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "config.jwt_secret",
"line_number": 62,
"usage_type": "attribute"
},
{
"api_name": "config.jwt_audience",
"line_number": 63,
"usage_type": "attribute"
},
{
"api_name": "jwt.Decode... |
162651788 | from aiohttp import web
import redis
import json
from settings import config
from aiohttp_validate import validate
REDIS_SET_NAME = 'inc'
r = redis.Redis(host=config.db_host, port=config.db_port, db=0)
routes = web.RouteTableDef()
class Storage:
pass
with open('jsonschema/increment/request.json') as json_fil... | null | hw2/main.py | main.py | py | 1,097 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "redis.Redis",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "settings.config.db_host",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "settings.config",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "settings.con... |
154533176 | import random
from numpy.random import choice
from PyDictionary import PyDictionary
import configparser as cp
config = cp.ConfigParser()
config.read("settings.ini")
class VocabBuilder(object):
def __init__(self, DB):
self.table_name = 'words'
self.DB = DB
self.set_length = int(... | null | Vocab/Controller.py | Controller.py | py | 9,867 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "PyDictionary.PyDictionary",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 98,
"usage_type": "call"
},
{
"api_name": "ran... |
291465845 | import os
from utils.data import define_dataset, select_dist
from utils.training import training_phase_rUNet_multi_loss
import numpy as np
from models import rUNet, dice_loss
import torch
import torch.optim as optim
import torch.nn as nn
SEED = 8
torch.manual_seed(SEED)
np.random.seed(SEED)
DATA_DIR_DEEPTHOUGHT = "/s... | null | core/run_rUNet_training_0.5coeff_seed_multi_loss.py | run_rUNet_training_0.5coeff_seed_multi_loss.py | py | 1,768 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.manual_seed",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
... |
165365060 | import re
from datetime import date, timedelta
from flask import Response, json
def custom_response(res, status_code):
"""
Custom Response Function
"""
return Response(
mimetype="application/json",
response=json.dumps(res),
status=status_code
)
def between(begin_time, en... | null | src/utils/helpers.py | helpers.py | py | 1,544 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Response",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.json.dumps",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.json",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "datetime.date.today",
... |
237083988 | # Syntax: fit_filter [OPTIONS ...]
"""Create filters from data
SYNTAX
$ gridlabd fit_filter -i|--input=INPUTCSV -o|--output=OUTPUTCSV [-k|--order]
[-c|--config=CONFIGNAME] [-g|--glm=GLMNAME] [-I|--init=ISODATETIME]
[-M|--module=MODULENAME] [-C|--class=CLASSNAME] [-N|--name=OBJNAME]
[-P|--pl... | null | tools/fit_filter.py | fit_filter.py | py | 20,526 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.set_printoptions",
"line_number": 116,
"usage_type": "call"
},
{
"api_name": "numpy.hstack",
"line_number": 190,
"usage_type": "call"
},
{
"api_name": "numpy.hstack",
"line_number": 191,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.solv... |
273211406 | # open webcam
import cv2
cap = cv2.VideoCapture(0)
if not cap.isOpened():
raise IOError("Cannot open webcam")
while True:
ret, frame = cap.read()
frame = cv2.resize(frame, None, fx=0.5, fy=0.5, interpolation=cv2.INTER_AREA)
cv2.imshow('Input', frame)
c = cv2.waitKey(1)
if c == 27:
... | null | Get_webcam_USBcam.py | Get_webcam_USBcam.py | py | 799 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.INTER_AREA",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "cv2.imshow",
"line... |
177310332 | """
Deep Learning on Graphs - ALTEGRAD - Dec 2019
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
class GNN(nn.Module):
"""Simple GNN model"""
def __init__(self, n_feat, n_hidden_1, n_hidden_2, n_class, dropout):
super(GNN, self).__init__()
self.fc1 = nn.Linear(n_feat, ... | null | lab6/code/part2/models.py | models.py | py | 909 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.nn.Module",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numb... |
475222572 | """
This code plots the power, pressure and temperature of GS5.2 and GS5.3 in order
to allow a more useful comparison between the two runs.
"""
from datetime import datetime, timedelta
import sys
sys.path.append("../miscutil")
import pandas
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
from hugco... | null | gs53/gs53_52_comparison.py | gs53_52_comparison.py | py | 4,270 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pandas.read_hdf",
"li... |
158347068 | import logging
import uuid
from flask_restful import reqparse, marshal_with, fields, abort
from mongoengine.queryset import DoesNotExist
from api.Auth import Resource
from api.Objects.MetaData import Slides, DictionaryWrap
slide_fields = {
"description": fields.String,
"sections": DictionaryWrap(attribute="s... | null | server/src/api/Resources/GDOSlide.py | GDOSlide.py | py | 1,407 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask_restful.fields.String",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "flask_restful.fields",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "api.Objects.MetaData.DictionaryWrap",
"line_number": 12,
"usage_type": "call"
},
... |
330942142 | from flask import Flask, request, jsonify
from json import JSONEncoder
import json
import mysql.connector
import statistics
from datetime import timedelta
import datetime
from sklearn.neighbors import KNeighborsClassifier
from sklearn.neighbors.nearest_centroid import NearestCentroid
from sklearn import tree
from s... | null | webService/validate.py | validate.py | py | 24,104 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "flask.request.form",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"l... |
299916245 | # -*- coding: utf-8 -*-
import json
from django.http import HttpResponse
from django.shortcuts import render_to_response, redirect, render
from django.views.decorators.csrf import csrf_exempt, csrf_protect
from django.conf import settings
from django.contrib.sessions.models import Session
from django.contrib.auth impor... | null | python_web/views.py | views.py | py | 3,398 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.shortcuts.render",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render_to_response",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 23,
"usage_type": "call"
},
{
... |
563591091 | from collections import OrderedDict
import numpy as np
from gym.spaces import Box, Dict
from sawyer_envs.env_util import get_stat_in_paths, create_stats_ordered_dict, get_asset_full_path
from sawyer_envs.multitask_env import MultitaskEnv
from sawyer_envs.base import SawyerXYZEnv
class SawyerPickAndPlaceEnv(Multitask... | null | sawyer_envs/pick_place.py | pick_place.py | py | 21,569 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sawyer_envs.multitask_env.MultitaskEnv",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "sawyer_envs.base.SawyerXYZEnv",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "sawyer_envs.multitask_env.MultitaskEnv.__init__",
"line_number": 28,
... |
488622623 | import cv2, time
face_cascade = cv2.CascadeClassifier("C:\\Users\\piet.goempel\\AppData\\Local\\Programs\\Python\\Python37-32\Files\\haarcascade_frontalface_default.xml")
video = cv2.VideoCapture(0)
a = 1
while True:
a = a + 1
check, frame = video.read()
print(frame)
#Converting to gray img
gray... | null | image_processing/training and tutorials/opencv_tut_video_face_detection.py | opencv_tut_video_face_detection.py | py | 848 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.CascadeClassifier",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY"... |
439866546 | import re
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
def parse(fname):
with open(fname) as f:
lines = f.read().splitlines()
records = [x for x in lines if 'kmalloc' in x]
d = {}
for record in records:
res = re.search(f"kmalloc-(\d+): (\d+)", record)
... | null | experiments/phoronix_impact/heap_plot.py | heap_plot.py | py | 1,370 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.search",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.log",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 29,
... |
186953160 | import numpy as np
import matplotlib.pyplot as plt
import sys, os
from scipy.special import erf
from scipy.optimize import minimize_scalar
from math import isnan
from math import isinf
def Jpole12():
""" 12th order J-pole expansion of plasma zeta function """
N = 12
bj= np.zeros((N), np.complex)
cj= ... | null | prototypes/dispersion-solver/dispsol.py | dispsol.py | py | 9,568 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.zeros",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.complex",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.complex",
"line_... |
47044871 | from flask import Flask, render_template, url_for, request, redirect, session, jsonify
import mysql.connector
from datetime import datetime, timedelta, date
from werkzeug.utils import secure_filename
import os
import csv
import time
import jwt
UPLOAD_FOLDER = 'test'
app = Flask(__name__)
app.config['UPLOAD_FOLDER'] ... | null | app.py | app.py | py | 9,322 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "mysql.connector.connector.connect",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "mysql.connector.connector",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_... |
587217786 | import csv
from gensim.models import Word2Vec
import string
import pickle
import numpy
model = Word2Vec.load('sw/sw.bin')
words = list(model.wv.vocab)
print(model.wv.similar_by_word('divai', 5))
# Pickle is in python 2, using encoding to open pickle with python 3
with open('polyglot-sw.pkl', 'rb') as f:
w... | null | code/testing_embeddings.py | testing_embeddings.py | py | 3,495 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "gensim.models.Word2Vec.load",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "gensim.models.Word2Vec",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "pickle.load",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "re.compi... |
57815925 | import requests
import json
import base64
from Crypto.Cipher import AES
import codecs
import math
import random
import re
import pymongo
MONGO_URL = 'localhost'
MONGO_DB = 'wangyiyun'
MONGO_TABLE = 'comment'
client = pymongo.MongoClient(MONGO_URL)
db = client[MONGO_DB]
b = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQ... | null | wangyiyun/method1.py | method1.py | py | 2,939 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "math.floor",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "random.random",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "Crypto.Cipher.AES.new",
... |
412117282 | import os
from blinker import Namespace
from datetime import datetime
from redis.sentinel import Sentinel
from flask_sqlalchemy import SQLAlchemy
from flask import Flask
from flask_cors import CORS
from flask_mongoengine import MongoEngine
from flask_redis import FlaskRedis
app = Flask(__name__)
CORS(app)
env = os.en... | null | todolist/app/__init__.py | __init__.py | py | 1,322 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_num... |
146912505 | from sklearn import ensemble
import pandas as pd
import sys, gc
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelEncoder
from tqdm import tqdm
import lightgbm as lgb
import matplotlib.pyplot as plt
#data_path = "/home/ali/Desktop/data science project/data/"... | null | Lightgbm.py | Lightgbm.py | py | 13,816 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 55,
"usage_type": "attribute"
},
{
"api_name": "pandas.to_numeric",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
... |
241200235 | # -*- coding: utf-8 -*-
"""
@author: Viet Nguyen <nhviet1009@gmail.com>
"""
import os
import sys
import json
import glob
import argparse
import socket
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import DataLoader
import shutil
import http.server
import socketserver
import lo... | null | classify-server.py | classify-server.py | py | 3,230 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "http.server.server",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "http.server",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "src.datas... |
487715147 | from __future__ import annotations
from typing import Callable
import pytest
from pandas import DataFrame
from snapflow.core.data_block import DataBlock, DataBlockMetadata
from snapflow.core.execution import PipeContext
from snapflow.core.graph import Graph, graph
from snapflow.core.module import DEFAULT_LOCAL_MODULE... | null | tests/test_pipe.py | test_pipe.py | py | 14,938 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "snapflow.core.pipe_interface.PipeAnnotation",
"line_number": 102,
"usage_type": "name"
},
{
"api_name": "snapflow.core.pipe_interface.PipeAnnotation.from_type_annotation",
"line_number": 103,
"usage_type": "call"
},
{
"api_name": "snapflow.core.pipe_interface.PipeA... |
332673966 | import sys
import sip
sip.setapi('QVariant',2)
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from widgets.MapView import *
from kml.KmlDocument import *
class MapComplete(QApplication):
def __init__(self, args):
super(MapComplete, self).__init__(args)
window = QMainWindow(None)
... | null | MapComplete.py | MapComplete.py | py | 1,170 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sip.setapi",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "kml.KmlDocument",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "kml.KmlDocument",
"line_number... |
123668471 |
import requests
import json
# Example:
# https://superheroapi.com/try-now.html
# API source rights: Copyright 2017 © TwentyEight10
class BattlesModel(db.model):
__tablename__ = 'battles'
id = db.Column(db.Integer, primary_key=True)
Hero_names = db.Column(db.String(128), nullable=False)
Results = d... | null | FlaskAPI/src/models/battles.py | battles.py | py | 5,802 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": ... |
479046524 | from flask import config
import wandb
from .metrics import *
import torch
import pytorch_lightning as pl
from torch.cuda.amp import GradScaler
from torch import nn
import torch.optim as optim
from sklearn.metrics import f1_score
from torch.nn.parallel import DistributedDataParallel as DDP
from pytorch_lightning.loggers... | null | Code/training/neural_nets.py | neural_nets.py | py | 7,778 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pytorch_lightning.LightningModule",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "flask.config",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "torch.nn.CrossEntropyLoss",
"line_number": 31,
"usage_type": "call"
},
{
"api... |
339595605 | import torch
import torch.nn as nn
import torch.nn.functional as F
'''
Autoencoder Neural Network
1. N layers of convolution and max pooling up to XX channels
2. M fully connected layers
3. N times upsampling followed by convolution
'''
class ModelAErelu(nn.Module):
def __init__(self, code_size, image_width, im... | null | src/models/cnn_auto_encoder_relu.py | cnn_auto_encoder_relu.py | py | 3,252 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.nn.Module",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
552771784 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon May 4 14:52:09 2020
@author: nickvalverde
"""
#Animate statistics for hand made distributions.
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.animation as animation
file_save = '/Users/ni... | null | statistics-zsimple_animation.py | statistics-zsimple_animation.py | py | 10,489 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",... |
103916733 | """
Classes for retrieving raw report strings via web scraping
"""
# pylint: disable=arguments-differ,invalid-name
# stdlib
import asyncio as aio
import random
from typing import Any, List, Optional, Tuple, Union
# library
from xmltodict import parse as parsexml # type: ignore
# module
from avwx.parsing.core impor... | null | avwx/service/scrape.py | scrape.py | py | 13,178 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "avwx.service.base.Service",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "avwx.service.base.CallsHTTP",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "av... |
197220003 | from PIL import Image
import random
# Ce filtre prend en argument une image PIL et retourne cette image modifée.
# Le filtre pixélise percentage_coverage % de l'image avec des groupes de pixels
# de taille block_size.
# Les blocks pixélisés sont positionnés aléatoirement dans l'image.
def average_block_color(image, s... | null | random-pixelator/random-pixelator.py | random-pixelator.py | py | 3,566 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "random.randint",
"line_number": 91,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 92,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 109,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_nu... |
301419884 | '''
IMPORTS
'''
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutExc... | null | seleniumDemo.py | seleniumDemo.py | py | 4,781 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "re.findall",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "re.sub",
... |
211915541 | #############################################################################
#
# Copyright (c) 2006-2007 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS... | null | src/grokcore/view/meta/skin.py | skin.py | py | 2,076 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "martian.InstanceGrokker",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "martian.component",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "zope.interface.interface.InterfaceClass",
"line_number": 31,
"usage_type": "argument"
},... |
523919738 | from flask import g
import sqlite3
DATABASE = "user.db"
def get_db():
db = getattr(g, "_database", None)
if not db:
db = g._database = sqlite3.connect(DATABASE)
return db
def output_formatter(results: tuple):
out = []
for result in results:
result_dict = {... | null | app/database/__init__.py | __init__.py | py | 1,686 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.g",
"line_number": 7,
"usage_type": "argument"
},
{
"api_name": "flask.g._database",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "flask.g",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "sqlite3.connect",
"line_n... |
417224170 | #LIBRARIES
#%%
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import pandas as pd
import matplotlib.cm as cm
from sklearn.cluster import KMeans
from sklearn.metrics import silhouette_samples, silhouette_score
from sklearn.preprocessing import StandardScaler
from sklearn.preprocessing import O... | null | VAR/2019-02-28/spotify copy.py | spotify copy.py | py | 12,841 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.tight_layout",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "matplo... |
279624650 | import os
import time
import io
import bz2
import random
import requests
import numpy
from shapely import geometry, ops
import O4_UI_Utils as UI
import O4_File_Names as FNAMES
overpass_servers={
"DE":"http://overpass-api.de/api/interpreter",
"FR":"http://api.openstreetmap.fr/oapi/interpreter",
... | null | src/O4_OSM_Utils.py | O4_OSM_Utils.py | py | 21,261 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "bz2.open",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "O4_UI_Utils.vprint",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "io.StringIO",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "O4_UI_Utils.lvprint",
"li... |
357685318 |
from django.conf import settings
from django.shortcuts import render,redirect
from django.http import HttpResponse
from django.contrib.auth.forms import UserCreationForm,AuthenticationForm
from django.core.mail import send_mail
from accounts.forms import RegistrationForm
from django.contrib.auth.decorators import logi... | null | accounts/views.py | views.py | py | 1,866 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "accounts.forms.RegistrationForm",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.EMAIL_HOST_USER",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 22,
"usage_type": "name"
... |
399393813 | from nose.tools import assert_equals
from rsk_mind.dataset import Dataset
from rsk_mind.utils import *
import os
class TestUtils:
def setUp(self):
header = ['a', 'b', 'target']
rows = [
[5, 2, 1],
[10.0, 7, 0],
[3, 2, 1],
[3, 4, 0]
]
... | null | tests/utils/test_utils.py | test_utils.py | py | 2,512 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "rsk_mind.dataset.Dataset",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "nose.tools.assert_equals",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "nose.tools.assert_equals",
"line_number": 37,
"usage_type": "call"
},
{
"api_na... |
140892521 |
import catkit
import numpy as np
import warnings
from ase import neighborlist
from ase.neighborlist import natural_cutoffs
from pymatgen.io.ase import AseAtomsAdaptor
from pymatgen.analysis.local_env import VoronoiNN
from .constants import COVALENT_RADIUS
from .surfaces import constrain_surface
class Combined():
... | null | ocdata/combined.py | combined.py | py | 12,170 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "surfaces.constrain_surface",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "catkit.Gratoms",
"line_number": 88,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 92,
"usage_type": "call"
},
{
"api_name": "catkit.gen.adso... |
61834004 | import configparser as cp
import mysql.connector as mysqlc
import pandas as pd
from pytz import timezone
import numpy as np
import os
import matplotlib.pyplot as plt
class SensorModel:
verbosity = 0
def __init__(self, config: cp.ConfigParser, cnx: mysqlc.Connect, table_name, start_time, end_time):
se... | null | app/sensor/sensor_db_model.py | sensor_db_model.py | py | 2,648 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "mysql.connector.Connect",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "mysql.connector",
"line_number": 13,
"usage_type": "name"
},
{
"api_n... |
131944687 | from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import Sum
from website.models import Order, UserOrder, Product, Ratings
@login_required
def display_order(request, order_id):
'''
purpose: Sho... | null | website/views/display_order.py | display_order.py | py | 2,532 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "website.models.Order.objects.get",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "website.models.Order.objects",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "website.models.Order",
"line_number": 24,
"usage_type": "name"
},
... |
312092277 | import collections
import cv2
import numpy as np
# Full kernels
FULL_KERNEL_3 = np.ones((3, 3), np.uint8)
FULL_KERNEL_5 = np.ones((5, 5), np.uint8)
FULL_KERNEL_7 = np.ones((7, 7), np.uint8)
FULL_KERNEL_9 = np.ones((9, 9), np.uint8)
FULL_KERNEL_31 = np.ones((31, 31), np.uint8)
# 3x3 cross kernel
CROSS_KERNEL_3 = np.a... | null | CV_depth.py | CV_depth.py | py | 2,383 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.ones",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "numpy.ones",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": ... |
43543400 | # Library dependency installer for pybot
# Misha Larionov
# github.com/MishaLarionov/pybot
# Licensed under MIT License
# See license.txt for full license
import pip, sys
libraries = ['asyncio','requests','dateparser','wikipedia']
for i in libraries:
print("Installing " + i)
pip.main(['install', i])
prin... | null | dependencyInstaller.py | dependencyInstaller.py | py | 797 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pip.main",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pip.main",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 25,
"usage_type": "call"
}
] |
285285040 | from django.shortcuts import render, redirect, render_to_response
from django.core.urlresolvers import reverse
from . import forms
# django的重量级体现,登录注销直接提供封装好的类
from django.http import HttpResponseRedirect, HttpResponse
# Create your views here.
from .models import *
import random
def do_login(request):
if request.... | null | discover/views.py | views.py | py | 7,630 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.shortcuts.redirect",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 32,
"usage_type": "call"
},
{
"api_n... |
252926048 | # -*- coding: utf-8 -*-
"""
Created on Tue Jul 30 12:05:36 2019
@author: 6066305
"""
from urllib import request
from datetime import datetime
from bs4 import BeautifulSoup
import csv
from selenium.webdriver.support.ui import Select
import pandas as pd
from pandas.io import sql
import mysql.connector
import time
from ... | null | ScrapFINAL.py | ScrapFINAL.py | py | 5,277 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "mysql.connector.connector.connect",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "mysql.connector.connector",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "mysql.connector",
"line_number": 21,
"usage_type": "name"
},
{
"... |
278734571 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import tinymce.models
import taggit.managers
import feincms.module.medialibrary.fields
class Migration(migrations.Migration):
dependencies = [
('taggit', '0001_initial'),
('medialibrary', '00... | null | oxford_library/migrations/0001_initial.py | 0001_initial.py | py | 2,897 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.CreateModel",
"line_number": 18,
"usage_type": "call"
},
... |
561449867 | import arcade
a = arcade
class MyGameWindow(arcade.Window):
def __init__(self, width, hight, title):
super().__init__(width, hight, title)
self.set_location(400, 200)
arcade.set_background_color(arcade.color.BLACK)
def on_draw(self):
a.start_render()
a.draw_lines([(0... | null | ICS3U1/ICS3U1/arcadetutorial/0_2drawing.py | 0_2drawing.py | py | 665 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "arcade.Window",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "arcade.set_background_color",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "arcade.color",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "arcad... |
614165000 | """scylla URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Clas... | null | scylla/urls.py | urls.py | py | 1,635 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.urls.path",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "... |
351305881 | import requests
import re
from bs4 import BeautifulSoup
import urllib.request
url = input('在此粘贴歌曲链接:')
html_sn = requests.get(url)
bs_sn = BeautifulSoup(html_sn.content, "html.parser")
song_name = bs_sn.find("h2", {"class":"play_name"})
song_name = song_name.get_text()
html_un = requests.get(url)
bs_un = BeautifulSo... | null | KgSpider/kgSpider(single).py | kgSpider(single).py | py | 750 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"li... |
434736938 | # T-test
# Linear Regression
# Classfiers
import pandas as pd
from pandas.plotting import scatter_matrix
import matplotlib.pyplot as plt
from sklearn.metrics import classification_report
from sklearn.metrics import confusion_matrix
from sklearn.metrics import accuracy_score
from sklearn.tree import DecisionTreeClassif... | null | buildings_and_industry/proj2_data_analysis/industrial_process/analysis/prediction.py | prediction.py | py | 8,836 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sklearn.neighbors.KNeighborsClassifier",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.accuracy_score",
"line_number": 43,
"usage_type": "call"
},
{
... |
408500881 | from itertools import product
import numpy as np
import torch
class SSDAnchorGenerator(object):
def __init__(
self,
im_size,
min_sizes,
max_sizes,
ratios,
steps,
alloc_sizes,
offsets=(0.5, 0.5),
clip=False,
**kwargs
):
sup... | null | pytorchcv/model_zoo/ssd/anchor.py | anchor.py | py | 2,064 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "itertools.product",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number... |
204044034 | import itertools
chain = (
(
'q',
'b',
),
(
'p',
'd',
),
(
'u',
'n',
),
)
dictionary = {
'b': 'q',
'd': 'p',
'n': 'u',
'p': 'd',
'q': 'b',
'u': 'n',
}
if __name__ == '__main__':
for permutation in itertools.permutations(chain):
for product in itertools.product(*permutation):
sequence = [*p... | null | 2018/bdpqnu/bdpqnu.py | bdpqnu.py | py | 436 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "itertools.permutations",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "itertools.product",
"line_number": 26,
"usage_type": "call"
}
] |
255387353 | # -*- coding: utf-8 -*-
import uuid
def assign_tile_ids(layout, override=True):
"""
This function takes a dict, and it will recursively traverse it and assign
sha-hashed ids so we are pretty sure they are unique among them
"""
for elem in layout:
if elem.get('type') == u'tile':
... | null | src/collective/cover/utils.py | utils.py | py | 555 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "uuid.uuid4",
"line_number": 15,
"usage_type": "call"
}
] |
242990834 | # Django settings for indiesart project.
import os.path
import sys
PROJECT_ROOT = os.path.normpath(os.path.dirname(__file__)) +'/'
sys.path.insert(0, os.path.join(PROJECT_ROOT, 'apps'))
try:
from settings_local import *
except ImportError:
import sys
sys.stderr.write('Unable to read settings_local.py\n'... | null | settings.py | settings.py | py | 3,011 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.path.normpath",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "os.path.path.dirname",
... |
127546270 | """Example script to run strip plot comparisons and saving them to pdf
"""
import os
import seaborn as sns
import matplotlib.pyplot as plt
import load_data
covariance_estimator = 'LedoitWolf'
dataset_names = ['COBRE', 'ADNI', 'ADNIDOD']
base_path = os.path.join('../prediction_scores', covariance_estimator)
for data... | null | rs_study/experiments/plotting_scripts_for_paper/example_stripplot_ica_dictlearn_kmeans.py | example_stripplot_ica_dictlearn_kmeans.py | py | 1,763 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 1... |
302755522 | # Copyright 2016-2017 DataStax, Inc.
#
# Licensed under the DataStax DSE Driver License;
# you may not use this file except in compliance with the License.
#
# You may obtain a copy of the License at
#
# http://www.datastax.com/terms/datastax-dse-driver-license-terms
try:
import unittest2 as unittest
except ImportE... | null | tests/integration/cqlengine/base.py | base.py | py | 1,544 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "dse.cqlengine.models.Model",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "dse.cqlengine.columns.UUID",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "dse.cqlengine.columns",
"line_number": 24,
"usage_type": "name"
},
{
"api_n... |
524483247 | import tflearn
from keras.utils import np_utils
import tflearn.datasets.oxflower17 as oxflower17
x, y = oxflower17.load_data(one_hot=True)
from sklearn.model_selection import train_test_split
x_train,x_test,y_train,y_test = train_test_split(x,y,test_size = 0.2,random_state=0)
x_train = x_train.astype('float32... | null | 02-AlexNet.py | 02-AlexNet.py | py | 3,102 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tflearn.datasets.oxflower17.load_data",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "tflearn.datasets.oxflower17",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 7,
"usage_type"... |
141069103 | '''
Simple YouTube scraper - scrapes audio, video without audio, video based on user's preference
Usage: python yt-scraper.py --url <URL> --output <OUTPUT_DIRECTORY> --download <DOWNLOAD_OPTION>
Eg: (Downloads "Avicii - Wake Me Up (Official Video)" with all options to current directory)
python yt-scraper.py --url htt... | null | yt-scraper.py | yt-scraper.py | py | 2,314 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.rename",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "pafy.new",
"line_numbe... |
323265604 | # saved as greeting-server.py
import Pyro4
@Pyro4.expose
class Delivereat(object):
def __init__(self):
self.menu = [["Apple", 0.99], ["Smoked Salmon", 4], ["Frozen Pizza", 1.55], ["Chocolate Milkshake", 3]];
self.orders = [["john", "DH14PZ", "01022019", ["apple", "smoked salmon"]], ["enoch", "GU214... | null | backserver1.py | backserver1.py | py | 2,995 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "Pyro4.Proxy",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "Pyro4.Proxy",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "Pyro4.expose",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "Pyro4.locateNS",
"line_nu... |
595316975 | import cv2
import numpy as np
import matplotlib.pyplot as plt
import pylab as pl
def main(imgName):
img = cv2.imread(imgName)
img_yuv = cv2.cvtColor(img, cv2.COLOR_BGR2YUV)
# equalize the histogram of the Y channel
img_yuv[:,:,0] = cv2.equalizeHist(img_yuv[:,:,0])
# convert the YUV image back to RGB format
img_o... | null | ready_Equ_colores.py | ready_Equ_colores.py | py | 759 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.imread",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2YUV",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "cv2.equalizeHist",
"l... |
44006903 | from django.shortcuts import render
from vdw.raw.sources.models import Source
def sources(request):
sources = Source.objects.filter(published=True, archived=False)\
.select_related('stats')
return render(request, 'sources/sources.html', {
'sources': sources,
})
| null | varify/raw/sources/views.py | views.py | py | 292 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "vdw.raw.sources.models.Source.objects.filter",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "vdw.raw.sources.models.Source.objects",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "vdw.raw.sources.models.Source",
"line_number": 6,
"... |
48529475 | from easy_thumbnails.fields import ThumbnailerImageField
from django.db import models
class Slide(models.Model):
title = models.CharField(max_length=50)
quote_text = models.TextField(max_length=1000,blank=True)
background_image = ThumbnailerImageField(upload_to='uploaded/img',blank=True)
order = models.IntegerFiel... | null | application/manager/models.py | models.py | py | 2,542 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.models.Model",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "... |
572580197 | from distutils import debug
from os import remove
from qgis.core import *
from PyQt5.QtCore import QTimer
import requests
from operator import itemgetter
from math import atan, pi, sqrt
from datetime import datetime
import xml.etree.ElementTree as ET
import tempfile
from shapely import geometry
import time
import trace... | null | GeoAtlasQGIS/utils.py | utils.py | py | 6,455 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 89,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 106,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 111,
"usage_type": "call"
},
{
"api_name": "shapely.geometry.Point",
... |
406053885 | """
Script to delete all containers that match the label filter defined by the environment variable LABEL_FILTER.
LABEL_FILTER: environment variable by which containers are filted. Must be in the form of LABEL_FILTER='foo=bar,foo2=bar2'.
CLEAN_MODE: determine which clean functions to execute. One of 'storage | exited'... | null | services/cleaning-job/run.py | run.py | py | 5,296 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.environ.get",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "docker.APIClient",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line... |
141171970 | import os, uuid
import random, string
import bcrypt
import jwcrypto.jwk as jwk
import python_jwt as jwt
import datetime
import json
import logging
import asyncio
import subprocess
from typing import Any
from fastapi import FastAPI, Depends, HTTPException, Request
from fastapi.security import OAuth2PasswordBearer
from ... | null | easyauth/server.py | server.py | py | 35,965 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "easyrpc.server.EasyRpcServer",
"line_number": 48,
"usage_type": "name"
},
{
"api_name": "logging.Logger",
"line_number": 51,
"usage_type": "attribute"
},
{
"api_name": "fast... |
186469696 | import flask
import random
from .util import B64_image
def create_svg(track):
if not track:
svg_data_dict = {
"is_playing": False,
"status": "No songs found",
"image": B64_image(
"https://img.freepik.com/free-icon/browser_318-313458.jpg"
),
... | null | src/svg.py | svg.py | py | 2,996 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "util.B64_image",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "util.B64_image",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "flask.render_temp... |
73634591 | import RPi.GPIO as gpio
import time
import threading
import socket
import os
import argparse
ap=argparse.ArgumentParser()
ap.add_argument("-IP_otro", "--i", type=str, default=0)
ap.add_argument("-puerto_mio", "--puerto", type=int, default=0)
ap.add_argument("-puerto_otro", "--p", type=int, default=0)
ap.add_argument(... | null | 2018/control.py | control.py | py | 10,803 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_n... |
160201671 | import requests
from bs4 import BeautifulSoup
from random import choice
import argparse
USERAGENTS = 'proxies_and_user-agents/user-agents.txt'
PROXIES = 'proxies_and_user-agents/proxies.txt'
def get_script_parameters():
parser = argparse.ArgumentParser(
description='The script shows rating of best movie... | null | cinemas.py | cinemas.py | py | 3,000 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "random.choice"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.