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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
116077342 | import socket
import threading
import random
import time
from rich.console import Console
console = Console()
hostname = socket.gethostname()
print ("")
print(" _____ ")
print(" / ____| ")
print(" | (___ ___ _ ____ _____ _ __ ")
print(" \___ \ / _ \... | null | server.py | server.py | py | 2,887 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "rich.console.Console",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "socket.gethostname",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "socket.socket",
... |
538356959 | from .settings import *
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
DEBUG = False
CELERY_IMPORTS = ("social.tasks", "dashboard.tasks")
sentry_sdk.init(
dsn=os.getenv("SENTRY_DSN"),
integrations=[DjangoIntegration()],
traces_sample_rate=1.0,
send_default_pii=True,
)... | null | jobsp/settings_server.py | settings_server.py | py | 2,133 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sentry_sdk.init",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sentry_sdk.integrations.django.DjangoIntegration",
"line_number": 12,
"usage_type": "call"
}
] |
374226516 | '''
This script aims to calculate risk-acause specific PAFs
'''
import logging
import os
import pandas as pd
import xarray as xr
from fbd_core import argparse
from fbd_core.db import get_cause_id
from fbd_core.demog.draws import truncate_draws
from fbd_core.etl.transformation import resample
from utils import (get_aca... | null | scalars/calculate_pafs.py | calculate_pafs.py | py | 9,716 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "settings.INDIR_SEV.format... |
211416396 | #We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once; for example, the 5-digit number, 15234, is 1 through 5 pandigital.
#The product 7254 is unusual, as the identity, 39 × 186 = 7254, containing multiplicand, multiplier, and product is 1 through 9 pandigital.
#Find... | null | Project Euler/Complete/032_Pandigital_products.py | 032_Pandigital_products.py | py | 1,525 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "itertools.permutations",
"line_number": 27,
"usage_type": "call"
}
] |
626303969 | #! python3
# pdf_combining.py - Combines all the PDFs in the current working directory into a single PDF,
# excluding the first pages.
import PyPDF2
import os
# Get all the PDF filenames in a list.
pdf_files = []
for filename in os.listdir('.'): # alternatively 'os.scandir'
if filename.endswit... | null | pdf_combining.py | pdf_combining.py | py | 1,182 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.listdir",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "PyPDF2.PdfFileWriter",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "PyPDF2.PdfFileReader",
"line_number": 21,
"usage_type": "call"
}
] |
592143188 | # encoding: utf-8
from flask import Flask, request, abort
from linebot import (
LineBotApi, WebhookHandler
)
from linebot.exceptions import (
InvalidSignatureError
)
from linebot.models import (
MessageEvent, TextMessage, TextSendMessage,
)
import codecs
import random
#ml
import operator
import io
from ge... | null | app.py | app.py | py | 8,647 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "linebot.LineBotApi",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "linebot.WebhookHandler",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "codecs.open",
... |
298275701 | __author__ = 'http://github.com/patricjansson'
import os
def get_statuspage_page_id():
return os.environ.get('STATUSPAGE_PAGE_ID')
def get_statuspage_api_key():
return os.environ.get('STATUSPAGE_API_KEY')
def use_debug():
debug = os.environ.get('DEBUG')
if debug is None:
return True
eli... | null | modules/os_enviroment.py | os_enviroment.py | py | 1,142 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.environ.get",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_num... |
465640265 | # 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 | sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/_models_py3.py | _models_py3.py | py | 131,146 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "msrest.serialization.Model",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "msrest.serialization.Model",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "msrest.serialization.Model",
"line_number": 190,
"usage_type": "name"
},
{
... |
346795892 | import numpy as np
import scipy as sp
import matplotlib.pylab as plt
from scipy.io.wavfile import write
class SoundObj(object):
def __init__(self,Fs,dur):
self.Fcs = {"c":262.,"D":294.,"E":330.,"F":349,"G":392.,"A":440.,"B":494.}
self.Fs = Fs
self.dur = dur
self.N = int(Fs*dur)
... | null | Programing_Languages_Experiment/Lesson10/Exercise/exercise3-2.py | exercise3-2.py | py | 797 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.zeros",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.sin",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 21,
... |
362458881 | # --------------------------------------------------------
# Deep Iterative Matching Network
# Licensed under The Apache-2.0 License [see LICENSE for details]
# Written by Gu Wang, Yi Li
# --------------------------------------------------------
from __future__ import print_function, division
import sys, os
cur_dir =... | null | toolkit/TLESS_v3_6_gen_rendered_test.py | TLESS_v3_6_gen_rendered_test.py | py | 8,963 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.dirname",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.path.insert",
"l... |
481316236 | import datetime as dt
import itertools
import multiprocessing as mp
import pickle
import platform
import select
import socket
import sys
import time
from contextlib import suppress
import pytest
from mbedtls import hashlib
from mbedtls.exceptions import TLSError
from mbedtls.pk import RSA
from mbedtls.tls import *
fr... | null | tests/test_tls.py | test_tls.py | py | 26,724 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "socket.socket",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 75,
"usage_type": "attribute"
},
{
"api_name": "contextlib.suppress",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "mbedtls.excepti... |
448000301 | import scrapy
from kingfisher_scrapy.base_spider import BaseSpider
class MoldovaOld(BaseSpider):
name = 'moldova_old'
def start_requests(self):
if self.sample:
yield scrapy.Request(
url='http://opencontracting.date.gov.md/ocds-api/year/2017',
meta={'kf_fil... | null | kingfisher_scrapy/spiders/moldova_old.py | moldova_old.py | py | 1,105 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "kingfisher_scrapy.base_spider.BaseSpider",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "scrapy.Request",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "scrapy.Request",
"line_number": 17,
"usage_type": "call"
}
] |
544131025 | from flask import Blueprint, render_template, request, redirect, flash
from flask.helpers import url_for
from .importar_excel import init_long_list, init_latit_list, end_long_list, end_latit_list, distance_list, route_name, vor_name_end, vor_name_ini
from .dijkstra import shortest_path, Graph, dist_path
main = Bl... | null | app/main.py | main.py | py | 2,356 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Blueprint",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "dijkstra.Graph",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "importar_excel.vor_name_ini",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "importar_ex... |
199753306 | #!/usr/bin/python3
"""view for State objects that handles all default RestFul API actions"""
from api.v1.views import app_views
from flask import jsonify, abort, request
from models import storage as st
from models.state import State
@app_views.route('/states', strict_slashes=False,
methods=["GET", "... | null | api/v1/views/states.py | states.py | py | 1,905 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "models.storage.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "models.state.State",
"line_number": 16,
"usage_type": "argument"
},
{
"api_name": "models.storage",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "flask.reques... |
25728336 | from flask import render_template
from app import app
__author__ = 'Tyler'
@app.route('/')
@app.route('/index')
def index():
user = {'name': 'Tyler'}
posts = [
{
'username': 'Tyler Hester',
'message': 'This is a test of a post and Jinya2'
},
{
'user... | null | app/views.py | views.py | py | 473 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.render_template",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "app.app.route",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "app.app",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "app.app.route",
"line_n... |
116467656 | import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
frame=pd.read_csv("data/bouldercreek_09_2013.txt",sep='\t')
print(frame)
newframe=frame[['datetime','04_00060']]
newframe.columns=['time','stream']
newframe=newframe.iloc[1:]
print(newframe)
x,k=newframe.shape
newframe.sort_values(by=['stream'])
x=... | null | Week03/Assignment/jstoppelman_03.py | jstoppelman_03.py | py | 451 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "matplotlib.py... |
635978821 | import requests as rq
import zipfile
import os
import re
dp = lambda *x, **y: print(*x, **y)
DICT_FILE_NAME = "dict.txt"
cache = {}
def download_dict(link="http://www.gwicks.net/textlists/english3.zip", file_name="english3.txt", force=True):
if force == False:
if os.path.isfile(DICT_FILE_NAME):
... | null | main.py | main.py | py | 2,766 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.isfile",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "zipfile.ZipFile",
"line_... |
218513707 | import numpy
import os, sys, os.path, tempfile, subprocess, shutil
from distutils.core import setup
from Cython.Build import cythonize
from distutils.extension import Extension
import Cython.Compiler.Options
Cython.Compiler.Options.annotate = True
def check_for_openmp():
##Adapted from Goldbaum reply. See https://... | null | pyforces/setup.py | setup.py | py | 2,080 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "Cython.Build.Compiler",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "Cython.Build",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "tempfile.mkdtemp",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
... |
301721130 | from flask_restful import Resource, reqparse, Api
import werkzeug
from app.config import S3_LOCATION, S3_BUCKET
from botocore.exceptions import ClientError
import boto3
from boto3.dynamodb.conditions import Key
from flask import jsonify
from flask import Blueprint, request
uploads_blueprint = Blueprint("uploads", __na... | null | transcriptions-api/app/api/uploads/views.py | views.py | py | 2,980 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Blueprint",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask_restful.Api",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "boto3.resource",
"... |
453859878 | # -*- coding: utf-8 -*-
import os
import json
from pydicom.filereader import dcmread
from dival.config import CONFIG
DATA_PATH = CONFIG['lidc_idri_dival']['data_path']
FILE_LIST_FILE = os.path.join(os.path.dirname(__file__),
'lidc_idri_file_list.json')
UID_LIST_FILE = os.path.join(os.pat... | null | dival/datasets/lidc_idri_dival/create_uid_list.py | create_uid_list.py | py | 896 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "dival.config.CONFIG",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"lin... |
653688868 | '''把该项目路径添加到当前python环境项目目录里'''
from distutils.sysconfig import get_python_lib
from pathlib import Path
import os
# 项目根目录
project_path = Path(os.path.dirname((os.path.abspath(__file__))))
# pth文件目录
site_packages_path = Path(get_python_lib())
pth_path = site_packages_path / "project.pth"
if pth_path.is_file():
dat... | null | addProject.py | addProject.py | py | 717 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pathlib.Path",
"line_number": 7,
"usage_type": "call"
},
{
"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_nu... |
594694382 | # -*- coding: utf-8 -*-
r"""
插入件调谐计算
"""
import os, sys;
import matplotlib.pyplot as plt
import numpy as np
import xrt.backends.raycing as raycing
import xrt.backends.raycing.sources as rs
precisionOpenCL = 'auto'
K2B = 10.710201593926415
#%%光源参数定义
E0 = 8000
dE = E0*0.0001/2
eMin0,eMax0 = E0-dE,E0+dE
kwargs_B8 = di... | null | Simulations/XRT/BE beamline/B_K_E1_BE.py | B_K_E1_BE.py | py | 3,980 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "xrt.backends.raycing.sources.Undulator",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "xrt.backends.raycing.sources",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "numpy.linspace",
"line_number": 28,
"usage_type": "call"
},
{
... |
285101101 | import cv2
import numpy as np
# Set up library
pattern = [cv2.imread('data\\CODE\\CAP.jpg'), cv2.imread('data\\CODE\\IRON_MAN.jpg'), cv2.imread('data\\CODE\\DR_STRANGE.jpg'),
cv2.imread('data\\CODE\\BLACK_PANTHER.jpg'), cv2.imread('data\\CODE\\HULK.jpg'), cv2.imread('data\\CODE\\THOR.jpg')]
video = [cv2.Vid... | null | final_main.py | final_main.py | py | 2,990 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.imread",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_numb... |
298623447 | #!/usr/bin/python3
# print(Q_values)
# print(Q_values.shape)
# print(Q_values[0])
# print(np.argmax(Q_values[0]))
import tensorflow as tf
import tensorflow.random
import keras
import numpy as np
import gym
from collections import deque
import os
import sys
from pyboy import PyBoy
from pyboy import WindowEvent
from... | null | alternate_tetris_dl.py | alternate_tetris_dl.py | py | 7,603 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.random.seed",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.random.set_random_seed",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": ... |
122819096 | from pathlib import Path
from flask import Blueprint, jsonify, request, send_from_directory, send_file
from app import mongo
from app.models.models import Student, AbstractUser, Mentor, UserDao, College, CollegeDao, DaoFactory, Appointment, AppointmentDao, Question, Answer
users_router = Blueprint("user", __nam... | null | app/controllers/controller_users.py | controller_users.py | py | 6,163 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Blueprint",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.Blueprint",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.Blueprint",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "app.models.models.DaoFac... |
555478602 | # ecobee Edge Data Store Historian
# Python script to read ecobee data remotely for a thermostat and write the data to EDS via OMF endpoint
import json
import requests
import shelve
import time
import sys
# Initialize token shelf on first run only
#apiKey = 'API KEY'
#api_token = 'API TOKEN'
#refresh_token = 'REFRESH... | null | ecobee.py | ecobee.py | py | 10,056 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "shelve.open",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "shelve.open",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": ... |
351451827 | # -*- coding: utf-8 -*-
import unittest
from mock import patch, Mock
from prediction_model.fasttest_multi_classes.model import SpamFastTextMultiClasses
from proto import rest_api_pb2
import functools
DOC_1 = rest_api_pb2.PredictItem()
DOC_1.content = 'doc 1'
DOC_1.id = 'id 1'
DOC_2 = rest_api_pb2.PredictItem()
DOC_2... | null | prediction_model/fasttest_multi_classes/model_test.py | model_test.py | py | 4,464 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "proto.rest_api_pb2.PredictItem",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "proto.rest_api_pb2",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "proto.rest_api_pb2.PredictItem",
"line_number": 13,
"usage_type": "call"
},
{
"ap... |
118687937 | #!/usr/bin/env python3
import os
import sys
import time
import rospy
import rospkg
import threading
import numpy as np
from time import sleep
from pynput import mouse
from std_msgs.msg import String, Bool, Int16
from pioneer_motion.motion import Motion
from pioneer_motion.action import Action
from pioneer_kinematics.k... | null | PIONEER-ROBOT/pioneer_main/scripts/cross_arm/main_cross_arm.py | main_cross_arm.py | py | 23,329 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "rospy.init_node",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "rospy.loginfo",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "rospkg.RosPack",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pioneer_kinematics.kinem... |
126130051 | #!/usr/bin/python
# Copyright 2018 Google 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 by ... | null | pysc2-master/pysc2/tests/step_without_observe_test.py | step_without_observe_test.py | py | 3,584 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pysc2.env.sc2_env.AgentInterfaceFormat",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pysc2.env.sc2_env",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "pysc2.env.sc2_env.Dimensions",
"line_number": 29,
"usage_type": "call"
},
{
... |
20866149 | from PIL import Image, ImageTk
from game_pieces import PiecesFactory
class Grid:
def __init__(self, board, size, image, XY):
self.board = board
self.image = image
self._occupation = None
self.size = size
self.position = 0
self.gridXY = XY
# grid highlight i... | null | board/Grid.py | Grid.py | py | 2,674 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PIL.Image.open",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "PIL.Image.ANTIALIAS",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image",
"li... |
334723496 | # -*- coding: utf-8 -*-
"""
C2017-40
"""
import codecs
import scrapy
from carbuisness.items import EChargeItem
import time
from scrapy.conf import settings
from scrapy.mail import MailSender
import logging
import json
import re
import random
import hashlib
from hashlib import md5
from carbuisness.ge... | null | cagey/carbuisness/carbuisness/spiders/echarge.py | echarge.py | py | 5,477 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "scrapy.Spider",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "scrapy.mail.MailSender.from_settings",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "scrapy.conf.settings",
"line_number": 37,
"usage_type": "argument"
},
{
"... |
609068357 | ''''
Real Time Face Recogition
Based on original code by Anirban Kar: https://github.com/thecodacus/Face-Recognition
Developed by João Vitor Rodrigues Baptista
'''
import cv2
import numpy as np
import os
import time
from datetime import datetime
import sqlite3
from time import sleep
from PyQt4 import QtCore, Qt... | null | 3_Trabalho/Arquivos/03_facial.py | 03_facial.py | py | 25,611 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PyQt4.QtCore.QString",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "PyQt4.QtCore",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "PyQt4.QtGui.QApplication",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "... |
432554334 | import requests
filename='/s3-file-storage/logistic_regression/iris.pickle'
testData={}
testFeatures = [{'sepal_length':5.1,'sepal_width':3.5,'petal_length':1.4,'petal_width':0.2},{'sepal_length':2.1,'sepal_width':5.5,'petal_length':6.4,'petal_width':0.2}]
testFeatures=testFeatures*1
testData['payload']=testFeatures
te... | null | mlaas/additional/client2.py | client2.py | py | 498 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.post",
"line_number": 9,
"usage_type": "call"
}
] |
202388332 | """run.py
Run a single simulation specified in config.py
Example
-------
>>> python -m ambiguity.run --sim-type context --out-dir
"""
import os
from config import SIMULATIONS
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--sim-type', type=str, def... | null | ambiguity/run.py | run.py | py | 906 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "config.SIMULATIONS",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
171640032 | from PyQt5 import QtCore, QtGui, QtWidgets
import mysql.connector as connector
from PyQt5.QtGui import QFont
import sys
class Ui_Dialog3(object):
def setupUi(self, Dialog3):
Dialog3.setObjectName("Dialog3")
Dialog3.resize(1920, 1080)
self.label = QtWidgets.QLabel(Dialog3)
self.labe... | null | dialog_ui3.py | dialog_ui3.py | py | 6,931 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PyQt5.QtWidgets.QLabel",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCore.QRect",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtCor... |
405763261 | import pygame
import neat
import time
import os
import random
MIN_WIDTH = 600
MIN_HEIGHT = 800
BIRD_IMAGES = [pygame.transform.scale2x(pygame.image.load(os.path.join("img", "bird1.png"))),
pygame.transform.scale2x(pygame.image.load(os.path.join("img", "bird2.png"))),
pygame.transform.s... | null | flappy.py | flappy.py | py | 2,168 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pygame.transform.scale2x",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pygame.transform",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pyga... |
365044105 | import os
import matplotlib.pyplot as plt
import geopandas as gpd
os.chdir('/home/roizmsu/FLOW/OUT')
#os.chdir('/home/roizmsu/FLOW/DAT')
def fileReading(name):
dim = []
file = open(name, 'r')
for line in file:
dim.append(float(line))
return dim
'''
def plotting():
return
'''
... | null | flowPlot.py | flowPlot.py | py | 3,772 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.chdir",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "geopandas.read_file",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "geopandas.read_file",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.qui... |
347816868 | import warnings
warnings.filterwarnings('ignore')
import numpy as np
# 加载莺尾花数据集
from sklearn import datasets
# 导入高斯朴素贝叶斯分类器
from sklearn.naive_bayes import GaussianNB
from sklearn.model_selection import train_test_split
if __name__ == '__main__':
X, y = datasets.load_iris(return_X_y=True)
X_train, X_test, y_tra... | null | src/main/python/jiqilearning/categorica_nb/categorical_demo.py | categorical_demo.py | py | 812 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets.load_iris",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "sk... |
593873786 | import types
from pathlib import Path
import logging
import os
from groundwork.configuration.exceptions import InvalidParameter
from groundwork.configuration.config import Config
class ConfigManager:
"""
Loads different configuration files and sets their attributes as attributes of its own instance.
A c... | null | groundwork/configuration/configmanager.py | configmanager.py | py | 3,089 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "groundwork.configuration.config.Config",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": ... |
239944252 | import cv2
import csv
import pandas as pd
import numpy as np
# Parse all csv rows into `lines` list
lines = []
with open('./driving_data/driving_log.csv') as csvfile:
reader = csv.reader(csvfile)
for line in reader:
lines.append(line)
# Create lists of images and corresponding mesurements
images = []
measurements... | null | model.py | model.py | py | 1,822 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "csv.reader",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number":... |
421758298 | # -*- coding: utf-8 -*-
from __future__ import print_function
import logging
import sys
import click
from pybel_tools.ols_utils import OlsNamespaceOntology
from .run import MODULE_FUNCTION, MODULE_DOMAIN, MODULE_NAME
@click.group()
def main():
"""Uber Anatomy Ontology to BEL"""
logging.basicConfig(level=1... | null | src/bio2bel_uberon/cli.py | cli.py | py | 1,251 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.basicConfig",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "click.group",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pybel_tools.ols_utils.OlsNamespaceOntology",
"line_number": 25,
"usage_type": "call"
},
{
"api_na... |
115395752 | from django.urls import path
from . import views
urlpatterns=[
path('home',views.index,name='home'),
path('addProduct',views.addProduct,name='addProduct'),
path('addProject',views.addProject,name='addProject'),
path('displayProject',views.displayProject,name='displayProject'),
path('addSupplier',... | null | ScaffoldApp/urls.py | urls.py | py | 515 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
41193965 | from matplotlib import pyplot as plt
from flask import Flask, request
from io import StringIO
import pandas as pd
guesses_df = pd.DataFrame()
app = Flask(__name__)
def get_ax():
fig, ax = plt.subplots(figsize=(8,8))
ax.set_xlim(-8, 8)
ax.set_ylim(-8, 8)
ax.spines['left'].set_position('zero')
ax.s... | null | f20/lab8/solution.py | solution.py | py | 1,507 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.DataFrame",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "matplotlib.pypl... |
608526875 | from argparse import Namespace
import nltk
import numpy as np
import torch
from pytorch_pretrained_bert import BertConfig
from .default_args import bert_config, preprocessing_args, summarizer_args
from .models import data_loader
from .models.model_builder import Summarizer
from .prepro import data_builder
class BSu... | null | src/bertsum/bsummarizer.py | bsummarizer.py | py | 4,173 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "default_args.summarizer_args",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "default_args.preprocessing_args",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "default_args.bert_config",
"line_number": 29,
"usage_type": "name"
},
{
... |
232531067 | """
The classes contained in this module are supposed to be agnostic to recording format
and encapsulate some generic mechanisms for producing things like spike timing
autocorrelograms, power spectrum calculation and so on
"""
import numpy as np
from scipy import signal, spatial, misc, ndimage, stats, io
from scipy.si... | null | ephysiopy/common/ephys_generic.py | ephys_generic.py | py | 80,334 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.array",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "warnings.warn",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "numpy.count_nonzero",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "warnings.warn",
"li... |
158563477 | #!/usr/bin/env python3
import json, argparse, os
CONFIG_FILE_NAME = "/etc/docker/daemon.json"
JSON_TEMPLATE = {
"insecure-registries": []
}
def prepare_no_file(args):
JSON_TEMPLATE["insecure-registries"].append(args.registry)
with open(CONFIG_FILE_NAME, mode='w', encoding='UTF-8') as file:
json.... | null | scripts/registry.py | registry.py | py | 1,109 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "json.dump",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": ... |
433254462 | import time, io
def parse_fasta3(file, db):
file_handle = open('sequence.fasta','r')
for line in file_handle:
datadict = {}
if line[0] == '>':
ID, Descr = line[1:].strip().split(maxsplit = 1)
datadict['ID'] = ID
datadict['Description'] = Descr
... | null | evni/Aufgabe_9B.py | Aufgabe_9B.py | py | 1,418 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "io.StringIO",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "io.StringIO",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 24,
... |
416713682 | # -*- coding: utf-8 -*-
"""
Created on Mon May 10 13:28:41 2021
https://gist.github.com/docPhil99/ca4da12c9d6f29b9cea137b617c7b8b1
"""
from PyQt5 import QtGui, QtWidgets
from PyQt5.QtWidgets import QWidget, QApplication, QLabel, QVBoxLayout
from PyQt5.QtGui import QPixmap
import sys
import cv2
from PyQt5.QtCore impor... | null | GUI_examples/Archive/QTOpenCV_Video_AddingCntl_0.004.py | QTOpenCV_Video_AddingCntl_0.004.py | py | 9,143 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PyQt5.QtCore.QThread",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCore.pyqtSignal",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.ndarray",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "cv2.V... |
566010156 | from django.urls import path
from users.views import *
urlpatterns = [
path('signup/', SignupView.as_view(), name='signup'),
path('signin/', SigninView.as_view(), name='signin'),
path('signout/', SignoutView.as_view(), name='signout'),
path('user/profile/<int:user_id>/', UserProfileView.as_view(), name='profile'),... | null | users/urls.py | urls.py | py | 667 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
234461540 | import matplotlib.pyplot as plt
import numpy as np
def plot_binner(binner, class_labels={0: '0', 1: '1'}):
_plot_bucket_values(binner.cond_proba_buckets, title=binner.name, class_labels=class_labels)
def _plot_bucket_values(buckets, title=None, class_labels={0: '0', 1: '1'}):
class_0 = [tup[1][0] for tup in... | null | DSTK/FeatureBinning/plotting.py | plotting.py | py | 847 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.arange",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.bar",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplo... |
587439704 | import pandas as pd
from geopy.geocoders import Nominatim
# df = pd.read_csv('./telegram_gruppe/src/data/landsums.csv')
geolocator = Nominatim(user_agent='max.donheiser@correctiv.org')
cities = ['Berlin','Hamburg','Bremen','Hannover','Dortmund','Köln','Frankfurt','Stuttgart','Leipzig','Dresden','München','Nürnberg']... | null | scripts/get_coords.py | get_coords.py | py | 722 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "geopy.geocoders.Nominatim",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 22,
"usage_type": "call"
}
] |
19136610 | """
Defines a general live test network class for integration testing.
"""
from unittest import TestCase
from lnregtest.lib.network import RegtestNetwork
from lndmanage.lib.node import LndNode
from test.testing_common import (
bin_dir,
test_data_dir,
)
import logging
logger = logging.getLogger(__name__)
log... | null | test/testnetwork.py | testnetwork.py | py | 2,523 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.NullHandler",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "unittest.TestCase",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "lnregtest.lib... |
337534323 | import serial
LUMINANCE_100 = b'\x01'
LUMINANCE_75 = b'\x02'
LUMINANCE_50 = b'\x03'
LUMINANCE_25 = b'\x04'
BACKSPACE = b'\x08'
TAB = b'\x09'
LF = b'\x0a'
CLEAR = b'\x0c'
CR = b'\x0d'
NORMAL_WRITE = b'\x11'
SCROLL_WRITE = b'\x12'
CURSOR = {
'on': b'\x13',
'off': b'\x14',
'flash': b'\x15',
}
CURSOR_TYPE = {... | null | vfd/vfd.py | vfd.py | py | 1,825 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "serial.Serial",
"line_number": 32,
"usage_type": "call"
}
] |
371166987 | import requests
import bs4
from .models import Webtoon
def webtoon(day):
html = requests.get('https://comic.naver.com/webtoon/weekdayList.nhn?week=' + day)
bs_object = bs4.BeautifulSoup(html.text, 'html.parser')
webtoon_list = bs_object.find('ul', {'class': 'img_list'})
for webtoon in webtoon_list.f... | null | webtoon/webtoon/naver_webtoon.py | naver_webtoon.py | py | 910 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "models.Webtoon",
"line_number": 15,
"usage_type": "call"
}
] |
550707191 | import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.learning_curve import learning_curve
import numpy as np
import pandas as pd
from sklearn import metrics
def plot_trainingCurve(model, X, y, N=5, title=None):
'''
This function will plot the training curve. This is
useful to s... | null | exploratoryFIles/plots.py | plots.py | py | 3,565 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.axes",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "mat... |
66190109 | # -*- coding: utf-8 -*-
"""
Created on Thu Jul 5 12:44:56 2018
@author: allen
"""
######################################
#Below is code that is supposed to compute the Eulers method
#I have purposely introduced an error(s) into the code
#The Purpose of this code is to practice debugging some common errors
... | null | debugging_exercises/DB2.py | DB2.py | py | 988 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "math.exp",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 33,
"usage_type": "name"
}
] |
480664720 | # 行数をカウントせよ.確認にはwcコマンドを用いよ.
from itertools import groupby
import math
import re
import sys
with open('../hightemp.txt', 'r') as f:
print('length', len(f.readlines()))
# UNIX
# [uu146953@CA4342 language_processing02]$ wc - l ../hightemp.txt
# 24 ../hightemp.txt
print("---------------------------------")
# 11. タブ... | null | language-processing/10-19.py | 10-19.py | py | 9,407 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.sub",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "math.ceil",
"line_number": 223,
"usage_type": "call"
},
{
"api_name": "itertools.groupby",
"line_number": 297,
"usage_type": "call"
}
] |
577368200 | import discord, asyncio, re, time
print("POMODORO BOT FOR DISCORD")
print("v0.1.0 (DO NOT USE)")
print("This is still a work-in-progress.")
bot_token = "your token here"
bot_username = "your bot's account name here"
alert_channel = "the channel you want to ping users in (by ID)"
admin_users = ["your admins here"]
cli... | null | bot.py | bot.py | py | 5,476 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "discord.Client",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "discord.Object",
"line_number"... |
528531818 | # Polls Adzerk for current list of flights and saves the current targeting
# information to zookeeper (to be run periodically with upstart)
import adzerk_api
import json
from pylons import app_globals as g
KEYWORD_NODE = "/keyword-targets"
def update_global_keywords():
active_flights = adzerk_api.Flight.list... | null | reddit_adzerk/adzerkkeywords.py | adzerkkeywords.py | py | 886 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "adzerk_api.Flight.list",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "adzerk_api.Flight",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pylons.app_globals.zookeeper",
"line_number": 24,
"usage_type": "attribute"
},
{
"a... |
157605736 | #!/usr/bin/python -tt
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu May 7 04:07:23 2020
@author: DaltonGlove with credit to
"""
#import modules
import bs4 as bs
import pickle
import requests
import matplotlib.pyplot as plt
from matplotlib import style
import datetime as dt
import os
import pa... | null | sp500.py | sp500.py | py | 9,408 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "yfinance.pdr_override",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "pickle.dump",
... |
282467996 | ##############################################################################
#
# Copyright (c) 2002-2006 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# TH... | null | Products.QueueCatalog/trunk/Products/QueueCatalog/tests/test_QueueCatalog.py | test_QueueCatalog.py | py | 10,906 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "Zope2.startup",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "Testing.ZopeTestCase.base.TestCase",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "Products.ZCatalog.ZCatalog.ZCatalog",
"line_number": 35,
"usage_type": "call"
},
{
... |
305955563 | import requests
def upload_image(_url,file_path):
url = _url
files = {'file': open(file_path, 'rb'),'type':'image/jpeg'}
headers = {
'accept': 'application/json',
'Content-Type': 'multipart/form-data'
}
response = requests.request("POST", url, files=files, headers=headers)
... | null | upload.py | upload.py | py | 346 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.request",
"line_number": 10,
"usage_type": "call"
}
] |
50305466 | import requests
import click
@click.command()
@click.argument('url')
@click.argument('filename', type=click.Path())
def download_file(url, filename):
print('Downloading from {} to {}'.format(url, filename))
response = requests.get(url)
with open(filename, 'wb') as ofile:
ofile.write(response.conte... | null | src/data/download.py | download.py | py | 371 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "click.command",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "click.argument",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "click.argument",
"line_num... |
336945504 | """Camera library for scripts.
"""
import sys,re,subprocess
from lib import common
from lib.common import Common
PicPath = sys.path[0]+"\\ResourceFile\\PicComparison"
#StorePath_Media = '/storage/emulated/0/DCIM/Camera'
#StorePath_MessagePic = '/storage/emulated/0/DCIM/Message+'
camera_package = "com.tcl.camera"
camer... | null | cdmemory/MemoryLeak/lib/camera.py | camera.py | py | 14,083 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "lib.common.Common",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "lib.common.Common.__init__",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "lib.common.... |
135543885 | #!/usr/bin/env python
import argparse
from PathFinder.pathFinder import NEBPathfinder, ChgcarPotential
from pymatgen import Element
from pymatgen.io.vaspio import Poscar, Chgcar
import numpy as np
__author__ = 'Shaun Rong'
__version__ = '0.1'
__maintainer__ = 'Shaun Rong'
__email__ = 'rongzq08@gmail.com'
def f2d(fra... | null | ApproxNEB/highestChgcarPoint.py | highestChgcarPoint.py | py | 1,836 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.array",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pymatgen.io.vaspio.Poscar.from_file",
"line_number": 32,
"usage_type": "call"
},
{
"api_name"... |
96134179 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import cv2
import glob
import pickle
def pickle_data(objpoints, imgpoints):
""" Pickles the data """
print("Saving the data ...")
img = cv2.imread('camera_cal/calibration11.jpg')
img_size = (img.shape[1], img.shape[0])... | null | calibrate.py | calibrate.py | py | 2,134 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.imread",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.calibrateCamera",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pickle.dump",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_nu... |
392670369 | from unittest import TestCase
from uuid import uuid4
from feedback.environment import get_local_setting
from feedback.environment import get_port
from feedback.environment import get_secret_key
from feedback.environment import is_debug
from feedback.environment import is_deployed
from feedback.environment import parse... | null | feedback/tests/test_environment.py | test_environment.py | py | 3,269 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "unittest.TestCase",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "feedback.tests.utils.environment.set_environment_state",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "feedback.environment.variables.PORT.key",
"line_number": 24,
"us... |
519593997 | # Implements message board protocol on TCP (server-side)
# in this protocol client's can send a big messages (delivered by TCP)
# Therefore there is no need to additionally implement sessions.
#
# Also as we can now send big messages we do no need to split the
# "get last N messages" routine into 2 sub routines, like w... | null | Sem2src/TCP Application/part1/tcp/mboard/sessions/server/protocol.py | protocol.py | py | 5,344 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.basicConfig",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "socket.error... |
47220819 | import cgi, cgitb, sys, random
#http://wedi.dy.fi/matte/noppa.py
def enc_print(string='', koodaus='utf-8'):
sys.stdout.buffer.write(string.encode(koodaus) + b'\n')
cgitb.enable()
enc_print('Content-Type: text/html\n\n')
enc_print("""
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Nopan heit... | null | noppa.py | noppa.py | py | 3,580 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.stdout.buffer.write",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "cgitb.enable",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "random.randint",
... |
190678882 | # 使用IRIS数据集作为示例,将所有tensorflow的处理集合在一起
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
from sklearn import datasets
# 加载iris数据
iris = datasets.load_iris()
# target为1或0,指定是否属于数据集
target = np.array([1. if x == 0 else 0. for x in iris.target])
# 数据集中花瓣的长度和宽度
iris_2d = np.array([[x[2], x[3]] for ... | null | tensorflow cookbook/Chapter2-必要流程/6_callFlow_example.py | 6_callFlow_example.py | py | 2,507 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sklearn.datasets.load_iris",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.array",
... |
361192658 | #!/usr/bin/env python3
#
# Copyright (c) 2016-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
... | null | eden/integration/hg/branch_test.py | branch_test.py | py | 901 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "lib.hg_extension_test_base.EdenHgTestCase",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "eden.integration.lib.hgrepo.HgRepository",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "eden.integration.lib.hgrepo",
"line_number": 17,
... |
164113154 | import os
import numpy as np
import matplotlib.pyplot as plt
import time
cmd1='sequence_time_scan.py'
cmd = 'conda activate artiq-main && artiq_run ' + cmd1
print(__file__)
os.system(cmd)
time.sleep(0.1)
data = np.load('microwave.npy')
plt.figure(1)
plt.bar(data[0],data[1],width=5)
plt.title('microw... | null | Sequence/BackUp/run_sequence_time_scan.py | run_sequence_time_scan.py | py | 445 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.system",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_... |
575088274 | import random
import torch
import numpy as np
from collections import deque
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.autograd import Variable
from memory import ReplayMemory
from model import DQN
from utils import find_max_lives, check_live, get_frame, get_init_state
... | null | assignment5/agent.py | agent.py | py | 3,891 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.device",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "memory.ReplayMem... |
488267450 | #! /usr/bin/env python
"""
Module with 2d/3d plotting functions.
"""
from __future__ import division, print_function
__author__ = 'Carlos Alberto Gomez Gonzalez, O. Wertz'
__all__ = ['pp_subplots']
import numpy as np
from matplotlib.pyplot import (figure, subplot, show, colorbar, Circle, savefig,
... | null | vip_hci/var/plotting.py | plotting.py | py | 17,076 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.interp",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.interp",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.interp",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "matplotlib.cm.register_cmap",
... |
404847142 | import tensorflow as tf
import numpy as np
from tqdm import tqdm
from layer import get_token_embeddings, position_wise, multi_head_attention, label_smoothing
import common
import const
class Transformer:
def __init__(self, args):
self.args = args
self.tgt_max_len_int = 100
self.global_s... | null | coreference/model.py | model.py | py | 18,741 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tensorflow.compat.v1.train.get_or_create_global_step",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "tensorflow.compat",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.random_normal_initializer",
"line_number": 17,
"us... |
294543616 | from collections import deque
from typing import Callable, Deque, Dict, List, Optional, Tuple
from input_data import data
class Halt(Exception):
"""Intcode exception for when a halt opcode is encountered."""
pass
class IntcodeProcessor:
"""Processes Intcode instructions and provides relevant output.""... | null | day05/solution.py | solution.py | py | 5,368 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.List",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_numbe... |
258593389 | from typing import final
import cv2
import numpy as np
import dlib
from math import hypot, pow, sqrt
# CONSTANTS
ESCAPE_KEY_CODE = 27
cap = cv2.VideoCapture(0)
detector = dlib.get_frontal_face_detector()
predictor = dlib.shape_predictor("shape_predictor_68_face_landmarks.dat")
cooler_img = cv2.imread('./assets/cooler... | null | test.py | test.py | py | 3,025 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "dlib.get_frontal_face_detector",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "dlib.shape_predictor",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "... |
619342643 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import web
import time, json, urllib
from config import setting
import app_helper
db = setting.db_web
# 修改个人信息
url = ('/app/v1/personal_save')
class handler:
@app_helper.check_sign(['app_id','dev_id','ver_code','tick','session',
'nickname','headimage','imag... | null | src/app_v1/personal_save.py | personal_save.py | py | 1,996 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "config.setting.db_web",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "config.setting",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "web.header",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "web.input",
"l... |
4969133 | from discord.ext import commands
import datetime
import json
import random
import aniso8601
import discordBot
from urllib.parse import urlparse
class Youtube:
"""Youtube Related commands. Uses Youtube Data API v3."""
def __init__(self, bot):
self.bot = bot
self.youtube = discordBot.youtube
... | null | cogs/youtube.py | youtube.py | py | 13,458 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "discordBot.youtube",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands.group",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands",
"line_number": 16,
"usage_type": "name"
},
{
"api_name"... |
480458152 | import numpy as np
import multiprocessing
import os,re,sys,math,pysam
from collections import defaultdict
from baseSharedMethods import createDict
class dealBamFile():
def filterBamFile(this,bamFile):
pass
def getRegionDepth(this, Hash, chorm=None, strat=None, end=None):
RegionDepth = RegionAverageDepth = 0
... | null | lib/operationBamFile.py | operationBamFile.py | py | 7,985 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "math.isnan",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "baseSharedMethods.createDict",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pysam.depth",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "re.search",
"... |
450543458 | from django.shortcuts import render
# Create your views here.
from django.contrib import auth, messages
from account.mixins import LoginRequiredMixin
from django.views.generic.edit import FormView
from account.forms import SettingsForm
from django.utils.translation import ugettext_lazy as _
from account.models import ... | null | useraccount/views.py | views.py | py | 10,269 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "useraccount.accountService.AccountService",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "django.http.HttpResponse",
"line_number": 30,
"usage_type": "call"
},
{
"api... |
541081729 | # Copyright 2015 The TensorFlow Authors. 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 applica... | null | tf/fashion_input.py | fashion_input.py | py | 10,450 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tensorflow.read_file",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "tensorflow.image.decode_jpeg",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "tensorflow.image",
"line_number": 74,
"usage_type": "attribute"
},
{
"api_name"... |
390741619 | import numpy as np
X_min = 352000
X_max = 556000
Y_min = 3850000
Y_max = 4052000
Z_min =-5000
Z_max = 105000
#Vp = 14; Vs = 15; Rho = 16
VpVsRho = np.loadtxt("input_files/Ridgecrest_cvms1000", usecols=[14,15,16])
print('done reading ascii Ridgecrest_cvms1000')
nx=205
ny=203
nz=111
VpVsRho = VpVsRho.reshape((nz,ny,nx... | null | generate_ASAGI_files/generate_RhoMuLambdaQpQs_cvms1000.py | generate_RhoMuLambdaQpQs_cvms1000.py | py | 4,079 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.loadtxt",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.cumsum",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_nu... |
590097571 | from gensim.models import Word2Vec
import codecs
def train_embed(train_file, set_vocab, n_embed):
textlist = [['<unk>'], ["<s>"], ["</s>"]]
wordlist = set()
with codecs.open(train_file, "r", encoding="utf-8") as fp:
for l in fp:
for word in l.split(" ")[:-1]:
wordlist.a... | null | generator/train_embed.py | train_embed.py | py | 626 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "codecs.open",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "gensim.models.Word2Vec",
"line_number": 17,
"usage_type": "call"
}
] |
569903961 | import calendar
from datetime import datetime, time, timedelta
from functools import reduce
import operator
import pytz
from django.conf import settings
from django.db.models import Q
from django.utils import timezone
from events.utils import categories
cities = {
'hanoi': 'Hanoi',
'saigon': 'Ho Chi Minh Ci... | null | anchoi/tonight/utils.py | utils.py | py | 2,008 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.settings.TIME_ZONE",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "pytz.timezone",
"line_number": 23,
"usage_type": "call"
},
{
"api_name":... |
132184724 | from django.conf.urls import include, patterns, url
from django.views.generic import TemplateView
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns(
'',
url(r'^$', 'photoplanet.views.home', name='home'),
url(
r'^all... | null | photoplanet/photoplanet/urls.py | urls.py | py | 464 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.urls.patterns",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "dj... |
598090829 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# проблема с low_memory
data = pd.read_csv('my_chains.csv', low_memory=False)
df = pd.DataFrame(data,columns = ['graph','length'])
"""
на вход принимает кол-во строк и колонок для графиков, список г... | null | dataset/plot_chains.py | plot_chains.py | py | 1,092 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.rcPa... |
502381444 | """project URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.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')
Cla... | null | project/urls.py | urls.py | py | 1,644 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.urls.path",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "... |
25229676 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 14 10:38:15 2020
@author: nooteboom
"""
import numpy as np
import shapefile
if(__name__=='__main__'):
Ma = 38 # Million years ago
DirR = '' + 'sitelocs/reconstructed_%dMa.shp'%(Ma)# # Where the file is written + name of file
sf = shape... | null | Tplots/SST_global/read_shp_write_npy.py | read_shp_write_npy.py | py | 937 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "shapefile.Reader",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_numb... |
646537870 | # coding=utf-8
from __future__ import absolute_import
from django.conf.urls import url
from django.conf.urls.i18n import i18n_patterns
from excursions.views import MainPageView, CategoryView, ExcursionItemView, ExcursionGalleryItemView, \
ExcursionGalleryIndexView, ExcursionRemoveView, ExcursionCategoryRemoveView,... | null | apps/excursions/urls/excursions.py | excursions.py | py | 3,721 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.urls.url",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "excursions.views.ajax",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "excursions.views",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "djan... |
348073153 | import os
import sys
import datetime
import numpy as np
import pandas as pd
from mxnet import autograd
from mxnet import gluon
from mxnet import image
from mxnet import init
from mxnet import nd
from mxnet.gluon.data import vision
sys.path.append('..')
import utils
from utils import transform_train, transform_test
f... | null | kaggle/cifar-10/test_ensemble.py | test_ensemble.py | py | 2,056 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_numb... |
539990596 | from flask import jsonify, request
from flask_restful import Resource
import json
from pony import orm
from models.genre import Genre
class GenreAPI(Resource):
@orm.db_session
def get(self, id):
try:
if not Genre.exists(lambda genre: genre.id == int(id)):
return None, 404
... | null | resources/genre.py | genre.py | py | 1,207 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask_restful.Resource",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "models.genre.Genre.exists",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "models.genre.Genre",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "fl... |
62266709 | import tflearn
from tflearn.data_utils import shuffle
from tflearn.layers.core import input_data, dropout, fully_connected
from tflearn.layers.conv import conv_2d, max_pool_2d
from tflearn.layers.normalization import batch_normalization
from tflearn.layers.estimator import regression
from tflearn.data_preprocessing imp... | null | accuracy.py | accuracy.py | py | 2,451 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "h5py.File",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "tflearn.data_preprocessing.DataPreprocessing",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "tflearn.data_augmentation.ImageAugmentation",
"line_number": 23,
"usage_type": "ca... |
216571129 | import os, datetime
directory = r'Games\\'
if not os.path.exists(directory):
print('Games folder created!')
os.makedirs(directory)
data = []
for file in os.listdir(directory):
f = open(directory + file, 'r')
for line in [line.split(',') for line in f.readlines()][4:]:
data.append(line + [file[:f... | null | Allstar Footy Analyser.py | Allstar Footy Analyser.py | py | 4,320 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.exists",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": ... |
310950020 | import sqlite3
def create_db():
import sqlite3
conn = sqlite3.connect("lab.db")
cur = conn.cursor()
table_create_sql = """Create table IF Not exists todo (
id integer primary key autoincrement,
category text not null,
what text not null,
... | null | TEAM.py | TEAM.py | py | 3,165 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sqlite3.connect",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
... |
141541906 | from django.shortcuts import render, redirect, get_object_or_404
from forum.models import Topic, Post
from forum.forms import TopicForm, PostForm
from django.utils import timezone
from django.http import Http404
from django.contrib.auth.decorators import login_required
def index(request):
topics = Topic.objects.or... | null | forum/views.py | views.py | py | 3,291 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "forum.models.Topic.objects.order_by",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "forum.models.Topic.objects",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "forum.models.Topic",
"line_number": 9,
"usage_type": "name"
},
{
... |
152279034 | from ethereum.tools import tester as t
from ethereum import utils, common, transactions, abi
from casper_initiating_transactions import mk_initializers, casper_config, \
viper_rlp_decoder_address, sig_hasher_address, purity_checker_address, casper_abi, purity_checker_abi
from viper import compiler
import serpent
fr... | null | casper/contracts/visual_casper_tester.py | visual_casper_tester.py | py | 14,624 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "ethereum.utils.int_to_addr",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "ethereum.utils",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "ethereum.tools.tester.a0",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name"... |
455328612 | # importing module
import logging
# Create and configure logger
logging.basicConfig(filename="log_teste.log",
format='%(asctime)s %(message)s',
filemode='w')
#Creating an object
logger=logging.getLogger()
#Setting the threshold of logger to DEBUG
logger.setLevel(logging.DEBUG)
... | null | teste_log.py | teste_log.py | py | 360 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.basicConfig",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 11,
"usage_type": "attribute"
}
] |
213085294 | import pickle
import numpy as np
import matplotlib.pyplot as plt
def fig_ctr(fout_name: str, ctrs: np.array, bins=100):
""" 広告のCTRのヒストグラムを作図する。
"""
plt.figure()
plt.hist(ctrs, bins=bins)
plt.savefig(fout_name)
def fig_rewards(fout_name: str, rewards: np.array, t_max: int, points_in_bin=10):
"... | null | draw.py | draw.py | py | 1,815 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.array",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "matplotlib.p... |
108058754 | import pytest
from datetime import datetime
pytestmark = [
pytest.mark.django_db,
pytest.mark.freeze_time('2032-12-01 15:30'),
]
def test_works(order):
assert order.paid is None
order.set_paid()
order.refresh_from_db()
assert order.paid == datetime(2032, 12, 1, 15, 30)
assert order.stud... | null | src/orders/tests/order_shipping/tests_order_set_paid.py | tests_order_set_paid.py | py | 1,907 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pytest.mark",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "pytest.mark.freeze_time",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "datetime.datet... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.