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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
23759648 | import appdirs
import argparse
import logging
import os
import pathlib
import sys
from sqlalchemy import create_engine
from chronophore import (
__description__, __title__, __version__, controller, Session
)
from chronophore.models import Base, add_test_users
def get_args():
"""Parse command line arguments."... | null | chronophore/chronophore.py | chronophore.py | py | 4,015 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "chronophore.__title__",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "chronophore.__description__",
"line_number": 19,
"usage_type": "name"
},
{
"api_nam... |
261200726 | from flask import Flask, request
from flask_restful import Api, Resource, reqparse, abort
from flask_sqlalchemy import SQLAlchemy
import requests
import json
app = Flask(__name__)
api = Api(app)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///users.sqlite3'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
db ... | null | APIPractice/.ipynb_checkpoints/rest_weather-checkpoint.py | rest_weather-checkpoint.py | py | 1,934 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask_restful.Api",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask_restful... |
312892304 | # coding: UTF-8
from bottle import route, run, template, request, redirect, static_file
from contextlib import contextmanager
from psycopg2 import pool, extras
import os
# 接続プール
conn_pool = pool.SimpleConnectionPool(minconn=1, maxconn=10, dsn=os.environ.get("DATABASE_URL"))
# BBS-ID
bbs_id = "1"
@route("... | null | app.py | app.py | py | 4,718 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "psycopg2.pool.SimpleConnectionPool",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "psycopg2.pool",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "os.environ.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.envir... |
435042437 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.db import models
# Create your models here.
class blog(models.Model):
username = models.ForeignKey(User)
picture = models.ImageField(upload_to = 'pictures', blank = True, null = True)
title = mo... | null | blogser/models.py | models.py | py | 559 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.db.models.Model",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.db.models.ForeignKey",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": ... |
557530024 | # -*- coding: utf-8 -*-
# __author__ = 'libingxin'
from django.http import HttpResponse
from TestModel.models import Mysql
# 数据库操作
def testdb(request):
# sample1
# test1 = mysql(name='runoob1')
# test1.save()
# test2 = mysql(name='melody1')
# test2.save()
# return HttpResponse("<p>数据添加成功!</p... | null | HelloWorld/testdb.py | testdb.py | py | 1,507 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "TestModel.models.Mysql.objects.all",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "TestModel.models.Mysql.objects",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_name": "TestModel.models.Mysql",
"line_number": 49,
"usage_type": "name"
... |
414968222 | import glob
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
from collections import Counter
configs = [['kc0.1-', 'special'], ['kc0.5-', 'special'], ['kc1.0-', 'special'], ['kc1.5-', 'special'],
['kc2.0-', 'special'], ['kc2.5-', 'special'], ['kc5.0-', 'special'], ['... | null | figures/plot_performance.py | plot_performance.py | py | 5,007 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "glob.glob",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.rc",
"... |
79869059 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
Script: pymenu
Version: 1.3
Author: Michel Lavoie
Date: 2013-03-20
Description: 1.0 (2013-03-20)
This script generates an application menu with dmenu from the
*.desktop files in /usr/share/applications, sorted by categor... | null | bin/pymenu.py | pymenu.py | py | 9,088 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.exists",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "sqlite3.connect",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "os.remove",
"line_num... |
625828181 | #!/usr/bin/python3
"""
Build Flask Application
"""
from os import getenv
from flask import Flask, jsonify
from models import storage
from api.v1.views import app_views
from flask_cors import CORS
app = Flask(__name__)
cors = CORS(app, resources={r"/api/*": {"origins": "0.0.0.0"}})
app.register_blueprint(app_views)
@... | null | api/v1/app.py | app.py | py | 784 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "api.v1.views.app_views",
"line_number": 13,
"usage_type": "argument"
},
{
"api_name": "flask.jsonify"... |
77906953 |
from create_classifier.build_grid_search_pipeline import build_pipeline, get_params_grid,build_full_pipeline, get_full_params_grid
from create_classifier.get_data import get_data, get_data_for_reg
from create_classifier.get_grid_search_results import meow, linear_regressor, get_reasults_only_clf_pipeline
import dateti... | null | test_data/new_pipeline/run_grid_search.py | run_grid_search.py | py | 845 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.datetime.now",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "create_classifier.get_data.get_data",
"line_number": 18,
"usage_type": "call"
},
{
"... |
314743908 | import re
import os
import sys
import requests
from configparser import ConfigParser
from html import unescape
import chardet
import pdfkit
from loguru import logger
def init():
cwd = os.path.abspath(os.path.dirname(__file__))
config_path = os.path.abspath(os.path.join(cwd, 'config.ini'))
config = Config... | null | 先知社区/xz_spider.py | xz_spider.py | py | 4,922 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.abspath",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"l... |
255874280 | import pytest
@pytest.mark.usefixtures("release_feed")
def test_release_feed(release_feed):
check_attrs = [
'name',
'url',
'is_adult',
'series',
'maker',
'size',
'scale',
'price',
'release_date',
'image_url',
'thumbnail',
... | null | tests/unit_test/test_extension_cls.py | test_extension_cls.py | py | 456 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pytest.mark.usefixtures",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 4,
"usage_type": "attribute"
}
] |
544166716 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This script loops through all media items to build a collection of attributes on
each media type. The resulting list can be compared with the current object
implementation in python-plex api to track new attributes and depricate old ones.
"""
import argparse, copy, pi... | null | tools/plexattrs.py | plexattrs.py | py | 10,554 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.defaultdict",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 19,
"usage_type": "call"
},
{
"api_name"... |
158994210 | from django.shortcuts import render, redirect
from models import User, Travel
from django.contrib import messages
import bcrypt
def index(request):
return render(request, "belt_exam_app/index.html")
def register(request):
errors = User.objects.register_validator(request.POST)
if len(errors) <= 0:
... | null | apps/belt_exam_app/views.py | views.py | py | 4,366 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.shortcuts.render",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "models.User.objects.register_validator",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "models.User.objects",
"line_number": 10,
"usage_type": "attribute"
},
{... |
448765207 | # run stream on a relocatable machine i.e. not datbroker dependent
# test a XS run
import os
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
# this is interactive mode for debugging
plt.ion()
# dask imports
# set up the distributed client
#from dask.cache import Cache
#_cache = Cache(1e9)
#_cac... | null | SciStreams/examples/run_stream_relocatable.py | run_stream_relocatable.py | py | 6,490 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.use",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.ion",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "dask.set_options"... |
103366713 | # -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
import toml
if os.name == 'posix' and sys.version_info[0] < 3:
import subprocess32 as subprocess
else:
import subprocess
# Logging
class Logger(object):
def set_verbose(self,verbose=True):
self._verbose = verbose... | null | bumpytrack/bumpytrack.py | bumpytrack.py | py | 6,843 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.name",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "sys.version_info",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "subprocess.run",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
... |
501761801 | from django.urls import path, include
from . views import (
HomeView,
extract,
products,
ProductOpinionsView,
AuthorView,
charts,
)
urlpatterns = [
path('', HomeView.as_view(), name='home'),
path('extract/', extract, name='extract'),
path('products/', products, name='products'),
... | null | core/urls.py | urls.py | py | 513 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.urls.path",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "views.HomeView.as_view",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "views.HomeView",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "django.urls.pa... |
308634908 | import requests
import random
import pandas as pd
url = 'http://localhost:8000/prediction'
X_test = pd.read_csv('test.csv')
def predict(feature_vector):
score = random.randrange(10) < 3
response = requests.post(url, json={
'feature_vector': feature_vector.tolist(),
'score': score
})
... | null | D6/tester.py | tester.py | py | 372 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_csv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "random.randrange",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 12,
"usage_type": "call"
}
] |
640617846 | import struct
import zlib
import re
import collections
from .const import *
from ..util.basetypes import Byte, Char, UShort
from ..util.stream import Reader
request_messages = {}
response_messages = {}
push_messages = {}
__all__ = [ 'Header', 'Message', 'MultipleMessage' ]
Attribute = collections.namedtuple('Attribu... | null | python/tools/binary-message/ouou/message/message.py | message.py | py | 10,878 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.namedtuple",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "collections.Iterable",
"line_number": 70,
"usage_type": "attribute"
},
{
"api_name"... |
314090925 | # -*- coding: utf-8 -*-
import datetime
import tornado.escape
from mongoengine import Document, IntField, connect, StringField,\
DateTimeField, FloatField, ObjectIdField, NotUniqueError,\
ListField, EmbeddedDocument, EmbeddedDocumentField, DictField,\
LongField
from settings import MONGODB_HOST, MONGODB_NA... | null | module/message.py | message.py | py | 2,585 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "mongoengine.Document",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "mongoengine.IntField",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "mongoengine.StringField",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "mon... |
237742228 | from discord.ext import commands
from discord.ext.commands import Context, Bot
ZED0_HELP_TEXT = """Very important command."""
FAUX_HELP_TEXT = """A member of the Rust evangelical strike force."""
GO_HELP_TEXT = """The eternal #cs meme."""
class Misc:
def __init__(self, bot: Bot):
self.bot = bot
@com... | null | commands/misc.py | misc.py | py | 778 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "discord.ext.commands.Bot",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "discord.ext.commands.Context",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "discord.ext.commands.command",
"line_number": 13,
"usage_type": "call"
},
{
... |
484022447 | import sys
sys.path.append("../../cs6350MLcourse/")
from algorithms import *
from algorithms.SVM import *
from algorithms.Random_forest import *
from utils import *
import json
import numpy as np
import os
import pandas as pd
from utils import Logger
arg=ml_arg()
argg=arg.parse_args()
# argg=arg.parse_args(["--tree_dep... | null | scripts/cross_SVM_random_tree.py | cross_SVM_random_tree.py | py | 9,117 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.append",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
442280669 | import copy
import re
import random
import configparser
import os
import glob
from haddock.modules.structure.utils import PDB
from haddock.utils.files import get_full_path
def treat_ensemble(pdb_dic):
check = False
new_d = {}
for mol in pdb_dic:
new_d[mol] = []
pdb = pdb_dic[mol]
w... | null | haddock/modules/functions.py | functions.py | py | 5,474 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "haddock.modules.structure.utils.PDB.split_models",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "haddock.modules.structure.utils.PDB",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "copy.deepcopy",
"line_number": 52,
"usage_type": "ca... |
160241042 | import os
import logging
import subprocess
import sys
from socket import *
import openpyxl
DEFAULT_IP = '127.0.0.1'
DEFAULT_PORT = 40000
PROJECT_NAME = "PolynomeAdder"
EXEC_DIRECTORY = f"{PROJECT_NAME}\\Debug\\"
ARGS_STRINGS = [
"<excel_file>",
"<num_polynomes>",
"<max_degree>",
"<num_... | null | Laborator/Lab 5/cpp_multiple_run.py | cpp_multiple_run.py | py | 2,981 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.exists",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "openpyxl.load_workbook",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "openpyxl.Workbook"... |
6562822 | """bot_words.py botの基本的な発言やコマンドをまとめたモジュールです。
"""
from modules import utils
txt = utils.get_text
# botが反応するコマンド一覧
BOT_COMMANDS = {
'NORMAL': 'らびちゃん',
'JANKEN': 'じゃんけん',
'OMIKUJI': 'おみくじ',
'HELP': r'へるぷ|教えて|おしえて',
}
# ランダムに返すメッセージ
RANDOM_CONTENTS = txt('default')
# メンションされた際のヒントメッセージ
HINT_MESSAGE... | null | settings/bot_words.py | bot_words.py | py | 656 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "modules.utils.get_text",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "modules.utils",
"line_number": 5,
"usage_type": "name"
}
] |
638309538 | import os
import cv2
import numpy as np
import argparse
import sys
import matplotlib.pyplot as plt
def main():
if not "MSC_HOME" in os.environ:
print("Environment variables like $MSC_HOME are not set.")
exit(1)
encryption_type = _check_and_get_args(sys.argv[1:]) # AES/CE
_display_program_... | null | research_programs/histogram/histogram.py | histogram.py | py | 6,375 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line... |
58158249 | # -*- coding: utf-8 -*-
import json
import re
import subprocess
import sys
import time
import os
from os.path import exists, join, split, dirname, abspath
from traitlets import Unicode
from jupyter_client.kernelspec import (
KernelSpecManager,
KernelSpec,
NATIVE_KERNEL_NAME,
)
CACHE_TIMEOUT = 60
CONDA_E... | null | conda/dbconnect/lib/python3.5/site-packages/nb_conda_kernels/manager.py | manager.py | py | 8,824 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "jupyter_client.kernelspec.KernelSpecManager",
"line_number": 23,
"usage_type": "name"
},
{
"api_na... |
103104464 | import pandas as pd
import numpy as np
import random
from sklearn.discriminant_analysis import QuadraticDiscriminantAnalysis
from sklearn.metrics import roc_curve
from matplotlib import pyplot as plt
# import data
dataPath = '/home/silver/Documents/TBI_NNs/Datasets/CSVFiles/patient12.csv'
axesDataPath = '/home/silve... | null | TBIDiscriminator.py | TBIDiscriminator.py | py | 4,596 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_csv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "sklearn.discriminant_a... |
284267546 | # -*- coding: utf-8 -*-
"""Test for the utils module"""
import time
from django.conf import settings
from django.contrib.auth.models import User
from django.test import TestCase
from mytardis_hsm.mytardis_hsm import DEFAULT_HSM_CLASSES
from mytardis_hsm.utils import DatafileLock
from tardis.tardis_portal.models impo... | null | tests/test_utils.py | test_utils.py | py | 4,080 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.test.TestCase",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.models.User.objects.create_user",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.models.User.objects",
"line_number": 23,
"us... |
422941428 | from PIL import Image
import os,sys
def photoResize(path, size):
toImage = Image.new('RGBA', size)
image = Image.open(path)
image = image.resize(size)
toImage.paste(image)
toImage.save(path)
| null | photos/photoResize.py | photoResize.py | py | 243 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "PIL.Image.new",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 6,... |
333622873 | # -*- coding: utf-8 -*-
__author__ = 'Bondarenko_Yura'
from django.core.management.base import BaseCommand, CommandError
from django.db.models import get_app, get_models
class Command(BaseCommand):
args = '<app app ...>'
help = 'Print all models and object counts.'
def handle(self, *args, **options):
... | null | user_profile/management/commands/prints_all.py | prints_all.py | py | 960 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.db.models.get_app",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "django.db.models.get_models",
"line_number": 19,
"usage_type": "call"
}... |
542589547 | from django.conf.urls import url, include
from . import views
app_name = 'accounts' #namespace these urls so that in case we have details path in another app we can distinguish
urlpatterns = [
url(r'^signup/$', views.signup_view, name='signup'),
url(r'^login/$', views.login_view, name='login'),
url(r'^logout/$', v... | null | django/blog/accounts/urls.py | urls.py | py | 355 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 9,
"usage_type": "call"
}
] |
454460939 | import ctypes
import glob
from PIL import Image
import os
# Program wide variables
# Final
PERCENTAGE_ACCURACY = .8
PERCENTAGE_VARIANCE_ALLOWED = .1
USER_32 = ctypes.windll.user32
MAIN_FILE_LOCATION = ''
# 0 - 11 1 Cost Champs
# 12 - 23 2 Cost Champs
# 24 - 35 3 Cost Champs
# 36 - 44 4 Cost Champs
# 45 - 50 5 Cost Cha... | null | TeamFightTacticsBot/Utility/Constants.py | Constants.py | py | 2,089 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "ctypes.windll",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_nu... |
64807355 | import sqlalchemy as sa
from sqlalchemy.orm import relationship
from tifa.globals import Model
from tifa.models.system import Permission
from tifa.models.utils import TimestampMixin, MetadataMixin
class App(MetadataMixin, Model):
__tablename__ = "app"
id = sa.Column(sa.Integer, primary_key=True)
name = ... | null | tifa/models/app.py | app.py | py | 2,531 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tifa.models.utils.MetadataMixin",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "tifa.globals.Model",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sq... |
321166438 | """
This file will test the creation of csv files in create_csv.py
"""
import logging
import unittest
import os
from src import create_csv
LOG_FORMAT = "%(asctime)s %(filename)s:%(lineno)-3d %(levelname)s %(message)s"
LOG_FILE = 'test_create_csv.log'
FORMATTER = logging.Formatter(LOG_FORMAT)
FILE_HANDLER = logging.Fi... | null | students/dfspray/Lesson10/tests/test_create_csv.py | test_create_csv.py | py | 2,232 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.Formatter",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.FileHandler",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "logging.basi... |
223250727 | # Module sys has to be imported:
import sys
from socketServer import *
from socketClient import *
from time import time, sleep
import asyncio
import os
import threading
from multiprocessing import Process, Pool
async def main():
try:
if(len(sys.argv) <= 1):
print("Please enter paramitter ex. p... | null | temp/routers.py | routers.py | py | 1,050 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.remove",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 1... |
562464911 | from collections import Counter
N, M, K = list(map(int, input().split()))
AB = [list(map(int, input().split())) for _ in range(M)]
CD = [list(map(int, input().split())) for _ in range(K)]
friend_g = [set() for i in range(N)]
for a, b in AB:
a, b = a-1, b-1
friend_g[a].add(b)
friend_g[b].add(a)
friend_co... | null | Python_codes/p02762/s133799390.py | s133799390.py | py | 1,028 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.Counter",
"line_number": 36,
"usage_type": "call"
}
] |
485768513 | from django.shortcuts import render, get_object_or_404
from django.db.models import Q
from expo.models import *
from .filters import PaintingFilter
############################## def gallery ##############################
def gallery(request, null=None):
artist_id = request.GET.get('artist_id', '')
genre_id = ... | null | expo/views.py | views.py | py | 14,738 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.db.models.Q",
"line_number": 143,
"usage_type": "call"
},
{
"api_name": "django.db.models.Q",
"line_number": 144,
"usage_type": "call"
},
{
"api_name": "django.db.models.Q",
"line_number": 145,
"usage_type": "call"
},
{
"api_name": "django.db... |
386247264 | from src.gp.GaussianProcess import GaussianProcess
from src.enum.DatasetEnum import DatasetEnum
from src.dataset_model.MapValueDictBase import MapValueDictBase
import numpy as np
from scipy.stats import multivariate_normal
from src.gp.covariance.CovarianceGenerator import CovarianceGenerator
class SimulatedMapValue... | null | src/dataset_model/SimulatedMapValueDict.py | SimulatedMapValueDict.py | py | 7,206 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "src.dataset_model.MapValueDictBase.MapValueDictBase",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "src.enum.DatasetEnum.DatasetEnum.Simulated",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "src.enum.DatasetEnum.DatasetEnum",
"line_... |
229818816 | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
from .items import *
import pymysql
def db_handle():
con = pymysql.connect(
host='localhost',
user='web',... | null | jump_300heroes/pipelines.py | pipelines.py | py | 1,671 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pymysql.connect",
"line_number": 13,
"usage_type": "call"
}
] |
422655793 | import cv2
import numpy as np
import random
from PIL import Image
data_1 = []
data_2 = []
for i in range(5):
img = np.zeros((500, 500, 3), np.uint8)
line = [random.randrange(0, 500, 1), random.randrange(0, 500, 1), random.randrange(0, 500, 1), random.randrange(0, 500, 1)]
cv2.line(img,(line[0], line[1]), (line[2], ... | null | mod.py | mod.py | py | 2,505 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.zeros",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "random.randrange",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.line",
"line_numb... |
339701550 | import sys
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
from django.db import router
from django.db.models import Model, Manager, QuerySet
from django.db.models.base import ModelBase, subclass_exception
from django.db.models.manager import BaseManager, ManagerDescriptor
from django.ut... | null | demo/shard/model.py | model.py | py | 8,959 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.db.models.QuerySet",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "django.db.router.db_for_write",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "django.db.router",
"line_number": 58,
"usage_type": "name"
},
{
"api_name... |
143404684 | """Fibonacci series is a series of numbers following a simple pattern where each number is a sum of
two preceding numbers
0 1 1 2 3 5 8 13 21
The series is a common pattern observed in nature, ex: Arrangement of sunflower seeds in the flower
"""
from typing import Dict, Generator
from functools import lru_cache
# cu... | null | algorithms/fibonacci.py | fibonacci.py | py | 2,014 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "typing.Dict",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "functools.lru_cache",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "typing.Generator",
"line_number": 69,
"usage_type": "call"
}
] |
465806974 | """
rawData.py contiains functions for messy data formatting, which I want to keep seperate from my model.
It collects data from Understat to produce a team performance database which is used in my fixture difficulty ratings,
and further to analyse recent xG and xA form of players compared to the teams around them.
It ... | null | src/raw_data_update.py | raw_data_update.py | py | 12,265 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "src.get_player.get_player",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "aiohttp.ClientSession",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "fpl.FPL",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "fpl.login",
... |
166780031 | import os
import logging
from logging.handlers import TimedRotatingFileHandler
BASE_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))
class LoggerManager:
"""
Logger singleton class.
"""
# Here will be the instance stored.
__logger = None
@staticmethod
def g... | null | utilities/logger.py | logger.py | py | 1,186 | 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": "os.path.join",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_nu... |
649762236 | from scipy.fftpack import fft,ifft
import matplotlib.pyplot as plt
import json
import numpy as np
import math
import os
def get_feature(data):
def find_z_is_0(content):
for frames_id in range(len(content)):
each_frame=content[frames_id]
for key_points_id in range(len(each_frame)):
... | null | select_points_without_z/get_feature_main2.py | get_feature_main2.py | py | 5,459 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "json.loads",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "numpy.set_printoptions",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "numpy.inf",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.su... |
163143166 | from common.russian_fio import TRussianFio
from declarations.sql_helpers import run_sql_script
import declarations.models as models
from common.logging_wrapper import setup_logging
from django.core.management import BaseCommand
import os
from collections import defaultdict
class Command(BaseCommand):
def __init_... | null | tools/disclosures_site/declarations/management/commands/build_surname_rank.py | build_surname_rank.py | py | 3,575 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.core.management.BaseCommand",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "common.logging_wrapper.setup_logging",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "common.russian_fio.TRussianFio",
"line_number": 17,
"usage_type":... |
88613791 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import cv2
import numpy as np
import numpy.linalg as la
import scipy.spatial.distance as spd
import pywt
import piexif
from matplotlib import pyplot as plt
def read_double_image(img_name):
img = cv2.cvtColor(cv2.imread(img_name, cv2.CV_LOAD_IMAGE_UNCHANGED), cv2.COLOR_BG... | null | python/imgprc.py | imgprc.py | py | 8,338 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cv2.cvtColor",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.CV_LOAD_IMAGE_UNCHANGED",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "cv2.COLOR_BG... |
331508331 | # -*- coding: utf-8 -*-
# file: cornernet.py
# brief: CornerNet.
# author: Zeng Zhiwei
# date: 2019/12/11
import torch
import hourglass
import cornerpool
from pool import TopPool, LeftPool, BottomPool, RightPool
class Intermediate(torch.nn.Module):
def __init__(self, in_channels, out_channels):
... | null | cornernet.py | cornernet.py | py | 9,068 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.nn",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "hourglass.Residual",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.nn.ReLU",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_n... |
207826112 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2016 DataONE
#
# Licensed under the Apache... | null | d1_libclient_python/src/d1_client/tests/test_data_package.py | test_data_package.py | py | 10,918 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "d1_common.test_case_with_url_compare.test_case_with_url_compare",
"line_number": 79,
"usage_type": "attribute"
},
{
"api_name": "d1_common.test_case_with_url_compare",
"line_number": 79,
"usage_type": "name"
},
{
"api_name": "d1_common.test_case_with_url_compare.ut... |
76599448 | import sys
from collections import deque
#sys.stdin = open('input.txt')
input = sys.stdin.readline
def bfs(visit, start):
global H, N, M
ret = 0
dz = (0, 0, 0, 0, 1, -1)
dy = (-1, 0, 1, 0, 0, 0)
dx = (0, 1, 0, -1, 0, 0)
dq = deque(start)
while dq:
z, y, x, cnt = dq.popleft()
... | null | 윤효전/211024/7569.py | 7569.py | py | 1,172 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.stdin",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 13,
"usage_type": "call"
}
] |
297937471 | import numpy as np
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
from matplotlib import cm
from scipy.integrate import odeint
from mpl_toolkits.mplot3d import Axes3D
rho = 28.0
sigma = 10
beta = 8.0 / 3.0
def f(state, t):
x, y, z = state # unpack the state vector
return sigma * (y - x... | null | Code/chaoticplot/LorenzAtt.py | LorenzAtt.py | py | 1,754 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.use",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "scipy.integrate.odeint",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "scipy.integrate.ode... |
336702311 | import json
import warnings
import numpy as np
warnings.filterwarnings("ignore")
from random import sample
from itertools import product
import itertools
from exp.misc.util import remove_duplicates
def random_search(num_searches=40, **kwargs):
"""
This implements random search for hyper-parameter search.
... | null | exp/hyp/search.py | search.py | py | 3,485 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.prod",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "exp.misc.util.remove_duplicates",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "ran... |
129297919 | from flask import Flask, render_template, url_for, request, jsonify
# from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer
import pickle
import numpy as np
app = Flask(__name__)
# Load the TF-IDF vocabulary specific to the category
with open(r"actors_vect.pkl", "rb") as f:
act = ... | null | app.py | app.py | py | 2,130 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 1... |
324561409 | # Make a nice illustration of some of the quantities of the Golden
# Mean Process over the range of the parameter p = Pr(0,A|A)
import numpy as np
from matplotlib import rc
import matplotlib.pyplot as plt
green = np.array([64, 150, 47]) / 255.
lgreen = np.array([214, 255, 178]) / 255.
lblue = np.array([178, 179, 25... | null | mahoney/source_tex/PRATISP_28jul09/image_src/gmp.py | gmp.py | py | 3,506 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.array",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 1... |
582503847 | import networkx as nx
import matplotlib.pyplot as plt
# implementation of welsh_powell algorithm for coloring the graph
def coloring_algo_welsh_powell(graph):
# sorting the nodes in descending degree
nodes_list = sorted(graph.nodes(), key=lambda x: len(graph[x]), reverse=True)
# dictionary to stor... | null | graph-coloring/coloring_graph_welsh_powell.py | coloring_graph_welsh_powell.py | py | 2,144 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "networkx.Graph",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "networkx.spring_layout",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "networkx.draw",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot... |
593681557 | # coding: utf-8
from PIL import Image
import pytesseract
import os
from bson.objectid import ObjectId
import pika
import json
import datetime as dt
import pytz
from dbal import DB
from medlang import PreTagger
from ProgressHandler import PH
class MedLangProcessor:
def __init__(self, **kwargs):
self.db... | null | inject/MedLangProcessor.py | MedLangProcessor.py | py | 5,020 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "dbal.DB",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "medlang.PreTagger",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "ProgressHandler.PH",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pika.BlockingConnection"... |
32608628 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from spectral import SpectralNorm
import numpy as np
# G(z)
class Generator_MLP(nn.Module):
# initializers
def __init__(self, batch_size=64, image_size=64, z_dim=100, mlp_dim=64, rgb_channel=3):
self.... | null | gan_models.py | gan_models.py | py | 2,664 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.nn.Module",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "spectral.SpectralNorm",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.nn.Linear",
... |
125407251 | """TODO: module docstring."""
import abc
import copy
from functools import lru_cache
import numpy as np
from numpy.lib import recfunctions as rfn
from chemex import peaks
from chemex.spindynamics import basis
from chemex.spindynamics import default
from chemex.spindynamics import util
class BaseProfile(metaclass=ab... | null | chemex/experiments/base/base_profile.py | base_profile.py | py | 6,519 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "abc.ABCMeta",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "chemex.peaks.Peak",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "chemex.peaks",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "chemex.spindynamics.u... |
277994344 | """
Sprite Module
"""
from math import degrees
from pygame.rect import Rect
from pygame.sprite import DirtySprite
from pygame.transform import rotozoom, smoothscale
from pymunk import Body, Circle
from stuntcat import resources
BALL_MASS = 1
class ShapeSprite(DirtySprite):
"""
Shape sprite class.
""... | null | stuntcat/scenes/platformer/sprite.py | sprite.py | py | 1,967 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pygame.sprite.DirtySprite",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "pygame.sprite.DirtySprite.__init__",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pygame.sprite.DirtySprite",
"line_number": 25,
"usage_type": "name"
},
{... |
387059297 | import datetime
from django.contrib.auth import get_user_model
from rest_framework import status
from rest_framework.authtoken.models import Token
from rest_framework.test import APITestCase, APIClient
from task.models import Task
User = get_user_model()
class ViewsTests(APITestCase):
@classmethod
def setU... | null | task/tests/test_views.py | test_views.py | py | 8,789 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "rest_framework.test.APITestCase",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "task.models.Task.objects.create",
"line_number": 23,
"usage_type": "ca... |
30863533 | """myweb1 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/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')
Class-based ... | null | myweb1/myweb1/urls.py | urls.py | py | 1,879 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.conf.urls.url",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 26,
"usage_type": "name"
},
{
"api_name... |
238884692 | """citoyencongolais URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/dev/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='ho... | null | citoyencongolais/urls.py | urls.py | py | 2,252 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "core.models.Element.objects.all",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "core.models.Element.objects",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "core.models.Element",
"line_number": 27,
"usage_type": "name"
},
{
... |
644642654 | from random import choice
from collections import Counter
import math
# ==========
# 定义数据集
# ==========
D = [
{'工作': '全职', '年龄': '中年', '信用等级': '优', '房子': '有', '放贷': '是'},
{'工作': '全职', '年龄': '中年', '信用等级': '中', '房子': '有', '放贷': '否'},
{'工作': '全职', '年龄': '老年', '信用等级': '良', '房子': '无', '放贷': '是'},
... | null | generate-tree.py | generate-tree.py | py | 6,736 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "random.choice",
"line_number": 91,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 99,
"usage_type": "call"
},
{
"api_name": "math.log",
"line_number": 103,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
... |
267475339 | import hashlib
from django.forms import ModelForm, CharField
from sana_pchr.models.app import App
class AppForm(ModelForm):
''' Mobile client application package '''
class Meta:
model = App
fields = [
'version',
'pkg',
]
def __init__(self, *args, **... | null | sana_pchr/forms/admin/app.py | app.py | py | 666 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "sana_pchr.models.app.App",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "hashlib.md5",
"line_number": 19,
"usage_type": "call"
}
] |
12036816 | #!/usr/bin/env python3
import h5py
import pandas as pd
import numpy as np
import geopandas as gpd
import os, sys
import time
fname = sys.argv[1]
f = h5py.File(fname, 'r')
print(list(f.keys()))
groups = [t for t in f.keys()]
print("File: %s" % (fname))
for group in groups:
if (group == 'METADATA'):
conti... | null | make_gedi_shape.py | make_gedi_shape.py | py | 8,008 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.argv",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "h5py.File",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.isfinite",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.isfinite",
"line_numb... |
603024843 | '''
Created on Oct 10, 2018
Tensorflow Implementation of Neural Graph Collaborative Filtering (NGCF) model in:
Wang Xiang et al. Neural Graph Collaborative Filtering. In SIGIR 2019.
@author: Xiang Wang (xiangwang@u.nus.edu)
version:
Parallelized sampling on CPU
C++ evaluation for top-k recommendation
'''
import os
i... | null | macr_lightgcn/LightGCN_tune.py | LightGCN_tune.py | py | 43,728 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.ConfigProto",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "tensorflow.Session",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.environ"... |
563448123 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('address', '0002_auto_20160202_1640'),
... | null | webapp/apps/accounts/migrations/0001_initial.py | 0001_initial.py | py | 5,540 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.swappable_dependency",
"line_number": 11,
"usage_type": "call... |
130183190 | import datetime
from dayangpy.api.base import BaseAPI
import dayangpy.constant as const
from dayangpy.utils import handle_args
class DaYangRank(BaseAPI):
"""
媒体榜单相关接口
"""
API_BASE_URL = "http://gateway.bigdata.cloud.dayang.com.cn:8088"
def get_hotsearch(self, site_id, classify, **kwargs):
... | null | dayangpy/api/rank.py | rank.py | py | 2,034 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "dayangpy.api.base.BaseAPI",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "dayangpy.constant.HOT_SEARCH_DICT.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "dayangpy.constant.HOT_SEARCH_DICT",
"line_number": 19,
"usage_type": "attr... |
292932358 | import sys
import os
from github import Github # GitHub: https://github.com/PyGithub/PyGithub
import token # <-- this file contains the access token for github
"""
# using username and password
g = Github("user", "password")
# or using an access token
g = Github("access_token")
"""
USERNAME = ""
PASSWORD = ""
ACCES... | null | create.py | create.py | py | 1,373 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "token.access_token",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"l... |
458906494 | ##### Filter tensorflow version warnings #####
import os
# https://stackoverflow.com/questions/40426502/is-there-a-way-to-suppress-the-messages-tensorflow-prints/40426709
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # or any {'0', '1', '2'}
import tensorflow as tf
tf.get_logger().setLevel('INFO')
tf.autograph.set_verbos... | null | stable_baselines_DQN.py | stable_baselines_DQN.py | py | 8,164 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.get_logger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "tensorflow.autograph.set_verbosity",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": ... |
354548249 | # a1 在头像上标记数字
from PIL import Image, ImageDraw, ImageFont
im = Image.open("../test1.jpg")
w, h = im.size
draw = ImageDraw.Draw(im)
# font = ImageFont.truetype('Arial.ttf', 120)
draw.text((w - 100, 50), "4", fill=(220, 20, 60))
im.save('../thumbnail.jpeg', 'jpeg')
| null | showmecode/first.py | first.py | py | 285 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "PIL.Image.open",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "PIL.ImageDraw.Draw",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "PIL.ImageDraw",
"line_nu... |
361203311 | #!/usr/bin/env python3
import os
from setuptools import setup, find_packages
this_dir = os.path.dirname(os.path.abspath(__file__))
readme_path = os.path.join(this_dir, 'README.rst')
with open(readme_path) as f:
long_description = f.read()
setup(
name='bepasty',
use_scm_version={
'write_to': '... | null | setup.py | setup.py | py | 2,184 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.dirname",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_nu... |
558090501 | # coding=utf-8
import datetime
import uuid
import bson
import pymongo
from bson import ObjectId, Binary
from pymongo.errors import DuplicateKeyError
from sources.common import ParameterMissingError, ParameterInvalidError, RecordNotFoundError, get_dict, remove_none_element
from sources.context import STATUS_NORMAL, ST... | null | sources/dao.py | dao.py | py | 24,956 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sources.context.STATUS_NORMAL",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "bson.ObjectId",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "sources.common.get_dict",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "s... |
482361676 | # -*- coding: utf-8 -*-
import slicer
import qt
import ctk
import vtk
class CapturaDeReferencias:
def __init__(self, parent):
parent.title = "Captura de Referencias - Beta"
self.parent = parent
parent.helpText = ""
self.parent = parent
class CapturaDeReferenciasWidget:
def _... | null | CapturaDeReferencias.py | CapturaDeReferencias.py | py | 4,891 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "slicer.qMRMLWidget",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "qt.QVBoxLayout",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "slicer.mrmlScene",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "ctk.ctkCollap... |
570821784 | #! /usr/bin/env python
#
# Copyright (C) 2018 Phillip Alday <phillip.alday@mpi.nl>
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copy... | null | setup.py | setup.py | py | 4,028 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.join",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number"... |
328918175 | #GUIwiki.py
import wikipedia
#python to docx
from docx import Document
def Wiki(keyword, lang='th'):
wikipedia.set_lang(lang)
# summary สำหรับบทความที่สรุป
data = wikipedia.summary(keyword)
# page + content บทความทั้งหน้า
data2 = wikipedia.page(keyword)
data2 = data2.content
... | null | GUIwiki.py | GUIwiki.py | py | 3,267 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "wikipedia.set_lang",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "wikipedia.summary",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "wikipedia.page",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "docx.Document",
... |
485884542 | # -*- coding: utf-8 -*-
# Copyright 2018 Mobicage NV
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | null | src/shop/migrations/_001_fix_services_with_excess_menu_items.py | _001_fix_services_with_excess_menu_items.py | py | 3,105 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "solutions.common.bizz.messaging.POKE_TAG_EVENTS",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "solutions.common.bizz.messaging.POKE_TAG_APPOINTMENT",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "solutions.common.bizz.messaging.POKE_TAG_ASK... |
526783026 | from pyspark import SparkContext, SparkConf
import os, string, math
import numpy as np
## Stage 1 Convert text to lower case and remove punctuations
def rm_punctuation(text):
# converted = text.encode('utf-8')
lowercased_str = text.lower().replace('--', ' ')
translator = str.maketrans('', '', string.punctu... | null | mini-query-search-engine/query_search_mapreducer_noargv.py | query_search_mapreducer_noargv.py | py | 5,718 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "string.punctuation",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "numpy.log",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_nu... |
309674159 | import matplotlib.pyplot as plt
import collections
# f = open("../results/pp_result.txt", "r")
# g = open("../results/pp_result_trimmed.txt", "w")
# current_index = 0
# results = {}
# for line in f:
# if current_index <= 16:
# current_index += 1
# continue
# columns = line.split()
# key = c... | null | plots/plot_pp.py | plot_pp.py | py | 1,023 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.ylabel",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "mat... |
443555119 | from math import pi, sqrt, copysign, atan, trunc, cos, exp # trunc - учечение до целого
from cmath import sqrt as csqrt # коплексные функции
from cmath import atan as catan
from numpy import zeros, arange # Модуль для работы с матрицами
from scipy.io import savemat, loadmat # savemat('br1.mat', mdict={'out': xb1}, ... | null | bpm.py | bpm.py | py | 16,982 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.basicConfig",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtCore.QObject",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCo... |
65253447 | import base64
import hashlib
import json
import logging
import os
import sys
import traceback
import jinja2
from jinja2 import Environment, StrictUndefined, FileSystemLoader, TemplateNotFound, TemplateError
from kluctl.utils.dict_utils import merge_dict
from kluctl.utils.yaml_utils import yaml_dump, yaml_load
logger... | null | kluctl/utils/jinja2_utils.py | jinja2_utils.py | py | 5,113 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "jinja2.Environment",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path",
"line... |
45593580 |
from sparsity import MyGraph
from graphcollections import GraphCollection
import json
raw7 = GraphCollection('raw7.json')
fvs_list = [ tuple(x['degree_sequence']) for x in raw7.data]
fvs_set = set(fvs_list)
for y in fvs_set:
x = list(y)
l = raw7.select(degree_sequence=x)
fn = "split/"+"_".join([str(i... | null | split7.py | split7.py | py | 467 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "graphcollections.GraphCollection",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 20,
"usage_type": "call"
}
] |
323222382 | from PySide2 import QtWidgets
from node_launcher.gui.components.copy_button import CopyButton
from node_launcher.gui.components.grid_layout import QGridLayout
from node_launcher.gui.components.horizontal_line import HorizontalLine
from node_launcher.gui.components.section_name import SectionName
from node_launcher.gui... | null | node_launcher/gui/network_buttons/joule_layout.py | joule_layout.py | py | 1,496 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "node_launcher.gui.components.grid_layout.QGridLayout",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "node_launcher.node_set.NodeSet",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "node_launcher.node_set.NodeSet",
"line_number": 14,
"... |
446889766 | from django import forms
from django.utils.translation import ugettext_lazy as _
from chronicles.models import Chronicle, ChronicleMember
# @@@ we should have auto slugs, even if suggested and overrideable
class ChronicleForm(forms.ModelForm):
slug = forms.SlugField(max_length=20,
help_text = _("a s... | null | apps/chronicles/forms.py | forms.py | py | 1,894 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.forms.SlugField",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.... |
139734872 | from django.shortcuts import render, HttpResponse
from time import gmtime, strftime
# Create your views here.
def index(request):
currentDateTime = strftime("%m-%d-%Y %H:%M:%S", gmtime())
context={
"currentDateTime":currentDateTime
}
return render(request, 'timedisplay/index.html', context)
| null | time_display_assignment/apps/timedisplay/views.py | views.py | py | 315 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "time.strftime",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "time.gmtime",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 12,
"usage_type": "call"
}
] |
463729851 | import discord
import json
from discord.ext import commands
from dotenv import load_dotenv
import traceback
import os
intents = discord.Intents.default()
intents.members = True
class MyBot(commands.Bot):
def __init__(self, command_prefix):
super().__init__(command_prefix, intents=intents)
for cog... | null | main.py | main.py | py | 1,491 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "discord.Intents.default",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "discord.Intents",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands.Bot",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name... |
411140828 | '''
Created on Jan 28, 2020
@author: sk199
'''
from labs.common.ConfigUtil import ConfigUtil
import logging
from labs.common import ConfigConst
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from smtpd import SMTPServer
import smtplib
class SmtpClientConnector(object):
'''
... | null | apps/project/SmtpClientConnector.py | SmtpClientConnector.py | py | 1,862 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "labs.common.ConfigUtil.ConfigUtil",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "labs.common.ConfigConst.DEFAULT_CONFIG_FILE_NAME",
"line_number": 27,
"usage_type": "attri... |
338989258 | import logging
import csv
import glob
import random
import operator
import argparse
import os
import importlib
import cachetools
import numpy
from deap import creator, base
from sklearn import preprocessing
from gp.algorithms import afpo
from gp.experiments import symbreg, fast_evaluate
from ndvi import gp_processing... | null | scripts/ml/symbolic_validate.py | symbolic_validate.py | py | 5,632 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "importlib.import_module",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "l... |
328075064 | '''Various utility functions for other modules of Votelib.
There should normally be no need to use these functions directly.
'''
import operator
import itertools
import collections
import bisect
import random
from fractions import Fraction
from typing import Any, List, Tuple, Dict, FrozenSet, Union
from numbers impor... | null | votelib/util.py | util.py | py | 3,767 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "typing.Dict",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "numbers.Number",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number"... |
652081322 | import numpy
from pandas import DataFrame
from matplotlib import pyplot
from pandas import read_excel
df = read_excel('data/시도별_월별_교통사고_20200327151519.xlsx')
print(df)
print('-' * 30)
col_list = list(df.columns)
print(col_list)
print('-' * 30)
df_traffic = df.filter(['시도별(1)','2017. 01', '2017. 02', '2017. 03', '201... | null | Python/workspace/16-Visualize/exam2.py | exam2.py | py | 2,426 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_excel",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 57,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 57,
"usage_type": "name"
},
{
"api_name": "ma... |
263843323 | __author__ = 'enricojr'
import datetime
from urlparse import urljoin
from scrapy.http import Request
from scrapy.contrib.loader.processor import Join
from news_scraper.items import NewsScraperItemLoader
from news_scraper.processors import Declutter, NormalizedJoin
from news_scraper.spiders.base import BaseSpider
cl... | null | news_scraper/spiders/eurogamer.py | eurogamer.py | py | 2,544 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "news_scraper.spiders.base.BaseSpider",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "news_scraper.items.NewsScraperItemLoader",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "scrapy.contrib.loader.processor.Join",
"line_number": 30,
"... |
161431769 | import click
import datetime
import traceback
from ckan_cloud_operator import logs
from . import manager
@click.group()
def proxy():
"""Manage the centralized db proxy"""
pass
@proxy.command()
def port_forward():
while True:
start_time = datetime.datetime.now()
try:
manager... | null | ckan_cloud_operator/providers/db/proxy/cli.py | cli.py | py | 1,950 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "click.group",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "traceback.pr... |
85747848 | from collections import defaultdict
import queue
class Graph:
def __init__(self,typeofGraph,v):
self.v = v
self.typeofGraph = typeofGraph
self.graph = defaultdict(set)
def addEdge(self,u,v):
if not self.typeofGraph:
self.graph[u].add(v)
self.graph... | null | graphTheory/BFS.py | BFS.py | py | 1,631 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.defaultdict",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "queue.Queue",
"line_number": 30,
"usage_type": "call"
}
] |
487730374 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import collections
i... | null | src/python/pants/engine/exp/scheduler.py | scheduler.py | py | 35,985 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.namedtuple",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "inspect.isclass",
"line_number": 107,
"usage_type": "call"
},
{
"api_name": "pants.... |
112376395 | import datetime
import sys
from pyspark.sql import Row
from pyspark.sql.functions import when, udf, coalesce, year, month, dayofmonth, \
date_format, lit, sum as sum_, count as count_, datediff
from pyspark.sql.types import IntegerType, DateType
from pyspark.sql.window import Window
from fraud_home.resou... | null | preprocessing/fraud_home/fecha.py | fecha.py | py | 16,248 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "fraud_home.resources.common.spark.SparkJob",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "fraud_home.resources.fraud_home.STRING.fecha_input_prediction",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "fraud_home.resources.fraud_home.STR... |
332458855 | __author__ = 'mkr'
import os
import socket
from xml.etree.ElementTree import Element
class ConfigReader:
def __init__(self, logger):
self.logger = logger
self.logger.debug("Begin")
# nothing to do here
self.logger.debug("End")
def get_qc_info(self, conf):
self.... | null | Framework/utils/CeleryRemote/config_reader.py | config_reader.py | py | 16,727 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.join",
"line_number": 249,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 249,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 264,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number"... |
82496629 | """ common API views of project """
import json
import ipdb
from rest_framework.decorators import (
api_view,
permission_classes,
)
from rest_framework.permissions import (
IsAuthenticated,
AllowAny,
)
from rest_framework.response import Response
from schema import (
Schema,
Use,
SchemaErro... | null | nikita_back/api/views.py | views.py | py | 1,106 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.contrib.sessions.models.Session.objects.get",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "django.contrib.sessions.models.Session.objects",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.sessions.models.Session",
... |
176453144 | from datetime import date
atual = date.today().year
nasc = int(input('Qual seu ano de nascimento?'))
idade = atual - nasc
print(f'Quem nasceu em {nasc} tem {idade} anos')
if idade == 18:
print('Voce precisa se alistar \033[30;41m IMEDIATAMENTE!!! \033[m')
elif idade < 18:
saldo = 18 - idade
alis = saldo ... | null | Exercicios_Python/exercicio39.1.py | exercicio39.1.py | py | 573 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.date.today",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 2,
"usage_type": "name"
}
] |
417445831 | #!/usr/bin/env python
__author__ = "David Rusk <drusk@uvic.ca>"
import argparse
from ossos.gui import tasks
from ossos.gui.app import ValidationApplication
def main():
parser = argparse.ArgumentParser()
parser.add_argument("task", choices=tasks.task_list,
help="The task to perform."... | null | src/ossos-pipeline/validate.py | validate.py | py | 559 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "ossos.gui.tasks.task_list",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "ossos.gui.tasks",
"line_number": 13,
"usage_type": "name"
},
{
"api_name":... |
117153476 | """A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
from os import path
# io.open is needed for projects that support Python 2.7
# It ensures op... | null | setup.py | setup.py | py | 2,527 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.abspath",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "io.open",
"line_number": ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.