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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
429736120 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
x = np.linspace(-10,10,200) # Define the x/y range
X,Y = np.meshgrid(x,x) # Make the grid of X,Y values
R =np.sqrt(X**2+Y**2) # Convert into spherical coordinates (R,PHI,THETA fixed to pi/2 (z = 0 plane))
PHI = np.arctan2(Y,X)... | null | StoP.py | StoP.py | py | 996 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.linspace",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.meshgrid",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.arctan2",
"line_numbe... |
365399748 | #!/usr/bin/env python
"""!
@section Description
This scripts is a ROS node that implements the object detection of six different colors (red,blue,green,yellow,black and magenta)
The first time this colored object have been detected, the robot moves towards them and sends informations about their positions and colors to... | null | scripts/object_detection.py | object_detection.py | py | 20,878 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "geometry_msgs.msg.Point",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "exp_assignment3.msg.ball",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "rospy.init_node",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "rosp... |
231840633 | import glob
import logging
import os
import time
from pathlib import Path
import cv2
import numpy as np
import skimage
import skimage.filters as sk_filters
from skimage import img_as_ubyte, io
from skimage.color import rgb2gray
import BaseImage
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__na... | null | pipeline.py | pipeline.py | py | 3,341 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.basicConfig",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "BaseImage.Ba... |
469056272 | import os
from django.conf import settings
from django.core.management.base import BaseCommand
from rmp.models import (
AccChem,
AccFlam,
Tbls6AccidentChemicals,
)
class Command(BaseCommand):
def handle(self, *args, **kwargs):
self.load_model(AccChem)
self.load_model(AccFlam)
... | null | rmp/management/commands/rawimport.py | rawimport.py | py | 1,965 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "rmp.models.AccChem",
"line_number": 14,
"usage_type": "argument"
},
{
"api_name": "rmp.models.AccFlam",
"line_number": 15,
"usage_type": "argument"
},
{
... |
651727762 | # usage:
# h5_filenames
import numpy as np
import h5py
import sys
import os
from tqdm import tqdm
import pandas as pd
from keyname import keyname as kn
from fileshash import fileshash as fsh
import re
from collections import Counter
from joblib import delayed, Parallel
import json
from natsort import natsorted
filena... | null | old/script/DominantRootPrep.py | DominantRootPrep.py | py | 2,308 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.argv",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "keyname.keyname.unpack",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "keyname.keyname",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "h5py.File",
... |
221058719 | # -*- coding: utf-8 -*-
"""
quandl for financial data
This is a temporary script file.
"""
import quandl
import fbprophet
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
plt.style.use('ggplot')
quandl.ApiConfig.api_key = 'VFx7rajTwvF1ztJwzrGL'
tesla = quandl.get('WIKI/TSLA')
gm = quandl.get(... | null | medium/time_series_tutorial.py | time_series_tutorial.py | py | 2,895 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.pyplot.style.use",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 15,
"usage_type": "name"
},
{
"api_na... |
545767894 | # coding: utf-8
import json
from bs4 import BeautifulSoup
import requests
from .dom_helpers import get_attr
from . import backcompat, mf2_classes, implied_properties, parse_property
import sys
if sys.version < '3':
from urlparse import urlparse, urljoin
else:
from urllib.parse import urlparse, urljoin
cla... | null | mf2py/parser.py | parser.py | py | 11,486 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.version",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
... |
494668540 | import re
from logging import getLogger
from traceback import print_exc
from webob import Request
from webob import Response
from jinja2 import Environment
from jinja2 import FileSystemLoader
from shared import ErrorResponses
from middlewares.csrf import CSRF
log = getLogger(__file__)
class Application(ErrorRespon... | null | nerfed/application.py | application.py | py | 4,150 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "shared.ErrorResponses",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "middlewares.csrf",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "middlewares.... |
5831184 | #! /usr/bin/env python
import rospy
from geometry_msgs.msg import Twist
from nav_msgs.msg import Odometry
import sys
import math as m
from tf.transformations import euler_from_quaternion, quaternion_from_euler
from threading import Thread
def manual(pub,in1,in2):
global vel
vel.linear.x,vel.linear.y,vel.linear.z = f... | null | src/scripts/main.py | main.py | py | 3,524 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "math.pi",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "math.pi",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "math.pi",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "math.pi",
"line_number": 2... |
432185816 | from django import forms
from netbox.forms import NetBoxModelBulkEditForm
from tenancy.choices import ContactPriorityChoices
from tenancy.models import *
from utilities.forms import add_blank_choice
from utilities.forms.fields import CommentField, DynamicModelChoiceField
__all__ = (
'ContactAssignmentBulkEditForm... | null | netbox/tenancy/forms/bulk_edit.py | bulk_edit.py | py | 3,224 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "netbox.forms.NetBoxModelBulkEditForm",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "utilities.forms.fields.DynamicModelChoiceField",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "django.forms.CharField",
"line_number": 28,
"usage_ty... |
63174100 | import tensorflow as tf
import pandas as pd
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn import model_selection, preprocessing, linear_model, naive_bayes, metrics, svm
import string
import numpy as np
from collections import Counter
## http://adventuresinmachinelearning.com/gensim-word2vec-... | null | Analyzer/lib/RNN/rnn_lstm.py | rnn_lstm.py | py | 8,899 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tensorflow.argmax",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "tensorflow.estimator",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.estimator.EstimatorSpec",
"line_number": 38,
"usage_type": "call"
},
{
"ap... |
304121579 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Concatenate Praat TextGrid files.
# Copyright (C) 2011 Marcin Włodarczak
#
# This program 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 t... | null | concatenate_textgrids.py | concatenate_textgrids.py | py | 3,813 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "tgt.read_textgrid",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "tgt.TextGrid"... |
545054308 | import discord
from discord.ext import commands
import pytz
from datetime import datetime
import asyncio
import random
class DayDetector():
def __init__(self, bot : commands.Bot):
print("initializing daydetector")
self.bot = bot
wednesday_self_reply = ["IT IS",
"IT IS I... | null | cogs/daydetector.py | daydetector.py | py | 2,320 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "discord.ext.commands.Bot",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "pytz.timezone",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "dateti... |
517434378 | # -*- coding: UTF-8 -*-
'''
@author: Andrewzhj
@contact: andrew_zhj@126.com
@file: pandas_start.py
@time: 4/16/19 7:48 AM
@desc:
@note:
'''
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
'''
pandas quick start
Doc url: http://pandas.pydata.org/pandas-docs/stable/getting_started/10min.... | null | pands_tutorial/pandas_start.py | pandas_start.py | py | 3,045 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.Series",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.nan",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "pandas.date_range",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
... |
434040120 | from django.shortcuts import render, redirect
from collection.forms import PlaceForm
from collection.models import Place
def index(request):
places = Place.objects.all()
return render(request, 'index.html', {
'places': places,
})
def place_detail(request, slug):
place = Place.objects.get(slug=... | null | collection/views.py | views.py | py | 883 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collection.models.Place.objects.all",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "collection.models.Place.objects",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "collection.models.Place",
"line_number": 6,
"usage_type": "name"
... |
257606514 | #!/usr/bin/python3
import requests
from lxml import html
url = 'https://wordassociations.net/de/assoziationen-mit-dem-wort/%s?button=Suchen'
def getTree(url):
result = requests.get(url)
return html.fromstring(result.content)
def getAssocs(word):
tree = getTree(url % word)
nouns = tree.xpath('.//div... | null | wordassociations.py | wordassociations.py | py | 628 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "lxml.html.fromstring",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "lxml.html",
"line_number": 10,
"usage_type": "name"
}
] |
382140868 | import pandas as pd
import numpy as np
from torch.utils.data import Dataset
from .electricity_utils import *
from .utils import *
class ElectricityDataset(Dataset):
@staticmethod
def get_split(data_folder, num_encoder_steps=7 * 24):
data_path = os.path.join(data_folder, 'LD2011_2014.txt')
if n... | null | misc/pytorch_toolkit/time_series/core/dataset/electricity_dataset.py | electricity_dataset.py | py | 5,970 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "pandas.read_csv",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.concatenate",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "pandas.conc... |
454179110 | #!/usr/bin/env python
# --------------------------------------------------
# Copyright The IETF Trust 2011, All Rights Reserved
# --------------------------------------------------
from setuptools import setup
import xml2rfc_gui.main
APP = ['xml2rfc-gui.py']
DATA = ['xml2rfc/templates']
OPTIONS = {
'argv_emulatio... | null | package/platforms/osx/template/setup.py | setup.py | py | 687 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "setuptools.setup",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "xml2rfc_gui.main.main",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "xml2rfc_gui.main",
"line_number": 20,
"usage_type": "name"
}
] |
565217596 | #!/usr/bin/python
# -*- coding:utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# copyright 2016 Wshuai, Inc.
# All Rights Reserved.
# @author: WShuai, Wshuai, Inc.
import os
import sys
import uuid
import json
import tornado.web
sys.path.append('/opt/sengled/apps/app/src/common')
sys.path.append('/opt/sengled/a... | null | src/user/Upload.py | Upload.py | py | 3,888 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.append",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_nu... |
104395041 | #!/usr/bin/env python
import sys
import cv2
import math
from matplotlib import pyplot as plt
import numpy as np
from matplotlib.mlab import center_matrix
def sort_pts(pts):
sorted_by_y = sorted(pts, key=lambda r: r[1])
twos = zip(*(iter(sorted_by_y),) * 2)
sorted_by_x = map(lambda t: sorted(t, key=l... | null | src/assignment4_image_processing/src/image_processing.py | image_processing.py | py | 5,459 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.array",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.transpose",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.dot",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.identity",
"line_numb... |
11244149 | #!/usr/bin/python3
from datetime import datetime
from dateutil.relativedelta import relativedelta
from odoo import models, fields, api
from odoo.exceptions import Warning
from odoo.tools import DEFAULT_SERVER_DATE_FORMAT
#from odoo.addons.ebay_ept.ebaysdk.trading import Connection_multipart as trading_multipart
from ... | null | ebay_ept/wizard/ebay_product_import_export.py | ebay_product_import_export.py | py | 18,077 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "odoo.models.TransientModel",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "odoo.models",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "odoo.fields.Boolean",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "odoo.... |
227763399 | from unittest import TestCase
from parameterized import parameterized
from pysubparser.parser import PARSERS
from pysubparser.parser import parse
from pysubparser.classes.exceptions import InvalidSubtitleTypeError
from pysubparser.classes.exceptions import InvalidTimestampError
PATH = './tests/files/{test_type}/tes... | null | tests/parser.py | parser.py | py | 3,468 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "unittest.TestCase",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "pysubparser.parser.parse",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "parameterized.parameterized.expand",
"line_number": 35,
"usage_type": "call"
},
{
"api... |
511022942 | # coding: utf-8
# ##################################################################
# Pair Trading adapted to backtrader
# with PD.OLS and info for StatsModel.API
# author: Remi Roche
##################################################################
from __future__ import (absolute_import, division, print_function,
... | null | bt_v3.py | bt_v3.py | py | 24,237 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.pylab.rcParams",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pylab",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "matplotlib.pylab.rcParams",
"line_number": 33,
"usage_type": "attribute"
},
{
"ap... |
1887529 | from typing import Iterable, Optional
from app.models import User, Message, Attachment, Conference
from app.models import store
from .sse import event_emitter
from .events import MessageReceive
from .events import MessageEdit
from .events import MessageDelete
@event_emitter(MessageReceive)
async def sto... | null | app/core/messages.py | messages.py | py | 3,146 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "typing.Iterable",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "app.models.Message",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "app.models.Attachment",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "app.models.s... |
270377134 | #!/usr/bin/env python3
"""exercise module
"""
import redis
import uuid
from typing import Union, Callable, Optional
from functools import wraps
def count_calls(method: Callable) -> Callable:
"""count calls function decorate
"""
key = method.__qualname__
@wraps(method)
def wrapper(self, *args, **k... | null | 0x0B_redis_basic/exercise.py | exercise.py | py | 2,691 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "typing.Callable",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "functools.wraps",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "typing.Callable",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "functools.wraps",
... |
579655175 | # !/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: dotfileManager.py
# Author: binss
# Create: 2016-08-17 21:45:56
# Description: No Description
#
import os
import configparser
import logging
from datetime import datetime, timedelta
import shutil
import filecmp
import argparse
import sub... | null | plugins/dotfile/dotfileManager.py | dotfileManager.py | py | 11,929 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.path",
"line... |
94521204 | # -*- coding:utf8 -*-
"""
读取配置文件,决定是否要可视化,以及要存储的路径
"""
import xml.etree.cElementTree as ET
import os
def visual_or_not():
tree = ET.parse("./configuration/predict_month.xml")
root = tree.getroot()
yes_no = root[3][0].text # 决定是否可视化
if yes_no == 'yes':
return True
else:
... | null | data_preprocess_code/each_tree_visual.py | each_tree_visual.py | py | 758 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "xml.etree.cElementTree.parse",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "xml.etree.cElementTree",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "xml.etree.cElementTree.parse",
"line_number": 20,
"usage_type": "call"
},
{
"... |
276346602 | import logging
import os
from IPython.display import display
import pandas as pd
from preprocessing.json_preprocessor import feature_with_json_detector
from preprocessing.data_explorer import outliers_detector
logger = logging.getLogger(__name__)
formatting = (
"%(asctime)s: %(levelname)s: File:%(filename)s Func... | null | preprocessing/data_type_detector.py | data_type_detector.py | py | 12,290 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"lin... |
74140742 | import time
import logging
import websocket
class WebSocketBase(object):
ws_url = ''
ws = None
callback = None
to_retry = True
retry_count = 0
retry_sec = 3.0
def __init__(self, callback=None):
self.init_logging()
self.init_ws()
if callback:
self.ca... | null | ws/ws_base.py | ws_base.py | py | 2,316 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.basicConfig",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "logging.info",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "websocket.WebSocke... |
86675382 | import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
def construct_mat(spec, theta):
a, alpha, d = spec
A = np.array([[np.cos(theta), -np.sin(theta)*np.cos(alpha), np.sin(theta)*np.sin(alpha), a*np.cos(theta)], [np.sin(theta), np.cos(theta)*np.cos(alpha), -np.cos(theta)*n... | null | 5.py | 5.py | py | 3,546 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.array",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.sin",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.eye",
"line_number": 15,
"... |
183950222 | from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from datetime import timedelta
app = Flask(__name__, static_url_path='')
app.jinja_env.add_extension('jinja2.ext.loopcontrols')
app.config['DEBUG'] = True
app.config['SEND_FILE_MAX_AGE_DEFAULT '] = timedelta(seconds=1)
app.config['SQLALCHEMY_DATAB... | null | app.py | app.py | py | 581 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 15,
"usage_type": "call"
}
] |
179386238 | import discord
from discord.ext import commands
import random
from quote import *
from apod import *
from meteo import *
prefix = '-'
description = '''Custom Kirbo Bot'''
bot = commands.Bot(command_prefix=prefix, description=description)
#bot.remove_command("help")
#@bot.group(invoke_without_command=True)
#async def ... | null | main.py | main.py | py | 3,113 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "discord.ext.commands.Bot",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "discord.Status",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "dis... |
451334625 | # uncompyle6 version 3.7.4
# Python bytecode 3.6 (3379)
# Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04)
# [GCC 8.4.0]
# Embedded file name: /Users/sanhehu/Documents/GitHub/troposphere_mate-project/troposphere_mate/codecommit.py
# Compiled at: 2020-02-12 18:15:55
# Size of source mod 2**32: 3278 bytes
... | null | pycfiles/troposphere_mate-0.0.14-py2.py3-none-any/codecommit.cpython-36.py | codecommit.cpython-36.py | py | 2,531 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.version_info",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sys.version_info",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "troposphere.codecommit.codecommit",
"line_number": 21,
"usage_type": "attribute"
},
{
... |
90495182 | # uncompyle6 version 3.7.4
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04)
# [GCC 8.4.0]
# Embedded file name: /Users/gustavofonseca/prj/github/scielo-django-extensions/scielo_extensions/tools.py
# Compiled at: 2012-03-21 14:32:09
from django.core.paginator import EmptyPa... | null | pycfiles/scielo-django-extensions-0.4.tar/tools.py | tools.py | py | 865 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.conf.settings.PAGINATION__ITEMS_PER_PAGE",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.core.paginator.Paginator",
"line_number": 15,
"usage_typ... |
301818939 | #!/usr/bin/env python3
import os
import discord
from redbot.core import commands
from redbot.core import utils
import sqlite3 as sq
import pprint as pp
import pathlib
import random
BaseCog = getattr(commands, "Cog", object)
RATINGSFILE = os.path.join(str(pathlib.Path.home()), "bots.db")
names = [
"bot",
... | null | goodbot/goodbot.py | goodbot.py | py | 10,076 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "redbot.core.commands",
"line_number": 14,
"usage_type": "argument"
},
{
"api_name": "os.path.join",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path.home"... |
279126209 | import xlrd
import matplotlib.pyplot as plt
import numpy as np
import time
from sklearn.linear_model import Ridge
book = xlrd.open_workbook("q1.xlsx")
sh = book.sheet_by_index(0)
y=[]
X=[]
k=0
for i in range(1, sh.nrows):
y.append(sh.cell_value(i,1))
X.append(sh.cell_value(i,0))
X = np.array(X).reshape(-1, ... | null | Assignment1/ass1/ridge.py | ridge.py | py | 462 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "xlrd.open_workbook",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model.Ridge"... |
344181196 | from django.shortcuts import render
from .forms import ContactForm
from . import models
# Create your views here.
def index(request):
if request.method=='POST':
#print("Helo")
#formValue = request.POST
form = ContactForm(request.POST)
#print(form)
if form.is_valid():
form.save()
# p = models.Employe... | null | mysite/polls/views.py | views.py | py | 452 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "forms.ContactForm",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "forms.ContactForm",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 21,
"usage_type": "call"
}
] |
67735876 | import numpy as np # a fundamental numerical linear algebra library
import matplotlib.pyplot as plt # a basic plotting library
import pandas as pd
class Random_Classification_Datamaker:
def __init__(self):
self.colors = ['salmon','cornflowerb... | null | mlrefined_libraries/datamakers_library/random_classification_datamakers.py | random_classification_datamakers.py | py | 8,393 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.random.rand",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.rand",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.random",
... |
447566178 | from time import sleep
import pyglet as pg
def get_timer_data():
minutes = None
while True:
try:
usr_input = input('timer-length [mm:ss]: ').split(':')
minutes = int(usr_input[0])
seconds = int(usr_input[1])
break
except ValueError:
p... | null | timer.py | timer.py | py | 1,979 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "time.sleep",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "pyglet.app.exit",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "pyglet.app",
"line_number": 60,
"usage_type": "attribute"
},
{
"api_name": "pyglet.media.load",
"l... |
483055299 | # -*- coding: utf-8 -*-
#
# Copyright 2018-2020- Swiss Data Science Center (SDSC)
# A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
# Eidgenössische Technische Hochschule Zürich (ETHZ).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in co... | null | renku/cli/show.py | show.py | py | 5,819 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.namedtuple",
"line_number": 109,
"usage_type": "call"
},
{
"api_name": "click.group",
"line_number": 113,
"usage_type": "call"
},
{
"api_name": "renku.cli.utils.callback.ClickCallback",
"line_number": 128,
"usage_type": "call"
},
{
"api_... |
147483588 | # Copyright 2013: Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | null | tests/benchmark/runners/test_base.py | test_base.py | py | 9,574 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tests.test.TestCase",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "tests.test",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "rally.benchmark.runners.base.ScenarioRunnerResult",
"line_number": 54,
"usage_type": "call"
},
{
... |
192630840 |
import numpy as np
from typing import Optional, Tuple
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from torch.nn.utils.rnn import PackedSequence
from lib.fpn.box_utils import nms_overlaps
from lib.word_vectors import obj_edge_vectors
from lib.get_dataset_coun... | null | lib/lstm/mem_rnn.py | mem_rnn.py | py | 14,428 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.autograd",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "torch.rand",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Embedding",
... |
3549410 | # -*- coding: utf-8 -*-
from setuptools import setup
def readme():
with open('README.rst') as f:
return f.read()
config = {
'name': 'metzoo-python-writer',
'version': '0.0.12',
'description': 'Python Data Writer for Metzoo',
'long_description': readme(),
'classifiers': [
'Deve... | null | pypi_install_script/metzoo-python-writer-0.0.12/setup.py | setup.py | py | 997 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "setuptools.setup",
"line_number": 37,
"usage_type": "call"
}
] |
155406552 | # dipolarkernel.py - Dipolar kernel operator
# -----------------------------------------------
# This file is a part of DeerLab. License is MIT (see LICENSE.md).
# Copyright(c) 2019-2020: Luis Fabregas, Stefan Stoll and other contributors.
# Numpy + SciPy
import numpy as np
from numpy import pi,inf
import scipy.integr... | null | deerlab/dipolarkernel.py | dipolarkernel.py | py | 12,372 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.inf",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "numpy.atleast_1d",
"line_number": 124,
"usage_type": "call"
},
{
"api_name": "numpy.atleast_1d",
"line_number": 125,
"usage_type": "call"
},
{
"api_name": "numpy.atleast_1d",
... |
319784114 | import json
from math import floor
from pathlib import Path
from ctypes import *
import parseador
from PIL import Image
class Imagem(Structure):
_fields_ = [
('imagem', POINTER(c_char)),
('tamanho', c_int),
('altura', c_int),
('largura', c_int)
]
class Pixagens:
lista = ... | null | python/main.py | main.py | py | 6,518 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "PIL.Image.open",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number"... |
586502821 | """A Python Pulumi program"""
import pulumi
import pulumi_aws as aws
import mimetypes
import os
import json
bucket = aws.s3.Bucket(
"shaht-website-bucket",
website=aws.s3.BucketWebsiteArgs(
index_document="index.html",
),
)
content_dir = "www"
for file in os.listdir(content_dir):
filepath = o... | null | Pulumi-Workshop-AWS-py/iac-workshop-py/__main__.py | __main__.py | py | 648 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pulumi_aws.s3.Bucket",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pulumi_aws.s3",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pulumi_aws.s3.BucketWebsiteArgs",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": ... |
426126721 | #!/usr/bin/python3.6
## import packages
import os
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "1"
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
import tensorflow as tf
config = tf.compat.v1.ConfigProto(allow_soft_placement=True)
config.gpu_options.allow_growth = True
sess = tf.compat.v1.Session(config=config)
import sys
sys.pat... | null | template_scripts/ranked_accuracy.py | ranked_accuracy.py | py | 1,386 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.compat.v1.ConfigProto",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "tensorf... |
346028425 | import os
from setuptools import setup, find_packages
PACKAGE = "icinga2api"
NAME = "python-icinga2api"
DESCRIPTION = "python icinga2 api "
AUTHOR = "fmnisme, Tobias von der Krone"
AUTHOR_EMAIL = "fmnisme@gmail.com, tobias@vonderkrone.info"
URL = "https://github.com/tobiasvdk/python-icinga2api"
VERSION = __import__(PA... | null | pypi_install_script/python-icinga2api-0.3.tar/setup.py | setup.py | py | 675 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.join",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "setuptools.setup",
"lin... |
494839988 | #!/usr/bin/python3
""" compress webstatic """
from fabric.operations import local
from datetime import datetime
def do_pack():
"""[summary
"""
local("sudo mkdir -p versions")
date = datetime.now().strftime("%Y%m%d%H%M%S")
path = "versions/web_static_{}.tgz".format(date)
compressed = local("t... | null | 1-pack_web_static.py | 1-pack_web_static.py | py | 448 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "fabric.operations.local",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "fabri... |
343339885 | # coding=utf-8
# noinspection PyPackageRequirements
from subprocess import Popen
from os import chdir, walk
from os.path import exists, join, abspath
from shutil import rmtree
from main import __version__
from zipfile import ZipFile, ZIP_LZMA
from subprocess import call
from time import sleep
from distutils.core imp... | null | setup.py | setup.py | py | 3,272 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.chdir",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "subprocess.Popen",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": 39,
... |
252471846 | from __future__ import absolute_import
import base64
import hashlib
import os
import struct
import io
from . import utils, odict
# Colleciton of utility functions that implement small portions of the RFC6455
# WebSockets Protocol Useful for building WebSocket clients and servers.
#
# Emphassis is on readabilty, simp... | null | netlib/websockets.py | websockets.py | py | 12,943 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.urandom",
"line_number": 101,
"usage_type": "call"
},
{
"api_name": "io.BytesIO",
"line_number": 165,
"usage_type": "call"
},
{
"api_name": "struct.pack",
"line_number": 201,
"usage_type": "call"
},
{
"api_name": "struct.pack",
"line_number":... |
441074628 | import matplotlib.pyplot as plt
import numpy as np
import csv
import sys
if len(sys.argv) != 9:
print("The number of supplied arguments is wrong")
sys.exit(1)
else:
print("## I will use this data file: " + str(sys.argv[1]) + " " + str(sys.argv[2]) + " " + str(sys.argv[3]) + " " + str(sys.argv[4]))
prin... | null | __utility/plotter5.py | plotter5.py | py | 1,760 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.argv",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 11,
... |
440722997 | import ecdsa
import base64
def validate_signature(public_key, signature, message):
"""Verify if the signature is correct. This is used to prove if
it's you (and not someon else) trying to do a transaction with your
address. Called when a user try to submit a new transaction.
"""
public_ke... | null | pycoin/keys.py | keys.py | py | 750 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "base64.b64decode",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "base64.b64decode",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "ecdsa.VerifyingKey.from_string",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "ecds... |
335874216 | # -*- coding: utf-8 -*-
"""
Created on Tue Mar 19 16:44:44 2019
@author: Bhavuk
"""
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 17 10:23:47 2019
@author: Bhavuk
"""
import numpy as np
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import Dropout
from keras.layers import CuDN... | null | wordasinput.py | wordasinput.py | py | 2,714 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "string.punctuation",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "tensorflow.keras.preprocessing.text.Tokenizer",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 48,
"usage_type": "call"
},
{
"api_... |
87041690 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Updates schema validation lists
# Requires PyYaml. Install using: $ pip install pyyaml
import yaml
import urllib, json
url = "https://raw.githubusercontent.com/open-data/ckanext-canada/master/ckanext/canada/schemas/presets.yaml"
response = urllib.urlopen(url)
data = y... | null | schema-sync.py | schema-sync.py | py | 1,617 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "urllib.urlopen",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "yaml.safe_load",
"line_number": 13,
"usage_type": "call"
}
] |
225956098 | import json
from os import mkdir, path
from sys import argv, exit
from io import open
from time import sleep
import requests
from bs4 import BeautifulSoup
fa = 'https://www.furaffinity.net/'
agent = 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36'
if len(argv) < ... | null | fa_json_exporter.py | fa_json_exporter.py | py | 4,104 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.argv",
"line_number": 13,
"usage_type": "argument"
},
{
"api_name": "sys.exit",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 36,
... |
625758348 | import euler
import itertools
import operator
# Evaluates Reverse Polish Notation expression
def rpn(exp):
stack = []
try:
while exp:
head = exp[0]
if isinstance(head, int):
stack.append(head)
else:
b = stack.pop()
a = ... | null | src/python/p093.py | p093.py | py | 1,716 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "operator.add",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "operator.sub",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "operator.mul",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "operator.truedi... |
628639491 | """Very lightweight URL manipulation library."""
__version__ = '0.5.0'
__author__ = 'Pavlo Kapyshin'
__email__ = 'i@93z.org'
import collections
try:
from urllib.parse import (
urlencode,
parse_qsl,
urljoin,
urlparse,
urlunparse,
)
_PY3K = True
except ImportError:... | null | urls.py | urls.py | py | 2,481 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "urlparse.urljoin",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "urlparse.urlparse",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "urlparse.urlunparse",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "collections.de... |
248916448 | # -*- coding: utf-8 -*-
# Copyright 2018 Spanish National Research Council (CSIC)
#
# 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
#
# Unle... | null | deepaas/api/v1.py | v1.py | py | 8,631 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "deepaas.model.register_v1_models",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "deepaas.model",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "aiohttp.web.Application",
"line_number": 31,
"usage_type": "call"
},
{
"api_name":... |
189436542 | from marshmallow import post_dump
from nestedworld_api.app import ma
from .. import api
class PointField(ma.Field):
def _serialize(self, value, attr, obj):
from geoalchemy2.shape import to_shape
point = to_shape(value)
return [point.x, point.y]
portals = api.namespace('portals')
@port... | null | nestedworld_api/views/api/v1/geo/__init__.py | __init__.py | py | 5,094 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "nestedworld_api.app.ma.Field",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "nestedworld_api.app.ma",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "geoalchemy2.shape.to_shape",
"line_number": 10,
"usage_type": "call"
},
{
... |
474157051 | import os
from django.conf import settings
from django.db.models import Q
from django.http import HttpResponse
from django.shortcuts import get_object_or_404
from django.template import loader
from rest_framework import viewsets
from rest_framework.decorators import api_view, list_route
from rest_framework.response im... | null | disclosure/views.py | views.py | py | 6,663 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "locality.models.Locality.objects.filter",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "locality.models.Locality.objects",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "locality.models.Locality",
"line_number": 38,
"usage_type":... |
554940619 | """Setup script for object_detection with TF1.0."""
import os
from setuptools import find_packages
from setuptools import setup
# AI Platform Train 実行時に追加でインストールしたいライブラリはここで指定する
# https://cloud.google.com/ai-platform/training/docs/packaging-trainer?hl=ja#adding_standard_pypi_dependencies
REQUIRED_PACKAGES = ['pillow... | null | chapter8_9/components/model_compile_generator/src/setup.py | setup.py | py | 1,497 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "setuptools.setup",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os... |
245049498 | from flask import Flask,render_template,request
import json
import os
app = Flask(__name__)
@app.route('/')
def index():
mins = request.args.get("mins")
os.chdir('./rasp')
f=open("reference.json",'r')
data=json.load(f)
f.close()
data["waittime"]=int(mins)
f=open("reference.json",'w')
j... | null | serverr.py | serverr.py | py | 456 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"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... |
625914699 | import pygame
from Spaceship import Spaceship
from Bullet import Bullet
from Enemy import EnemyWave
import neat
import os
import pickle
pygame.font.init()
SCREEN_WIDTH = 500
SCREEN_HEIGHT = 500
BACKGROUND = back = pygame.image.load("images/back.jpg")
generation = 0
def draw_screen(screen, score, highscore, alive, ge... | null | SpaceGame_Play.py | SpaceGame_Play.py | py | 5,504 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pygame.font.init",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.font",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pygame.image",
... |
405512953 | import os
import random
import requests
from django.shortcuts import get_object_or_404, render
from django.http import HttpResponse, HttpResponseRedirect
from django.contrib.auth.decorators import login_required, user_passes_test
from django.contrib.admin.views.decorators import staff_member_required
from django.core.e... | null | club/views.py | views.py | py | 21,455 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.utils.timezone.now",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "django.utils.timezone",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "models.Event.objects.get",
"line_number": 40,
"usage_type": "call"
},
{
"api_name... |
323460369 | # -*- coding: utf-8 -*-
import logging
def deprecated(func):
"""This is a decorator which can be used to mark functions
as deprecated. It will result in a warning being emmitted
when the function is used."""
def newFunc(*args, **kwargs):
logging.warn("Call to deprecated function %s." % func.__name__,
cate... | null | core/decorator.py | decorator.py | py | 498 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.warn",
"line_number": 9,
"usage_type": "call"
}
] |
646661678 | import pandas as pd
import numpy as np
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten
from keras.layers import Conv2D, MaxPooling2D
from keras.losses import categorical_crossentropy
from keras.optimizers import Adam
from keras.utils import np_utils
df = pd.read_csv('fer... | null | emotion with keras/main.py | main.py | py | 5,582 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_csv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_numbe... |
566725029 | import pandas as pd #pip install pandas
import numpy as np #pip install numpy
import matplotlib.pyplot as plt #pip install matplotlib
#Install sckit-learn:
#pip install NumPy
#pip install SciPy
#pip install Joblib
#pip install threadpoolctl
#pip install --pre --extra-index https://pypi.anaconda.org/scipy-wheels-nigh... | null | modulo2/scikit-learn_sistema_automatico.py | scikit-learn_sistema_automatico.py | py | 2,792 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_csv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.LabelEncoder",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": ... |
452665543 | from os.path import join, dirname
import pytest
from fabric.api import local
from fabric.context_managers import warn_only
from mock import patch
from sm.engine.db import DB
from sm.engine.search_job import SearchJob
from sm.engine.util import SMConfig
from sm.engine.fdr import DECOY_ADDUCTS
from sm.engine.tests.util... | null | tests/test_search_job_imzml_example.py | test_search_job_imzml_example.py | py | 3,472 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.dirname",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sm.engine.tests.util.sm_config",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path.j... |
391969400 | import requests
from bs4 import BeautifulSoup
# 获取链接
def crawler_image(url):
req = requests.get(url)
soup = BeautifulSoup(req.content, 'html.parser')
sum = 0
for x in soup.find_all("img", attrs={"class": "BDE_Image"}):
# print (sum,'.jpg')
down_load(x['src'], str(sum) + '.jpg')
... | null | rockyfire/0013.py | 0013.py | py | 541 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 18,
"usage_type": "call"
}
] |
421151920 | # -*- coding: utf-8 -*-
from actors.models import SUser
from core.models import Gallery, City, Tag
from ckeditor.fields import RichTextField
from django.contrib.gis.db import models
from django.contrib.gis.geos import Point
from django.template import defaultfilters
from unidecode import unidecode
from django.conf impo... | null | company/models.py | models.py | py | 4,681 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.contrib.gis.db.models.Model",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.gis.db.models",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "django.contrib.gis.db.models.CharField",
"line_number": 16,
"usage_t... |
642111167 | #______________________________________________________________
from random import randint, uniform, seed
from neuron import h
from neuron.units import ms, mV
import matplotlib.pyplot as plt
from matplotlib import cm
import numpy as np
import os
import pickle
from instrumentation import *
from hpca_config import *
fro... | null | scripts/.ipynb_checkpoints/fp2-checkpoint.py | fp2-checkpoint.py | py | 2,396 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.pyplot.style.use",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 14,
"usage_type": "name"
},
{
"api_na... |
231963190 | # -*- coding: UTF-8 -*-
'''
项目:教务处查询
文件:notice.py
作者:刘乾 2018.09.02
功能:获取教务处通知 返回给前台
参数:url
'''
import sys
import requests
from bs4 import BeautifulSoup
def get_text(url):
'''教务处通知'''
#url=sys.argv[1]
session = requests.Session()
headers = {
"Accept": "text/html,application/xhtml+xml,application... | null | django/MyTest/py/notice_gettext.py | notice_gettext.py | py | 1,385 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.Session",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 32,
"usage_type": "call"
}
] |
50366496 | #!/usr/bin/env python2
import hashlib
import os
import re
import sys
import anymarkup
import click
import json
def bundle_datafiles(data_dir):
bundle = {}
for root, dirs, files in os.walk(data_dir, topdown=False):
for name in files:
if re.search(r'\.(ya?ml|json)$', name):
... | null | validator/bundler.py | bundler.py | py | 2,047 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.walk",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"... |
455148954 | import sys, argparse
from gooey import Gooey
from PatternCount import PatternCount
init_length = len(sys.argv)
if init_length >= 2:
if not '--ignore-gooey' in sys.argv:
sys.argv.append('--ignore-gooey')
@Gooey(program_name="Symbol Array", program_description='Stand Alone Symbol Array Routine')
d... | null | SymbolArray.py | SymbolArray.py | py | 2,647 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.argv",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "sys.argv.append",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number"... |
548948304 | # -*- coding: utf-8 -*-
"""
Created on Tue Feb 9 16:40:04 2021
@author: windows
"""
#Regresión lineal simple
#Carga de librerias
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
#Importar el dataset
dataset = pd.read_csv('Salary_Data.csv')
X = dataset.iloc[:, :-1].values
y = dataset.iloc[:, 1... | null | 1 - Regresiones/Regresion lineal simple/simple_linear_regression.py | simple_linear_regression.py | py | 1,372 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_csv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model.LinearRegression",
"line_number": 27,
"usage_type": "call"
... |
443584301 | from typing import List
def isPrime(nums: int) -> bool:
if nums <=1 :
return False
if nums <= 3:
return True
for i in range(2, nums):
if nums % i == 0:
return False
return True
def primes(n: int) -> List[int]:
res = []
for i in range(2, n + 1):
i... | null | Array/Primes_number.py | Primes_number.py | py | 427 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "typing.List",
"line_number": 17,
"usage_type": "name"
}
] |
347946044 | import milkmaid
from datetime import datetime
testToken = "1a79ee75e7328538f9df96bdc7e22f9d17ae398e"
def uploadMemento(mementoToken=testToken, mementoTime=datetime.now()):
milkmaid.token = mementoToken
mev = milkmaid.MementoEvent()
mev.datetime = mementoTime.replace(microsecond=0)
mev.creat... | null | uploadEvents.py | uploadEvents.py | py | 1,057 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.datetime.now",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "milkmaid.token",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "milkmaid.Mem... |
363784289 | #
# Copyright 2017 IBM Corp. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | null | bot.py | bot.py | py | 8,250 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "settings.SLACK_API_TOKEN",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "settings.BOT_ID",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "slackclient.SlackClient",
"line_number": 38,
"usage_type": "call"
},
{
"api_na... |
123140153 | import numpy as np
import theano
import theano.tensor as T
rng = np.random
tanh = T.tanh
sigmoid = T.nnet.sigmoid
softmax = T.nnet.softmax
softplus = T.nnet.softplus
class NetLayer:
def __init__(self, inVar, inSize, **args):
self.var = inVar
self.inSize = inSize
self.size = args.get('numUnits', inSize)
self.... | null | pannet/layer.py | layer.py | py | 351 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.random",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "theano.tensor.tanh",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "theano.tensor",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "theano.tensor.nn... |
625594585 | import os
import sys
import numpy as np
import matplotlib.pyplot as plt
from astropy import units
from astropy.io import fits
autolens_version = "0.45.0"
#autolens_version = "0.46.2"
config_path = "./config_{}".format(
autolens_version
)
if os.environ["HOME"].startswith("/cosma"):
cosma_server = "7"
outp... | null | autofit/tutorial_0/runner_with_selfcal__lens__sie__source__ellipticalsersic__data__len__sie__source__ellipticalsersic__phase_errors.py | runner_with_selfcal__lens__sie__source__ellipticalsersic__data__len__sie__source__ellipticalsersic__phase_errors.py | py | 7,441 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "autofit.conf",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "autofit.conf.Config... |
247938877 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | null | azure-cognitiveservices-vision-computervision/azure/cognitiveservices/vision/computervision/models/detect_result.py | detect_result.py | py | 1,541 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "msrest.serialization.Model",
"line_number": 15,
"usage_type": "name"
}
] |
154949119 | #!/usr/bin/env python3
# coding: utf-8
import sys, json, jsonpickle
from sandboxio import output, get_context
from components import Component
from jinja2 import Environment, BaseLoader
def component(l):
if isinstance(l,dict):
selector = l["selector"]
cid = l["cid"]
else:
selector = l... | null | grader/evaluatorstep.py | evaluatorstep.py | py | 6,479 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "jinja2.Environment",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "jinja2.BaseLoader",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "namespace.namespace",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "components.C... |
458257114 | import logging
from paws.aws.aws import Aws
import paws.log
from paws.log import IndentingLogger
class RdsLauncher(object):
def __init__(self, aws = Aws(), logger = logging.getLogger(__name__)):
self.aws = aws
self.logger = IndentingLogger(logger)
def launch_rds(self, rds_config, env_config):... | null | paws/stack/rds_launcher.py | rds_launcher.py | py | 1,236 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "paws.aws.aws.Aws",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "paws.log.IndentingLogger",
"line_number": 10,
"usage_type": "call"
}
] |
419394369 |
import numpy as np
import cv2
im = cv2.imread('messi.jpg')
imgray = cv2.cvtColor(im,cv2.COLOR_BGR2GRAY)
ret,thresh = cv2.threshold(imgray,127,255,0)
contours = cv2.findContours(thresh,cv2.RETR_TREE,cv2.CHAIN_APPROX_SIMPLE)
cv2.drawContours(im,contours[1],-1,(255,255,255),3)
cv2.imshow("window title", im)
cv2.wait... | null | 2. contour.py | 2. contour.py | py | 349 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cv2.imread",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "cv2.threshold",
"lin... |
153059493 | import mysql.connector
from datetime import date
def add_book():
conn = mysql.connector.connect(
host='localhost', database='library', user='root', password='')
cursor = conn.cursor()
title = raw_input('Enter Book Title :')
author = raw_input('Enter Book Author : ')
publisher =... | null | library management.py | library management.py | py | 7,999 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "mysql.connector.connector.connect",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "mysql.connector.connector",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "mysql.connector",
"line_number": 6,
"usage_type": "name"
},
{
"api... |
213583933 | """
Ensure that settings.py gets the proper settings value from settings.json and
the environment.
"""
from base import BaseCastorTest
import mock
class BaseSettingsTest(BaseCastorTest):
def _import_settings(self):
from castor import settings
settings = reload(settings)
return settings
... | null | tests/settings.py | settings.py | py | 1,764 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "base.BaseCastorTest",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "castor.settings",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "castor.settings",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "mock.patch",
... |
326040687 | from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
# Examples:
url(r'^$', 'app.views.inicio', name='inicio'),
url(r'^hola/$', 'app.views.hola', name='hola'),
url(r'... | null | ProyectoHolaMundo/ProyectoHolaMundo/urls.py | urls.py | py | 854 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.conf.urls.patterns",
"line_number": 7,
"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": "dja... |
179957690 | from flask import Flask, render_template, url_for
from htmlmin.minify import html_minify
import HTMLParser
from util import NavBar, NavItem, ContactLink
app = Flask(__name__)
app.config['SERVER_NAME'] = 'ataraxialocal'
"""ATARAXIA in Greek."""
hparser=HTMLParser.HTMLParser()
ataraxia='άταρ&#x... | null | web/run.py | run.py | py | 1,316 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "HTMLParser.HTMLParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "util.NavBar",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "util.NavItem",
"line... |
181306819 | from django.contrib import admin
from .models import Link
@admin.register(Link)
class LinkAdmin(admin.ModelAdmin):
list_display = ("__str__", "destination", "link_markup")
list_filter = ("created", "updated")
readonly_fields = ("created", "updated", "link")
| null | shortlinks/admin.py | admin.py | py | 273 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.register",
"line_number": 5,
"usage_type": "call"
},
{
... |
435948160 | # -*- coding: utf-8 -*-
import picamera
import picamera.array
import cv2
import time
import datetime
###################################################
## 定数定義
###################################################
#動画の格納パス
videopath='/home/pi/camera'
class Camera:
##################################################... | null | camera_step1/Camera.py | Camera.py | py | 2,771 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "picamera.PiCamera",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "picamera.array.PiRGBArray",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "picamera.array",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "datet... |
485179305 | # Copyright (c) 2019 Martin Olejar
#
# SPDX-License-Identifier: BSD-3-Clause
# The BSD-3-Clause license for this file can be found in the LICENSE file included with this distribution
# or at https://spdx.org/licenses/BSD-3-Clause.html#licenseText
import os
import logging
import collections
from time import time
from s... | null | mboot/usb.py | usb.py | py | 14,084 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "struct.pack",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "struct.unpack_from",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "os.name",
"line_number": 62,
"usage_type": "attribute"
},
{
"api_name": "protocol.UsbProtocolMixin... |
457753233 | import os
import shutil
from config import Config
DIR = os.path.abspath(Config.DIR)
CUR_DIR = []
def showDirectories(flags=None) -> str:
files = ""
for file in os.listdir():
files += f'{file}\n'
return files[:-1] if files != "" else ' '
def createDirectory(*names, flags=None) -> str:
for na... | null | 5_FTP-server/commands.py | commands.py | py | 4,559 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.abspath",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "config.Config.DIR",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "config.Config",
... |
569928579 | """Test the loading of config."""
import pytest
from config import Config, MissingConfigError
import os
@pytest.fixture
def complete_config():
"""Return a config object with complete attributes."""
os.environ = {
'TESTING': 'True',
'SLACK_SIGNING_SECRET': 'something secret',
... | null | tests/config/config_test.py | config_test.py | py | 2,173 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "config.Config",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"li... |
463670072 | import threading, os, time
from collections import deque, namedtuple
from .constants import *
ByteCount = namedtuple('ByteCount', ['rx', 'tx'])
TimedByteCount = namedtuple('TimedByteCount', ['time', 'count'])
class NetworkStatisticsMonitorThread(threading.Thread):
def __init__(self, monitoring_interfaces=[], *arg... | null | netbandmonitor/netstats/NetworkStatisticsMonitorThread.py | NetworkStatisticsMonitorThread.py | py | 3,093 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.namedtuple",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "thre... |
331629828 | # imports
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import requests
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras.models import load_model
from tensorflow.keras.preprocessing.image import img_to_array, load_img
import numpy as np
from numpy import expand_dims
from cv2 import cv2... | null | YOLOv3.py | YOLOv3.py | py | 7,154 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "functions.br",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "functions.br",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_num... |
328552107 | # Loads the maps
from struct import unpack_from
from typing import List
from src.tools.osu.models import BeatmapEntry, KeyTimingPoint, InheritedTimingPoint
from src.tools.osu.filter import filter_items, parse_filters
class DatabaseReader:
def __init__(self, file):
self.cursor = 0
self._db = file.... | null | src/tools/osu/database.py | database.py | py | 5,270 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "struct.unpack_from",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "src.tools.osu.filter.parse_filters",
"line_number": 96,
"usage_type": "call"
},
{
"api_name": "src.tools.osu.filter.filter_items",
"line_number": 98,
"usage_type": "call"
},
... |
310369704 | import requests
url = "http://www.google.com"
response = requests.get(url)
print(f"Your request to {url} came back with status code {response.status_code}")
url = "https://icanhazdadjoke.com/"
response = requests.get(url, headers={"Accept": "application/json"})
data = response.json()
print(data["joke"]... | null | first_request.py | first_request.py | py | 1,210 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number"... |
491974299 |
from tkinter import *
#Automated Date input
from datetime import date
from datetime import datetime
import os
def window_three():
#time showing date and time
today = datetime.now().strftime("%d-%m-%Y um %H %M %S Uhr")
def mhello():
mtext = mEntry.get()
mlabel2 = Label(mGui, ... | null | input_new.py | input_new.py | py | 1,065 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.datetime.now",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "os.makedirs",
"line_number": 17,
"usage_type": "call"
}
] |
654536603 | """
Some nifty Utilities
"""
import os
import logging
from itertools import chain
import click
# TODO: create a config for this
class StyledStreamHandler(logging.StreamHandler):
"""
Wraps a logger for styled stream outputs.
The record is passed to the formatter by dict keys,
so the Handler can effec... | null | sca/utils.py | utils.py | py | 4,044 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.StreamHandler",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "click.style",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "click.echo",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.