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
630445238
from django.shortcuts import render from django.contrib.auth.models import User from rest_framework import (generics, status) from .serializers import ( RegisterSerializer, UserProfileSerializer, CustomTokenObtainPairSerializer, UserDiseaseHistorySerializer, UpdateUserSerializer) from .models import...
null
account/views.py
views.py
py
3,696
python
en
code
null
code-starcoder2
66
[ { "api_name": "rest_framework_simplejwt.views.TokenObtainPairView", "line_number": 19, "usage_type": "name" }, { "api_name": "rest_framework.decorators.permission_classes", "line_number": 20, "usage_type": "name" }, { "api_name": "rest_framework.permissions.AllowAny", "line_n...
201022000
from __future__ import absolute_import from __future__ import division from __future__ import print_function import math import os import random import sys import time import logging import numpy as np from six.moves import xrange # pylint: disable=redefined-builtin import tensorflow as tf from bleu import BLEU impor...
null
model/QA.py
QA.py
py
18,343
python
en
code
null
code-starcoder2
66
[ { "api_name": "tensorflow.app.flags.DEFINE_float", "line_number": 19, "usage_type": "call" }, { "api_name": "tensorflow.app", "line_number": 19, "usage_type": "attribute" }, { "api_name": "tensorflow.app.flags.DEFINE_float", "line_number": 20, "usage_type": "call" }, ...
16139996
import paramiko import threading import socket import sys import traceback import re import os class ParamikoServer(paramiko.ServerInterface): def __init__(self, keys_directory, authorized_keys_file): self._event = threading.Event() self._keys_directory = keys_directory self._authorized_key...
null
client/ssh_server.py
ssh_server.py
py
5,911
python
en
code
null
code-starcoder2
66
[ { "api_name": "paramiko.ServerInterface", "line_number": 9, "usage_type": "attribute" }, { "api_name": "threading.Event", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", ...
383659183
#!/usr/bin/env python # encoding: utf-8 """ @Author: yangwenhao @Contact: 874681044@qq.com @Software: PyCharm @File: make_feat.py @Time: 2020/4/1 11:25 AM @Overview: """ from __future__ import print_function import argparse import os import shutil import sys import time from multiprocessing import Pool, Manager imp...
null
Process_Data/Compute_Feat/make_feat.py
make_feat.py
py
13,834
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 82, "usage_type": "call" }, { "api_name": "os.path", "line_number": 82, "usage_type": "attribute" }, { "api_name": "os.path.join", ...
106130241
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- import nu...
null
onnxmltools/convert/keras/operator_converters/LSTM.py
LSTM.py
py
6,183
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.empty", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.empty", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 43, "usage_type": "call" }, { "api_name": "common._apply_operation.apply_res...
327514325
# encoding: utf-8 from flask import Flask, request, abort import urllib2 import re import yaml from bs4 import BeautifulSoup import xml.etree.ElementTree as ET from linebot import ( LineBotApi, WebhookHandler ) from linebot.exceptions import ( InvalidSignatureError ) from linebot.models import ( Messag...
null
app.py
app.py
py
3,417
python
en
code
null
code-starcoder2
66
[ { "api_name": "yaml.load", "line_number": 26, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 28, "usage_type": "call" }, { "api_name": "linebot.LineBotApi", "line_number": 30, "usage_type": "call" }, { "api_name": "linebot.WebhookHandler", ...
580410290
import sys sys.setrecursionlimit(1000000) from sys import exc_info from os import path import json import logging import datetime from traceback import format_exc from time import time from urllib3.exceptions import * from asyncio import sleep as async_sleep from asyncstdlib import anext from bitcoin.wallet import P2P...
null
yadacoin/core/consensus.py
consensus.py
py
16,099
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.setrecursionlimit", "line_number": 2, "usage_type": "call" }, { "api_name": "yadacoin.core.chain.CHAIN.MAX_TARGET", "line_number": 40, "usage_type": "attribute" }, { "api_name": "yadacoin.core.chain.CHAIN", "line_number": 40, "usage_type": "name" }, ...
202144244
# Run 'discoronode.py' program to start processes to execute # computations sent by this client, along with this program. # Distributed computing example where this client sends computation to # remote discoro process to run as remote coroutines. At any time at # most one computation coroutine is scheduled at a proces...
null
examples/discoro_client2.py
discoro_client2.py
py
4,346
python
en
code
null
code-starcoder2
66
[ { "api_name": "asyncoro.disasyncoro.MonitorException", "line_number": 51, "usage_type": "attribute" }, { "api_name": "asyncoro.disasyncoro", "line_number": 51, "usage_type": "name" }, { "api_name": "asyncoro.disasyncoro.httpd.HTTPServer", "line_number": 62, "usage_type": ...
455960182
# -*- coding : utf-8 -*- from openpyxl import Workbook import os if os.path.isdir == 'data': os.mkdir('data') os.chdir('data') wb = Workbook() ws = wb.active ws['A1'] = 'Hello, World' sheet = 'Test sheet' ws2 = wb.create_sheet(1, sheet) ws2['A1'] = 100 wb.save('test2.xlsx')
null
Study_from_Windows/openpyxl/openpyxl_prac2.py
openpyxl_prac2.py
py
296
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_number": 6, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": 7, "usage_type": "call" }, { "api_name": "openpyxl.Workbook", "line_number": 9,...
413436269
#!/usr/bin/env python3 # -*- coding:utf-8 -*- """ 準備一些環境 以main運行,將: 讀取設定檔 構建必要的資料庫和錶結構 存入管理員用戶配寘 存入初始化數據 對應的配寘、增改數據等請參照注釋調整常數定義 關於資料檔案: 資料檔案必須按格式書寫 數據檔案格式要求: 1. csv格式,對應表的每個欄位都需要體現,即使該欄位沒有值,也應該留空 2.數據以英文分號分隔,無文本標記 3.資料檔案不包含標題 3.例:1;1;2;;5;1 關於初始化清單: 定義在常數datas中,...
null
preenv.py
preenv.py
py
11,246
python
en
code
null
code-starcoder2
66
[ { "api_name": "configparser.ConfigParser", "line_number": 107, "usage_type": "call" }, { "api_name": "MySQLdb.connect", "line_number": 119, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 171, "usage_type": "call" }, { "api_name": "os.path",...
217193061
import os import glob from pymatgen.core.structure import Structure from pymatgen.symmetry.analyzer import SpacegroupAnalyzer module_dir = os.path.join(os.path.dirname(os.path.abspath(__file__))) find_structure = glob.glob(os.path.join(module_dir, "clus", "Al1H10O5"+"*")) #print(find_structure) s = Structure.from_fil...
null
test_structures/es.py
es.py
py
582
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.join", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_nu...
201674138
import os from migrate import exceptions as versioning_exceptions from migrate.versioning import api as versioning_api from migrate.versioning.repository import Repository from oslo_db.sqlalchemy import utils as db_utils from oslo_log import log as logging import sqlalchemy from sqlalchemy.sql import null from mgmt.d...
null
exec_srvc/db/sqlalchemy/migration.py
migration.py
py
2,839
python
en
code
null
code-starcoder2
66
[ { "api_name": "mgmt.db.sqlalchemy.api.get_api_engine", "line_number": 20, "usage_type": "call" }, { "api_name": "mgmt.db.sqlalchemy.api", "line_number": 20, "usage_type": "name" }, { "api_name": "migrate.versioning.api.upgrade", "line_number": 33, "usage_type": "call" }...
578950631
# -*- coding: utf-8 -*- """ spider.wechat.py ~~~~~~~~~~~~~~ :copyright:... """ import datetime import json import logging import requests # 测试号 appid = "wx23d964155e171297" secret = "80d5b0a1ba016ea4e5d7c436f42b96be" values = {'grant_type': 'client_credential', 'appid': appid, 'secret'...
null
spider/wechat.py
wechat.py
py
2,271
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 23, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 24, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 24, "usage_type": "attribute" }, { "api_name": "reques...
35174295
''' ICLR RocketPy - Frontend Maintained by Raihaan Usman The face of RocketPy! Uses Flask and Streamlit to provide a web interface for the RocketPy workflow. Full usage notes are available at https://rpycore.readthedocs.io/en/latest/ ''' from flask import Flask, render_template, request, jsonify # The nic...
null
rpycore/RocketPy.py
RocketPy.py
py
1,316
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 17, "usage_type": "call" }, { "api_name": "streamlit.already_started_server", "line_number": 23, "usage_type": "attribute" }, { "api_name": "streamlit.write", "line_number": 25, "usage_type": "call" }, { "api_name": "fla...
106166422
from django.shortcuts import render from .forms import SignUpForm def home(request): if request.user.is_authenticated(): title = 'Welcome, {}'.format(request.user) else: title = 'Welcome' # if request.method == "POST": # print(request.POST) form = SignUpForm(request.POST or ...
null
newsletter/views.py
views.py
py
835
python
en
code
null
code-starcoder2
66
[ { "api_name": "forms.SignUpForm", "line_number": 15, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 37, "usage_type": "call" } ]
182853905
import argparse import argcomplete def register_merge_parser(subparsers): merge_parser = subparsers.add_parser('merge', help='Merge current branch in main branch, generating changelog, with a nice message') def register_commit_parser(subparsers): commit_parser = subparsers.add_parser('commit', help='Create a...
null
tmsgit/__main__.py
__main__.py
py
3,029
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 38, "usage_type": "call" }, { "api_name": "argcomplete.autocomplete", "line_number": 50, "usage_type": "call" }, { "api_name": "commands.create_branch", "line_number": 65, "usage_type": "call" }, { "api_name"...
152578382
import numpy as np from numpy.linalg import norm from numpy.fft import fft, ifft from sklearn.metrics import silhouette_score as _silhouette_score def sbd(x, y): ncc = _ncc_c(x, y) idx = ncc.argmax() dist = 1 - ncc[idx] if dist < 0: return 0 else: return dist def _ncc_c(x, y): ...
null
causal-discovery/clustering/sbd.py
sbd.py
py
997
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.array", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.linalg.norm", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.Inf", "line_number": 17, "usage_type": "attribute" }, { "api_name": "numpy.fft.ifft", "li...
617487137
# SVM and Random Forest # Team Project from sklearn_pandas import DataFrameMapper import numpy as np import pandas as pd import re import matplotlib.pyplot as plt from nltk.corpus import stopwords from sklearn.model_selection import train_test_split from sklearn.feature_extraction.text import CountVectorizer import sc...
null
main.py
main.py
py
4,417
python
en
code
null
code-starcoder2
66
[ { "api_name": "nltk.stem.PorterStemmer", "line_number": 20, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 44, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 47, "usage_type": "call" }, { "api_name": "re.search", "line_number": ...
578868046
#!/usr/bin/env python # encoding: utf-8 """Migrate files to correct container. Note: Must use Rackspace credentials with access to both test and production containers. Note: Must have pyrax installed to run. Run dry run: python -m scripts.migrate_cloudfiles_container dry Run migration: python -m scripts.migrate_cloudf...
null
scripts/migrate_cloudfiles_container.py
migrate_cloudfiles_container.py
py
4,065
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 34, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 35, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 35, "usage_type": "attribute" }, { "api_name": "modularodm.Q"...
456410219
import os import sys import logging import argparse import configure logger = logging.getLogger(__name__) class Config(object): """ Usage: config = Config() print config['acme/proxy/https'] """ def __init__(self): try: self.__config = configure.Configuration.from_file( ...
null
acme/tools/config.py
config.py
py
1,514
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "configure.Configuration.from_file", "line_number": 21, "usage_type": "call" }, { "api_name": "configure.Configuration", "line_number": 21, "usage_type": "attribute" }, { "a...
591721952
''' Manages the mute command. Last update: 30/04/19 ''' # Dependancies import discord, asyncio, time from discord.ext import commands from discord.ext.commands import Cog from discord.utils import get from cogs.utils.translation.translation import Translator from cogs.utils.functions.auto_mod.perm_overwrite import Mu...
null
cogs/commands/mute.py
mute.py
py
5,276
python
en
code
null
code-starcoder2
66
[ { "api_name": "discord.ext.commands.Cog", "line_number": 20, "usage_type": "name" }, { "api_name": "discord.Member", "line_number": 27, "usage_type": "attribute" }, { "api_name": "cogs.utils.translation.translation.Translator", "line_number": 33, "usage_type": "call" },...
440538908
import click import yaml import yamlordereddictloader import os from datetime import datetime, timedelta def echo_success(msg): click.echo(click.style(msg, fg='green')) def echo_error(msg): click.echo(click.style(msg, fg='red')) def echo_skip(msg): click.echo(click.style(msg, fg='cyan')) def update_...
null
utils/utils.py
utils.py
py
1,401
python
en
code
null
code-starcoder2
66
[ { "api_name": "click.echo", "line_number": 9, "usage_type": "call" }, { "api_name": "click.style", "line_number": 9, "usage_type": "call" }, { "api_name": "click.echo", "line_number": 13, "usage_type": "call" }, { "api_name": "click.style", "line_number": 13, ...
653934355
import pandas as pd from collections import Counter movies = pd.read_csv("movies.csv") # Extract column year movies["year"] = movies["title"].apply(lambda x: x[-5:-1]) # Select movie in year 1995 movies_1995 = movies[movies.year == '1930'] pd.options.mode.chained_assignment = None # See this https://stackoverflow.c...
null
pandas-lib/2.py
2.py
py
858
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 4, "usage_type": "call" }, { "api_name": "pandas.options", "line_number": 12, "usage_type": "attribute" }, { "api_name": "collections.Counter", "line_number": 27, "usage_type": "call" } ]
555371143
# -*- coding: utf-8 -*- # BUG1989 is pleased to support the open source community by supporting ncnn available. # # Copyright (C) 2019 BUG1989. All rights reserved. # # 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 t...
null
quan_table/dcp/sq_finetune_2/utils/quant_net.py
quant_net.py
py
3,724
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.nn.Module", "line_number": 33, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 33, "usage_type": "name" }, { "api_name": "dcp.sq_finetune.utils.quant_op.quantize_data", "line_number": 51, "usage_type": "call" }, { "api_na...
74930404
# coding: utf-8 # In[ ]: import requests # In[ ]: from bs4 import BeautifulSoup # In[17]: request = requests.get('https://www.amazon.com/PlayStation-Slim-1TB-Console-Bundle-4/dp/B07YLDNTKB/ref=sr_1_1?fst=as%3Aoff&pf_rd_i=16225016011&pf_rd_m=ATVPDKIKX0DER&pf_rd_p=03b28c2c-71e9-4947-aa06-f8b5dc8bf880&pf_rd_r=...
null
Untitled24 (1).py
Untitled24 (1).py
py
774
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 19, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 21, "usage_type": "call" } ]
479265236
# code in this file is created by Vishwas from django.http import HttpResponse from django.shortcuts import render def index(request): # para = {'name':'vishwas', 'place':'mumbai'} # return HttpResponse('''<h1>Hello Vishwaschandra</h1> <a href='https://www.flanoyinfotech.com/' target="blank">Flanoy Infotech</a...
null
djangosite/views.py
views.py
py
2,859
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.shortcuts.render", "line_number": 8, "usage_type": "call" }, { "api_name": "django.http.HttpResponse", "line_number": 67, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 69, "usage_type": "call" } ]
301810678
from flask import Flask from flask_sock import Sock import time app = Flask(__name__) sock = Sock(app) i = 0 @sock.route('/reverse') def reverse(ws): while True: # text = ws.receive() # ws.send(text[::-1]) time.sleep(3) i += 1 ws.send(1) if __name__ == '__main__': ...
null
.history/ws_20210607171026.py
ws_20210607171026.py
py
343
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask_sock.Sock", "line_number": 6, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 14, "usage_type": "call" } ]
267469407
import json from collections import Counter from datetime import datetime import redis from pytz import timezone from flask import Flask, jsonify import requests import os from flask_cors import CORS from redis import Redis app = Flask(__name__) CORS(app) def init_redis(): # localhost:6379 return redis.St...
null
backend.py
backend.py
py
4,338
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 15, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 16, "usage_type": "call" }, { "api_name": "redis.StrictRedis.from_url", "line_number": 21, "usage_type": "call" }, { "api_name": "redis.StrictRe...
442213319
import pygame import time ########## Initialize Pygame ########## pygame.init() pygame.font.init() ########## Set Initial Values ########## screenwidth = 600 screenheight = 300 size = (screenwidth,screenheight) screen = pygame.display.set_mode(size) bgcolor = (255,255,255) pygame.display.set_caption("Moving ...
null
6_1_player_ball_movement.py
6_1_player_ball_movement.py
py
2,914
python
en
code
null
code-starcoder2
66
[ { "api_name": "pygame.init", "line_number": 4, "usage_type": "call" }, { "api_name": "pygame.font.init", "line_number": 5, "usage_type": "call" }, { "api_name": "pygame.font", "line_number": 5, "usage_type": "attribute" }, { "api_name": "pygame.display.set_mode", ...
95299856
import numpy as np import matplotlib.pyplot as plt import cs231n.classifiers.linear_classifier as linear_classifier from cs231n.classifiers.data_util import init_train_data from cs231n.classifiers.data_util import init_train_feature_data def svm(normal = True): if(normal): x_train , y_train , x_val , y_val...
null
cs231n/classifiers/init.py
init.py
py
2,286
python
en
code
null
code-starcoder2
66
[ { "api_name": "cs231n.classifiers.data_util.init_train_data", "line_number": 9, "usage_type": "call" }, { "api_name": "cs231n.classifiers.data_util.init_train_feature_data", "line_number": 11, "usage_type": "call" }, { "api_name": "cs231n.classifiers.linear_classifier.LinearSVM",...
93947431
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Feb 26 10:58:48 2020 @author: danbiderman """ import copy import aesmc # note: imported from package import numpy as np import torch import torch.nn as nn import torch.nn.functional as F class Initial: # distribution for latents at t=0 def __init...
null
test/arm_models/moving_obj_1D.py
moving_obj_1D.py
py
16,846
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.distributions.Normal", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.distributions", "line_number": 23, "usage_type": "attribute" }, { "api_name": "torch.nn.Module", "line_number": 26, "usage_type": "attribute" }, { "api_name...
32020751
import hashlib from jinja2 import Template from django.core.mail import send_mail from multiprocessing import Process from threading import Thread class QueueThread(Thread): def run(self): while len(MessageQueue.queue) > 0: MessageQueue.queue[0].start() MessageQueue.queue[0].join(...
null
Solutions/Task3/853506_Karpyza_Andrey/DjangoChat/MessageProcessing.py
MessageProcessing.py
py
1,621
python
en
code
null
code-starcoder2
66
[ { "api_name": "threading.Thread", "line_number": 8, "usage_type": "name" }, { "api_name": "jinja2.Template", "line_number": 18, "usage_type": "call" }, { "api_name": "hashlib.sha1", "line_number": 29, "usage_type": "call" }, { "api_name": "multiprocessing.Process"...
185092424
# imports ############################################################# import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import numpy as np from Bio import SeqIO import plotly.plotly as py import plotly.graph_objs as go # load and manipulate dataframe ##########################################...
null
sequence_analysis/prelim_fitness.py
prelim_fitness.py
py
3,083
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.NaN", "line_number": 22, "usage_type": "attribute" }, { "api_name": "numpy.NaN", "line_number": 26, "usage_type": "attribute" }, { "api_name": "Bio.SeqIO.read", "l...
596558795
import pygame import os from settings import settings from settings.enums import Colors, BiomesTypes import math class DisplayManager: def __init__(self): self.screen = None self._negativImgs = {} self._imgs = {} self._baseH = 0 def init(self): self.flags = pygame.DO...
null
modules/displayManager.py
displayManager.py
py
3,066
python
en
code
null
code-starcoder2
66
[ { "api_name": "pygame.DOUBLEBUF", "line_number": 18, "usage_type": "attribute" }, { "api_name": "pygame.display.init", "line_number": 19, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 19, "usage_type": "attribute" }, { "api_name": "setting...
606370776
# -*- coding: utf-8 -*- import os import time from fabric.api import local, run, cd from fabric import colors from fabric.context_managers import settings from fabric.contrib.console import confirm from fabric.contrib import django from fabric.contrib.files import exists from fabric.utils import abort from fabric.oper...
null
django_fabric/base.py
base.py
py
6,326
python
en
code
null
code-starcoder2
66
[ { "api_name": "fabric.contrib.django.project", "line_number": 42, "usage_type": "call" }, { "api_name": "fabric.contrib.django", "line_number": 42, "usage_type": "name" }, { "api_name": "fabric.api.run", "line_number": 45, "usage_type": "call" }, { "api_name": "fa...
50191612
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html from scrapy.exceptions import DropItem class BookPipeline(object): review_rating_map = { 'One': '1/5', 'Tw...
null
toscrape_book/toscrape_book/pipelines.py
pipelines.py
py
850
python
en
code
null
code-starcoder2
66
[ { "api_name": "scrapy.exceptions.DropItem", "line_number": 25, "usage_type": "call" } ]
47854336
import re import struct from hashlib import sha256 from io import BytesIO from typing import Callable, Dict, Optional, cast from zipfile import ZipFile import chardet # type: ignore import magic as pymagic # type: ignore from karton.core import Config, Karton, Task from karton.core.backend import KartonBackend from...
null
karton/classifier/classifier.py
classifier.py
py
21,321
python
en
code
null
code-starcoder2
66
[ { "api_name": "zipfile.ZipFile", "line_number": 17, "usage_type": "call" }, { "api_name": "io.BytesIO", "line_number": 17, "usage_type": "call" }, { "api_name": "zipfile.filelist", "line_number": 19, "usage_type": "attribute" }, { "api_name": "typing.Optional", ...
563987021
from datetime import datetime from jedi.libs.cache.redis import rd from jedi.libs.cache.redis import ZRANGEBYSCORE_MAX from jedi.libs.mq.consts import WorkerSignal from jedi.libs.db.store import db from jedi.libs.sentry.client import client from jedi.libs.course import get_all_lesson_ids from jedi.libs.course import ...
null
jedi/jedi/models/learningprogress/scheduler.py
scheduler.py
py
6,973
python
en
code
null
code-starcoder2
66
[ { "api_name": "jedi.libs.cache.redis.rd.delete", "line_number": 42, "usage_type": "call" }, { "api_name": "jedi.libs.cache.redis.rd", "line_number": 42, "usage_type": "name" }, { "api_name": "jedi.libs.cache.redis.rd.zcard", "line_number": 49, "usage_type": "call" }, ...
316926878
import graphene from graphene_django import DjangoObjectType from graphql_api import models class User(DjangoObjectType): class Meta: model = models.User class Post(DjangoObjectType): class Meta: model = models.Post class UserInput(graphene.InputObjectType): name = graphene.String() clas...
null
social_media_graphql_api/schema.py
schema.py
py
2,191
python
en
code
null
code-starcoder2
66
[ { "api_name": "graphene_django.DjangoObjectType", "line_number": 5, "usage_type": "name" }, { "api_name": "graphql_api.models.User", "line_number": 7, "usage_type": "attribute" }, { "api_name": "graphql_api.models", "line_number": 7, "usage_type": "name" }, { "api...
221019081
import logging from pyppeteer import launch from sites.base import BaseSite from sites.glasswall import Glasswallsolutions from helper import Helper log = logging.getLogger("GW:traffic_g") class TrafficGenerator: Allowed_Sites = {"glasswallsolutions.com": Glasswallsolutions} @staticmethod def get_site(...
null
upwork-devs/ashish-belwase/traffic_generator.py
traffic_generator.py
py
1,142
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "sites.glasswall.Glasswallsolutions", "line_number": 12, "usage_type": "name" }, { "api_name": "helper.Helper.get_domain_from_url", "line_number": 16, "usage_type": "call" }, { ...
418067829
from django.core.management.base import BaseCommand, CommandError from django.conf import settings from django.core.mail import send_mail import datetime from django.db import connection #for custom sql from django.template.loader import render_to_string from access.models import SendDailyEmail # this helper function ...
null
src/students/management/commands/attendance_status_email.py
attendance_status_email.py
py
6,362
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 37, "usage_type": "name" }, { "api_name": "datetime.date.today", "line_number": 39, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 39, "usage_type": "attribute" }, { "ap...
552132523
import requests from bs4 import BeautifulSoup as bs import json import os solved = {} solved_list = os.listdir('../boj') for i in solved_list: solved[i[:i.find('.')]] = 1 with open('boj_random.txt', 'rt') as f: random = f.read().splitlines() for i in random: solved[i] = 1 r = requests.get('https://www.a...
null
TODO/upd.py
upd.py
py
666
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.listdir", "line_number": 7, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 17, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 18, "usage_type": "call" } ]
502327838
import copy import functools import itertools import math import random from sklearn import datasets __all__ = ['check_estimator'] def make_random_features(model, n_observations, n_features): for _ in range(n_observations): yield {i: random.random() for i in range(n_features)} def make_random_targets...
null
creme/utils/estimator_checks.py
estimator_checks.py
py
6,123
python
en
code
null
code-starcoder2
66
[ { "api_name": "random.random", "line_number": 15, "usage_type": "call" }, { "api_name": "random.random", "line_number": 25, "usage_type": "attribute" }, { "api_name": "functools.partial", "line_number": 28, "usage_type": "call" }, { "api_name": "random.choice", ...
377523859
#THIS PROGRAM DECRYPTS THE INPUT FILE from tqdm import tqdm import os #GLOBAL VARIBLE position=0 #FUNCTION THAT READS THE FILE def read_file(location_of_file): with open(location_of_file,'r') as f: Compute_Data(f.readlines()) print('Decryption Succssfull :)') #FUNCTION CHANGES FILE...
null
Decrypt.py
Decrypt.py
py
1,544
python
en
code
null
code-starcoder2
66
[ { "api_name": "tqdm.tqdm", "line_number": 17, "usage_type": "call" }, { "api_name": "os.remove", "line_number": 57, "usage_type": "call" }, { "api_name": "os.rename", "line_number": 58, "usage_type": "call" } ]
169945570
# Python code to demonstrate table creation and # insertions with SQL # importing module import sqlite3 # connecting to the database connection = sqlite3.connect("myTable.db") # cursor crsr = connection.cursor() # SQL command to insert the data in the table sql_command = """INSERT INTO stude...
null
test.py
test.py
py
746
python
en
code
null
code-starcoder2
66
[ { "api_name": "sqlite3.connect", "line_number": 8, "usage_type": "call" } ]
330383229
from django.dispatch import receiver from django.db.models.signals import post_save from .. import models # 获取随机字符串(24位大小英文字母加数字的组合) from django.utils.crypto import get_random_string @receiver(post_save, sender=models.Survey) def create_unique_code_handler(sender, **kwargs): print('接收信号') print(sender) pr...
null
app/signals/app.py
app.py
py
1,252
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.utils.crypto.get_random_string", "line_number": 34, "usage_type": "call" }, { "api_name": "django.dispatch.receiver", "line_number": 8, "usage_type": "call" }, { "api_name": "django.db.models.signals.post_save", "line_number": 8, "usage_type": "argum...
515804936
from __future__ import print_function from keras import losses from keras import Sequential from keras.layers import Dense, Dropout from keras.callbacks import ModelCheckpoint, EarlyStopping, CSVLogger from sklearn.metrics import mean_absolute_error from util.dataset import load_data_with_sentences_single_flag, l...
null
sim_mlp.py
sim_mlp.py
py
2,259
python
en
code
null
code-starcoder2
66
[ { "api_name": "keras.Sequential", "line_number": 14, "usage_type": "call" }, { "api_name": "keras.layers.Dense", "line_number": 15, "usage_type": "call" }, { "api_name": "keras.layers.Dense", "line_number": 16, "usage_type": "call" }, { "api_name": "keras.layers.D...
606110572
import bs4 import requests conjOpt = { "present": 0, "cat_a": 1, "cat_b": 2, "cat_c": 3, "past_tense": 4, "cat_d": 0, } def conj_verb(verb): api = f"https://leconjugueur.lefigaro.fr/french/verb/{verb}.html" page = requests.get(api) status = page.status_code if status != 200: return f"ERROR: {status}" dom...
null
main.py
main.py
py
835
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 15, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 19, "usage_type": "call" } ]
448592085
import warnings import numpy as np import pandas as pd from sklearn.datasets import load_boston from sklearn.model_selection import train_test_split from sklearn.linear_model import LinearRegression from sklearn.metrics import mean_squared_error, mean_absolute_error from sklearn.preprocessing import StandardScaler fro...
null
linear_regression_boston.py
linear_regression_boston.py
py
13,400
python
en
code
null
code-starcoder2
66
[ { "api_name": "warnings.filterwarnings", "line_number": 15, "usage_type": "call" }, { "api_name": "sklearn.datasets.load_boston", "line_number": 18, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 33, "usage_type": "call" }, { "api_name": ...
271926007
from django.contrib import admin from django.urls import path, include from django.conf.urls.static import static from django.conf import settings from member.views import * urlpatterns = [ path('', HotListView.as_view(), name='home'), path('jet/', include('jet.urls','jet')), path('jet/dashboard/', includ...
null
config/urls.py
urls.py
py
955
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 10, "usage_type": "call" }, { "api_name": "django.urls.include", "line_number": 10, "usage_type": "call" }, { "api_name": "django.urls.path...
584474338
from __future__ import print_function from apiclient.discovery import build from apiclient import errors from httplib2 import Http from oauth2client import file, client, tools from flask import Flask, render_template, redirect # from utils import Service, encode_image import base64 from flask import make_response, re...
null
flaskapp.py
flaskapp.py
py
15,727
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.dirname", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path", "line_number": 28, "usage_type": "attribute" }, { "api_name": "flask.Flask", "line_number": 31, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_...
261794183
#!/usr/bin/env python from __future__ import absolute_import from __future__ import print_function import logging import os import sys import re from argparse import ArgumentParser from commcare_cloud.environment.paths import get_available_envs sys.path.append(os.path.dirname(os.path.dirname(__file__))) # this lets...
null
fab/fab/etc_hosts.py
etc_hosts.py
py
2,758
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.path.append", "line_number": 13, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_num...
567928939
""" Remove Dups Write code to remove duplicates from unsorted linked list. How would you solve this problem if a temporary buffer is not allowed? """ from data import Node def buffer_solution(linked_list): seen = {} node = linked_list prev = None while node: if node.val in seen: ...
null
python/linked_lists/question_2_1.py
question_2_1.py
py
1,164
python
en
code
null
code-starcoder2
66
[ { "api_name": "data.Node", "line_number": 48, "usage_type": "call" }, { "api_name": "data.Node", "line_number": 52, "usage_type": "call" } ]
159464825
from django.contrib.auth.decorators import login_required from django.http import HttpResponse from django.shortcuts import render from django.urls import reverse from django.utils.decorators import method_decorator from django.views import View from tasks.forms import TaskForm from tasks.models import Task @login_r...
null
src/tasks/views.py
views.py
py
3,132
python
en
code
null
code-starcoder2
66
[ { "api_name": "tasks.forms", "line_number": 20, "usage_type": "name" }, { "api_name": "tasks.models.Task.objects.select_related", "line_number": 20, "usage_type": "call" }, { "api_name": "tasks.models.Task.objects", "line_number": 20, "usage_type": "attribute" }, { ...
229221685
from django.shortcuts import render_to_response from django.template import RequestContext from django.contrib.auth import authenticate, login from django.http import HttpResponseRedirect, HttpResponse from django.core.urlresolvers import reverse from django_hello_world.hello.models import Person, Request from django_h...
null
django_hello_world/hello/views.py
views.py
py
3,395
python
en
code
null
code-starcoder2
66
[ { "api_name": "django_hello_world.hello.models.Person.objects.get", "line_number": 11, "usage_type": "call" }, { "api_name": "django_hello_world.hello.models.Person.objects", "line_number": 11, "usage_type": "attribute" }, { "api_name": "django_hello_world.hello.models.Person", ...
618593416
from flask import jsonify, request from flask_restful import abort, Resource from data import db_session from data.users import User from api.user_parser import parser def abort_if_user_not_found(user_id): session = db_session.create_session() user = session.query(User).get(user_id) if not user: ...
null
api/users_resource.py
users_resource.py
py
2,780
python
en
code
null
code-starcoder2
66
[ { "api_name": "data.db_session.create_session", "line_number": 10, "usage_type": "call" }, { "api_name": "data.db_session", "line_number": 10, "usage_type": "name" }, { "api_name": "data.users.User", "line_number": 11, "usage_type": "argument" }, { "api_name": "fl...
545221073
#!/usr/bin/env python # -*- coding:utf-8 -*- # @CreationDate: 2021-01-29 23:59:51 # @Author: xiaochuan # @Description: 433. 最小基因变化 from typing import List class Solution: def minMutation(self, start: str, end: str, bank: List[str]) -> int: # 双向bfs # 预处理 if end not in bank: ret...
null
Week_07/双向BFS 433. 最小基因变化.py
双向BFS 433. 最小基因变化.py
py
1,096
python
en
code
null
code-starcoder2
66
[ { "api_name": "typing.List", "line_number": 11, "usage_type": "name" } ]
376058392
#!/usr/bin/python2 # -*- coding: utf-8 -*- from pyspark import SparkContext from pyspark.sql import SparkSession from pyspark.sql.functions import to_date, to_timestamp,months_between,current_timestamp,date_format,datediff #获得数据 spark = SparkSession.builder.master("local[4]").appName("pssql03").getOrCreate() df =...
null
N&E local/3.py
3.py
py
1,138
python
en
code
null
code-starcoder2
66
[ { "api_name": "pyspark.sql.SparkSession.builder.master", "line_number": 9, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pyspark.sql.SparkSession", "line_number": 9, "usage_type": "n...
535820437
from collections import deque # Definition for singly-linked list. class ListNode: def __init__(self, val=0, next=None): self.val = val self.next = next class Solution: def removeNthFromEnd(self, head: ListNode, n: int) -> ListNode: stack = deque() node = head while no...
null
medium/RemoveNthNode.py
RemoveNthNode.py
py
570
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.deque", "line_number": 12, "usage_type": "call" } ]
548267451
import tkinter from tkinter.filedialog import askopenfilename import os import queue import sys import threading import math import time import pyaudio import wave from sklearn.cluster import KMeans import hmmlearn.hmm import numpy as np import pickle import librosa import sounddevice as sd import soundfile as sf RE...
null
app.py
app.py
py
7,357
python
en
code
null
code-starcoder2
66
[ { "api_name": "pyaudio.paInt16", "line_number": 41, "usage_type": "attribute" }, { "api_name": "queue.Queue", "line_number": 49, "usage_type": "call" }, { "api_name": "librosa.load", "line_number": 52, "usage_type": "call" }, { "api_name": "math.floor", "line_...
653611162
import demjson import argparse import sys from math import pi, sin, cos, acos # The global average radius of the Earth in kilometers EARTH_RADIUS_KM = 6371 # Default values for command line arguments (default is 100km from SF Financial District) CUSTOMER_LIST_FILE_NAME = 'Customer List.txt' DISTANCE_TO_CENTER = 100 C...
null
nearby_customers.py
nearby_customers.py
py
3,998
python
en
code
null
code-starcoder2
66
[ { "api_name": "math.pi", "line_number": 20, "usage_type": "name" }, { "api_name": "math.sin", "line_number": 28, "usage_type": "call" }, { "api_name": "math.cos", "line_number": 29, "usage_type": "call" }, { "api_name": "math.acos", "line_number": 30, "usa...
125448378
import os, inspect currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(os.path.dirname(currentdir)) os.sys.path.insert(0,parentdir) import pybullet_envs from datetime import datetime, time from baselines.common import tf_util as U from baselines import log...
null
testAgent.py
testAgent.py
py
1,268
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.dirname", "line_number": 2, "usage_type": "call" }, { "api_name": "os.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 2, "usage_type": "call" }, { "api_name": "inspect.getfile", "line...
345749178
from Environment import Environment from Memory import ReplayMemory from collections import deque from config import CFG from utils import Transition import torch import torch.multiprocessing as mp import math import random as rd import numpy as np import os device = torch.device("cuda") mp.set_start_method('spawn', ...
null
Actor.py
Actor.py
py
5,608
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.device", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.multiprocessing.set_start_method", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.multiprocessing", "line_number": 15, "usage_type": "name" }, { "api_nam...
588363981
import numpy as np import timeit from mpl_toolkits.mplot3d import Axes3D from matplotlib import pyplot as plt from matplotlib import animation # Constants LX = 4 LY = 1 A = 1 # Number of grid nodes per time and space variables K_big = 100 I_big = 100 ANIMATION_TIME_STEPS = 100 def __plot_2d(x_sp, y_sp, t, figname,...
null
equations/numerical_solution.py
numerical_solution.py
py
5,105
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 20, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 20, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.subplot", "line_number": 21, "usage_type": "call" }, { "api_name": "...
603380181
""" Service class ------------------ Service object for interfacing with the Project Service API. """ import time import os from typing import Optional, List, Union, Dict from ...services import BaseService from ...client import Client from ...exceptions import NotFound, ServerError from .exceptions import ProjectErr...
null
nextcode/services/project/service.py
service.py
py
12,632
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 25, "usage_type": "call" }, { "api_name": "services.BaseService", "line_number": 38, "usage_type": "name" }, { "api_name": "client.Client", "line_number": 47, "usage_type": "name" }, { "api_name": "os.environ.get",...
359684312
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from django.contrib.auth.models import AbstractUser from django.db import models as db from django.utils.translation import ugettext_lazy as _ f...
null
src/ralph_scrooge/models/owner.py
owner.py
py
4,189
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.contrib.auth.models.AbstractUser", "line_number": 16, "usage_type": "name" }, { "api_name": "django.utils.translation.ugettext_lazy", "line_number": 21, "usage_type": "call" }, { "api_name": "django.utils.translation.ugettext_lazy", "line_number": 22, ...
549296532
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unle...
null
keystone/source/keystone/keystone/tests/test_v3_credential.py
test_v3_credential.py
py
4,965
python
en
code
null
code-starcoder2
66
[ { "api_name": "keystone.tests.test_v3.RestfulTestCase", "line_number": 24, "usage_type": "attribute" }, { "api_name": "keystone.tests.test_v3", "line_number": 24, "usage_type": "name" }, { "api_name": "uuid.uuid4", "line_number": 30, "usage_type": "call" }, { "api...
424674803
from datetime import datetime, timedelta from django.db.models import Q from django.utils import timezone from .models import ( Person, Membership, Settings, Subscription, Invoice, InvoiceItem, InvoiceQuery, Payment, Refund, Enquiry, ) from django_filters import Filter, FilterSet...
null
members/filters.py
filters.py
py
10,197
python
en
code
null
code-starcoder2
66
[ { "api_name": "models.Settings.current_year", "line_number": 25, "usage_type": "call" }, { "api_name": "models.Settings", "line_number": 25, "usage_type": "name" }, { "api_name": "django_filters.FilterSet", "line_number": 34, "usage_type": "name" }, { "api_name": ...
537634904
""" Unit tests specifically for 1.0.0-style DataCube """ import pathlib import sys import textwrap import pytest import shapely.geometry import openeo.metadata from openeo import UDF from openeo.api.process import Parameter from openeo.internal.graph_building import PGNode from openeo.internal.process_graph_visitor...
null
tests/rest/datacube/test_datacube100.py
test_datacube100.py
py
48,994
python
en
code
null
code-starcoder2
66
[ { "api_name": "openeo.rest.datacube.DataCube", "line_number": 25, "usage_type": "name" }, { "api_name": "pytest.warns", "line_number": 52, "usage_type": "call" }, { "api_name": "openeo.rest.connection.Connection", "line_number": 76, "usage_type": "name" }, { "api_...
351001406
import pytest from search import binary_search, linear_search @pytest.mark.parametrize("list_,item,expected,algorithm", [ ([1, 2], 2, 1, linear_search), ([1, 2, 3, 4], 3, 2, linear_search), ([1, 2, 3], 1, 0, linear_search), ([1], 1, 0, linear_search), ([1, 2], 2, 1, binary_search), ([1, 2, 3,...
null
algorithms/test_search.py
test_search.py
py
869
python
en
code
null
code-starcoder2
66
[ { "api_name": "pytest.mark.parametrize", "line_number": 6, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 6, "usage_type": "attribute" }, { "api_name": "search.linear_search", "line_number": 7, "usage_type": "name" }, { "api_name": "search.lin...
502233741
# custom module imports import match # library imports from bs4 import BeautifulSoup import requests import sys import math import logging from datetime import datetime as dt from datetime import timedelta class Bookmaker(object): def __init__(self): self.base_url = 'https://www.bookmaker.eu/live-lines/...
null
scrapers/bookmaker.py
bookmaker.py
py
2,900
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 18, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 28, "usage_type": "call" }, { "api_name": "requests.exceptions", "line_number": 31, "usage_type": "attribute" }, { "api_name": "sys.exit", ...
213744401
# Copyright 2012 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 applicable law or a...
null
tools/gcutil/gcutil-1.7.2/lib/google_compute_engine/gcutil/kernel_cmds.py
kernel_cmds.py
py
2,580
python
en
code
null
code-starcoder2
66
[ { "api_name": "gflags.FLAGS", "line_number": 26, "usage_type": "attribute" }, { "api_name": "gcutil.command_base.GoogleComputeCommand", "line_number": 30, "usage_type": "attribute" }, { "api_name": "gcutil.command_base", "line_number": 30, "usage_type": "name" }, { ...
533531322
from dragon import source_datas from dragon import export from config.myconfig import singleton_cfg from db import request_db_data def main(): today_date = singleton_cfg.getRaceDate() print('Today=>', today_date) immd_info_dict = request_db_data.RequestImmdLatestRows(today_date) # race_date_No &...
null
20190902/futureData_model4/dragon/dragon.py
dragon.py
py
8,417
python
en
code
null
code-starcoder2
66
[ { "api_name": "config.myconfig.singleton_cfg.getRaceDate", "line_number": 8, "usage_type": "call" }, { "api_name": "config.myconfig.singleton_cfg", "line_number": 8, "usage_type": "name" }, { "api_name": "db.request_db_data.RequestImmdLatestRows", "line_number": 10, "usag...
259578261
#!/usr/bin/env python # coding: utf-8 # In[1]: # Correction: Projet_evaluation # In[2]: # 1. Ecrire une fonction python r_names() qui admet pour entrer une de ces chaînes de #caractères et qui retourne une liste de nom de colonnes. # In[5]: from re import sub #sub: fonction de substitution # In[6]: na...
null
Correction/Partie_1_correction_question_1_2_6.py
Partie_1_correction_question_1_2_6.py
py
4,563
python
en
code
null
code-starcoder2
66
[ { "api_name": "sqlalchemy.create_engine", "line_number": 113, "usage_type": "call" }, { "api_name": "pandas.read_excel", "line_number": 124, "usage_type": "call" } ]
310466912
""" Built-in, globally-available admin actions. """ from django.core.exceptions import PermissionDenied from django.contrib import messages from django.contrib.admin import helpers from django.contrib.admin.util import model_ngettext from django.db import router from django.template.response import TemplateResponse fr...
null
pbs/prescription/actions.py
actions.py
py
5,891
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.core.exceptions.PermissionDenied", "line_number": 35, "usage_type": "name" }, { "api_name": "django.db.router.db_for_write", "line_number": 37, "usage_type": "call" }, { "api_name": "django.db.router", "line_number": 37, "usage_type": "name" }, {...
203290766
import math from wpilib import SmartDashboard as Dash from wpilib.command import Command from constants import Constants from subsystems import drive from utils import pid, units import odemetry import wpilib class TurnToAngle(Command): def __init__(self, setpoint, relative=False): super().__init__() ...
null
src/commands/turntoangle.py
turntoangle.py
py
2,088
python
en
code
null
code-starcoder2
66
[ { "api_name": "wpilib.command.Command", "line_number": 12, "usage_type": "name" }, { "api_name": "subsystems.drive.Drive", "line_number": 15, "usage_type": "call" }, { "api_name": "subsystems.drive", "line_number": 15, "usage_type": "name" }, { "api_name": "odemet...
130440308
""" Sonar. Copyright (c) 2014 Grant Jenks http://www.grantjenks.com/ Exercises 1. Increase the number of targets to 10. 2. How would you create a computer player? 3. How would moving targets change things? """ import sys, pygame, random from pygame.locals import * pygame.init() width = 800 screen = pygame.display....
null
sonar.py
sonar.py
py
2,052
python
en
code
null
code-starcoder2
66
[ { "api_name": "pygame.init", "line_number": 16, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 19, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 19, "usage_type": "attribute" }, { "api_name": "pygame.font.F...
222393713
# -*- coding:utf-8 -*- # Copyright (c) 2012 theo crevon # # See the file LICENSE for copying permission. import sys import logging def loglevel_from_str(log_level_str): log_level_str = log_level_str.upper() numeric_level = getattr(logging, log_level_str, None) if not isinstance(numeric_level, int): ...
null
elevator/log.py
log.py
py
1,639
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.Formatter", "line_number": 31, "usage_type": "call" }, { "api_name": "logging.StreamHandler", "line_number": 34, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 34, "usage_type": "attribute" }, { "api_name": "logging.FileH...
215476008
import os import simplejson import commonware.log from django.conf import settings from django.contrib.auth.decorators import user_passes_test from django.http import HttpResponse from django.shortcuts import render_to_response from django.template import RequestContext, loader from django.views.debug import get_safe_...
null
apps/base/views.py
views.py
py
4,339
python
en
code
null
code-starcoder2
66
[ { "api_name": "commonware.log.log.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "commonware.log.log", "line_number": 17, "usage_type": "attribute" }, { "api_name": "commonware.log", "line_number": 17, "usage_type": "name" }, { "api_name": "d...
552609321
"""Automatic test of the *transpose conjecture*. It checks whether CTM values are transpose invariant. This test is slow. """ import pytest from pytest import approx import numpy as np from bdm.encoding import decode_array @pytest.mark.slow def test_transpose_conjecture(bdm_d2): for i in range(2**16): ar...
null
test/test_theory.py
test_theory.py
py
864
python
en
code
null
code-starcoder2
66
[ { "api_name": "bdm.encoding.decode_array", "line_number": 15, "usage_type": "call" }, { "api_name": "pytest.approx", "line_number": 16, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 12, "usage_type": "attribute" }, { "api_name": "bdm.encoding...
212216922
#!python # coding=utf-8 import base64 import operator import itertools import simplejson as json import numpy as np import netCDF4 as nc4 from . import logger def all_subclasses(cls): """ Recursively generate of all the subclasses of class cls. """ for subclass in cls.__subclasses__(): yield subclas...
null
pocean/utils.py
utils.py
py
5,267
python
en
code
null
code-starcoder2
66
[ { "api_name": "builtins.map", "line_number": 32, "usage_type": "call" }, { "api_name": "operator.itemgetter", "line_number": 32, "usage_type": "call" }, { "api_name": "itertools.groupby", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.issubdtype",...
584662148
# -*- coding: utf-8 -*- """ Created on Thu Aug 16 14:21:23 2018 @author: henri Script for Plotting some results """ import pandas as pd import matplotlib.pyplot as plt from pandas import Series from sklearn.preprocessing import MinMaxScaler import numpy as np from sklearn.model_selection import train...
null
DS1/HI_pred.py
HI_pred.py
py
5,807
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 22, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 30, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 41, "usage_type": "call" }, { "api_name": "pandas.read_csv", ...
388509213
from flask import Flask from flask import flash, redirect, render_template, request, session, abort, url_for from flask_sqlalchemy import SQLAlchemy from flask_admin import Admin from flask_admin.contrib.sqla import ModelView import random import os # from flask.ext.login import LoginManager # for datetime from dateti...
null
app.py
app.py
py
12,089
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 20, "usage_type": "call" }, { "api_name": "os.urandom", "line_number": 22, "usage_type": "call" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 25, "usage_type": "call" }, { "api_name": "flask_admin.Admin"...
324886375
from . import v2 from flask import request, abort from ..app import logger import xmltodict from collections import OrderedDict from ..app import pbx from flask import current_app as app def _convert_v3_response_to_v2(pbx_name, termtype, command, v3_response): """ Convert the v3 response to the legacy v2 xml ...
null
pbxd/v2/views.py
views.py
py
2,820
python
en
code
null
code-starcoder2
66
[ { "api_name": "app.logger.debug", "line_number": 14, "usage_type": "call" }, { "api_name": "app.logger", "line_number": 14, "usage_type": "name" }, { "api_name": "collections.OrderedDict", "line_number": 24, "usage_type": "call" }, { "api_name": "collections.Order...
368136523
import numpy as np import matplotlib.pyplot as plt import pandas as pd import gym import dill from transfer import Tabular import seaborn as sns from scipy.misc import logsumexp if __name__=='__main__': rng = np.random.RandomState(1234) env = gym.make('Fourrooms-v0') features = Tabular(env.observation_spac...
null
fourrooms/show_actions.py
show_actions.py
py
2,186
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.random.RandomState", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 11, "usage_type": "attribute" }, { "api_name": "gym.make", "line_number": 12, "usage_type": "call" }, { "api_name": "transfer.Tabular"...
192956080
from direct.distributed.DistributedSmoothNode import DistributedSmoothNode from direct.distributed.DistributedObjectOV import DistributedObjectOV from pandac.PandaModules import * from direct.actor.Actor import Actor import Globals class TagAvatar(DistributedSmoothNode): paintTs = None def __init__(self, cr, ...
null
TagAvatar.py
TagAvatar.py
py
14,977
python
en
code
null
code-starcoder2
66
[ { "api_name": "direct.distributed.DistributedSmoothNode.DistributedSmoothNode", "line_number": 7, "usage_type": "name" }, { "api_name": "direct.distributed.DistributedSmoothNode.DistributedSmoothNode.__init__", "line_number": 11, "usage_type": "call" }, { "api_name": "direct.dist...
474777582
from OpenGL.GL import * from OpenGL.GLUT import * from random import random import ctypes import time from PIL import Image import pygame import numpy # Треугольники во весь экран point_vertex1 = [[1.0, -1.0, 0.0], [1.0, 1.0, 0], [-1.0, -1.0, 0]] point_vertex2 = [[-1.0, 1.0, 0.0], [-1.0, -1.0, 0], [1.0, 1.0, 0]] xOrig...
null
shader3.py
shader3.py
py
8,093
python
en
code
null
code-starcoder2
66
[ { "api_name": "PIL.Image.open", "line_number": 18, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 18, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.int8", "line_number": ...
414731245
# -*- coding: utf-8 -*- """ Created on Wed Nov 4 17:58:11 2020 @author: Jordan """ import requests import PyQt5.QtWidgets as Widgets import pandas as pd import numpy as np a = requests.get('https://raw.githubusercontent.com/plotly/plotly.js/master/dist/plot-schema.json').json() # types = {'boolean':Widgets.QCheckB...
null
Fun_Stuff/PlotlyAttrs.py
PlotlyAttrs.py
py
2,525
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 13, "usage_type": "call" } ]
117121787
import numpy as np import torch as t import torch.optim as optim from agents.BaseAgent import BaseAgent from module.network_bodies import AtariBody from module.networks import DQN from utils.hyperparameters import Config from utils.replay_memory import PrioritizedReplayMemory cfg = Config() class Model(BaseAgent): ...
null
agents/DDQNPriorityReplay.py
DDQNPriorityReplay.py
py
10,146
python
en
code
null
code-starcoder2
66
[ { "api_name": "utils.hyperparameters.Config", "line_number": 10, "usage_type": "call" }, { "api_name": "agents.BaseAgent.BaseAgent", "line_number": 13, "usage_type": "name" }, { "api_name": "torch.optim.Adam", "line_number": 43, "usage_type": "call" }, { "api_name...
305958428
import sqlalchemy as sa conn = sa.create_engine('sqlite:///books.db') rows = conn.execute('SELECT title FROM book ORDER BY title') for row in rows: print(row) # # result # # ('Perdido Street Station',) # ('Small Gods',) # ('The Spellman Files',) # ('The Weirdstone of Brisingamen',) # ('Thud!',)
null
ch08/ex10/main.py
main.py
py
304
python
en
code
null
code-starcoder2
66
[ { "api_name": "sqlalchemy.create_engine", "line_number": 3, "usage_type": "call" } ]
442285708
from scrapy import signals from scrapy.exporters import CsvItemExporter class DouJobsPipeline(object): @classmethod def from_crawler(cls, crawler): pipeline = cls() crawler.signals.connect(pipeline.spider_opened, signals.spider_opened) crawler.signals.connect(pipeline.spider_closed, si...
null
dou_jobs/pipelines.py
pipelines.py
py
860
python
en
code
null
code-starcoder2
66
[ { "api_name": "scrapy.signals.spider_opened", "line_number": 9, "usage_type": "attribute" }, { "api_name": "scrapy.signals", "line_number": 9, "usage_type": "name" }, { "api_name": "scrapy.signals.spider_closed", "line_number": 10, "usage_type": "attribute" }, { "...
642973641
from sklearn.datasets import load_digits from sklearn.linear_model import Perceptron import datetime start = datetime.datetime.now() X, y = load_digits(return_X_y=True) clf = Perceptron(tol=1e-3, random_state=0) clf.fit(X, y) clf.score(X, y) #accuracy end = datetime.datetime.now() print (end-start) #running time
null
proj3/perceptron.py
perceptron.py
py
314
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime.now", "line_number": 4, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 4, "usage_type": "attribute" }, { "api_name": "sklearn.datasets.load_digits", "line_number": 5, "usage_type": "call" }, { "api_name":...
209749682
from collections import namedtuple import sqlite3 # make a basic Link class Link = namedtuple('Link', ['id', 'submitter_id', 'submitted_time', 'user_question', 'guru_advice', 'type']) # list of user queries for QnA (Question and Advice Module) qna_data = [ Link(0, 60398, 1334014208.0, ...
null
normal_usr_module/QnA_module.py
QnA_module.py
py
4,182
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.namedtuple", "line_number": 5, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 63, "usage_type": "call" } ]
52677892
#!/usr/bin/env python3.6 # -*- coding: utf-8 -*- # BamboBot by Krystian Spandel # Much code from GetBeaned discord bot version = 'v3.0.0' print("Loading...") # Importing the discord API warpper print("Loading discord...") import discord # Load some essentials modules print("Loading traceback...") print("Loading c...
null
bot.py
bot.py
py
2,638
python
en
code
null
code-starcoder2
66
[ { "api_name": "cogs.helpers.init_logger.init_logger", "line_number": 28, "usage_type": "call" }, { "api_name": "asyncio.set_event_loop_policy", "line_number": 41, "usage_type": "call" }, { "api_name": "uvloop.EventLoopPolicy", "line_number": 41, "usage_type": "call" }, ...
428315283
# coding: utf-8 # In[1]: import findspark findspark.init() import pyspark # In[2]: from pyspark.sql import SparkSession spark = SparkSession.builder.master("local").appName("CTR Models").config( "spark.executor.memory", "8g").config( "spark.driver.memory", "15g").getOrCreate() # In[3]: from pyspark...
null
spark_selection.py
spark_selection.py
py
3,584
python
en
code
null
code-starcoder2
66
[ { "api_name": "findspark.init", "line_number": 8, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder.master", "line_number": 17, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder", "line_number": 17, "usage_type": "attribute" }...
491480425
# -*- coding: utf-8 -*- from numpy import uint32,uint16,uint8,float16 from pandas import read_csv from yaml import dump,load from collections import defaultdict def load_geo_csv(path): """Imports csv into pandas DataFrame default dtypes: - 'user':uint32 - 'id':uint32 - 'place_asked':uint16 ...
null
inputoutput.py
inputoutput.py
py
2,035
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.uint32", "line_number": 24, "usage_type": "name" }, { "api_name": "numpy.uint16", "line_number": 24, "usage_type": "name" }, { "api_name": "numpy.float16", "line_number": 24, "usage_type": "name" }, { "api_name": "numpy.uint8", "line_numbe...
433249073
# Copyright (c) 2018 PaddlePaddle 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 app...
null
parl/core/fluid/agent.py
agent.py
py
7,244
python
en
code
null
code-starcoder2
66
[ { "api_name": "warnings.simplefilter", "line_number": 16, "usage_type": "call" }, { "api_name": "parl.core.agent_base.AgentBase", "line_number": 28, "usage_type": "name" }, { "api_name": "parl.core.fluid.algorithm.Algorithm", "line_number": 74, "usage_type": "argument" ...
516944928
#!/usr/bin/python3 import sys import json from es2json import ArrayOrSingleValue, eprint,litter,isint from pymarc import MARCReader from six.moves import zip_longest as izip_longest def transpose_to_ldj(record): json_record={} json_record['_LEADER'] = record.leader json_record['_FORMAT'] = "MarcXchange" ...
null
helperscripts/marc2jsonl.py
marc2jsonl.py
py
1,579
python
en
code
null
code-starcoder2
66
[ { "api_name": "es2json.isint", "line_number": 16, "usage_type": "call" }, { "api_name": "six.moves.zip_longest", "line_number": 22, "usage_type": "call" }, { "api_name": "pymarc.MARCReader", "line_number": 35, "usage_type": "call" }, { "api_name": "sys.stdin.buffe...
482955197
from sklearn.feature_extraction.text import TfidfTransformer from sklearn.feature_extraction.text import CountVectorizer import numpy as np import random import pickle import argparse parser = argparse.ArgumentParser(description='Process some integers.') parser.add_argument('--stopwords_dir', default="data/stopwords-...
null
image_lookup.py
image_lookup.py
py
4,642
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 8, "usage_type": "call" }, { "api_name": "random.seed", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.random", ...
473868660
""" This comannd create permission and add to existent group for User model """ # for existent groups list refer to ddws/hardcode.py - look at specific group # # syntax: python3 manage.py new_permission_to_group -g promo --permission can_hoax --text "Can hoax" # python3 manage.py new_permission_to_group -...
null
ddws/ddgui/management/commands/new_permissions_to_group.py
new_permissions_to_group.py
py
1,802
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 13, "usage_type": "name" }, { "api_name": "django.contrib.auth.models.Group.objects.get", "line_number": 28, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.Group.objects", "line_number"...