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
507313209
import pymysql.cursors connection = pymysql.connect(host='localhost', user='root', password='mcx202PX@P', db='nse_500', charset='utf8mb4', cursorclass=pymysql.cursors.DictCu...
null
test3.py
test3.py
py
1,005
python
en
code
null
code-starcoder2
66
[ { "api_name": "pymysql.cursors.connect", "line_number": 4, "usage_type": "call" }, { "api_name": "pymysql.cursors", "line_number": 4, "usage_type": "name" }, { "api_name": "pymysql.cursors.cursors", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pym...
610548235
from fastapi import APIRouter, Depends, File, HTTPException, Response, UploadFile, status from sqlalchemy.ext.asyncio.session import AsyncSession from app.database.session import get_async_db_session from app.exceptions import InvalidContentType, MetadatafilNotFound from app.routers.dto.Metadata import Metadata from a...
null
mottak-arkiv-service/app/routers/metadatafil.py
metadatafil.py
py
2,091
python
en
code
null
code-starcoder2
66
[ { "api_name": "fastapi.APIRouter", "line_number": 11, "usage_type": "call" }, { "api_name": "fastapi.UploadFile", "line_number": 18, "usage_type": "name" }, { "api_name": "sqlalchemy.ext.asyncio.session.AsyncSession", "line_number": 18, "usage_type": "name" }, { "...
563347759
from itertools import repeat from random import choice from pprint import pprint import asyncio import yaml from async_timeout import timeout import aiofiles import asyncssh async def connect_ssh(device, command): print(f"Подключаюсь к {device['host']}") async with timeout(20): ssh = await asyncssh....
null
examples/11_async_libs/connect_to_devices_async_timeout.py
connect_to_devices_async_timeout.py
py
2,042
python
en
code
null
code-starcoder2
66
[ { "api_name": "async_timeout.timeout", "line_number": 15, "usage_type": "call" }, { "api_name": "asyncssh.connect", "line_number": 16, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 25, "usage_type": "call" }, { "api_name": "asyncio.sleep", ...
183158564
import gym import gym_gomoku import os from algorithms import q_improvement, get_action import numpy as np env = gym.make('TicTacToe-v0') class Env: def trinaryToDecimal(self, trinary): decimal = 0 i = 0 n = 0 while(trinary != 0): dec = trinary % 10 decima...
null
blesfia/Tictactoe/tong-tac-toe.py
tong-tac-toe.py
py
1,941
python
en
code
null
code-starcoder2
66
[ { "api_name": "gym.make", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.random.choice", "line_number": 39, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 39, "usage_type": "attribute" }, { "api_name": "algorithms.q_improvemen...
565180616
# Copyright 2017 The Bazel 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 applicable la...
null
packaging/whl.py
whl.py
py
9,636
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.umask", "line_number": 29, "usage_type": "call" }, { "api_name": "os.umask", "line_number": 30, "usage_type": "call" }, { "api_name": "os.chmod", "line_number": 39, "usage_type": "call" }, { "api_name": "os.path.basename", "line_number": 51, ...
36994977
import os import sys import multiprocessing import subprocess import shlex import glob from io_simo import check_files_if_exist from io_simo import make_dir_if_necessary from filesmasher import FaSmasher from ftsensor import FtSensor class Mummer: def __init__(self, args): self.outp = os.path.realpath(args.outp) ...
null
mummer.py
mummer.py
py
6,192
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.realpath", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_nu...
93585589
import os import time import sys import numpy as np import matplotlib.pyplot as plt X = [] Y = [] with open(sys.argv[1],'r') as f: for line in f: words = line.strip().split() if len(words)>0: X.append(int(words[0])) Y.append(float(words[1])) X = np.array(X, dtype=...
null
process.py
process.py
py
526
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.argv", "line_number": 10, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.int32", "line_number": 18, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_nu...
402770370
# Databricks notebook source # MAGIC %run ./../utils/utils_functions # COMMAND ---------- import time import mlflow import numpy as np import mlflow.sklearn from mlflow.exceptions import RestException from mlflow.tracking import MlflowClient from sklearn.metrics import accuracy_score, roc_auc_score class LendingClu...
null
model/evaluation_pipeline.py
evaluation_pipeline.py
py
3,238
python
en
code
null
code-starcoder2
66
[ { "api_name": "mlflow.tracking.MlflowClient", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 27, "usage_type": "call" }, { "api_name": "mlflow.exceptions.RestException", "line_number": 33, "usage_type": "name" }, { "api_name"...
201401806
import json import requests import json import sys, os import pika, re,base64 import zlib from bs4 import BeautifulSoup from pymongo import MongoClient requests.packages.urllib3.disable_warnings() class StokaInstance: STORAGE = {} def __init__(self, rabbit_mq_connection, seed_page_object, group_n...
null
facebook.py
facebook.py
py
10,637
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.packages.urllib3.disable_warnings", "line_number": 10, "usage_type": "call" }, { "api_name": "requests.packages", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pymongo.MongoClient", "line_number": 19, "usage_type": "call" }, { ...
394972431
#!/usr/bin/python def mo_plot(mo_energies, x_pos=(1, 2), linewidth=1): '''mo_plots(energies, x_pos, linewidth) returns a PathPatch object for matplotlib. 'energies' should be a list of floats 'x_pos' (1, 2) should be a tuple to define start and end of the mo-line 'linewidth' (1) define the linewidth of each...
null
plots.py
plots.py
py
729
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.path.Path.MOVETO", "line_number": 18, "usage_type": "attribute" }, { "api_name": "matplotlib.path.Path", "line_number": 18, "usage_type": "name" }, { "api_name": "matplotlib.path.Path.LINETO", "line_number": 20, "usage_type": "attribute" }, {...
123964014
from flask import Blueprint, Response, session, render_template, request, redirect, url_for import os import uuid import shutil from ..utils import helper import datetime from settings import Config ind = Blueprint('ind', __name__) @ind.before_request # (执行这个 蓝图 里的视图函数之前 进行操作) def authlogin(): if not session.ge...
null
statistical_code/views/index.py
index.py
py
4,537
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Blueprint", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.session.get", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.session", "line_number": 14, "usage_type": "name" }, { "api_name": "flask.redirect", "...
134215851
N,M = map(int, input().split()) S = input() T = input() from fractions import gcd # 15, 9 # 3$BJ8;z$:$D8+$F$$$/!"(B5$BJ8;z$:$D8+$F$$$/(B LEN = N*M // gcd(N,M) # 45 p = LEN // N # 3 q = LEN // M # 5 lcm = p*q//gcd(p,q) for i in range(0, LEN//lcm): if S[i*q] != T[i*p]: print(-1) e...
null
Source Codes/AtCoder/agc028/A/4625768.py
4625768.py
py
337
python
en
code
null
code-starcoder2
66
[ { "api_name": "fractions.gcd", "line_number": 8, "usage_type": "call" }, { "api_name": "fractions.gcd", "line_number": 11, "usage_type": "call" } ]
146964425
import kubernetes as k8s from argparse import ArgumentParser from pint import UnitRegistry from collections import defaultdict import json import datetime import time import os def evict_pod(data, gracePeriodSeconds, dry_run, evictAllPodsAtOnce): isPodEvicted = False for node in data["on-demand"]: for ...
null
main.py
main.py
py
17,644
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime.now", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 15, "usage_type": "attribute" }, { "api_name": "kubernetes.client.V1beta1Eviction", "line_number": 22, "usage_type": "call" }, { "ap...
600810480
import argparse import boto3 import datetime import gzip import json import logging import os import os.path import re import time import threading from botocore.client import Config logging.basicConfig(level=logging.ERROR, format='%(asctime)s %(message)s') class Syncer: typekey_map = { 'nodejs': '_var_...
null
main.py
main.py
py
5,273
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.basicConfig", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.ERROR", "line_number": 15, "usage_type": "attribute" }, { "api_name": "re.search", "line_number": 48, "usage_type": "call" }, { "api_name": "re.search", "lin...
534017441
import pygame import csv import sys import random DIM = (600,500) SFONDO = (0,0,0) LINEA = (255,255,255) def drawlinea(): dim = 20 spessore = 1 direzioni = 60 dizionario_posizioni = {0:[0,0], 1:[10,0], 2:[20,0], 3:[20,-10]} dizionario_posizioni.items() for direzioni in...
null
Bob.py
Bob.py
py
1,072
python
en
code
null
code-starcoder2
66
[ { "api_name": "pygame.Rect", "line_number": 20, "usage_type": "call" }, { "api_name": "pygame.draw.rect", "line_number": 24, "usage_type": "call" }, { "api_name": "pygame.draw", "line_number": 24, "usage_type": "attribute" }, { "api_name": "csv.writer", "line_...
467392145
import os import matplotlib.pyplot as plt from PIL import Image import numpy as np from keras.layers import ( Activation, BatchNormalization, Dense, Dropout, Flatten, Reshape, UpSampling2D, ZeroPadding2D, ) from keras.layers.advanced_activations import LeakyReLU from keras.layers.convol...
null
src/test3.py
test3.py
py
8,229
python
en
code
null
code-starcoder2
66
[ { "api_name": "keras.models.Sequential", "line_number": 35, "usage_type": "call" }, { "api_name": "keras.layers.Dense", "line_number": 37, "usage_type": "call" }, { "api_name": "keras.layers.Reshape", "line_number": 38, "usage_type": "call" }, { "api_name": "keras...
235769392
import praw from random import randint class reddit(object): def __init__(self): self.r = praw.Reddit(user_agent='SaltBot by /u/fertilelionfish') self.subs = ['funny', 'comics', 'gaming', 'videos', 'cats', 'woahdude'] def command_parse(self, command): parsed = command.split(' ') ...
null
src/reddit.py
reddit.py
py
1,112
python
en
code
null
code-starcoder2
66
[ { "api_name": "praw.Reddit", "line_number": 7, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 16, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 26, "usage_type": "call" } ]
616204161
#!/usr/bin/env python3 # vim: set encoding=utf-8 tabstop=4 softtabstop=4 shiftwidth=4 expandtab ######################################################################### # Copyright 2016 <Onkel Andy> <onkelandy@hotmail.com> ######################################################################### # ...
null
oppo/__init__.py
__init__.py
py
5,334
python
en
code
null
code-starcoder2
66
[ { "api_name": "builtins.SDP_standalone", "line_number": 29, "usage_type": "attribute" }, { "api_name": "os.path.sep.join", "line_number": 37, "usage_type": "call" }, { "api_name": "os.path", "line_number": 37, "usage_type": "attribute" }, { "api_name": "os.path.re...
311778964
import json import tempfile from django.core.files import File from django.test import TestCase from django.urls import reverse from PIL import Image from findit.models import Products from ..factories import ShopFactory, UserFactory from ..utils import get_token class WhenUserCreateProduct(TestCase): """ ...
null
tests/commerce/test_user_can_create_products.py
test_user_can_create_products.py
py
1,480
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.test.TestCase", "line_number": 15, "usage_type": "name" }, { "api_name": "factories.UserFactory", "line_number": 24, "usage_type": "call" }, { "api_name": "factories.ShopFactory", "line_number": 25, "usage_type": "call" }, { "api_name": "util...
187647527
""" views.py ======== Generic, one-off views for PLA * Home page view """ from django.core.urlresolvers import reverse from django.views.generic.edit import FormView from ..forms import SearchForm class HomeView(FormView): """Home page for PLA""" template_name = 'home.html' form_class = SearchForm ...
null
ui/views/home.py
home.py
py
532
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.views.generic.edit.FormView", "line_number": 14, "usage_type": "name" }, { "api_name": "forms.SearchForm", "line_number": 18, "usage_type": "name" }, { "api_name": "django.core.urlresolvers.reverse", "line_number": 23, "usage_type": "call" } ]
400215074
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Dec 28 11:26:07 2018 @author: audiodsp """ import pyaudio import wave import tkinter as tk import threading import matplotlib.pyplot as plt import numpy as np import scipy.io.wavfile import librosa from tkinter import Label from PIL import Image, ImageT...
null
Week -1/RecordingApp2.py
RecordingApp2.py
py
5,130
python
en
code
null
code-starcoder2
66
[ { "api_name": "tkinter.Tk", "line_number": 22, "usage_type": "call" }, { "api_name": "tkinter.Label", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 3...
22907416
#!/usr/bin/env python # -*- coding: utf-8 -*- """A script to run backprojection.""" __author__ = "Steven Gao" __version__ = "1.0" __maintainer__ = "Steven Gao" __email__ = "stevenruidigao@gmail.com" import pickle import numpy as np import pandas as pd import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Ax...
null
raw_code/pulson440/backprojection-aligned.py
backprojection-aligned.py
py
23,503
python
en
code
null
code-starcoder2
66
[ { "api_name": "pathlib.Path", "line_number": 18, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "sys.path.insert", "line_number": 19, "usage_type": "call" }, { "api_name": "sys.path", "line_numbe...
523159664
from iqoptionapi.stable_api import IQ_Option import time import json import sys import config from datetime import datetime from trade_config import * from dateutil import tz API = IQ_Option(config.email, config.senha) check, reason = API.connect() print(check, reason) API.change_balance('PRACTICE') def timestamp_co...
null
mhi-gale-simples.py
mhi-gale-simples.py
py
4,631
python
en
code
null
code-starcoder2
66
[ { "api_name": "iqoptionapi.stable_api.IQ_Option", "line_number": 10, "usage_type": "call" }, { "api_name": "config.email", "line_number": 10, "usage_type": "attribute" }, { "api_name": "config.senha", "line_number": 10, "usage_type": "attribute" }, { "api_name": "...
193569520
"""Demo platform that has two fake binary sensors.""" import copy from homeassistant.components.calendar import CalendarEventDevice, get_date import homeassistant.util.dt as dt_util def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the Demo Calendar platform.""" calendar_data_fut...
null
homeassistant/components/demo/calendar.py
calendar.py
py
2,884
python
en
code
null
code-starcoder2
66
[ { "api_name": "copy.copy", "line_number": 27, "usage_type": "call" }, { "api_name": "homeassistant.components.calendar.get_date", "line_number": 29, "usage_type": "call" }, { "api_name": "homeassistant.components.calendar.get_date", "line_number": 30, "usage_type": "call"...
429370595
from django.conf.urls import url from . import views #This code is for creating new pages and redirecting to their URLS. urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^admin_login/$', views.admin_login, name='admin_login'), url(r'^chairperson_login/$', views.chairperson_login, name='chairp...
null
CRS/urls.py
urls.py
py
561
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 9, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 10, "usage_type": "call" }, { "api_name": "django.c...
205367678
# This files contains your custom actions which can be used to run # custom Python code. # # See this guide on how to implement these action: # https://rasa.com/docs/rasa/custom-actions # This is a simple example for a custom action which utters "Hello World!" from typing import Any, Text, Dict, List from rasa_sdk ...
null
actions/actions.py
actions.py
py
3,571
python
en
code
null
code-starcoder2
66
[ { "api_name": "rasa_sdk.Action", "line_number": 34, "usage_type": "name" }, { "api_name": "typing.Text", "line_number": 36, "usage_type": "name" }, { "api_name": "rasa_sdk.executor.CollectingDispatcher", "line_number": 39, "usage_type": "name" }, { "api_name": "ra...
120729944
import os import shutil import tempfile import torchvision.datasets.utils as utils import unittest import zipfile import tarfile import gzip TEST_FILE = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'assets', 'grace_hopper_517x606.jpg') class Tester(unittest.TestCase): def te...
null
test/test_datasets_utils.py
test_datasets_utils.py
py
3,664
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.abspath", "line...
419884307
from rest_framework import serializers from .models import Destination from .models import Purchase class DestinationSerializer(serializers.ModelSerializer): class Meta: model = Destination fields = ['id', 'name'] class PurchaseSerializer(serializers.ModelSerializer): class Meta: mode...
null
backend/core/serializers.py
serializers.py
py
901
python
en
code
null
code-starcoder2
66
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 5, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 5, "usage_type": "name" }, { "api_name": "models.Destination", "line_number": 7, "usage_type": "name" },...
337258642
import os, os.path import math from PIL import Image from scipy.fftpack import dct, idct import matplotlib.pyplot as plt import numpy def dct_2_dim(d2image, default="ortho"): return dct(dct(d2image.T, norm=default).T, norm=default) def i_dct_2_dim(d2image, default="ortho"): return idct(idct(d2image.T, norm=...
null
image_fractaling.py
image_fractaling.py
py
2,255
python
en
code
null
code-starcoder2
66
[ { "api_name": "scipy.fftpack.dct", "line_number": 10, "usage_type": "call" }, { "api_name": "scipy.fftpack.idct", "line_number": 14, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.array", "li...
363504880
#!/usr/bin/env python # -*- coding:utf-8 -*- import redis r = redis.Redis(host='192.168.174.140',port=6379) r.set('name','wei',ex=5)#ex=5设置过期时间,单位为秒,5秒后这个键就不存在了 r.set('name1','fang',px=5)#px=5设置过期时间,单位为毫秒,5毫秒后这个键就不存在了 r.set('name2','haha',nx=True)#nx=True,如果设置为True,则只有键不存在时,当前set操作才执行,如果这个键已存在,则不会设置 r.set('name','we...
null
Modular_five/redis相关/redis_string操作.py
redis_string操作.py
py
2,559
python
en
code
null
code-starcoder2
66
[ { "api_name": "redis.Redis", "line_number": 6, "usage_type": "call" } ]
483999919
import numpy as np from numpy.random import shuffle import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt def entropy(array): # Entropy of rooms rooms = [] for row in array: rooms.append(row[-1]) # Isolate last column (room no) room_number, label_occurrences = np.unique(rooms, ...
null
decision_tree.py
decision_tree.py
py
17,012
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.use", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.log2", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.argsort", "line_numbe...
70158332
#coding=utf-8 import base64 import utils import json import hashlib import urllib, urllib2 import re import os import time import tempfile import random import xml.dom.minidom as minidom from cookielib import MozillaCookieJar import requests # from bs4 import BeautifulSoup from bilibili_config import * from xbmcswift2...
null
resources/lib/bilibili.py
bilibili.py
py
18,305
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.dirname", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 25, "usage_type": "call" }, { "api_name": "cookielib.MozillaCookieJ...
500554341
import string from nlpaug.augmenter.char import CharAugmenter from nlpaug.util import Action class RandomCharAug(CharAugmenter): def __init__(self, action=Action.SUBSTITUTE, name='RandomChar_Aug', aug_min=1, aug_p=0.3, include_upper_case=True, include_lower_case=True, include_numeric=True, ...
null
nlpaug/augmenter/char/random.py
random.py
py
5,149
python
en
code
null
code-starcoder2
66
[ { "api_name": "nlpaug.augmenter.char.CharAugmenter", "line_number": 7, "usage_type": "name" }, { "api_name": "nlpaug.util.Action.SUBSTITUTE", "line_number": 8, "usage_type": "attribute" }, { "api_name": "nlpaug.util.Action", "line_number": 8, "usage_type": "name" }, {...
93230294
import pandas as pd import matplotlib.pyplot as plt from gensim.models import Word2Vec from sklearn.manifold import TSNE from matplotlib import font_manager, rc import matplotlib as mpl font_path = './Jalnan.ttf' font_name = font_manager.FontProperties(fname=font_path).get_name() mpl.rcParams['axes.unicode_mi...
null
prj2_Movie_for_you/word2vec_visualization.py
word2vec_visualization.py
py
1,784
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.font_manager.FontProperties", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.font_manager", "line_number": 9, "usage_type": "name" }, { "api_name": "matplotlib.rcParams", "line_number": 10, "usage_type": "attribute" }, { ...
259892541
#Modulo CLiente para el Proyecto 1 de Redes 1 Enero Marzo 2018 #Integrantes: Salvador Gonzalez - 10-10296 # Valentina Hernandez - 10-10352 from __future__ import print_function from time import sleep import os import sys import socket as s import datetime as d #PUERTOS PARA LAS CONEXIONES PORTS = [5000,5001,5002...
null
client.py
client.py
py
7,321
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.argv", "line_number": 14, "usage_type": "attribute" }, { "api_name": "socket.socket", "line_number": 25, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 25, "usage_type": "attribute" }, { "api_name": "socket.SOCK_STREAM", ...
533781780
""" Celery settings """ from kombu import Queue, Exchange CELERY_BROKER_URL = 'amqp://developer:pwd123@localhost:5672//' CELERY_ACCEPT_CONTENT = ['json'] CELERY_RESULT_BACKEND = "redis" CELERY_REDIS_HOST = "localhost" CELERY_REDIS_PORT = 6379 CELERY_REDIS_DB = 2 CELERY_TASK_SERIALIZER = 'json' CELERY_RESULT_SERIA...
null
project/settings/dev/celery.py
celery.py
py
931
python
en
code
null
code-starcoder2
66
[ { "api_name": "kombu.Queue", "line_number": 17, "usage_type": "call" }, { "api_name": "kombu.Exchange", "line_number": 17, "usage_type": "call" }, { "api_name": "kombu.Queue", "line_number": 18, "usage_type": "call" }, { "api_name": "kombu.Exchange", "line_num...
290057996
import torch.utils.data from data.base_data_loader import BaseDataLoader from torchvision import transforms, utils def CreateDataset(opt): dataset = None from data.cityscapes import Cityscapes transform = transforms.Compose( [ transforms.Resize((256, 256)), transforms.Rando...
null
data/custom_dataset_data_loader.py
custom_dataset_data_loader.py
py
1,247
python
en
code
null
code-starcoder2
66
[ { "api_name": "torchvision.transforms.Compose", "line_number": 9, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 9, "usage_type": "name" }, { "api_name": "torchvision.transforms.Resize", "line_number": 11, "usage_type": "call" }, { ...
354287389
from tensorflow.python.platform import gfile import tensorflow as tf import cv2 import numpy as np import sys import argparse import json import mxnet as mx gpu_id = 0 # img = cv2.imread('test.png') # img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) # img = cv2.resize(img, (112, 112,)) # img = np.swapaxes(img, 0, 2) # img ...
null
test_same.py
test_same.py
py
3,067
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.random.randint", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 17, "usage_type": "attribute" }, { "api_name": "numpy.uint8", "line_number": 17, "usage_type": "attribute" }, { "api_name": "numpy.transpo...
648879760
import asyncio import logging import os import re import aiohttp import cv2 import discord import pytesseract import yaml from bs4 import BeautifulSoup from discord.ext import commands import tools if os.name == 'nt': # noinspection SpellCheckingInspection pytesseract.pytesseract.tesseract_cmd = r"C:\\Progra...
null
cogs/plox_commands.py
plox_commands.py
py
36,097
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.name", "line_number": 16, "usage_type": "attribute" }, { "api_name": "pytesseract.pytesseract", "line_number": 18, "usage_type": "attribute" }, { "api_name": "re.compile", "line_number": 22, "usage_type": "call" }, { "api_name": "yaml.safe_load",...
439529641
from django.http import HttpResponse from django.shortcuts import render, redirect, reverse, HttpResponseRedirect, HttpResponse, get_object_or_404 from django.contrib.auth import login, authenticate, logout from .forms import SignupForm from django.contrib.sites.shortcuts import get_current_site from django.utils.enco...
null
blog/views.py
views.py
py
18,416
python
en
code
null
code-starcoder2
66
[ { "api_name": "property.models.PropertyListing.objects.filter", "line_number": 25, "usage_type": "call" }, { "api_name": "property.models.PropertyListing.objects", "line_number": 25, "usage_type": "attribute" }, { "api_name": "property.models.PropertyListing", "line_number": ...
420674683
""" Created on Mon Jun 29 14:33:06 2020 @author: flavio martins CSC method """ # Header ###################################################################### import numpy as np import pickle import random import progressbar from scipy.io import loadmat ########################################...
null
CreateDataSets.py
CreateDataSets.py
py
9,058
python
en
code
null
code-starcoder2
66
[ { "api_name": "scipy.io.loadmat", "line_number": 86, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 90, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 91, "usage_type": "call" }, { "api_name": "numpy.array", "line_numb...
69346388
# -*- encoding:utf-8 -*- from mako import runtime, filters, cache UNDEFINED = runtime.UNDEFINED __M_dict_builtin = dict __M_locals_builtin = locals _magic_number = 5 _modified_time = 1281553043.325609 _template_filename='/Users/albee/Development/PcP-Bridge/pcpbridge/templates/debug_upload.mako' _template_uri='/debug_up...
null
pcpbridge/data/templates/debug_upload.mako.py
debug_upload.mako.py
py
2,892
python
en
code
null
code-starcoder2
66
[ { "api_name": "mako.runtime.UNDEFINED", "line_number": 3, "usage_type": "attribute" }, { "api_name": "mako.runtime", "line_number": 3, "usage_type": "name" }, { "api_name": "mako.cache.Cache", "line_number": 10, "usage_type": "call" }, { "api_name": "mako.cache", ...
9432681
import boto3 import json from boto3.dynamodb.conditions import Key, Attr from botocore.exceptions import ClientError import decimal # Helper class to convert a DynamoDB item to JSON. class DecimalEncoder(json.JSONEncoder): def default(self, o): if isinstance(o, decimal.Decimal): if ...
null
lambda scripts/getscore.py
getscore.py
py
893
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.JSONEncoder", "line_number": 9, "usage_type": "attribute" }, { "api_name": "decimal.Decimal", "line_number": 11, "usage_type": "attribute" }, { "api_name": "boto3.resource", "line_number": 19, "usage_type": "call" }, { "api_name": "json.dumps",...
279900796
import torch import torch.nn as nn import encoder import util import random device = torch.device("cuda" if torch.cuda.is_available() else "cpu") class BaseDecoder(nn.Module): def __init__(self, vocab_size, embedding_dim, hidden_size): super(BaseDecoder, self).__init__() self.vocab_size = vocab_...
null
pytorch/seq2seqWithAttention/baseDecoder.py
baseDecoder.py
py
1,934
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.device", "line_number": 7, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 7, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.nn.Module", ...
351691489
import logging import googlemaps logger = logging.getLogger('boto3') logger.setLevel(logging.INFO) def lambda_handler(event, context): """ :param event: :param context: this function: 1. Accepts an address 2. Uses the address to look up coordinates via googlemaps 3. Returns...
null
Lambda/latLonLookup/latLonLookup.py
latLonLookup.py
py
1,400
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 5, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 6, "usage_type": "attribute" }, { "api_name": "googlemaps.Client", "line_number": 29, "usage_type": "call" } ]
388296269
#!/usr/bin/env python """ This script contains code used by the following jupytr notebooks: 1. dd-wrangling.ipynb 2. env.py 3. """ # =========== # ENVIRONMENT # =========== import os import sys import pandas as pd from env import path # variables to use by selection of features from data dictionary: ONE_CO...
null
acquire.py
acquire.py
py
4,424
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 136, "usage_type": "call" }, { "api_name": "env.path", "line_number": 136, "usage_type": "name" }, { "api_name": "pandas.merge", "line_number": 146, "usage_type": "call" }, { "api_name": "os.system", "line_number...
199212226
from django.shortcuts import render from django.http import HttpResponse from news.models import Article def index(request): title = request.POST['title'] post = request.POST['post'] if title != 'none' and post != 'none': publish = Article(title = title, post = post) publish.save() ...
null
createnews/views.py
views.py
py
501
python
en
code
null
code-starcoder2
66
[ { "api_name": "news.models.Article", "line_number": 9, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 11, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 16, "usage_type": "call" } ]
359000629
""" input: numbers output: 3 number appear once solution: ^ """ import random from functools import reduce def findTheLastOne(x): return x & (-x) def findTwoOnceNum(x, s): num = findTheLastOne(x) a, b = 0, 0 for i in s: if i & num: a ^= i else: b ^= i re...
null
learning-algorithm-book/2/h2-2.py
h2-2.py
py
733
python
en
code
null
code-starcoder2
66
[ { "api_name": "random.shuffle", "line_number": 39, "usage_type": "call" }, { "api_name": "functools.reduce", "line_number": 40, "usage_type": "call" } ]
394028830
from ruamel.yaml.comments import CommentedSeq, CommentedMap from strictyaml.exceptions import YAMLValidationError from strictyaml.yamllocation import YAMLLocation from strictyaml.exceptions import raise_exception import dateutil.parser import decimal import copy import re class Optional(object): def __init__(sel...
null
strictyaml/validators.py
validators.py
py
10,715
python
en
code
null
code-starcoder2
66
[ { "api_name": "strictyaml.yamllocation.YAMLLocation", "line_number": 23, "usage_type": "call" }, { "api_name": "strictyaml.yamllocation.YAMLLocation", "line_number": 34, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 35, "usage_type": "call" }, ...
611724987
import datetime import calendar import traceback import os # Политика имен файлов для хранилища def naming(start_date=None, end_date=None, period_name='', count=1): # Имя вызывающей функции func_name = traceback.extract_stack()[-3][3] func_name = func_name[(func_name.find('.')+1):func_name.find('(...
null
service.py
service.py
py
8,568
python
en
code
null
code-starcoder2
66
[ { "api_name": "traceback.extract_stack", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 76, "usage_type": "call" }, { "api_name": "os.path", "line_number": 76, "usage_type": "attribute" }, { "api_name": "os.makedirs", ...
160750745
# app/urls.py from django.conf.urls import url from ksdb import protocols, program, person, institution, publication, fundedsite, group, committee, view, organ, discipline, specimentype, species, disease, degree, querypubmed, publishRDF, ingestRDF, ModalView, ekeutils, ksdbviews from sitemain import settings urlpatt...
null
ksdb/urls.py
urls.py
py
4,260
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.conf.urls.url", "line_number": 9, "usage_type": "call" }, { "api_name": "ksdb.protocols.protocol_input", "line_number": 9, "usage_type": "attribute" }, { "api_name": "ksdb.protocols", "line_number": 9, "usage_type": "name" }, { "api_name": "d...
164773018
import os # Path setting and file-retrieval import cv2 # OpenCV import numpy as np # See above import CONFIG as cfg # Debug flags and constants import CoreFunctions as cf # Common functions from shutil import rmtree # Directory removal from time import perf_counter ...
null
CUDAEncrypt.py
CUDAEncrypt.py
py
7,284
python
en
code
null
code-starcoder2
66
[ { "api_name": "CONFIG.DEBUG_IMAGES", "line_number": 18, "usage_type": "attribute" }, { "api_name": "numpy.zeros", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 21, "usage_type": "call" }, { "api_name": "time.perf_counter", ...
509370462
import ConfigParser import json import re import requests from bottle import route, run from bs4 import BeautifulSoup #TODO: # check get envelope by id for correct json formatting #Load config file config = ConfigParser.RawConfigParser() config.read('mvelopes.cfg') #Set authentication credentials mvUser = config.get...
null
mvelopesAPI.py
mvelopesAPI.py
py
6,160
python
en
code
null
code-starcoder2
66
[ { "api_name": "ConfigParser.RawConfigParser", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.session", "line_number": 24, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 48, "usage_type": "call" }, { "api_name": "json....
248109528
import os import pandas as pd import numpy as np import matplotlib.pyplot as plt from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense import tensorflow as tf from tensorboard.plugins import projector from sklearn.model_selection import train_test_split def make_meshgrid(x, y, h=.02...
null
lab2/lab2_test.py
lab2_test.py
py
3,085
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.meshgrid", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.c_", "line_number"...
513759842
import json events= [ {"type": "session", "data": {"player_id": 89757, "session_id": 66055, "name": "ergou", "date": "2016-1-1HHMMSS"}}, {"type": "purchase", "data": {"player_id": 89757, "session_id": 66055, "state": "success", "date": "2016-1-2HHMMSS"}}, ] events = json.dumps(events) # to string events = json.load...
null
pocket gems/onsite/json_to_database.py
json_to_database.py
py
2,398
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.dumps", "line_number": 8, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 9, "usage_type": "call" } ]
292565003
import matplotlib.pyplot as plt def plot_guess(x,y): fig, ax = plt.subplots() ax.plot(x, y, 'ro-', linewidth=1, label='Guess solution') ax.legend(loc='upper right') ax.set_xlabel('grid points') ax.set_ylabel('Guess solution') ax.grid(True) plt.show()
null
multigrid/plot_guess.py
plot_guess.py
py
281
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 6, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.show", "line_number": 12, "usage_type": "call" }, { "api_name": "mat...
57102392
import yaml import pickle import json from tqdm import tqdm from MDP_learner_gridworld_cleaned import MDP from copy import deepcopy as dcp IMPROVED = "improved" def vector_value(mdp, state): vector_s = [] pref_seq = [] for pref_state in mdp.vector_V: pref_seq.append(pref_state) ...
null
SMDPtools_simplified/calc_result_vector_V_updated.py
calc_result_vector_V_updated.py
py
14,073
python
en
code
null
code-starcoder2
66
[ { "api_name": "tqdm.tqdm", "line_number": 75, "usage_type": "call" }, { "api_name": "MDP_learner_gridworld_cleaned.MDP", "line_number": 105, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 110, "usage_type": "call" }, { "api_name": "copy.deep...
249093231
import cv2 import numpy as np import face_recognition # print("Hello coders") # Loading image from Folder imgRobert = face_recognition.load_image_file('imageTest/disha.jpeg') # Convert image to RGB format imgRobert = cv2.cvtColor(imgRobert,cv2.COLOR_BGR2RGB) # Loading image (Testing) imgRobertTest = face_r...
null
main.py
main.py
py
1,452
python
en
code
null
code-starcoder2
66
[ { "api_name": "face_recognition.load_image_file", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2RGB", "line_number": 9, "usage_type": "attribute" }, { "api_name": "fac...
310309700
import cv2 import numpy as np from matplotlib import pyplot as plt import math def hsv_colorname(color): # red = np.uint8([[[255,0,0 ]]]) # hsv_red = cv2.cvtColor(red,cv2.COLOR_BGR2HSV) hsv_color={'blue':[[100,150,0],[140,255,255]],'red':[[170,50,50],[180,255,255],[0,50,50],[10,255,255]],\ ...
null
sign detection/pract1.py
pract1.py
py
7,740
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.array", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 17, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2HSV", "line_number": 17, "usage_type": "attribute" }, { "api_name": "cv2.inRange", "li...
568267358
# -*- coding: utf-8 -*- import scrapy from Tencent.items import TencentItem class PosispiderSpider(scrapy.Spider): name = 'posiSpider' allowed_domains = ['http://hr.tencent.com'] start_urls = ['http://hr.tencent.com/position.php?&start=0#a'] def parse(self, response): node_list = response.xp...
null
Tencent/Tencent/spiders/posiSpider.py
posiSpider.py
py
1,437
python
en
code
null
code-starcoder2
66
[ { "api_name": "scrapy.Spider", "line_number": 6, "usage_type": "attribute" }, { "api_name": "Tencent.items.TencentItem", "line_number": 16, "usage_type": "call" }, { "api_name": "scrapy.Request", "line_number": 36, "usage_type": "call" } ]
318689998
import numpy as np np.random.seed(42) # データ用意 x = np.arange(-100, 100, 0.5) def my_func(x): if ( (-10 <= x and x < 0) or (8 <= x and x < 9) or (20 <= x and x < 40) ): return x else: return 0 y = np.zeros(x.size) for i in range(x.size): y[i] = my_func( x[i] ) # モデルの構造設計 import keras from...
null
hoge.py
hoge.py
py
892
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.random.seed", "line_number": 2, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 2, "usage_type": "attribute" }, { "api_name": "numpy.arange", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.zeros", "line...
182368817
import json import datetime from django.contrib.auth.decorators import login_required from django.core.exceptions import ObjectDoesNotExist from django.http import HttpResponse from django.core.serializers import serialize # Create your views here. from orders.models import Order from quotes.models import Quotes @...
null
orders/views.py
views.py
py
2,080
python
en
code
null
code-starcoder2
66
[ { "api_name": "quotes.models", "line_number": 17, "usage_type": "name" }, { "api_name": "quotes.models.Quotes", "line_number": 17, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 19, "usage_type": "call" }, { "api_name": "quotes.models.ticks", ...
550314423
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import matplotlib.pyplot as p import pickle ''' Columns ''' # Load data with open('fruit-sales.pickle', 'rb') as f: data = pickle.load(f) # Split tuples from (name, number) to 2 lists fruit, num_sold = zip(*data) # coords bar_coords = range(len(fruit)) # Se...
null
DataScience/Data Vis/matplotlib/Charts.py
Charts.py
py
3,332
python
en
code
null
code-starcoder2
66
[ { "api_name": "pickle.load", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.xticks", "line_number": 24, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 24, "usage_type": "name" }, { "api_name": "matplotlib.pyp...
620005141
from datetime import datetime from afs.model.BaseModel import BaseModel class Partition(BaseModel): """ Model object of a Partition """ def __init__(self, id='', serv='', part='', free=0, size=0, used=0, perc=0): """ initialize an empty object """ self.id = Non...
null
afs/model/Partition.py
Partition.py
py
1,046
python
en
code
null
code-starcoder2
66
[ { "api_name": "afs.model.BaseModel.BaseModel", "line_number": 5, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 26, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 26, "usage_type": "name" }, { "api_name": "...
580601936
import json import re import requests def save_cover_image(cover_url): response = requests.get(cover_url) filename = cover_url.split('/')[-1] with open('./images1/%s' % filename, 'wb') as f: f.write(response.content) def parse_page(html): # 漫画图片 pattern = re.compile('<p class="mh-cover ...
null
day02/1kkk.py
1kkk.py
py
1,785
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 8, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 16, "usage_type": "call" }, { "api_name": "re.S", "line_number": 16, "usage_type": "attribute" }, { "api_name": "re.findall", "line_number": 17, ...
413085928
# -*- coding: utf-8 -*- """ Created on Tue Nov 6 22:00:42 2018 @author: Ryan """ from collections import deque class Vertex: def __init__(self,label): self.label = str(label) class Graph: def __init__(self,Adj): self.Adj = Adj self.nbVertices = len(Adj) self.V = [v for v in...
null
tools/python/Ryan/graph.py
graph.py
py
3,270
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.deque", "line_number": 34, "usage_type": "call" } ]
472968969
import cv2 import numpy as np from sort import Sort import balloon.balloon as Balloon weights_path = 'D:\CH2\MyWork\Mask-Rcnn-Sort\mask_rcnn_balloon.h5' #weights_path = input("输入权重地址:") imagepath = '' logpath = Balloon.DEFAULT_LOGS_DIR videopath = 'D:\CH2\MyWork\Mask-Rcnn-Sort\CatAndBalloon.mp4' sort_max_age = 5 sort_...
null
Main.py
Main.py
py
2,956
python
en
code
null
code-starcoder2
66
[ { "api_name": "balloon.balloon.DEFAULT_LOGS_DIR", "line_number": 9, "usage_type": "attribute" }, { "api_name": "balloon.balloon", "line_number": 9, "usage_type": "name" }, { "api_name": "balloon.balloon.BalloonConfig", "line_number": 14, "usage_type": "attribute" }, {...
60459422
""" Contains common settings for both development and production. Functions: get_env_variable(var_name): Returns the value of a given os env variable. The rest of the Django settings can be seen here: https://docs.djangoproject.com/en/1.8/ref/settings/: """ import os from django.core.exceptions import Improperl...
null
src/portfolio/settings/base.py
base.py
py
2,906
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ", "line_number": 19, "usage_type": "attribute" }, { "api_name": "django.core.exceptions.ImproperlyConfigured", "line_number": 22, "usage_type": "call" }, { "api_name": "django.conf.global_settings.TEMPLATE_CONTEXT_PROCESSORS", "line_number": 53, ...
418318751
#!/usr/bin/env python # coding=utf-8 """Admin panel for user related models.""" from celery import current_app as ctask from django.contrib import admin from .models import ( UserInfo, TaskLog, GithubProfile, CodingLanguage, Framework, Hobby, Inbox ) class GithubProfileAdminView(admin.TabularInline): ""...
null
app/user/admin.py
admin.py
py
2,459
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.contrib.admin.TabularInline", "line_number": 14, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 14, "usage_type": "name" }, { "api_name": "models.GithubProfile", "line_number": 21, "usage_type": "name" }, { ...
556135880
#!/usr/bin/env python3 # -*- coding:utf-8 vi:ts=4:noexpandtab # Simple RTSP server. Run as-is or with a command-line to replace the default pipeline """ Документация на библиотеку ImageDraw https://pillow.readthedocs.io/en/stable/reference/ImageDraw.html """ import RPi.GPIO as GPIO from PIL import Image # библио...
null
drow.py
drow.py
py
1,857
python
en
code
null
code-starcoder2
66
[ { "api_name": "Adafruit_SSD1306.SSD1306_128_64", "line_number": 17, "usage_type": "call" }, { "api_name": "PIL.Image.new", "line_number": 21, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 21, "usage_type": "name" }, { "api_name": "PIL.ImageDraw...
647448727
import datetime import os import shutil import numpy as np import pandas as pd import pickle import collections import functools import inspect from copy import deepcopy def list2csv(thelist, file_path): my_df = pd.DataFrame(thelist) my_df.to_csv(file_path, index=False, header=False) def list_move_duplicat...
null
Tools.py
Tools.py
py
10,470
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.DataFrame", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.concat", "line_number": 54, "usage_type": "call" }, { "api_name": "pandas.Series", "line_number": 76, "usage_type": "call" }, { "api_name": "pickle.dump", "line_...
186707485
from gensim.parsing.porter import PorterStemmer stemmer = PorterStemmer() def clean_guess(guesses): return map(lambda x: x[0], guesses) def deduplicate_guess(play, candidates): p_guesses = [stemmer.stem(w) for w in play.guesses] clues = [stemmer.stem(w) for w in play.clues] candidates = [stemmer.stem(w) for w in...
null
game.py
game.py
py
1,783
python
en
code
null
code-starcoder2
66
[ { "api_name": "gensim.parsing.porter.PorterStemmer", "line_number": 3, "usage_type": "call" } ]
438065019
from django.shortcuts import render from .models import GalleryImage def gallery(request): gallery = GalleryImage.objects.all().order_by('-name') template = 'gallery/gallery.html' context = { 'gallery': gallery, } return render(request, template, context)
null
gallery/views.py
views.py
py
289
python
en
code
null
code-starcoder2
66
[ { "api_name": "models.GalleryImage.objects.all", "line_number": 7, "usage_type": "call" }, { "api_name": "models.GalleryImage.objects", "line_number": 7, "usage_type": "attribute" }, { "api_name": "models.GalleryImage", "line_number": 7, "usage_type": "name" }, { ...
161763625
from flask import jsonify, request from sqlalchemy.sql import exists from src import LOGGER, app from ..entities.entity import Session from ..entities.indexes import Indexes, IndexesSchema from ..utils.manage_request import get_request_data @app.route('/api/index') def get_all_indexes(): session = Session() ...
null
server/src/services/DAOindexes.py
DAOindexes.py
py
3,045
python
en
code
null
code-starcoder2
66
[ { "api_name": "entities.entity.Session", "line_number": 14, "usage_type": "call" }, { "api_name": "entities.indexes.Indexes", "line_number": 16, "usage_type": "argument" }, { "api_name": "entities.indexes.IndexesSchema", "line_number": 18, "usage_type": "call" }, { ...
142671535
from django.contrib import admin from users import models class UserAdmin(admin.ModelAdmin): list_display = ('nick_name', 'phone', 'is_verify', 'is_fake') search_fields = ('phone', 'nick_name') class AlipayChangeApplyAdmin(admin.ModelAdmin): list_display = ('user', 'create_time', 'state') readonly_fi...
null
users/admin.py
admin.py
py
613
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 5, "usage_type": "name" }, { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 9, "usage_type": "attribute" }...
444538491
from sklearn.cluster import KMeans from sklearn.externals import joblib import numpy as np import os import sys def load_features(src): print("[+] Load data....") data = [] for folder in os.listdir(src): folder_path = os.path.join(src, folder) for file in os.listdir(folder_path): ...
null
clustering.py
clustering.py
py
914
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.listdir", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 1...
7725350
# Controller #from GameSimulator import * # Not used.. from HEX import * import argparse import variables import actor #from variables import * from Node import * from MCTS import * #pytorch import torch.optim as optim import torch.nn as nn import torch.nn.modules.loss as pyloss #torch.manual_seed(2809) #np.random.s...
null
controller.py
controller.py
py
17,327
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentTypeError", "line_number": 21, "usage_type": "call" }, { "api_name": "argparse.ArgumentTypeError", "line_number": 27, "usage_type": "call" }, { "api_name": "argparse.ArgumentTypeError", "line_number": 29, "usage_type": "call" }, { "...
147126487
# importing libraries import pygame import time import random import hardmenu from pygame.locals import * def main(): snake_speed = 20 # Window size window_x = 720 window_y = 480 # defining colors black = pygame.Color(0, 0, 0) white = pygame.Color(255, 255, 255) red = pygame.Color(25...
null
hardsnake.py
hardsnake.py
py
6,564
python
en
code
null
code-starcoder2
66
[ { "api_name": "pygame.Color", "line_number": 17, "usage_type": "call" }, { "api_name": "pygame.Color", "line_number": 18, "usage_type": "call" }, { "api_name": "pygame.Color", "line_number": 19, "usage_type": "call" }, { "api_name": "pygame.Color", "line_numbe...
293964581
import sqlite3 as lite import sys import os path = os.path.dirname(__file__) + "test.db" con = lite.connect(path) with con: cur = con.cursor() # chỉ cần dùng phương thức execute() với câu SQL tương ứng. cur.execute("SELECT * FROM Cars") # cach 2: lấy từng dòng và in chúng ra màn hình. ...
null
select.py
select.py
py
740
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.dirname", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "sqlite3.connect", "line_number": 6, "usage_type": "call" } ]
117540467
# -*- coding: utf-8 -*- from datetime import datetime, timedelta import numpy as np import pylab as pl import pytz import matplotlib.pyplot as plt from sklearn.hmm import GaussianHMM from zipline.algorithm import TradingAlgorithm from zipline.utils.factory import * from bin.mongodb_driver import * from bin.start im...
null
algorithm/gaussianhmm_algorithm.py
gaussianhmm_algorithm.py
py
2,910
python
en
code
null
code-starcoder2
66
[ { "api_name": "zipline.algorithm.TradingAlgorithm", "line_number": 21, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.arra...
186361098
# # video_faces_to_images.py # # This script will take video(s) as input and extract and save all images that have a face detected. # Author: Allen Wang # ### import errno import os import numpy as np import cv2 import argparse from util import mkdirP from util import iterVids face_cascade = cv2.CascadeClassifier('...
null
tools/opencvideo_faces_to_images.py
opencvideo_faces_to_images.py
py
2,875
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.CascadeClassifier", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.path.realpath",...
169640480
import time import pynput import win32gui from threading import Thread from hacks import casinofingerprint, casinokeypad, cayofingerprint, cayovoltage def PrintBanner(): print(''' ██╗░░░░░███████╗░██████╗████████╗███████╗██████╗░  ██╗░░░██╗███████╗██████╗░  ██████╗░░░░░█████╗░ ██║░░░░░██╔════╝██╔════╝╚══██╔══╝██╔...
null
main.py
main.py
py
3,223
python
en
code
null
code-starcoder2
66
[ { "api_name": "win32gui.FindWindow", "line_number": 28, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 36, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 53, "usage_type": "call" }, { "api_name": "hacks.casinofingerpri...
8240941
#!/usr/bin/env python # listend/main.py # Dylan Taylor <taylordj@g.cofc.edu> # # listend is the interface between Twitter's API and Beatty Research's database. import sys from optparse import OptionParser import tweepy from pymongo import MongoClient # set vars from define argument flags parser = OptionParser(usage="...
null
main.py
main.py
py
3,480
python
en
code
null
code-starcoder2
66
[ { "api_name": "optparse.OptionParser", "line_number": 13, "usage_type": "call" }, { "api_name": "tweepy.OAuthHandler", "line_number": 28, "usage_type": "call" }, { "api_name": "tweepy.API", "line_number": 30, "usage_type": "call" }, { "api_name": "pymongo.MongoCli...
528512251
import numpy as np import math import cv2 import matplotlib.pyplot as plt from PIL import ImageGrab from datetime import datetime import NeuralNetwork as myNN import Utilities as utils import tensorflow as tf import time import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' tf.set_random_seed(12) def MakeRunName(): ...
null
Unsorted/playvideo.py
playvideo.py
py
3,888
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ", "line_number": 15, "usage_type": "attribute" }, { "api_name": "tensorflow.set_random_seed", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 20, "usage_type": "call" }, { "api_name": "date...
399503009
from lxml import etree import json class ParsePage: def __init__(self, page_source): self.html = etree.HTML(page_source) def overview_parse(self, main_info): items = main_info[0].xpath('./table[@class="detail-info"]/tr/td') # print(items) infos = {} for item in items:...
null
NewGovInfo/parsePage.py
parsePage.py
py
4,281
python
en
code
null
code-starcoder2
66
[ { "api_name": "lxml.etree.HTML", "line_number": 8, "usage_type": "call" }, { "api_name": "lxml.etree", "line_number": 8, "usage_type": "name" }, { "api_name": "json.dumps", "line_number": 106, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": ...
154872411
import numpy as np import pandas as pd import pickle import os # Building the model from keras.models import Sequential from keras.layers import Dense from keras.layers import LSTM from keras.layers import Dropout # get the data from sklearn.preprocessing import OneHotEncoder input_dir_list = ['F:/palmpad/csv/zy_1/'...
null
learn/palmpad_classifier.py
palmpad_classifier.py
py
2,708
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.load", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "numpy.load", "line_number": ...
277799792
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright © 2012 Mozilla Corporation # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # Remove a test by name and all a...
null
util/delete_test_by_name.py
delete_test_by_name.py
py
1,219
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.argv", "line_number": 16, "usage_type": "attribute" }, { "api_name": "sys.stderr.write", "line_number": 17, "usage_type": "call" }, { "api_name": "sys.stderr", "line_number": 17, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_n...
395703196
import pytest import os, re import pandas.testing as pdt import wsynphot from wsynphot.io import cache_filters as cf DATA_PATH = os.path.join(wsynphot.__path__[0], 'io', 'tests', 'data') CACHE_DIR = os.path.join(DATA_PATH, 'filters', 'SVO') @pytest.fixture def sample_table(): from astropy.table import Table ...
null
wsynphot/io/tests/test_cache_filters.py
test_cache_filters.py
py
2,478
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": "wsynphot.__path__", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.join", "lin...
75789216
from django.conf.urls import patterns, include, url #from django.views.generic.base import TemplateView from django.http import HttpResponse from settings import MEDIA_ROOT # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = patterns('', # Ex...
null
urls.py
urls.py
py
1,163
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.conf.urls.patterns", "line_number": 10, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 12, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 13, "usage_type": "call" }, { "api_name": "d...
439999424
from django.conf.urls import patterns, include, url # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() from tastypie.api import Api from licenses.api import ProjectResource, UserResource, MembershipResource v1_api = Api(api_name='v1') v1_api.register(UserResource...
null
melo/urls.py
urls.py
py
1,035
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.contrib.admin.autodiscover", "line_number": 5, "usage_type": "call" }, { "api_name": "django.contrib.admin", "line_number": 5, "usage_type": "name" }, { "api_name": "tastypie.api.Api", "line_number": 9, "usage_type": "call" }, { "api_name": "...
448414054
from keras_common import * from keras_train import * from matplotlib import pyplot as plt import numpy as np from random import random import os os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2" import tensorflow as tf from tensorflow import keras def get_predictions(data, model): predictions = [model.predict(d) for d in d...
null
keras/test.py
test.py
py
1,712
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ", "line_number": 7, "usage_type": "attribute" }, { "api_name": "tensorflow.data.Dataset.from_tensor_slices", "line_number": 24, "usage_type": "call" }, { "api_name": "tensorflow.data", "line_number": 24, "usage_type": "attribute" }, { "ap...
290490764
# coding: utf-8 """ 百度新闻 """ from datetime import datetime, timedelta import re import asyncio import aiohttp from scrapy.selector import Selector from w3lib.html import remove_tags from app import config from app.spider.base import Spider from app.spider.risk_control.baidu.variable import BaiduNewsVariableMixin from...
null
app/spider/risk_control/baidu/spider.py
spider.py
py
5,239
python
en
code
null
code-starcoder2
66
[ { "api_name": "app.utils.log.get_logger", "line_number": 19, "usage_type": "call" }, { "api_name": "app.spider.base.Spider", "line_number": 22, "usage_type": "name" }, { "api_name": "app.spider.risk_control.baidu.variable.BaiduNewsVariableMixin", "line_number": 22, "usage...
306901826
# -*- coding: utf-8 -*- from datetime import timedelta from celery.schedules import crontab BROKER_URL = 'redis://127.0.0.1:6379' CELERY_RESULT_BACKEND = 'redis://127.0.0.1:6379/0' CELERY_TIMEZONE='Asia/Shanghai' CELERY_IMPORTS = ( 'celery_app.task1', 'celery_app.task2' ) CELERYBEAT_SCHEDULE = { ...
null
develop/Python/modules/celery/example/celery_demo/celery_app/celeryconfig.py
celeryconfig.py
py
616
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.timedelta", "line_number": 21, "usage_type": "call" }, { "api_name": "celery.schedules.crontab", "line_number": 27, "usage_type": "call" } ]
644177720
import numpy as np import matplotlib.pyplot as plt plt.switch_backend('agg') from tool_box import * # from scipy import optimize # from scipy import asarray as ar, exp # from scipy.optimize import curve_fit # import PIL # from PIL import ImageFont # from PIL import Image # from PIL import ImageDraw # # f...
null
PLOT.py
PLOT.py
py
8,791
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.switch_backend", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 5, "usage_type": "name" }, { "api_name": "numpy.zeros", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.li...
139539499
"""@package lss.core Module with a main script that runs all the configurators. It contains configurators runner class and the body of the "main" function. """ import yaml from lss.configurators.factory import ConfiguratorsFactory from lss.wrappers.factory import PackageManagersFactory class ConfiguratorsRunner: ...
null
lss/core/run.py
run.py
py
3,127
python
en
code
null
code-starcoder2
66
[ { "api_name": "lss.configurators.factory.ConfiguratorsFactory", "line_number": 22, "usage_type": "call" }, { "api_name": "yaml.safe_load", "line_number": 69, "usage_type": "call" }, { "api_name": "lss.wrappers.factory.PackageManagersFactory", "line_number": 71, "usage_typ...
308847349
from engine.globs import EngineData, ANCHO, ALTO, CAPA_OVERLAYS_MENUS, TEXT_SEL, CANVAS_BG from engine.globs.event_dispatcher import EventDispatcher from engine.UI.widgets import Boton, BaseWidget, Fila from engine.libs.textrect import render_textrect from engine.globs.event_aware import EventAware from engine.glo...
null
engine/UI/menues/menu.py
menu.py
py
5,883
python
en
code
null
code-starcoder2
66
[ { "api_name": "engine.globs.event_aware.EventAware", "line_number": 11, "usage_type": "name" }, { "api_name": "engine.UI.widgets.BaseWidget", "line_number": 11, "usage_type": "name" }, { "api_name": "engine.globs.CAPA_OVERLAYS_MENUS", "line_number": 20, "usage_type": "nam...
365321859
import cv2 import numpy as np import glob def sort_contours(cnts, method="left-to-right"): # initialize the reverse flag and sort index reverse = False i = 0 # handle if we need to sort in reverse if method == "right-to-left" or method == "bottom-to-top": reverse = True #...
null
code/code.py
code.py
py
4,412
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.boundingRect", "line_number": 21, "usage_type": "call" }, { "api_name": "cv2.threshold", "line_number": 31, "usage_type": "call" }, { "api_name": "cv2.THRESH_BINARY", "line_number": 31, "usage_type": "attribute" }, { "api_name": "cv2.THRESH_OTSU...
424843846
import panstarrs1 import poss import merge import pandas as pd #This is the main loop def cycle(ra,dec): for ra_i,dec_i in zip(ra,dec): panstarrs1.download(ra_i,dec_i) poss.download(ra_i,dec_i) merge.resize_pic(ra_i,dec_i) merge.merge_into_pic(ra_i,dec_i) if __name__ == '__main...
null
main.py
main.py
py
453
python
en
code
null
code-starcoder2
66
[ { "api_name": "panstarrs1.download", "line_number": 9, "usage_type": "call" }, { "api_name": "poss.download", "line_number": 10, "usage_type": "call" }, { "api_name": "merge.resize_pic", "line_number": 11, "usage_type": "call" }, { "api_name": "merge.merge_into_pi...
453859893
import json import random import requests from django.core.cache import cache from rest_framework.response import Response from rest_framework import viewsets, mixins from rest_framework.decorators import list_route from my.models import CarUser from my.serializer import UserSerializer, UserRegisterSerializer, UserLogi...
null
my/views.py
views.py
py
2,499
python
en
code
null
code-starcoder2
66
[ { "api_name": "rest_framework.viewsets.GenericViewSet", "line_number": 13, "usage_type": "attribute" }, { "api_name": "rest_framework.viewsets", "line_number": 13, "usage_type": "name" }, { "api_name": "rest_framework.mixins.ListModelMixin", "line_number": 13, "usage_type...
210287100
from .base_env import BaseEnv, another_player import numpy as np from logging import getLogger logger = getLogger(__name__) from .base_env import Player, Winner from .renju_env import RenjuEnv, RenjuBoard class TicTacToeEnv(RenjuEnv): def __init__(self): super().__init__() self.concurrent_cou...
null
src/reversi_zero/env/tictactoe_env.py
tictactoe_env.py
py
641
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "renju_env.RenjuEnv", "line_number": 14, "usage_type": "name" }, { "api_name": "renju_env.RenjuBoard", "line_number": 23, "usage_type": "name" } ]