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
250555844
# Good morning! Here's your coding interview problem for today. # This problem was asked by IBM. # Given an integer, find the next permutation of it in absolute order. # For example, given 48975, the next permutation would be 49578. from itertools import permutations def one_digit_checker(num): if (num >= 0) a...
null
Daily Coding Problem/Solved/Problem#205_Easy.py
Problem#205_Easy.py
py
1,744
python
en
code
null
code-starcoder2
83
[ { "api_name": "itertools.permutations", "line_number": 36, "usage_type": "call" } ]
605340624
from visdom import Visdom import time class VisdomLinePlotter(object): def __init__(self, vis, color='red', size=5, title=None, ylabel=None, xlabel=None, linelabel=None): self.vis = vis self.title = title self.ylabel = ylabel self.xlabel = xlabel # this holds the data to be plotted self.trace = [dict(x...
null
visdom_utils.py
visdom_utils.py
py
1,633
python
en
code
null
code-starcoder2
83
[ { "api_name": "visdom.Visdom", "line_number": 37, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 51, "usage_type": "call" } ]
477083590
import nltk import torch import re from rupo.g2p import graphemes gr = graphemes.Graphemes() def repackage_hidden(h): """Wraps hidden states in new Tensors, to detach them from their history.""" if isinstance(h, torch.Tensor): return h.detach() else: return tuple(repackage_hidden(v) f...
null
utils.py
utils.py
py
1,878
python
en
code
null
code-starcoder2
83
[ { "api_name": "rupo.g2p.graphemes.Graphemes", "line_number": 6, "usage_type": "call" }, { "api_name": "rupo.g2p.graphemes", "line_number": 6, "usage_type": "name" }, { "api_name": "torch.Tensor", "line_number": 12, "usage_type": "attribute" }, { "api_name": "nltk....
512786865
import json import hashlib import os import re import logging import boto3 from botocore.vendored import requests from botocore.exceptions import ClientError # get variable from env alien_apikey = os.environ['ALIEN_API_KEY'] alien_url = os.environ['ALIEN_URL'] confidence = os.environ['CONFIDENCE'] action_type = os.env...
null
alienvault_s3.py
alienvault_s3.py
py
2,975
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.environ", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.environ", "lin...
3140707
"""Module for solving Equation 6 of Canto, Raga, & Wilkin 1996 (CRW96) This finds the radius of a stellar wind interaction bowshock in terms of the momentum and angular momentum injected by the two winds. CRW96 concentrated on the case of isotropic winds, but this module will work generally with any cylindrically sym...
null
Programs/equation6.py
equation6.py
py
13,580
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.sqrt", "line_number": 42, "usage_type": "call" }, { "api_name": "numpy.cos", "line_number": 42, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 48, "usage_type": "attribute" }, { "api_name": "numpy.cos", "line_number": 49,...
643155825
import gym import matplotlib import numpy as np env = gym.make("MountainCar-v0") DESCRETE_OS_SIZE = [20] * len(env.observation_space.high) descrete_state_window_size = (env.observation_space.high - env.observation_space.low) / DESCRETE_OS_SIZE LEARNING_RATE = 0.1 DISCOUNT = 0.95 EPISODES = 5000 epsilon = 0...
null
MountainCar.py
MountainCar.py
py
1,795
python
en
code
null
code-starcoder2
83
[ { "api_name": "gym.make", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.random.uniform", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 21, "usage_type": "attribute" }, { "api_name": "numpy.argmax", "li...
57717416
""" Figures for the first SST OOD paper""" import os, sys import numpy as np import glob import matplotlib as mpl import matplotlib.gridspec as gridspec from matplotlib import pyplot as plt from mpl_toolkits.axes_grid1.inset_locator import inset_axes import matplotlib.ticker as mticker import cartopy.crs as ccrs fro...
null
papers/I/Figures/py/fig_sst_anomaly_flowI.py
fig_sst_anomaly_flowI.py
py
42,467
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.rcParams", "line_number": 16, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 36, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 36, "usage_type": "attribute" }, { "api_name": "os.path.abspat...
57533445
class_name = 'content_tab' from qtpy import QtCore, QtGui, QtWidgets, uic import os import sys import re import pathlib import json from logzero import logger from modules.sumologic import SumoLogic from modules.shared import ShowTextDialog class findReplaceCopyDialog(QtWidgets.QDialog): def __init__(self, fromc...
null
modules/content_tab.py
content_tab.py
py
47,992
python
en
code
null
code-starcoder2
83
[ { "api_name": "qtpy.QtWidgets.QDialog", "line_number": 13, "usage_type": "attribute" }, { "api_name": "qtpy.QtWidgets", "line_number": 13, "usage_type": "name" }, { "api_name": "qtpy.QtWidgets.QDialogButtonBox", "line_number": 27, "usage_type": "attribute" }, { "a...
5969881
import folium import pandas import math data_k = pandas.read_excel("data_k.xlsx",sheet_name=0) data_e = pandas.read_excel("data_e.xlsx",sheet_name=0) data_v = pandas.read_excel("data_v.xlsx",sheet_name=0) basic = ["show_name","country_name","country_id","population", "latitude", "longitude"] basic2 = ["show...
null
gazdfoci.py
gazdfoci.py
py
2,474
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_excel", "line_number": 5, "usage_type": "call" }, { "api_name": "pandas.read_excel", "line_number": 6, "usage_type": "call" }, { "api_name": "pandas.read_excel", "line_number": 7, "usage_type": "call" }, { "api_name": "math.isnan", "...
227478972
from django.shortcuts import render,redirect, get_object_or_404 from django.http import HttpResponse from django.db.models import Q from .models import Juridica from .models import Ciudad from .models import Sector from .models import TipoEmpresa from ..personas_naturales.models import Persona_Natural from . import for...
null
ventas/personas_juridicas/views.py
views.py
py
4,208
python
en
code
null
code-starcoder2
83
[ { "api_name": "dal.autocomplete.Select2QuerySetView", "line_number": 15, "usage_type": "attribute" }, { "api_name": "dal.autocomplete", "line_number": 15, "usage_type": "name" }, { "api_name": "models.Juridica.objects.all", "line_number": 20, "usage_type": "call" }, {...
240327679
import pygame as pg import pygame.freetype import pygame.gfxdraw from setting import * from Background import * from BKLOG import * from Scenes import * import typing TOPLEFT=1 TOPRIGHT=2 BOTTOMLEFT=3 BOTTOMRIGHT=4 LEFT=5 RIGHT=6 TOP=7 BOTTOM=8 BODY=10 EDIT_MODE=True #EDIT_MODE=False class Label(pg.sprite.DirtySp...
null
MenuScene 20210730.py
MenuScene 20210730.py
py
29,966
python
en
code
null
code-starcoder2
83
[ { "api_name": "pygame.sprite", "line_number": 25, "usage_type": "attribute" }, { "api_name": "pygame.Color", "line_number": 32, "usage_type": "call" }, { "api_name": "pygame.freetype.SysFont", "line_number": 34, "usage_type": "call" }, { "api_name": "pygame.freety...
577929564
import pytest from api.clusters.serializers import ClusterSerializer from api.nodes.serializers import ClusterNodeDetailSerializer, ClusterNodeSerializer, GPUSerializer from db.models.clusters import Cluster from db.models.nodes import ClusterNode, NodeGPU from factories.factory_clusters import ClusterNodeFactory, GPU...
null
tests/test_clusters/test_serializers.py
test_serializers.py
py
4,611
python
en
code
null
code-starcoder2
83
[ { "api_name": "tests.utils.BaseTest", "line_number": 12, "usage_type": "name" }, { "api_name": "api.nodes.serializers.GPUSerializer", "line_number": 13, "usage_type": "name" }, { "api_name": "db.models.nodes.NodeGPU", "line_number": 14, "usage_type": "name" }, { "...
384243273
# coding = utf-8 import requests import configparser import os config = configparser.ConfigParser() basedir = os.path.abspath(os.path.dirname(__file__)) static_file_path = os.path.join(basedir, 'config.ini') config.read(static_file_path) cookieUrl = config.get('url', 'cookieUrl') data = config.get('data', ...
null
test2/Cookie/Cookies.py
Cookies.py
py
429
python
en
code
null
code-starcoder2
83
[ { "api_name": "configparser.ConfigParser", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.dirname",...
287990213
from bs4 import BeautifulSoup import pandas as pd import re import unidecode import time path = [] for i in range(1, 51): path.append('text_data/' + str(i) + '.txt') for i in range(0, 50): crawl_path = 'crawl_data/text_data' + str(i) + '.csv' html = open(path[i], 'r', encoding='utf-8') htmlhandle = ht...
null
spider/web_comments.py
web_comments.py
py
2,950
python
en
code
null
code-starcoder2
83
[ { "api_name": "bs4.BeautifulSoup", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 17, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 28, "usage_type": "call" }, { "api_name": "re.compile", "line_...
338121494
from tastypie.resources import ModelResource from tastypie import fields from tastypie.utils import trailing_slash from facilities.models import Hospital, GPSurgery from django.core import serializers from django.http import HttpResponse from django.db.models import Q from django.conf.urls.defaults import url class H...
null
nhsbugs/facilities/api.py
api.py
py
1,189
python
en
code
null
code-starcoder2
83
[ { "api_name": "tastypie.resources.ModelResource", "line_number": 11, "usage_type": "name" }, { "api_name": "facilities.models.Hospital.objects.all", "line_number": 14, "usage_type": "call" }, { "api_name": "facilities.models.Hospital.objects", "line_number": 14, "usage_ty...
451508286
import torch.nn as nn from torch import optim from torch.utils.data import Dataset, DataLoader from torch.utils.data.dataset import Dataset from torch.utils.data.sampler import BatchSampler from torchsummary import summary from torchvision import transforms from torchvision.datasets import DatasetFolder import errno i...
null
src/pytorch-template/old/baseline/Network_num_2.py
Network_num_2.py
py
11,582
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.path.append", "line_number": 31, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 31, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 45, "usage_type": "call" }, { "api_name": "os.path", "line_num...
320101996
import argparse import numpy as np import h5py import data_reader as dr import util as ut class ImageSerializer(): def __init__(self, n_bins): self.mjj_cut = 1100. self.n_bins = n_bins def read_file(self, path ): event_reader = dr.DataReader( path ) events = event_reader.read...
null
sarewt/event_to_image_serialization.py
event_to_image_serialization.py
py
5,080
python
en
code
null
code-starcoder2
83
[ { "api_name": "data_reader.DataReader", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.digitize", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.digitize", ...
434728083
#!/usr/bin/env python # -*- coding: utf-8 -*- """ 两种最基础的inesrt和bulk insert。 """ from __future__ import print_function from mongoengine import * from datetime import datetime, date connect("test", host="localhost", port=27017) class User(Document): user_id = IntField(primary_key=True) name = StringField(max_...
null
lsn04_basic_update_and_upsert.py
lsn04_basic_update_and_upsert.py
py
2,512
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime.now", "line_number": 29, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 29, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 30, "usage_type": "call" }, { "api_name": "datetim...
171918871
""" Copyright (c) 2018 SPARKL Limited. All Rights Reserved. Author <miklos@sparkl.com> Miklos Duma. Test cases for Crypto Portfolio SPARKL mix in examples repo. """ import pytest from tests.conftest import (IMPORT_DIR, OPERATION, INPUT_FIELDS, EXP_RESPONSE, CHECK_FUN, run_tests, read_from_c...
null
tests/with_auth/test_lib_slack.py
test_lib_slack.py
py
4,554
python
en
code
null
code-starcoder2
83
[ { "api_name": "tests.conftest.read_from_config", "line_number": 12, "usage_type": "call" }, { "api_name": "tests.conftest.IMPORT_DIR", "line_number": 21, "usage_type": "argument" }, { "api_name": "tests.conftest.OPERATION", "line_number": 88, "usage_type": "name" }, {...
74662768
""" Given a stack of N elements, interleave the first half of the stack with the second half reversed using only one other queue. This should be done in-place. Recall that you can only push or pop from a stack, and enqueue or dequeue from a queue. For example, if the stack is [1, 2, 3, 4, 5], it should become [1, ...
null
old/dcp_series/dcp_180.py
dcp_180.py
py
1,068
python
en
code
null
code-starcoder2
83
[ { "api_name": "collections.deque", "line_number": 21, "usage_type": "call" } ]
262499944
import sys sys.path.insert(0, '/data/niekserver/lib') from http import _POST from http import _USER from http import html from http import java from general import redirect from general import make_page from urllib.parse import unquote name = "Server Connect" content_head = """ <h1>Server Connect</h1> """ form = " ...
null
NiekServer/py/server_connect.py
server_connect.py
py
1,425
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.path.insert", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "re.compile", "line_number": 48, "usage_type": "call" }, { "api_name": "socket.gethostbyname", "li...
639196969
from __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from future import standard_library standard_library.install_aliases() from avatar.configuration.configurationFactory import ConfigurationFactory from avatar.system impor...
null
avatar/tests/test_configuration.py
test_configuration.py
py
3,055
python
en
code
null
code-starcoder2
83
[ { "api_name": "future.standard_library.install_aliases", "line_number": 6, "usage_type": "call" }, { "api_name": "future.standard_library", "line_number": 6, "usage_type": "name" }, { "api_name": "os.getcwd", "line_number": 46, "usage_type": "call" }, { "api_name"...
464706012
import tkinter as tk from tkinter import * import tkinter as ttk import sklearn.neighbors._typedefs import numpy as np import pandas as pd import pickle df = pd.read_csv("career_pred.csv") df = df.iloc[: , 7:] dataset = df for i in dataset.columns: Types = [] for j in dataset[i]: ...
null
Prof_Orientation_model.py
Prof_Orientation_model.py
py
23,948
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.LabelEncoder", "line_number": 78, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.Normalizer", "line_number": 86, "usage_type": "call" }, { ...
275804822
import base64 from datetime import datetime import hashlib import hmac import json import base64 import hashlib import hmac import random import socket import time import requests import re def create_signature(secret_key, method, md5, ctype, date, uri): # Get the string to sign string_sign = string_to_sign(me...
null
app/trace.py
trace.py
py
2,291
python
en
code
null
code-starcoder2
83
[ { "api_name": "hmac.new", "line_number": 20, "usage_type": "call" }, { "api_name": "hashlib.sha1", "line_number": 20, "usage_type": "attribute" }, { "api_name": "base64.b64encode", "line_number": 21, "usage_type": "call" }, { "api_name": "re.compile", "line_nu...
500187938
# -*- coding: utf-8 -*- # from __future__ import unicode_literals import os import json import requests from time import sleep from kbot.log import Log from kbot.message import Message from kbot.book.common import BookSearchQuery class CalilService(object): CALIL_BASE_URL = "http://api.calil.jp/check" @cla...
null
kbot/book/calil.py
calil.py
py
3,489
python
en
code
null
code-starcoder2
83
[ { "api_name": "time.sleep", "line_number": 33, "usage_type": "call" }, { "api_name": "kbot.book.common.BookSearchQuery", "line_number": 34, "usage_type": "call" }, { "api_name": "kbot.log.Log.info", "line_number": 51, "usage_type": "call" }, { "api_name": "kbot.lo...
410339514
def numero_materiales(elemento,material,nombre): from lxml import etree lista = [] for elem in elemento: lista.append(elem.text) lista_materiales = [] lista_muro = [] lista_tabiques = [] lista_cubierta = [] lista_interno = [] lista_terreno = [] lista_medianera = [] for elem in material: lista_materiales...
null
Funciones_xml.py
Funciones_xml.py
py
3,322
python
en
code
null
code-starcoder2
83
[ { "api_name": "lxml.etree.parse", "line_number": 46, "usage_type": "call" }, { "api_name": "lxml.etree", "line_number": 46, "usage_type": "name" }, { "api_name": "lxml.etree.parse", "line_number": 68, "usage_type": "call" }, { "api_name": "lxml.etree", "line_n...
498276825
import pandas as pd from datetime import date from main.dataframe_ops import transform_df class SimulationA: tx_fee = 0.65 def __init__(self, principal): self.principal = principal self.principal_init = principal self.owned_shares = 0 self.owned_shares_hodling = 0 def ...
null
simulator/SimulationA.py
SimulationA.py
py
3,495
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_csv", "line_number": 23, "usage_type": "call" }, { "api_name": "main.dataframe_ops.transform_df", "line_number": 38, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 49, "usage_type": "call" } ]
610380581
from django.shortcuts import render,redirect from django.contrib.auth.decorators import login_required from django.contrib.auth.forms import AuthenticationForm,UserCreationForm from django.contrib.auth import authenticate,login from django.contrib.auth.models import User from django.core.paginator import Paginator...
null
sanliuyunsite/sanliuyunapp/views.py
views.py
py
10,861
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.shortcuts.render", "line_number": 14, "usage_type": "call" }, { "api_name": "sanliuyunapp.form.uploadArtForm", "line_number": 19, "usage_type": "name" }, { "api_name": "sanliuyunapp.form.uploadArtForm", "line_number": 21, "usage_type": "call" }, ...
384755586
import numpy as np import matplotlib.pyplot as plt from ZachsPackage import Display as D L = 0.15 # Fin length Tb = 500 # Base temperature K k = 16.0 # Thermal conductivity W/mK Ac = 1.67e-4 # Cross sectional area m^2 P = 0.066 # Perimeter length m Tf = 300 # Free stream temperature K h = 25 # Heat transfer coefficient...
null
ME342NumAnalysis/Unit5/Assignment58.py
Assignment58.py
py
12,087
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.array", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 38, "usage_type": "call" }, { "api_name": "numpy.argwhere", "line_numbe...
563058881
#!/usr/bin/python from __future__ import print_function import argparse import serial import time import os import stat try: import meterbus except ImportError: import sys sys.path.append('../') import meterbus def ping_address(ser, address, retries=5): for i in range(0, retries + 1): me...
null
tools/mbus-serial-continous-request-data.py
mbus-serial-continous-request-data.py
py
7,546
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.path.append", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "meterbus.send_ping_frame", "line_number": 20, "usage_type": "call" }, { "api_name": "meterbus.load"...
79111955
# coding: utf-8 # PYTHON IMPORTS from datetime import datetime import csv import re from types import * # DJANGO IMPORTS from django.contrib.admin import helpers from django.utils.encoding import force_unicode from django.shortcuts import render_to_response from django import template from django.contrib.admin.util i...
null
3rd_party_apps/grappelli/actions.py
actions.py
py
5,306
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime.now", "line_number": 72, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 72, "usage_type": "name" }, { "api_name": "csv.QUOTE_MINIMAL", "line_number": 107, "usage_type": "attribute" }, { "api_name": "djang...
625020565
import unittest from selenium import webdriver from pyvirtualdisplay import Display class SearchTests(unittest.TestCase): def setUp(self): #display = Display(visible=0, size=(1920, 1080)).start() self.driver=webdriver.Chrome() self.driver.implicitly_wait(30) self.driver.maximize_wi...
null
fake.py
fake.py
py
674
python
en
code
null
code-starcoder2
83
[ { "api_name": "unittest.TestCase", "line_number": 5, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 9, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 9, "usage_type": "name" }, { "api_name": "unit...
417891386
''' 動画を取り込んで、txtファイルに変換。 通信仕様変更したほうがいい気がする。 コマンド系は、改行コード のみframe_start \ n lazer_off \ n 座標系は、、カンマ 区切りと改行23,285 \ n 24,284 \ n 基本は改行コードで切り分けていき、カンマ区切りで座標のx、yを分ける。 ''' import numpy as np import cv2 import socket import math #define #Curryのしきい値 Edge_min = 100 Edge_max = 200 delay = 1 #C:/Users/herom/Desktop/NY_Laser...
null
Python/main_movie_fileoutput_kaigyou.py
main_movie_fileoutput_kaigyou.py
py
4,586
python
en
code
null
code-starcoder2
83
[ { "api_name": "math.sqrt", "line_number": 43, "usage_type": "call" }, { "api_name": "cv2.resize", "line_number": 44, "usage_type": "call" }, { "api_name": "cv2.resize", "line_number": 49, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number":...
478680555
#导入相关的包 import smtplib from email.mime.text import MIMEText mail_content=""" <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <h1>这是一封python邮件</h1> </body> </html> """ ...
null
net编程/07.py
07.py
py
1,541
python
en
code
null
code-starcoder2
83
[ { "api_name": "email.mime.text.MIMEText", "line_number": 21, "usage_type": "call" }, { "api_name": "smtplib.SMTP_SSL", "line_number": 45, "usage_type": "call" } ]
527876114
import cv2 import numpy as np import pano_stitcher as ps # Load source images p1 = cv2.imread('my_panos/src/part1.jpg') p2 = cv2.imread('my_panos/src/part2.jpg') p3 = cv2.imread('my_panos/src/part3.jpg') # Warp first image by the homography mapping # the first image to the second image p1_homography = ps.homography(p...
null
CS378-Computer Vision/project_1/stitch.py
stitch.py
py
918
python
en
code
null
code-starcoder2
83
[ { "api_name": "cv2.imread", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 8, "usage_type": "call" }, { "api_name": "pano_stitcher.homography", "line_nu...
103723213
from django.shortcuts import render, get_object_or_404, redirect from blogtest.models import Post from .models import Comment from .form import CommentForm # Create your views here. def post_comment(request, post_pk): # 先获取被评论的文章,因为后面需要把评论和被评论的文章关联起来。 # 这里我们使用了 Django 提供的一个快捷函数 get_object_or_404, # 这个函...
null
comments/views.py
views.py
py
2,546
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.shortcuts.get_object_or_404", "line_number": 15, "usage_type": "call" }, { "api_name": "blogtest.models.Post", "line_number": 15, "usage_type": "argument" }, { "api_name": "form.CommentForm", "line_number": 18, "usage_type": "call" }, { "api_...
539887010
# -*- coding: utf-8 -*- """ Flask app initialization. """ from flask import Flask from flask.ext.mako import MakoTemplates from flask_login import LoginManager from flask_sqlalchemy import SQLAlchemy from flask_user import SQLAlchemyAdapter, UserManager app = Flask(__name__) # pylint: disable=invalid-name MakoTemplat...
null
src/presence_analyzer/main.py
main.py
py
1,093
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.ext.mako.MakoTemplates", "line_number": 12, "usage_type": "call" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 14, "usage_type": "call" }, { "api_name": "...
326407413
from datetime import datetime from django.conf import settings from django.utils.safestring import mark_safe from drchrono.api import get_all_patients # Since we cannot filter partial dates, we get all patients and then select # those that have their birthday today. def get_birthday_patients(social): all_patien...
null
drchrono/birthday_wisher/modules.py
modules.py
py
3,984
python
en
code
null
code-starcoder2
83
[ { "api_name": "drchrono.api.get_all_patients", "line_number": 12, "usage_type": "call" }, { "api_name": "django.conf.settings.DEBUG", "line_number": 16, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 16, "usage_type": "name" }, { ...
387437624
# # sublimelinter.py # Part of SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Ryan Hileman and Aparajita Fishman # # Project: https://github.com/SublimeLinter/SublimeLinter3 # License: MIT # import sublime import sublime_plugin import json import os import re import time from .lint.linte...
null
sublimelinter.py
sublimelinter.py
py
8,683
python
en
code
null
code-starcoder2
83
[ { "api_name": "lint.persist.plugin_is_loaded", "line_number": 26, "usage_type": "attribute" }, { "api_name": "lint.persist", "line_number": 26, "usage_type": "name" }, { "api_name": "lint.persist.load_settings", "line_number": 27, "usage_type": "call" }, { "api_na...
87508914
#!/usr/bin/env python3 ### Requirements ### # bqpjson v0.5 - pip install bqpjson # ortools v1.5 - https://developers.google.com/optimization/ import sys, json, argparse from ortools.linear_solver import pywraplp import bqpjson def main(args): if args.input_file == None: data = json.load(sys.stdin) ...
null
bop_ortools.py
bop_ortools.py
py
3,896
python
en
code
null
code-starcoder2
83
[ { "api_name": "json.load", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 15, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 18, "usage_type": "call" }, { "api_name": "bqpjson.validate", "line_numbe...
41665574
import sys sys.stdin = open('input.txt', 'r') import sys input = sys.stdin.readline from itertools import combinations N = int(input()) arr = [list(map(int, input().split())) for _ in range(N)] ans = float('inf') for case in combinations(range(N), N//2): esac = tuple(set(range(N)).difference(case)) temp, pme...
null
BOJ/201904/14889.py
14889.py
py
554
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.stdin", "line_number": 2, "usage_type": "attribute" }, { "api_name": "sys.stdin", "line_number": 5, "usage_type": "attribute" }, { "api_name": "itertools.combinations", "line_number": 12, "usage_type": "call" } ]
262733548
import socket import struct import numpy as np import matplotlib.pyplot as plt import time from matplotlib.animation import FuncAnimation import threading import sys from scipy.signal import savgol_filter src_addr = '129.82.45.102' # src_addr = '127.0.0.1' src_port = 8000 stream_id = 32 def connect(): """ C...
null
v1/receiveAndShow_screen.py
receiveAndShow_screen.py
py
15,083
python
en
code
null
code-starcoder2
83
[ { "api_name": "socket.socket", "line_number": 23, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 23, "usage_type": "attribute" }, { "api_name": "socket.SOCK_STREAM", "line_number": 23, "usage_type": "attribute" }, { "api_name": "struct.pack...
400180185
#!/usr/bin/env python3 """Write gaze samples to samples.txt""" import argparse import itertools import os import queue import threading import time import sys import coloredlogs import cv2 as cv import numpy as np import tensorflow as tf from datasources import Video, Webcam, HDF5Source from models import ELG import...
null
src/view_data.py
view_data.py
py
7,207
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 24, "usage_type": "call" }, { "api_name": "coloredlogs.install", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.int32", "line_number": 39, "usage_type": "call" }, { "api_name": "numpy.zeros",...
18628778
import re import signal from datetime import datetime, timezone, timedelta import time import os import errno import psutil from threading import Thread import youtube_dl from common import logger def time_now(): utc_dt = datetime.utcnow().replace(tzinfo=timezone.utc) bj_dt = utc_dt.astimezone(timezone(timede...
null
Engine/work.py
work.py
py
7,617
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime.utcnow", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 14, "usage_type": "name" }, { "api_name": "datetime.timezone.utc", "line_number": 14, "usage_type": "attribute" }, { "api_name": ...
109975958
import matplotlib.pyplot as plt import numpy as np #显示中文 plt.rcParams['font.sans-serif']='SimHei' #显示-号 plt.rcParams['axes.unicode_minus']=False #内容太大时,强制显示所有内容,不省略 np.set_printoptions(threshold=np.NaN) #读取数据,二进制 data=np.load('国民经济核算季度数据.npz') print(type(data)) for i in data: print(i) name=data['co...
null
数据分析/day3/14、作业2.py
14、作业2.py
py
885
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.pyplot.rcParams", "line_number": 5, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 5, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 7, "usage_type": "attribute" }, { "ap...
100602281
# -*- coding:utf-8 -*- # @Author : 江湖一笑 # @Time : 2019/6/18 7:33 # @Software : PyCharm # @Python_verison : 3.7 ''' 多进程multiprocessing模块的使用和多线程threading模块的用法类似,multiprocessing提供了本地和远程的并发性, 有效的通过全局解释锁(GIL)来使用进程,由于GIL的存在,在CPU密集型的程序中,使用多线程并不能有效的利用多核CPU的优势, 因为一个解释器在同一时刻,只会有一个线程在执行,所以,multiprocessing模...
null
Web-Autotest-Python/Python-Selenium/python多线程-第10章/多进程技术03/multiprocessing模块01.py
multiprocessing模块01.py
py
1,876
python
en
code
null
code-starcoder2
83
[ { "api_name": "time.ctime", "line_number": 17, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 18, "usage_type": "call" }, { "api_name": "multiprocessing.Process", "line_number": 24, "usage_type": "call" }, { "api_name": "time.ctime", "line_...
148665457
from collections import deque for ir in range(int(input())): N = int(input()) A = [] dir = [[-1, 0], [0, 1], [1, 0], [0, -1]] for i in range(N): a = input() b = [] for i2 in a: b.append(int(i2)) A.append(b) A_cal = list([90000 for i in range(N)] for i1 i...
null
lecture/algorithm/problem/1249. 보급로.py
1249. 보급로.py
py
869
python
en
code
null
code-starcoder2
83
[ { "api_name": "collections.deque", "line_number": 18, "usage_type": "call" } ]
602102204
# # Copyright (c) 2012, 2013, 2014 Hewlett-Packard Development Company, L.P. # # 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 requi...
null
git_upstream/lib/rebaseeditor.py
rebaseeditor.py
py
10,175
python
en
code
null
code-starcoder2
83
[ { "api_name": "git_upstream.lib.utils.GitMixin", "line_number": 34, "usage_type": "name" }, { "api_name": "git_upstream.log.LogDedentMixin", "line_number": 34, "usage_type": "name" }, { "api_name": "git.Git", "line_number": 58, "usage_type": "call" }, { "api_name"...
615205495
import os import json import csv import boto3 def save_to_dynamodb(db_table, item): db_table.put_item( Item=item ) def lambda_handler(event, context): # extract info from event bucket = event['Records'][0]['s3']['bucket']['name'] s3_object = event['Records'][0]['s3']['object']['key'] # temprorary file to ...
null
Serverless_Application/csv_processor.py
csv_processor.py
py
1,006
python
en
code
null
code-starcoder2
83
[ { "api_name": "boto3.client", "line_number": 23, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 27, "usage_type": "attribute" }, { "api_name": "boto3.resource", "line_number": 28, "usage_type": "call" }, { "api_name": "csv.DictReader", "lin...
605256556
# -*- coding: utf-8 -*- """ Created on Wed Feb 17 16:32:30 2021 @author: Spyro """ # import main Flask class and request object from flask import Flask, request from flask_cors import CORS, cross_origin import api_calls # create the Flask app app = Flask(__name__) cors = CORS(app) app.config['CORS_HEA...
null
bin/scripts/visualization_app_api_start.py
visualization_app_api_start.py
py
1,729
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 14, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.request.get_json", "line_number": 26, "usage_type": "call" }, { "api_name": "flask.request", ...
223887987
# -*- coding: utf-8 -*- """ Created on Tue Jan 5 01:19:25 2021 @author: ma7mo """ # Data Preprocessing Tools # importing libs import numpy as np import pandas as pd import matplotlib.pyplot as plt # importing dataset dataset = pd.read_csv('Data.csv') X = dataset.iloc[: , :-1].values y = dataset.iloc[: , -1].value...
null
P14-Part1-Data-Preprocessing/Section 3 - Data Preprocessing in Python/Python/my_data_preprocessing_tools.py
my_data_preprocessing_tools.py
py
2,193
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_csv", "line_number": 16, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.Imputer", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.nan", "line_number": 23, "usage_type": "attribute" }, { "api_name": "sklearn....
240295490
# The plot server must be running # Go to http://localhost:5006/bokeh to view this plot import time from numpy import pi, cos, sin, linspace, roll, zeros_like from bokeh.plotting import cursession, figure, show, output_server from bokeh.models import GlyphRenderer N = 50 + 1 r_base = 8 theta = linspace(0, 2*pi, N) ...
null
examples/plotting/server/animated.py
animated.py
py
1,161
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.linspace", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 13, "usage_type": "name" }, { "api_name": "numpy.linspace", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": ...
586075123
from PIL import Image, ImageDraw, ImageChops, ImageStat import argparse import os from functools import partial, reduce from random import random, randint from time import process_time import cairo import numpy import datetime # The Genetic Algorithm DNA strand will be a tuple of the polygons. # With each polygon cont...
null
grow.py
grow.py
py
14,158
python
en
code
null
code-starcoder2
83
[ { "api_name": "random.randint", "line_number": 24, "usage_type": "call" }, { "api_name": "random.random", "line_number": 41, "usage_type": "call" }, { "api_name": "random.random", "line_number": 44, "usage_type": "call" }, { "api_name": "functools.partial", "l...
467653873
import shutil from unittest.mock import Mock from pyspark.sql import DataFrame from pyspark.sql import functions as F from butterfree.configs import environment from butterfree.constants import DataType from butterfree.constants.columns import TIMESTAMP_COLUMN from butterfree.extract import Source from butterfree.ext...
null
tests/integration/butterfree/pipelines/test_feature_set_pipeline.py
test_feature_set_pipeline.py
py
4,873
python
en
code
null
code-starcoder2
83
[ { "api_name": "pyspark.sql.DataFrame", "line_number": 22, "usage_type": "name" }, { "api_name": "pyspark.sql.functions.col", "line_number": 37, "usage_type": "call" }, { "api_name": "pyspark.sql.functions", "line_number": 37, "usage_type": "name" }, { "api_name": ...
257914739
#!/usr/bin/python # -*- coding: utf8-*- import requests from bs4 import BeautifulSoup import pandas as pd import urllib from datetime import datetime import lxml import json import pathlib # ########## 다음 키워드 뽑아오기 ################ # dlist = [] ## 다음 키워드 저장 # html = requests.get("https://www.daum.net").text # soup = B...
null
crawling/chapter3/save2.py
save2.py
py
6,794
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.isdir", "line_number": 48, "usage_type": "call" }, { "api_name": "os.path", "line_number": 48, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_number": 49, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_num...
555534352
#vim: set fileencoding=utf-8 from django.http import HttpResponse, HttpResponseRedirect, Http404 from django.template import RequestContext, Template from django.template import Context, loader from django.shortcuts import render_to_response from django.contrib.auth.decorators import login_required from django.core.pag...
null
src/frontend/app/ctlweb/views/lists.py
lists.py
py
6,148
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.template.RequestContext", "line_number": 35, "usage_type": "call" }, { "api_name": "django.shortcuts.render_to_response", "line_number": 36, "usage_type": "call" }, { "api_name": "ctlweb.models.Interfaces.objects.none", "line_number": 52, "usage_type...
319436366
import unittest from selenium import webdriver from selenium.webdriver.common.by import By from pages.main_page import MainPage from argparser_dir.argparser_file import args class MyTestCase(unittest.TestCase): def setUp(self): self.driver = webdriver.Chrome() self.parser = args def test_lo...
null
tests/test_verification_file.py
test_verification_file.py
py
2,920
python
en
code
null
code-starcoder2
83
[ { "api_name": "unittest.TestCase", "line_number": 10, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 12, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 12, "usage_type": "name" }, { "api_name": "a...
443249128
#!/usr/bin/python # coding:utf-8 # https://gist.github.com/albertomontesg/d8b21a179c1e6cca0480ebdf292c34d2 from keras.models import Sequential from keras.layers.core import Dense, Dropout, Flatten from keras.layers.convolutional import Conv3D,Convolution3D, MaxPooling3D, ZeroPadding3D from keras.optimizers import SGD f...
null
hi_src/ST-CNN_ver2/savemodel.py
savemodel.py
py
10,680
python
en
code
null
code-starcoder2
83
[ { "api_name": "keras.backend.variable", "line_number": 33, "usage_type": "call" }, { "api_name": "keras.backend", "line_number": 33, "usage_type": "name" }, { "api_name": "keras.backend.clip", "line_number": 40, "usage_type": "call" }, { "api_name": "keras.backend...
400081428
from django.shortcuts import render, redirect from chat.models import Room, Message from django.http import HttpResponse, JsonResponse from django.contrib.auth.forms import UserCreationForm from .forms import CreateUserForm from django.contrib import messages from django.contrib.auth import authenticate, login, logou...
null
chat/views.py
views.py
py
2,781
python
en
code
null
code-starcoder2
83
[ { "api_name": "forms.CreateUserForm", "line_number": 14, "usage_type": "call" }, { "api_name": "forms.CreateUserForm", "line_number": 17, "usage_type": "call" }, { "api_name": "django.contrib.messages.success", "line_number": 21, "usage_type": "call" }, { "api_nam...
88871896
# -*- coding: utf-8 -*- # @File : SimplePostPythonModule.py # @Date : 2019/1/12 # @Desc : import base64 import json from Lib.ModuleAPI import * class PostModule(PostMSFPythonWithParamsModule): NAME = "内网Netbios&SMB扫描" DESC = "通过 NBNS 协议获取 NetBIOS Name.\n" \ "通过 139(默认)或者 445 探测系统相关信息.\n" ...
null
MODULES/Discovery_NetworkServiceScanning_NbtScanByPython.py
Discovery_NetworkServiceScanning_NbtScanByPython.py
py
6,565
python
en
code
null
code-starcoder2
83
[ { "api_name": "base64.b64decode", "line_number": 95, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 96, "usage_type": "call" } ]
152914191
import csv import random from pathlib import Path from typing import * import cv2 import imutils import numpy as np import tqdm SEED = 0xCAFFE IOU_THRESHOLD = 0.3 py_rng = random.Random(SEED) np_rng = np.random.RandomState(SEED) MAX_TRIES = 50 MINIMAL_WIDTH = 5 MINIMAL_HEIGHT = 5 WIDTH_RANGE = (MINIMAL_WIDTH, 40) HEI...
null
src/dataset/create_no_sign_class_samples.py
create_no_sign_class_samples.py
py
8,470
python
en
code
null
code-starcoder2
83
[ { "api_name": "random.Random", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.random.RandomState", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 14, "usage_type": "attribute" }, { "api_name": "pathlib.Path...
647634643
## 30 days classification import os import glob from tqdm import tqdm import pandas as pd from sklearn.utils import resample from sklearn.utils import shuffle def clean_data(path): print("process start..") df_admi_table=pd.read_csv(f'{path}/AdmissionsCorePopulatedTable.txt', nam...
null
utility/.ipynb_checkpoints/preprocessing2-checkpoint.py
preprocessing2-checkpoint.py
py
3,798
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_csv", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 16, "usage_type": "call" }, { "api_name": "os.makedirs", "li...
490801650
import logging from logging.handlers import TimedRotatingFileHandler import os from app.flask_app import ROOT def get_logger(name): """ Ф-я создания логирования name - название файла лога (для каждого handlera свое) Выход: созданный логгер """ formatter = logging.Formatter( fmt='%(ascti...
null
tasks/utils/logger.py
logger.py
py
877
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.Formatter", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.handlers.TimedRotatingFileHandler", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 18, "usage_type": "call" }, { "api_name...
623226672
import pytest @pytest.mark.models @pytest.mark.unit @pytest.mark.incremental class TestPageView: model = None data = { 'session_id': 'asjdkasdhjghj', 'url': 'any.com' } def test_create(self, database): from geru.models.pageviews import PageView page = PageView(**self.d...
null
etc/geru_code/tests/models/test_pageviews.py
test_pageviews.py
py
830
python
en
code
null
code-starcoder2
83
[ { "api_name": "geru.models.pageviews.PageView", "line_number": 16, "usage_type": "call" }, { "api_name": "geru.models.pageviews.PageView", "line_number": 22, "usage_type": "name" }, { "api_name": "geru.models.pageviews.PageView", "line_number": 26, "usage_type": "name" ...
85690461
import sqlite3 # open-source sql built into python # make a connection to a db conn = sqlite3.connect('my_db') # conect to this db or create a db if doesnt exist and then connect to it # create a cursor to access members of the db curs = conn.cursor() # curs is a db access object # some SQL statements to rea...
null
pyadvanced/some_db/208db_read.py
208db_read.py
py
871
python
en
code
null
code-starcoder2
83
[ { "api_name": "sqlite3.connect", "line_number": 4, "usage_type": "call" } ]
280588641
# -*- encoding: UTF-8 -*- #!/usr/bin/python3.4 import sys import subprocess import datetime def plot(lst): i = 0 trying = 100 base_name = 'plot_pipe' #print(lst) while (i < trying): try: file_name = base_name+str(i) f = open(file_name, 'w') for x in lst: f.write(str(x)+' ') f.flush() f.close(...
null
Cauchy_problem/pipe_ploter.py
pipe_ploter.py
py
1,000
python
en
code
null
code-starcoder2
83
[ { "api_name": "subprocess.call", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 32, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 32, "usage_type": "attribute" }, { "api_name": "subproce...
277091834
#!/usr/bin/env python # coding: utf-8 # # Test for simulated EEG # # Authors : Guillaume Dumas # # Date : 2020-07-09 from pathlib import Path from copy import copy from collections import OrderedDict import numpy as np import scipy from scipy.integrate import odeint import matplotlib.pyplot as plt...
null
tutorial/simulations.py
simulations.py
py
5,601
python
en
code
null
code-starcoder2
83
[ { "api_name": "mne.Epochs", "line_number": 23, "usage_type": "attribute" }, { "api_name": "numpy.ndarray", "line_number": 23, "usage_type": "attribute" }, { "api_name": "numpy.linspace", "line_number": 53, "usage_type": "call" }, { "api_name": "numpy.random.randn"...
55174180
from abc import abstractmethod import random import sys import threading from time import time from spidev import spidev from util.logger import Logger try: import RPi.GPIO as GPIO except RuntimeError: print('Error importing RPi.GPIO!' ' This is probably because you need superuser privileges.' ...
null
sensors/adc/adc.py
adc.py
py
2,563
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.exit", "line_number": 15, "usage_type": "call" }, { "api_name": "util.logger.Logger", "line_number": 20, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 23, "usage_type": "attribute" }, { "api_name": "spidev.spidev.SpiDe...
288656633
import discord from discord.ext import commands class botinfo(): def __init__(self, client): self.client = client @commands.command() async def botinfo(self, ctx, *, user: discord.Member=None): embed=discord.Embed(title="informações do bot", description="essas são minha informações...
null
cogs/botinfo.py
botinfo.py
py
1,225
python
en
code
null
code-starcoder2
83
[ { "api_name": "discord.Member", "line_number": 8, "usage_type": "attribute" }, { "api_name": "discord.Embed", "line_number": 10, "usage_type": "call" }, { "api_name": "discord.ext.commands.command", "line_number": 7, "usage_type": "call" }, { "api_name": "discord....
13981326
from copy import copy from typing import Dict, Type, Any, Optional, TypeVar from .common import Serializer, Parser, AbstractFactory from .parsers import create_parser, get_lazy_parser from .schema import Schema, merge_schema from .serializers import create_serializer, get_lazy_serializer from .type_detection import is...
null
dataclass_factory/factory.py
factory.py
py
4,441
python
en
code
null
code-starcoder2
83
[ { "api_name": "schema.Schema", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 11, "usage_type": "name" }, { "api_name": "naming.NameStyle.ignore", "line_number": 15, "usage_type": "attribute" }, { "api_name": "naming.NameStyl...
278766536
import Orange from orangecontrib.associate.fpgrowth import * from scipy.sparse import lil_matrix import sys def inferRules(content): if content == 1: set = "cars_proc.tab" minsup = 0.2 minconf = 0.7 elif content == 0: set = "voting.tab" minsup = 0.5 minconf = 0....
null
HW1_p3.py
HW1_p3.py
py
1,368
python
en
code
null
code-starcoder2
83
[ { "api_name": "Orange.data.Table", "line_number": 20, "usage_type": "call" }, { "api_name": "Orange.data", "line_number": 20, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 48, "usage_type": "call" } ]
202061974
import telebot from telebot import types TOKEN = '1017092229:AAGfakUe7TMHtP8MwTDhS6hYXD8wHEmK9X0' # bot token OKDA bot = telebot.TeleBot(TOKEN) #memes def nice(message): noice = open('img/noice.jpg', 'rb') bot.send_photo(message.chat.id, noice) bot.send_message(message.chat.id, "Держи, ёмаё."...
null
config.py
config.py
py
398
python
en
code
null
code-starcoder2
83
[ { "api_name": "telebot.TeleBot", "line_number": 7, "usage_type": "call" } ]
260084595
#!/usr/bin/env python import argparse import logging import platform import os import subprocess import time import yaml import uuid def parse_config(config_file) : logging.info("Loading configuration from %s" % config_file) config = open(config_file, 'r') return yaml.load(config) def main(): # Par...
null
production/bsub_prod.py
bsub_prod.py
py
4,216
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.info", "line_number": 14, "usage_type": "call" }, { "api_name": "yaml.load", "line_number": 16, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 21, "usage_type": "call" }, { "api_name": "logging.basicConfig", ...
603548270
import requests import json from urllib.parse import urljoin import urllib3 class BaseClient(object): def __init__(self, base_url, verify=False, ok_codes=(200, 201, 204), headers=None, auth=None): self._base_url = base_url self._verify = verify self._ok_codes = ok_codes self._head...
null
src/blueprints/common.py
common.py
py
3,783
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.Session", "line_number": 15, "usage_type": "call" }, { "api_name": "urllib3.disable_warnings", "line_number": 20, "usage_type": "call" }, { "api_name": "urllib.parse.urljoin", "line_number": 23, "usage_type": "call" }, { "api_name": "json.d...
116228920
#!/usr/bin/python import os import sys import logging import urllib.request import json import cv2 from concurrent.futures.thread import ThreadPoolExecutor from progress.bar import Bar from PIL import Image import socket # download function on multi-threads def download(item_id, url, images_dir, bbox,...
null
download.py
download.py
py
6,593
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.exists", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path.join", "line_numb...
571327733
# -*- coding: utf-8 -*- import numpy as np import math import matplotlib.pyplot as plt def sigmoid(x): ''' :param x: :return: ''' if type(x)!=np.ndarray: return 1/(1+math.exp(-x)) return 1/(1+np.exp(-x)) #激活函数的偏导数 def sigDer(x): ''' :param x: :return: ''' return sigm...
null
code/torchBp.py
torchBp.py
py
2,028
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.ndarray", "line_number": 10, "usage_type": "attribute" }, { "api_name": "math.exp", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.array", "line_number"...
199685258
#!/usr/bin/python from collections import Counter def main(): print("How many employees will be playing?: ") try: count = int(input()) init(count) except ValueError: print("Not a number, Pleas try again") main() def init(count): w , h = 8,count master_list = [] ...
null
greenphire.py
greenphire.py
py
1,762
python
en
code
null
code-starcoder2
83
[ { "api_name": "collections.Counter", "line_number": 55, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 59, "usage_type": "call" } ]
538983773
""" code to build MEDS files """ from __future__ import print_function import json import copy import numpy from numpy import where, zeros # external requirements import fitsio # esutil is only needed for the Maker, so we will let # it slide if it is missing try: import esutil as eu have_esutil=True except: ...
null
meds/maker.py
maker.py
py
29,287
python
en
code
null
code-starcoder2
83
[ { "api_name": "fitsio.FITS", "line_number": 95, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 235, "usage_type": "call" }, { "api_name": "defaults.default_values", "line_number": 236, "usage_type": "name" }, { "api_name": "numpy.where", "...
269871591
from django.core.management import BaseCommand, CommandError from django.test import override_settings from tickets.models import Order from tickets.tests import factories class Command(BaseCommand): def handle(self, *args, **kwargs): if Order.objects.count() > 0: raise CommandError('The data...
null
ironcage/management/commands/generatesampledata.py
generatesampledata.py
py
827
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.core.management.BaseCommand", "line_number": 8, "usage_type": "name" }, { "api_name": "tickets.models.Order.objects.count", "line_number": 10, "usage_type": "call" }, { "api_name": "tickets.models.Order.objects", "line_number": 10, "usage_type": "att...
594921209
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Nov 6 2018 Authors: Nathan De Lara <ndelara@enst.fr> Quality metrics for graph embeddings """ import numpy as np from scipy import sparse from scipy.stats import hmean def dot_modularity(adjacency_matrix, embedding: np.ndarray, features=None, resolutio...
null
sknetwork/embedding/metrics.py
metrics.py
py
5,458
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.ndarray", "line_number": 18, "usage_type": "attribute" }, { "api_name": "scipy.sparse.csr_matrix", "line_number": 49, "usage_type": "attribute" }, { "api_name": "scipy.sparse", "line_number": 49, "usage_type": "name" }, { "api_name": "scipy.sp...
234598352
from __future__ import print_function from __future__ import division import os import sys import torch import torch.nn as nn import numpy as np import scipy as sp import torch.nn.functional as F from torch.autograd import Variable import re from collections import Mapping, namedtuple, defaultdict, Sequenc...
null
utils/misc.py
misc.py
py
11,080
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.random", "line_number": 32, "usage_type": "attribute" }, { "api_name": "numpy.random", "line_number": 33, "usage_type": "attribute" }, { "api_name": "numpy.integer", "line_number": 34, "usage_type": "attribute" }, { "api_name": "numpy.random.R...
158691299
#!/usr/bin/env python # -*- coding:utf-8 -*- # Author : Xfell # Email: xfell96@163.com # File Name:app # Date:2018/3/26 from flask import Flask,render_template,abort import os import json app = Flask(__name__) app.config['TEMPLATES_AUTO_RELOAD'] = True class File(object): dircetory = os.path.join(os.path.abspat...
null
challenge_6/app.py
app.py
py
1,366
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_num...
115987368
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
null
azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/models/artifact_source_fragment.py
artifact_source_fragment.py
py
4,157
python
en
code
null
code-starcoder2
83
[ { "api_name": "resource.Resource", "line_number": 15, "usage_type": "name" } ]
27736703
import numpy as np import pandas as pd import matplotlib.pyplot as plt # Question: Is there a correlation between the relationships between the victim and the perpetrator? dataArr = pd.read_csv("../data/database.csv") # remove these columns dataArr = (dataArr.drop(['Record ID', 'Agency Code','Agency Name','Agency Ty...
null
scripts/q2_relationship_2.py
q2_relationship_2.py
py
1,237
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.pie", "line_number": 29, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 29, "usage_type": "name" }, { "api_name": "matplotlib.pyp...
565420388
from flask import jsonify, request, abort, Response, render_template from flight import app from extractor import getData, filterResults from datetime import datetime import json import requests from weather import getWeather url = "http://partners.api.skyscanner.net/apiservices/" @app.route('/', methods=['GET']) def...
null
src/flight/routes.py
routes.py
py
5,156
python
en
code
null
code-starcoder2
83
[ { "api_name": "flight.app.send_from_directory", "line_number": 13, "usage_type": "call" }, { "api_name": "flight.app", "line_number": 13, "usage_type": "name" }, { "api_name": "flight.app.route", "line_number": 11, "usage_type": "call" }, { "api_name": "flight.app...
207201112
from app.common.toolbox import doRender from google.appengine.ext import db from app.model import * import datetime from datetime import date from app.base_handler import BaseHandler from app.common.voluptuous import * import json import base64 import re class GetUserHandler(BaseHandler): def get(self, user_id): s...
null
app/controllers/users.py
users.py
py
1,341
python
en
code
null
code-starcoder2
83
[ { "api_name": "app.base_handler.BaseHandler", "line_number": 13, "usage_type": "name" }, { "api_name": "app.common.toolbox.doRender", "line_number": 20, "usage_type": "call" }, { "api_name": "app.base_handler.BaseHandler", "line_number": 24, "usage_type": "name" }, { ...
412228127
import sys import cv2 import numpy as np import math from random import shuffle import selectinwindow # Set recursion limit sys.setrecursionlimit(10 ** 9) drawing = False xi, yi = -1, -1 B = [i for i in range(256)] G = [i for i in range(256)] R = [i for i in range(256)] def nothing(x): pass # cv2.createTrackb...
null
mouse_event.py
mouse_event.py
py
1,357
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.setrecursionlimit", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.EVENT_LBUTTONDOWN", "line_number": 28, "usage_type": "attribute" }, { "api_name": "random.shuffle", "line_number": 31, "usage_type": "call" }, { "api_name": "cv2.EV...
571018383
from redis import StrictRedis if __name__ == '__main__': # 创建一个StrictRedis对象,链接redis数据库 try: sr = StrictRedis() # 添加一个key,为name,value为Simon # res = sr.set('name', 'simon') # print(res) # 修改name的值为chou # res = sr.set('name', 'chou') # 获取name的值 ...
null
redis_test/redis_string.py
redis_string.py
py
629
python
en
code
null
code-starcoder2
83
[ { "api_name": "redis.StrictRedis", "line_number": 6, "usage_type": "call" } ]
531811695
import tensorflow as tf from tensorflow.keras import regularizers from tensorflow.keras.preprocessing.image import ImageDataGenerator from neural_nets.data_utils import * from tensorflow.keras import Sequential from tensorflow.keras.models import load_model from tensorflow.keras.layers import * from tensorflow.keras.ca...
null
neural_nets/tensorflow_models/tf_digits_CNN_Data_Gen.py
tf_digits_CNN_Data_Gen.py
py
5,671
python
en
code
null
code-starcoder2
83
[ { "api_name": "tensorflow.initializers.VarianceScaling", "line_number": 17, "usage_type": "call" }, { "api_name": "tensorflow.initializers", "line_number": 17, "usage_type": "attribute" }, { "api_name": "tensorflow.keras.layers.Conv2D", "line_number": 20, "usage_type": "c...
558568422
""" The :mod:`spirograph.main` module contains the :function:`main`. The :function:`main` function, along with it's associated helper functions, will make it easy to draw multiple spirographs from the command line. """ import argparse import turtle from spirograph.my_spiro import Spirograph from spirograph.my_spiro_a...
null
spirograph/main.py
main.py
py
4,702
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 77, "usage_type": "call" }, { "api_name": "turtle.setup", "line_number": 97, "usage_type": "call" }, { "api_name": "turtle.shape", "line_number": 98, "usage_type": "call" }, { "api_name": "turtle.title", ...
107530508
from jesusanaya_com.models import get_engine, get_session_factory, get_tm_session from jesusanaya_com.models.meta import Base import pytest import transaction @pytest.fixture(scope="session") def db_engine(request): engine = get_engine({"sqlalchemy.url": "sqlite:///:memory:"}) Base.metadata.create_all(engine)...
null
jesusanaya_com/tests/conftest.py
conftest.py
py
667
python
en
code
null
code-starcoder2
83
[ { "api_name": "jesusanaya_com.models.get_engine", "line_number": 9, "usage_type": "call" }, { "api_name": "jesusanaya_com.models.meta.Base.metadata.create_all", "line_number": 10, "usage_type": "call" }, { "api_name": "jesusanaya_com.models.meta.Base.metadata", "line_number":...
209801353
#!/usr/bin/env python import sys import os from shutil import copyfile import time import itertools import torch from torch.autograd import Variable import torchvision.utils as vutils from options import TrainOptions, create_sub_dirs from data import load, AlignedIterator, UnalignedIterator from model import StochCyc...
null
edges2shoes_exp/train.py
train.py
py
7,795
python
en
code
null
code-starcoder2
83
[ { "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", "line_number": 21, "usage_type": "call" }, { "api_name": "glob.glob", "line_n...
233156173
import pytest import numpy import pandas def pytest_addoption(parser): parser.addoption("--skip-slow", action="store_true", help="skip slow tests") parser.addoption("--skip-network", action="store_true", help="run network tests") parser.addoption("--only-slow", a...
null
pandas/conftest.py
conftest.py
py
1,007
python
en
code
null
code-starcoder2
83
[ { "api_name": "pytest.skip", "line_number": 18, "usage_type": "call" }, { "api_name": "pytest.skip", "line_number": 21, "usage_type": "call" }, { "api_name": "pytest.skip", "line_number": 24, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number...
127275463
import json import sys import textwrap from engine import GameEngine COLUMNS = 80 class Application: def __init__(self, game, use_audio=True): if use_audio: print('Loading hardware ...') from farmer_says import FarmerSays print('... done') self._hardware...
null
src/app_console.py
app_console.py
py
2,469
python
en
code
null
code-starcoder2
83
[ { "api_name": "farmer_says.FarmerSays", "line_number": 18, "usage_type": "call" }, { "api_name": "json.load", "line_number": 24, "usage_type": "call" }, { "api_name": "json.load", "line_number": 27, "usage_type": "call" }, { "api_name": "engine.GameEngine", "l...
468552044
# -*- coding: utf-8 -*- """ Created on Mon Oct 19 15:52:19 2020 @author: Karan """ import time import requests import io import os import hashlib from selenium import webdriver from PIL import Image def fetch_image_urls(query, max_links_to_fetch, wd, sleep_between_interactions=1): def scroll_to_end(wd): ...
null
scrapper.py
scrapper.py
py
3,730
python
en
code
null
code-starcoder2
83
[ { "api_name": "time.sleep", "line_number": 23, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 43, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 59, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 73...
536325315
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from functools import partial from odoo import api, fields, models, _ from odoo.exceptions import UserError from odoo.tools.misc import formatLang class AccountInvoice(models.Model): _inherit = "account.invoice" ...
null
tax_margin/models/account_invoice.py
account_invoice.py
py
16,586
python
en
code
null
code-starcoder2
83
[ { "api_name": "odoo.models.Model", "line_number": 11, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 11, "usage_type": "name" }, { "api_name": "odoo.fields.Boolean", "line_number": 15, "usage_type": "call" }, { "api_name": "odoo.fields", ...
620613938
import cv2 as cv import numpy as np blank = np.zeros((400,400), dtype='uint8') rectangle = cv.rectangle(blank.copy(),(30,30),(370,370),255,-1) circle = cv.circle(blank.copy(),(200,200),200,255,-1) cv.imshow('Rectangle',rectangle) cv.imshow('Circle',circle) #bitwise And bitwise_and = cv.bitwise_and(rectangle,circle)...
null
bitwise.py
bitwise.py
py
433
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.zeros", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.rectangle", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.circle", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 9, ...
138650590
#!/usr/bin/env python import argparse import json import logging import sys import time import requests """ Fetches events from Remora and ingests into KairosDB. """ KAIROS_WRITE_PATH = "/api/v1/datapoints" def sum_lag(consumer_group_name, consumer_group_data): metrics = {} for partition in consumer_grou...
null
remora-fetcher.py
remora-fetcher.py
py
3,728
python
en
code
null
code-starcoder2
83
[ { "api_name": "time.time", "line_number": 37, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 43, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 47, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": ...
71224660
import numpy as np import astropy.units as u from astropy import constants as const from astropy.table import QTable from glue.core.message import (SubsetCreateMessage, SubsetDeleteMessage, SubsetUpdateMessage) from traitlets import Bool, Float, Int, List, U...
null
jdaviz/configs/default/plugins/line_lists/line_lists.py
line_lists.py
py
26,894
python
en
code
null
code-starcoder2
83
[ { "api_name": "jdaviz.core.template_mixin.TemplateMixin", "line_number": 26, "usage_type": "name" }, { "api_name": "traitlets.Bool", "line_number": 27, "usage_type": "call" }, { "api_name": "traitlets.Bool", "line_number": 30, "usage_type": "call" }, { "api_name":...
540167651
import argparse import contextlib import json import logging import os import shutil import subprocess import unicodedata import fs from typing import ( Dict, IO, Iterator, Tuple, ) EXTENSIONS = ( '.flac', '.m4a', '.mp3', '.mp4', '.opus', '.wma', ) parser = argparse.ArgumentP...
null
ghettosync.py
ghettosync.py
py
5,652
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 28, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 32, "usage_type": "attribute" }, { "api_name": "logging.basicConfig", "line_number": 35, "usage_type": "call" }, { "api_name": "logging...