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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
364571636 | import torch
from torch.utils.data import Dataset
import numpy as np
from tqdm.auto import tqdm
import typing
from typing import List
from typing import Dict
from typing import Tuple
from collections import Counter
import itertools
import functools
import os
import math
import multiprocessing as mp
cl... | null | backup/dataset.py | dataset.py | py | 9,370 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "numpy.ndarray",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "typing.List",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "typing.Dict",... |
623709004 | import cv2
import numpy as np
img1=cv2.imread('twocolor.jpg')
img2=cv2.imread('people.jpg')
dst = cv2.addWeighted(img1,1,img2,0,0)
cv2.imshow('dst',dst)
cv2.waitKey(0)
cv2.destroyAllWindows() | null | mix.py | mix.py | py | 193 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cv2.imread",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.addWeighted",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 8,... |
341310636 | from rest_framework.renderers import JSONRenderer
from django.http import HttpResponse
import hashlib
class JSONResponse(HttpResponse):
def __init__(self, data, **kwargs):
content = JSONRenderer().render(data)
kwargs['content-type'] = 'application/json'
super(JSONResponse, self).__init__(co... | null | ExamServerPy/ExamServer/utils.py | utils.py | py | 536 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.http.HttpResponse",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "rest_framework.renderers.JSONRenderer",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "hashlib.md5",
"line_number": 13,
"usage_type": "call"
}
] |
486120807 | from django.shortcuts import render,redirect,get_object_or_404
from playGame.models import Game
from django.contrib.auth.decorators import login_required
from .forms import InvitationForm
from .models import Invitation
from django.core.exceptions import PermissionDenied
from django.views.generic import CreateView
from ... | null | player/views.py | views.py | py | 3,046 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "playGame.models.Game.objects.games_for_user",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "playGame.models.Game.objects",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "playGame.models.Game",
"line_number": 17,
"usage_type": "na... |
275046121 | import sys
import unittest
from markdown import markdown, Markdown
is_python3 = sys.version_info >= (3, 0)
if is_python3:
from mdx_linkify.mdx_linkify import LinkifyExtension
else:
from mdx_linkify import LinkifyExtension
class LinkifyTest(unittest.TestCase):
def test_link(self):
expected = '<p... | null | mdx_linkify/tests.py | tests.py | py | 3,899 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.version_info",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "unittest.TestCase",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "markdown.markdown",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "markdow... |
387367179 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 28 00:27:41 2021
@author: qiang
"""
import cv2
from CoppeliaSim_UR5_gym_v3 import CoppeliaSim_UR5_gym_v3
from env import GymEnv, EnvBatcher
env = CoppeliaSim_UR5_gym_v3()
from torchvision.utils import make_grid
# from __future__ import print_functio... | null | run.py | run.py | py | 4,699 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "CoppeliaSim_UR5_gym_v3.CoppeliaSim_UR5_gym_v3",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.rand_like",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.clip",
"line_number": 35,
"usage_type": "call"
},
{
"api_name... |
368650281 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# vals program is free software: you can redistribute it and/or modify
# it under the terms of the G... | null | addons_miguel/despesa/wizard/formulario_diario_pagamentos_ordem.py | formulario_diario_pagamentos_ordem.py | py | 6,903 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "openerp.osv.osv.Model",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "openerp.osv.osv",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "openerp.osv.osv.except_osv",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": ... |
277574737 | from typing import Dict
from collections import deque
from datetime import datetime
import asyncio
class SynchronizationThrottler:
"""Synchronization throttler used to limit the amount of concurrent synchronizations to prevent application
from being overloaded due to excessive number of synchronisation respon... | null | lib/clients/metaApi/synchronizationThrottler.py | synchronizationThrottler.py | py | 6,057 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.deque",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "asyncio.sleep",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "asyncio.sleep",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "asyncio.create_task",
... |
632182732 | # included from libs/dinic_maxflow.py
"""
Dinic: MaxFlow
"""
from collections import defaultdict
from collections import deque
class Dinic:
def __init__(self, numVertex):
from collections import defaultdict
self.numVertex = numVertex
self.edges = defaultdict(lambda: defaultdict(int))
... | null | single/arc085e.py | arc085e.py | py | 4,642 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.defaultdict",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "sys.stderr",
"line_number": 93,
"usage_type": "attribute"
},
{
"api_name": "{'defaultdi... |
67655373 | import torch.nn.functional as F
import torch
class ClassifyModel(torch.nn.Module):
def __init__(self, num_features=316, num_hidden=[316,316], num_classes=6,dropout_prob=0.7):
super(ClassifyModel, self).__init__()
num_hidden_1, num_hidden_2 = num_hidden
self.linear_1 = torch.nn.Linear(num... | null | lr/model.py | model.py | py | 1,058 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.nn",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Linear",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Linear",
"lin... |
451501816 | from django.conf.urls import patterns, url
from visual import views
urlpatterns = patterns('',
# ex: /visual/
url(r'^$', views.fetch, name='fetch'),
# ex: /visual/results/
url(r'^results/$', views.results, name='results'),
# ex: /visual/base/
url(r'^base/$', views.base, name='base'),
) | null | visual/urls.py | urls.py | py | 309 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.conf.urls.patterns",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "visual.views.fetch",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "v... |
396469497 | """
A freely-propagating, premixed methane-air flat flame with charged species.
"""
import cantera as ct
import numpy as np
# Simulation parameters
p = ct.one_atm # pressure [Pa]
Tin = 300.0 # unburned gas temperature [K]
reactants = 'CH4:1, O2:2, N2:7.52' # premixed gas composition
width = 0.05 # m
loglevel = 1 ... | null | interfaces/cython/cantera/examples/onedim/ion_flame.py | ion_flame.py | py | 1,198 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cantera.one_atm",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "cantera.Solution",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "cantera.IonFlame",
"line_number": 21,
"usage_type": "call"
}
] |
451317089 | import pytest
import requests
# URL endpoints
test_url = 'http://localhost:8088'
upload_url = test_url + '/upload'
detail_url = test_url + '/detail'
cleanup_url = test_url + '/cleanup'
# Test message strings
no_server_msg = 'Start web app server at ' + test_url + ' to run tests'
detail_400_msg = '400: Missing image... | null | tests/test.py | test.py | py | 3,246 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "requests.exceptions",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "pytest.mark.skipif",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pytest.mark"... |
363356148 | """Add bbb_logo
Revision ID: 4c7fc99d143c
Revises: 74021af9ca81
Create Date: 2020-08-21 13:56:29.869486
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '4c7fc99d143c'
down_revision = '74021af9ca81'
branch_labels = None
depends_on = None
def upgrade():
# ###... | null | migrations/versions/4c7fc99d143c_add_bbb_logo.py | 4c7fc99d143c_add_bbb_logo.py | py | 1,246 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "alembic.op.add_column",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.String"... |
146540757 | from datetime import datetime
# class Spy is declared
class Spy:
def __init__(self,name,salutation,age,rating):
self.name = name
self.salutation = salutation
self.age = age
self.rating = rating
self_is_online = True
self.chats = []
self.current_status = None... | null | spy_details.py | spy_details.py | py | 732 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.datetime.now",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 19,
"usage_type": "name"
}
] |
560014477 | import csv
import datetime
import sqlite3
from matplotlib import pyplot
from statistics import mean
conn = sqlite3.connect('covid.db')
mycursor = conn.cursor()
infips = input('Enter FIPS or 0 for USA:')
dataout = []
if int(infips) > 999:
mycursor.execute('SELECT * FROM state_counties WHERE cfips=?', [infips])
... | null | covid/old/dump_data_sqlite.py | dump_data_sqlite.py | py | 3,163 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sqlite3.connect",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.title",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",... |
516837070 | #!/usr/bin/env python
import numpy as np
def argsort_atoms_by_chem(
atoms,
chem_order=None,
):
chems = np.array(atoms.get_chemical_symbols())
if not chem_order:
chem_order = np.unique(chems)
argsort = []
for chem in chem_order:
argsort.extend(np.arange(len(atoms))[chems == c... | null | sort_atoms.py | sort_atoms.py | py | 2,155 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.array",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.unique",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"l... |
346810835 | #comment these out whilst unused
import h5py
#import mapplot
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
from scipy import stats
### Modify the lines below ####################################################
# Set the file to read in
import os
#empty array for dates
dat... | null | correlation_LSTtxt.py | correlation_LSTtxt.py | py | 3,665 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.listdir",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "h5py.File",
"line_number": 6... |
361987732 | import urllib.request
import pytest
from bs4 import BeautifulSoup
from django.contrib.auth.models import User
from friendreq.models import ITEM_CHOICES, ItemRequest, ItemsFound
from gatherer import agora
@pytest.fixture(scope='module')
def soup_list():
"""
this fixture initialize soup list that contain soup ... | null | givitsite/givitsite/tests/pr_tests/test_gatherer_pr.py | test_gatherer_pr.py | py | 1,681 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "bs4.BeautifulSoup",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "gatherer.agora.fin... |
363725740 | import numpy as np, cv2
roi_hist = None # 추적 객체 히스토그램 저장 변수
win_name = 'MeanShift Tracking'
termination = (cv2.TERM_CRITERIA_EPS | cv2.TERM_CRITERIA_COUNT, 10, 1)
cap = cv2.VideoCapture(0)
cap.set(cv2.CAP_PROP_FRAME_WIDTH, 640)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 480)
while cap.isOpened():
ret, frame = cap.re... | null | 08.match_track/track_meanshift_cam.py | track_meanshift_cam.py | py | 2,227 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cv2.TERM_CRITERIA_EPS",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "cv2.TERM_CRITERIA_COUNT",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": ... |
232659435 | import random
from tqdm import tqdm
#Input text
src_text_path = "./back-translate-data/back-trans-open-sub.az"
src_text_file = open(src_text_path, "r")
src_text = src_text_file.readlines()
src_text_file.close()
trgt_text_path = "./back-translate-data/back-trans-open-sub.en"
trgt_text_file = open(trgt_text_path, "r")
t... | null | huggingface/train_dev_test_split.py | train_dev_test_split.py | py | 1,799 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "random.shuffle",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 56,... |
551620882 | from rest_framework import serializers
from django.contrib.auth import get_user_model
from django.urls import reverse
from misago.acl import serialize_acl
from .user import UserSerializer
UserModel = get_user_model()
__all__ = [
'AuthenticatedUserSerializer',
'AnonymousUserSerializer',
]
class AuthFlags... | null | misago/users/serializers/auth.py | auth.py | py | 2,490 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "user.UserSerializer",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.SerializerMethodField",
"line_number": 28,
"usage_type"... |
638978589 | from __future__ import print_function
import sys
import pkg_resources
from paste.script import command
import optparse
import re
from grokproject import GrokProject
project_name_re=re.compile('[A-z_][A-z0-9_]*')
def main(vars=GrokProject.vars, template_name='grok'):
usage = "usage: %prog [options] PROJECT"
pa... | null | grokproject/main.py | main.py | py | 3,267 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "re.compile",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "grokproject.GrokProject.vars",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "grokproject.GrokProject",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "o... |
198068393 | # For a list of documents sharing the same root element, merge them by
# creating a new document with the same root element, containing the children
# of each document's root element, in the order specified on the command line,
# and write to stdout.
# Attributes of the root elemenet must also be copied.
# Usage: pyt... | null | merge_xml.py | merge_xml.py | py | 1,069 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.argv",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "lxml.etree.fromstring",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"l... |
163531930 |
import os
import random
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim as optim
import torch.utils.data
from torchvision.datasets import ImageFolder
import torchvision.datasets as dset
from torch.utils.data import DataLoader, Dataset
import torchvisi... | null | scripts/second_stage.py | second_stage.py | py | 14,694 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "random.seed",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "torch.manual_seed",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numb... |
567114310 | from FastaSequence import *
from ErrorModelMaker import ErrorModelMaker
from DistributionMaker import SizeDistribution
from MetasimPy import MetasimPy
from Logger import Logger
import glob, FastaSequence, os, subprocess, datetime, platform, re
def SystemCheck():
CurrentDirectory = os.getcwd() + '/'
VelvetAnaly... | null | Runner.py | Runner.py | py | 13,922 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.getcwd",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "os.system",
"line_number": 21... |
194710106 | import numpy
from scipy import ndimage
'''采用高斯模糊的方法,通过高斯模糊矩阵对每个3*3的像素点进行卷积'''
def blur(image, districts, scale):
new_image = image.copy()
for district in districts:
new_image = gauss_blur(new_image, district, scale)
return new_image
def gauss_blur(image, district, scale):
#高斯模糊矩阵求每... | null | features/blur/blur.py | blur.py | py | 863 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.array",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "scipy.ndimage.convolve",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "scipy.ndimage",
"line_number": 26,
"usage_type": "name"
}
] |
534227905 | from requests import get
import matplotlib.pyplot as plt
from dateutil import parser
url = 'https://apex.oracle.com/pls/apex/raspberrypi/weatherstation/getallmeasurements/2801460'
weather = get(url).json()
temperatures = []
for record in weather['items']:
temperature = record['ambient_temp']
temperatures.append(tempe... | null | app.py | app.py | py | 557 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "dateutil.parser.parse",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "dateutil.parser",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.p... |
641155738 | import numpy as np
import cv2
import torch
import matplotlib.pyplot as plt
from torchvision.utils import make_grid
from models.unet import UNet
from models.gated_network import GatedGenerator
def unmask(unet_path,gated_conv_path,img,save_path):
myUnet=UNet()
myUnet.load_state_dict(torch.load(unet_pat... | null | models/unmasking/unmasker.py | unmasker.py | py | 1,054 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "models.unet.UNet",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torch.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.IMREAD_COLOR",
"line_n... |
616323057 | from bs4 import BeautifulSoup as soup
from urllib.request import urlopen as uReq
my_url="https://m.investing.com/crypto/"
#Estabelece uma conexão e pega a página
uClient = uReq(my_url)
page_html = uClient.read()
uClient.close()
#html parsing
page_soup = soup(page_html, "html.parser")
print(page_soup.body)
| null | usingBS.py | usingBS.py | py | 313 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 12,
"usage_type": "call"
}
] |
541095230 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('users', '0006_auto_20151028_0707'),
]
operations = [
migra... | null | users/migrations/0007_auto_20151028_0709.py | 0007_auto_20151028_0709.py | py | 576 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AlterField",
"line_number": 16,
"usage_type": "call"
},
{... |
576453518 | from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.Qt import *
class CirclingWidget(QWidget):
offset = QPoint()
def __init__(self, diameter=1, relative=True, sprite=None,
anglesPerSecond=360, clockwise=True, offset=None, alignment=None):
super().__init__()
self.d... | null | test.py | test.py | py | 5,160 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 107,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 107,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtGui.QPen",
"line_number": 131,
"usage_type": "call"
},
{
"api_name": "... |
366763791 | # Author: bbrighttaer
# Project: DRL-lessons
# Date: 1/23/20
# Time: 12:05 AM
# File: frozenlake_tabular_qlearning.py
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import collections
import gym
import numpy as np
... | null | chapter06/frozenlake_tabular_qlearning.py | frozenlake_tabular_qlearning.py | py | 2,717 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "random.seed",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "gym.make",
"line_... |
15811367 | import requests
import json
def get_month_num(month):
if month.find('работаю на данный момент') != -1:
return None
monthes = {
'январь':'01',
'феварь': '02',
'март':'03',
'апрель':'04',
'май': '05',
'июнь': '06',
'июль': '07',
'август': ... | null | Mixins.py | Mixins.py | py | 1,357 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "json.loads",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 30,
"usage_type": "call"
}
] |
618606383 | import argparse, sys
parser = argparse.ArgumentParser()
parser.add_argument('--dataset', required=True)
parser.add_argument('--model', required=True)
parser.add_argument('--depth', default=2, type=int)
parser.add_argument('--burnepochs', default=0, type=int)
parser.add_argument('--epochs', default=100, type=int)
parser... | null | run.py | run.py | py | 10,030 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.random",
... |
579372282 | import copy
import re
import zipfile
import json
import os
from tqdm import tqdm
import sys
import difflib
from fuzzywuzzy import fuzz
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
from convlab2.util.file_util import read_zipped_json, write_zipped_json
import... | null | data/unified_datasets/multiwoz23/preprocess.py | preprocess.py | py | 62,742 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.append",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
157227140 |
from torch import nn
class MLP(nn.Module):
def __init__(self, input_size, output_size_list):
'''
Parameters:
-input_size (int): number of dimensions for each point in each sequence.
-output_size_list (list of ints): number of output dimensions for each layer.
'''
... | null | models/utils/mlp.py | mlp.py | py | 1,253 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.nn.Module",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numb... |
219598586 | from db.crud import session_scope, recreate_database
from db.models import IncomeStatement, Ticker
from yahooquery import Ticker as YqTicker
import numpy as np
if __name__ == '__main__':
recreate_database()
ul = YqTicker('ul')
# print(ul.income_statement().columns)
print(ul.summary_detail)
print(u... | null | app/app.py | app.py | py | 998 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "db.crud.recreate_database",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "yahooquery.Ticker",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "db.crud.session_scope",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "db.mo... |
78556936 | # SCAR - Serverless Container-aware ARchitectures
# Copyright (C) 2011 - GRyCAP - Universitat Politecnica de Valencia
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | null | src/providers/aws/s3.py | s3.py | py | 7,169 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "src.providers.aws.clientfactory.GenericClient",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "botocore.exceptions.ClientError",
"line_number": 49,
"usage_type": "name"
},
{
"api_name": "src.logger.log_exception",
"line_number": 51,
"usage_type":... |
474302679 | #Machine Learning Heart Murmur Clustering
#Alisa Levin and Skyler Szot
import numpy as np
import pandas as pd
from sklearn.datasets import make_blobs
from matplotlib import cm
import matplotlib.pyplot as plt
from sklearn.cluster import KMeans
filename = "OnlySyst3.xlsx"
print("")
df = pd.read_excel(io=filename,... | null | heartmurmur.py | heartmurmur.py | py | 7,803 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_excel",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "sklearn.cluster.KMeans",
... |
562470380 | import tornado.httpserver
import tornado.websocket
import tornado.ioloop
import tornado.web
import socket
import csv
'''
This is a simple Websocket Echo server that uses the Tornado websocket handler.
Please run `pip install tornado` with python of version 2.7.9 or greater to install tornado.
This program will echo bac... | null | Project4/server/server.py | server.py | py | 5,011 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "csv.reader",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 54,
... |
18913785 | import cv2
import numpy as np
import os
import math
from scipy.spatial import distance as dist
from collections import OrderedDict
from scipy.optimize import linear_sum_assignment
from filterpy.kalman import KalmanFilter, UnscentedKalmanFilter, MerweScaledSigmaPoints
from filterpy.common import Q_discrete_white_noise
... | null | src/kalman_utils/UKFilter_test.py | UKFilter_test.py | py | 6,531 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.array",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.dot",
"line_number": 43... |
370393155 | # Definition for a binary tree Link.
# class TreeLink:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
from collections import deque
class Solution:
# @param {TreeLink} root
# @return {integer[][]}
def levelOrder(self, root):
if not root:
... | null | leetcode-solutions-master/102_binary_tree_level_order_traversal/binary_tree_level_order_traversal.py | binary_tree_level_order_traversal.py | py | 863 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.deque",
"line_number": 14,
"usage_type": "call"
}
] |
172237933 | #!/usr/bin/python2.7
# -*- coding: utf-8 -*-
# Write by yskang(kys061@gmail.com)
import subprocess
import time
from logging.handlers import RotatingFileHandler
import logging
import sys
import re
from time import sleep
stm_ver = r'7.3'
stm_id = r'cli_admin'
stm_pass = r'cli_admin'
stm_host = r'localhost'
stm_port = r... | null | script/thread_monitor/thread_monitor.py | thread_monitor.py | py | 15,306 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "logging.handlers.RotatingFileHandler",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name... |
192675009 | import base64
import celery
from celery import Celery
from flask import Flask, request
import hashlib
import hmac
import json
import keys
import logging
import requests
from tasks import transfer_item
app = Flask(__name__)
if not app.debug:
handler = logging.FileHandler('log')
handler.setLevel(logging.INFO)
... | null | app.py | app.py | py | 1,599 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.FileHandler",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "hmac.new",
"lin... |
459773917 | from flask import url_for
from models.user import User
from pytest import mark
# file named test_api_user to avoid pytest conflict with test_user from unit/models.
@mark.usefixtures("database")
class TestUser:
endpoint = "api.user"
def test_post_res_creates_new_user_and_returns_user_info(self, client, val... | null | backend/tests/integration/api/test_api_user.py | test_api_user.py | py | 631 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.url_for",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "models.user.User.get_or_none_by_id",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "models.user.User",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "pyt... |
273013801 | #!/usr/bin/env python
# createversion.py
# -------------------
# This script create version file
# replace keyword in specified template file.
#
# The format of the version number is as follows
# (optional components are shown in square brackets ([ and ]):
# Major.Minor.[.Build[.Revision]]
#
# KEYWORD
# ... | null | py/jenkins/createversion.py | createversion.py | py | 3,051 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "os.remove",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "subprocess.check_output",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "subprocess.CalledPr... |
18121671 | import struct
import binascii
from cryptography.hazmat.primitives.ciphers.aead import AESGCM
from .sqrl_crypto import *
class Identity():
def __init__(self, sqrlbinary):
self._sqrlbinary = sqrlbinary
if sqrlbinary[208:]:
# TODO: Parse data
raise NotImplemented("Identity w... | null | pysqrl/pysqrl/sqrl_s4.py | sqrl_s4.py | py | 7,931 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "struct.unpack",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "binascii.hexlify",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "binascii.hexlify",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "binascii.hexlify",
... |
178516331 | import unittest
from unittest import mock
from podman import PodmanClient
class TestPodmanClient(unittest.TestCase):
"""Test the PodmanClient() object."""
def setUp(self) -> None:
super().setUp()
self.client = PodmanClient(base_url='unix://localhost:9999')
@mock.patch('requests.Session.... | null | podman/tests/unit/test_podmanclient.py | test_podmanclient.py | py | 489 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "unittest.TestCase",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "podman.PodmanClient",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "unittest.mock.patch",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "unittes... |
300858795 | import math
import time
import asyncio
import requests
from typing import Tuple, Dict
from ratelimit import sleep_and_retry
from ratelimit.exception import RateLimitException
from functools import wraps
@sleep_and_retry
def get_with_retry(
url,
retry_on: Tuple[int] = (),
sleep_period: int = No... | null | IA/utils.py | utils.py | py | 2,595 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "typing.Tuple",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "ratelimit.exception.RateLimitEx... |
364601212 | import pandas as pd
import numpy as np
from keras.models import Model, Sequential
from keras.layers import Dense, Input, Activation
from keras.models import model_from_json
from keras import optimizers
from keras import backend as K
import matplotlib.pyplot as plt
class BreastCancerNetwork:
def __init__(self, tr... | null | bc_nerual_network.py | bc_nerual_network.py | py | 2,751 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "keras.models.Sequential",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "keras.layers.Dense",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "keras.layers.Dense",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "keras.l... |
432174626 | '''
Created on Dec 31, 2017
@author: kot
'''
import curses
import yaml
from common import *
from constantvals import *
from lib.funcs import *
ROW_TITLE = 2
ROW_ITEMS = 7
ROW_DESCRIPTION = 4
COL_TITLE = 2
COL_DESCRIPTION = 2
COL_ITEMS = 2
class Menu(object):
'''
Menu object
This will store the selected... | null | infratools/cli_menu/menu.py | menu.py | py | 4,154 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "curses.wrapper",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "yaml.load",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "curses.start_color",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "curses.init_pair",
"l... |
62794401 | import pytest
import requests
import os
import openpyxl
from common.request_method import requests_get,requests_post
def setup_module(module):
print('setup module')
def teardown_module(module):
print('teardown module')
def test_all(get_conf):
if os.path.exists(get_conf['case_path']):
wkbk = openp... | null | test_api/test_all.py | test_all.py | py | 1,175 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.exists",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "openpyxl.load_workbook",
"line_number": 15,
"usage_type": "call"
}
] |
146963617 | """Website URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-ba... | null | YASE/urls.py | urls.py | py | 3,083 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.conf.urls.url",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "Blog.views.index",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "Blog.views",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "django.conf.url... |
290105850 | # -*- coding: utf-8 -*-
import os
import tushare as ts
import pandas as pd
import matplotlib as mpl
# zw.xxx
import zwSys as zw #::zwQT
# ----------
def zw_down_stk_cn010(qx, xtyp="D"):
""" xcod:股票代码
xtyp:数据类型,9,Day9,简版股票数据,可下载到2001年,其他的全部是扩充版数据,只可下载近3年数据
D=日k线 W=周 M=月 5=5分钟 15=15分钟 30=30分钟... | null | 20180103/k303_down_hist_data.py | k303_down_hist_data.py | py | 1,884 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.exists",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "tushare.get_hist_data",
... |
67784924 | from keras.optimizers import Adam
from keras.callbacks import ModelCheckpoint, EarlyStopping, ReduceLROnPlateau
from keras import backend as K
from keras.models import load_model
from math import ceil
import numpy as np
from matplotlib import pyplot as plt
from keras_ssd7 import build_model
from keras_ssd_loss import ... | null | ssd_keras-master/test3_eval.py | test3_eval.py | py | 3,283 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "ssd_batch_generator.BatchGenerator",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "ssd_box_encode_decode_utils.decode_y2",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 68,
"usage_type": "cal... |
576939270 | import os, re
from xml.etree import ElementTree
from shapefileIO import ShapefileWriter, TYPE as SHTYPE
from PyQt4.QtCore import *
from qgis.core import *
class XmlToShapefile(QObject):
# Signal emitted to update progress
prog_sig = pyqtSignal(int)
def __init__(self, xml_path, sh_dir, formula):
QOb... | null | xmlToShapefile.py | xmlToShapefile.py | py | 7,481 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "shapefileIO.ShapefileWriter",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree.register_namespace",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 14,
"usage_type": "name"
},... |
533858161 | import csv
from django.core.management.base import BaseCommand
from reviews.models import Category, Comment, Genre, Review, Title, TitleGenre
from users.models import User
class Command(BaseCommand):
def handle(self, *args, **options):
with open('static/data/users.csv', newline='',
enc... | null | api_yamdb/reviews/management/commands/load_csv.py | load_csv.py | py | 2,772 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "csv.DictReader",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "users.models.User.objects.create",
"line_number": 15,
"usage_type": "call"
},
{... |
305290056 | # -*- coding: utf-8 -*-
"""
Created on Sat Feb 13 11:53:24 2016
@author: Imtiaz Mukadam
"""
import googlemaps
import Queue
import copy
class TSP_tree:
'TSP tree used for Assignment 1'
__locationList = ['Locations for the TSP',
'University of Pretoria, Pretoria',
... | null | TSP/TSP_tree.py | TSP_tree.py | py | 4,863 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "googlemaps.Client",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "Queue.LifoQueue",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "copy.copy",
"line_number": 123,
"usage_type": "call"
}
] |
631519760 | #!/usr/bin/env python
from pyopenstates import *
from ratelimiter import RateLimiter
import pandas as pd
set_api_key('') # Get key here: https://openstates.org/api/register/
bills_request = search_bills(state='tn', fields=['session', 'id', 'bill_id', 'title', 'sponsors', 'type', 'subjects'])
# Keep only bills (drop... | null | py/pull.py | pull.py | py | 2,103 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.DataFrame",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "ratelimiter.RateLimiter",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "pandas.conc... |
192906740 | from auger_ml._optimizers.skopt_wrapper import SkOptWrapper
from skopt.plots import plot_objective
f_space = {
"f": {
"x": {
"bounds": (-10, 10),
"type": "float",
"log": False
},
"y": {
"bounds": (-10, 10),
"type": "float",
... | null | tests/_test_skopt_wrapper.py | _test_skopt_wrapper.py | py | 969 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "auger_ml._optimizers.skopt_wrapper.SkOptWrapper",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.show",
"line_number": 46,
"usage_type": "call"
},
... |
459840906 | import random
from os.path import join
from django.conf import settings
from django.core.files.uploadedfile import SimpleUploadedFile
from django.urls import reverse
from nails_project.accounts.models import Profile
from nails_project.sonq_nails.models import Nails
from tests.base.mixins import UserTestUtils
from test... | null | nails_project/tests/account/views/test_profile_details.py | test_profile_details.py | py | 4,404 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tests.base.mixins.UserTestUtils",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "tests.base.tests.NailsProjectTestCase",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "django.urls.reverse",
"line_number": 17,
"usage_type": "call"
},
... |
342448251 | import requests, json, time, sys
from lxml import html
from lxml import etree as et
from twilio.rest import Client
session_requests = requests.session()
login_url = "https://sso-legacy.sun.ac.za/cas/login?service=https://web-apps.sun.ac.za/AcademicResults/shiro-cas"
result = session_requests.get(login_url)
tree = ht... | null | results.py | results.py | py | 2,874 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.session",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "lxml.html.fromstring",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "lxml.html",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "json.load",
"line_... |
69915749 | #!/usr/bin/env python
################################################################################
# Copyright (C) 2014, 2015 GenAP, McGill University and Genome Quebec Innovation Centre
#
# This file is part of MUGQIC Pipelines.
#
# MUGQIC Pipelines is free software: you can redistribute it and/or modify
# it und... | null | pipelines/methylseq/methylseq.py | methylseq.py | py | 41,698 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.append",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
485883391 | import os
import json
from datetime import date
def load_journal_file():
# Get the current date in ISO format (e.g., "2023-07-24")
current_date = date.today().isoformat()
# Define the folder where journal files will be stored
folder_path = ".journal"
# Create the file path using the current date ... | null | journal.py | journal.py | py | 2,221 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.date.today",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numb... |
115283781 | # Copyright (c) maiot GmbH 2020. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | null | zenml/steps/preprocesser/standard_preprocesser/methods/standard_methods.py | standard_methods.py | py | 2,079 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "zenml.utils.preprocessing_utils.MethodDescriptions",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "zenml.steps.preprocesser.standard_preprocesser.methods.methods_nonseq_filling.min_f",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "zenml... |
401464890 | # -*- coding: utf-8 -*-
from datetime import datetime
class Event:
def __init__(self, event_version=0, event_message="", timestamp=None):
self.event_version = event_version
self.event_message = event_message
self.timestamp = timestamp if not timestamp else datetime.now()
| null | mypackages/domainevent/event.py | event.py | py | 303 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.datetime.now",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 10,
"usage_type": "name"
}
] |
476652575 | import os
import re
from api.models import PathAndRename
from django.test import TestCase
class PathAndRenameTestCase(TestCase):
def setUp(self):
self.instance = None
self.filename = 'file.ext'
self.sub_folder = 'folder'
self.object = PathAndRename(self.sub_folder)
def test_i... | null | api/tests/unit/test_model_helpers.py | test_model_helpers.py | py | 1,094 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.test.TestCase",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "api.models.PathAndRename",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.split",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
48493522 | from . import api
import os
import uuid
from flask import jsonify, request
from .. import db
from sqlalchemy.exc import IntegrityError
from .helpers import allowed_file
from manage import app
from ..models import User
from .response import response_builder
@api.route('/users/<int:id>', methods=['GET'])
def get_user(i... | null | app/api/users.py | users.py | py | 2,231 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "models.User.query.get_or_404",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "models.User.query",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "models.User",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "respo... |
73777347 | from urllib.request import urlopen # b_soup_1.py
from bs4 import BeautifulSoup
from selenium.webdriver import Chrome
import numpy as np
import pandas as pd
us_state_abbrev = {
'Alabama': 'AL',
'Alaska': 'AK',
'Arizona': 'AZ',
'Arkansas': 'AR',
'California': 'CA',
'Colorado': 'CO',
'Conn... | null | fetch_data.py | fetch_data.py | py | 8,608 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.DataFrame",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "urllib.request.urlopen",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "pandas.Data... |
507607043 | import gspread
from oauth2client.service_account import ServiceAccountCredentials
import os, time
def connect():
global sheet
scope = ['https://spreadsheets.google.com/feeds', 'https://www.googleapis.com/auth/drive']
creds = ServiceAccountCredentials.from_json_keyfile_name('database.json', scope)
client... | null | spreadsheet-malware/main.py | main.py | py | 1,498 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "oauth2client.service_account.ServiceAccountCredentials.from_json_keyfile_name",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "oauth2client.service_account.ServiceAccountCredentials",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "gspread.author... |
108399491 | import pymysql
import hashlib
import random
import time
banderaFirma = 1
#Valores simulados
latitud = "19.721830"
longitud = "-101.185828"
valor = 24
class DataBase:
def __init__(self):
self.connection = pymysql.connect(
host='localhost',
user='root',
... | null | main.py | main.py | py | 2,177 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pymysql.connect",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "time.strftime",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "time.strftime",
"line... |
431095647 | import numpy as np
from coinrun import setup_utils,make
import tensorflow as tf
from baselines.common.vec_env import VecEnvWrapper
import time
from baselines.ppo2 import ppo2
import gym
from collections import deque
from baselines.common.vec_env.vec_monitor import VecMonitor
from course_learn.wrappers import CourierW... | null | course_learn/concat_train.py | concat_train.py | py | 4,933 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.prod",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.random.normal",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "numpy.linalg.svd",
... |
647841353 | """CFNgin command base class."""
import argparse
import logging
import signal
import threading
# pylint false positive
from six.moves.collections_abc import Mapping # pylint: disable=E
from ...environment import parse_environment
LOGGER = logging.getLogger(__name__)
SIGNAL_NAMES = {
signal.SIGINT: "SIGINT",
... | null | runway/cfngin/commands/stacker/base.py | base.py | py | 9,142 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "signal.SIGINT",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "signal.SIGTERM",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "threading.Ev... |
459308726 | # 2-3 in Lab Report 3
#Author: Tyler A. Bailey
import uncertainty as unc #uncertainty package developed by me
import numpy as np
import matplotlib.pyplot as plt
count_rate = [217.92, 211.20, 185.58, 163.08, 157.32, 123.68, 79.93, 27.53, 12.38, 5.5, 4.3, 4.35, 4.13, 6.88]
cr = []
absorber = [3, 7, 9.9, 19, 2... | null | Lab3/2b1.py | 2b1.py | py | 2,831 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "uncertainty.count_rate_unc",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "uncertainty.unwrap_lst_unc",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "uncertainty.bg_subtracted_counting_rate",
"line_number": 16,
"usage_type": "call"
... |
29091393 | # 3. KS-test
from decimal import Decimal
import numpy as np
import pandas as pd
from scipy import stats
import matplotlib.pyplot as plt
import seaborn as sns
from AA_Index_Dictionary import get_scales, get_description
from aaData.Original_Sequences import Dataset
from abProcess.Profiles_Original_Sequences import profil... | null | xOld/Statistics_KS.py | Statistics_KS.py | py | 7,151 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "seaborn.set",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "AA_Index_Dictionary.get_scales",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "AA_Index_Dictionary.get_description",
"line_number": 16,
"usage_type": "call"
},
{
"ap... |
546439322 | from pygame.locals import MOUSEBUTTONDOWN ,KEYDOWN, K_ESCAPE, K_q, K_x, K_f, K_z, K_c, K_v, FULLSCREEN
import pygame
from pygame.locals import Color, QUIT, MOUSEBUTTONDOWN, USEREVENT, USEREVENT
from pygame.sprite import collide_rect, Sprite, spritecollide
import cv2
import sys
import tensorflow as tf
import nump... | null | MAIN_MENU.py | MAIN_MENU.py | py | 17,182 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sqlite3.connect",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pygame.sprite",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "pygame.sprite.Sprite.__init__",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "pyga... |
534553669 | from torch import nn, optim
import torch
class MLP(nn.Module):
""" a simple 4-layer MLP """
def __init__(self, nin, nout, nh):
super().__init__()
self.net = nn.Sequential(
nn.Linear(nin, nh),
nn.LeakyReLU(0.2),
nn.Linear(nh, nh),
nn.LeakyReLU(0.2... | null | models/mpnn_main.py | mpnn_main.py | py | 5,931 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.nn.Module",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_n... |
24262298 | from django.shortcuts import render
from django.views.generic import ListView, DetailView, CreateView
from .models import Message
from django.contrib.auth.models import User
# Create your views here.
class MessageListView(ListView):
model = Message
# template_name = "TEMPLATE_NAME"
class MessageCreateView... | null | twitter/twitter_messages/views.py | views.py | py | 583 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.views.generic.ListView",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "models.Message",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.views.generic.CreateView",
"line_number": 15,
"usage_type": "name"
},
{
"api_n... |
646245704 | from django.conf.urls import url
from .views import *
urlpatterns = [
url(r'^groups/$', group_list_page, name="group_list_page"),
url(r'^groups/(?P<page>\d+)/$', group_list_page, name="group_list_page"),
url(r'^group/(?P<group_id>\d+)/$', group_page, name="group_page"),
url(r'^group/(?P<group_id>\d+)/a... | null | group/urls.py | urls.py | py | 1,007 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.conf.urls.url",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.co... |
457789714 | # -*- coding: utf-8 -*-
"""
Created on Mon Dec 12 22:39:09 2016 @author:das
"""
import pandas as pd
import numpy as np
from sklearn.cross_validation import StratifiedKFold
from sklearn.grid_search import GridSearchCV
from sklearn.cross_validation import cross_val_score
from xgboost.sklearn import XGBClassifier
from s... | null | titanic_model6_blending.py | titanic_model6_blending.py | py | 9,229 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_csv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.isnan",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "pandas.get_dummies",
... |
620167717 | import cv2
import numpy as np
import matplotlib.pyplot as plt
img_l = cv2.imread('../../../../../Downloads/zaw_1_12/lab_5_ZAW/aloes/aloeL.jpg')
img_r = cv2.imread('../../../../../Downloads/zaw_1_12/lab_5_ZAW/aloes/aloeR.jpg')
gray_l = cv2.cvtColor(img_l, cv2.COLOR_BGR2GRAY)
gray_r = cv2.cvtColor(img_r, cv2.COLOR_BGR2... | null | Codes/Stereovision_ZAW/Not_maine/z_3_wlasne_podchody.py | z_3_wlasne_podchody.py | py | 1,002 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cv2.imread",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number... |
136975249 | """async fetcher (worker)."""
import asyncio
import itertools
import json
import logging
import os
import re
import time
from bmt import Toolkit as BMToolkit
from strider.scoring import score_graph
from strider.worker import Worker, Neo4jMixin, SqliteMixin
from strider.query import create_query
from strider.result im... | null | strider/fetcher.py | fetcher.py | py | 14,966 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.getenv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "strider.worker.Worker",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "strider.worker.Neo4... |
235135068 | from django.shortcuts import render,redirect
from django.http import HttpResponse
from django.urls import reverse
from django.contrib import auth
from django.contrib.auth.models import User
from users.models import UserInfo
from parkingweb.forms import LoginForm, RegForm, UserDetailForm
from carposition.models import C... | null | users/views.py | views.py | py | 2,671 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "carposition.models.CarPosition.objects.filter",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "carposition.models.CarPosition.objects",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "carposition.models.CarPosition",
"line_number": 14,... |
158148604 | import pandas as pd
import argparse
import glob
import os
def size_to_sec(size) :
"""
size: Mo
"""
# Formule : bit depth * freq / bits / 8 * sec = size en bytes
# valable pour mono 16kHz 16 bits
return size / (16 * 16000 / 1000000 / 8)
def get_duration_from_split(cv, split):
total_size... | null | fine_tuning/dataset_labellise/split.py | split.py | py | 2,864 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.getsize",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"lin... |
614415548 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
import torch
def get_corr_from_eigs(eigs):
N = len(eigs)
num = np.max(np.sqrt(eigs))
denom = np.sum(np.sqrt(eigs))
factor = N/(N-1)
const = -1/N
corr = factor * (num/denom) + const
return corr
def get_popcorr(mat)... | null | scripts/linedraw/correlation.py | correlation.py | py | 2,254 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.max",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 10,
... |
595172127 | # Copyright (c) 2011-2020 Eric Froemling
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish,... | null | assets/src/ba_data/python/ba/_teamgame.py | _teamgame.py | py | 7,230 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "typing.TypeVar",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "typing.TypeVar",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "ba._gameactivity.G... |
280199302 | from random import randint
from django.shortcuts import render
from django.db.models import Count
from rest_framework import views
from rest_framework.response import Response
from . import serializers, models
class MessageView(views.APIView):
"""View to managing messages through the API."""
# The 'serial... | null | api/views.py | views.py | py | 2,298 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rest_framework.views.APIView",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.views",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "rest_framework.response.Response",
"line_number": 42,
"usage_type": "call"
},
... |
16282813 | import datetime
from flask import Blueprint, jsonify, request
from flask import current_app as app
import json
import requests
from helpers.check_login import is_loggedin
from helpers.create_note import create_note
router = Blueprint('add_note', __name__)
@router.route('/add_note', methods=['POST'])
def add_note():
... | null | microservices/app/src/controllers/add_note.py | add_note.py | py | 1,235 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Blueprint",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.request.get_json",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask.request",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "flask.jsonify",
... |
130263153 | from django import template
from django.utils.html import conditional_escape
from django.utils.safestring import mark_safe
import re
register = template.Library()
@register.filter
def usuarios(value, autoescape=None):
value = conditional_escape(value)
user = re.compile('(\s|^)(@)(\w+)(\s|$)')
value = user... | null | twitter/templatetags/links.py | links.py | py | 714 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.template.Library",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.utils.html.conditional_escape",
"line_number": 10,
"usage_type": "call"
},
{
"api_na... |
513254273 | from django.contrib import admin
from page_content.models import Brand, WebPage, PageSection, Billboard, Page404
class PageSectionInline(admin.StackedInline):
model = PageSection
sortable_field_name = "display_order"
extra = 1
suit_classes = 'suit-tab suit-tab-sections'
fieldsets = (
(N... | null | page_content/admin.py | admin.py | py | 3,597 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.contrib.admin.StackedInline",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "page_content.models.PageSection",
"line_number": 6,
"usage_type": "name"
},
... |
563104579 | import unittest
from app.database import Database
from pymongo import MongoClient
from app.models import MessageFactory
from datetime import datetime, timedelta
'''
Slow test running against a real database. Observe that it remove the database at the end.
'''
def generate_message_in_time_and_save(self, time):
m... | null | test/test_database.py | test_database.py | py | 4,834 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "unittest.TestCase",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "app.database.Database",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "app.... |
324055553 | import typing
from datetime import date, datetime, time, timedelta
import strawberry
from api.conferences.types import Day, ScheduleSlot
from api.helpers.ids import decode_hashid
from conferences.models import Conference
from languages.models import Language
from schedule.models import Day as DayModel
from schedule.mo... | null | backend/api/schedule/mutations.py | mutations.py | py | 4,043 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "strawberry.type",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "datetime.time",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.combine",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "datetime... |
174440821 | from skimage import filter
from scipy import ndimage
import numpy as np
import random
def makeSegmentKernel(kernelShape, edge=1):
K = np.ones(kernelShape, dtype=np.float)
K[edge: -edge, edge:-edge] *= -1
K[K > 0] /= (K > 0).sum()
K[K < 0] /= (K < 0).sum()
return K
def getMask(mShape, center, an... | null | dev/edge_gs.py | edge_gs.py | py | 2,111 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.ones",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.float",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.sin",
"line_number": ... |
554248575 | # pyOCD debugger
# Copyright (c) 2018-2019 Arm Limited
# SPDX-License-Identifier: Apache-2.0
#
# 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... | null | pyocd/flash/loader.py | loader.py | py | 11,404 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "utility.progress.print_progress",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "core.exceptions.TargetSupportError",
"line_number": 124,
"usage_type": "call"
},
{
... |
325248246 | # -*- coding: utf-8 -*-
import sys
import scrapy
from scrapy.selector import HtmlXPathSelector
from scrapy.http import Request
from gippokrat.items import GippokratItem
import urlparse
import re
from scrapy.shell import inspect_response
from scrapy import log
from scrapy.utils.response import open_in_browser
from urll... | null | gippokrat/spiders/gippokrat_spider.py | gippokrat_spider.py | py | 6,833 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "scrapy.Spider",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "urlparse.urljoin",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "scrapy.http.Request",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "gippokrat.ite... |
367396572 | """textbook program: Valuation of European call option in BSM model
Analytic formula.
========================
Parameters
=======================
S0: Initial stock/index level-Float
K: strike price-float
T: maturity date (in year fractions)-float
r: constant risk-free short rate-float
sigma: volitility factor in diffus... | null | FinancialEngineeringChapter1/ComputFinance.py | ComputFinance.py | py | 2,726 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "math.log",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "math.log",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "scipy.stats.norm.cdf",
"line_number":... |
651751713 | import chess
from IPython.display import display, clear_output
import random
import time
def who(player):
return "White" if player == chess.WHITE else "Black"
class ChessGame:
"""
Base class where the chess game is played
"""
def __init__(self, player1, player2):
self.board = chess.Bo... | null | RL/alphazero/env.py | env.py | py | 2,754 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "chess.WHITE",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "chess.Board",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "chess.WHITE",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "chess.BLACK",
"line_... |
634171894 | # Django Modules
from django.utils.translation import ugettext_lazy as _ # To mark strings for translation
# Our modules
from infra.models import AppReport, ResourceDescription
from infra.custom import VersionModelAdmin, VersionTabularInline
from infra.custom.infra_admin_site import infra_admin_site
from infra.forms.a... | null | infra/admin/app_report.py | app_report.py | py | 2,434 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "infra.custom.VersionTabularInline",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "infra.models.ResourceDescription",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "infra.forms.app_resource.ResourceDescriptionForm",
"line_number": 17,
... |
468401517 | import logging
from xml.etree import ElementTree
import requests
_logger = logging.getLogger(__name__)
class Privat24Api(object):
BASE_URL = 'https://api.privatbank.ua/p24api/'
HEADERS = {
'User-Agent': 'python',
'id': '',
'Token': '',
'Content-Type': 'application/json;charse... | null | privat24_api_client/p24api_base.py | p24api_base.py | py | 1,015 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree.XML",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "xml.etree.Ele... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.