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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
249065757 | from __future__ import absolute_import
import re
import requests
from .base import RegexBasedDetector
from detect_secrets.core.constants import VerifiedResult
class GheDetector(RegexBasedDetector):
""" Scans for GitHub credentials """
secret_type = 'GitHub Credentials'
opt_github_prefix = r'(?:github... | null | detect_secrets/plugins/gh.py | gh.py | py | 2,613 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "base.RegexBasedDetector",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "base.RegexBasedDetector.assign_regex_generator",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "base.RegexBasedDetector",
"line_number": 26,
"usage_type": "name"
... |
40191605 | """Cloud Foundry test"""
from flask import Flask
import os
import sys
import platform
import logging
app = Flask(__name__)
port = int(os.getenv('PORT', 8080))
@app.route('/')
def hello_world():
sys.stdout.write('**** hello_world ****\n')
sys.stdout.flush()
return 'Hello World! I am running on port ' + st... | null | hello.py | hello.py | py | 971 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.stdout.write",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number":... |
262777750 | from django.conf import settings
from django.core.mail import send_mail
from django.shortcuts import render, redirect
from .models import Servicio, Reserva, TipoServicio
from django.contrib.auth.decorators import login_required
from .forms import CustomUserForm, ContactForm
from django.contrib.auth import login, authe... | null | salon/core/views.py | views.py | py | 3,868 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "models.Servicio.objects.all",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "models.Servicio.objects",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "models.Servicio",
"line_number": 22,
"usage_type": "name"
},
{
"api_name... |
557056667 | import logging
from io import StringIO
from itertools import count
from operator import itemgetter
import networkx as nx
from htd_validate.decompositions import Decomposition
from htd_validate.utils import Graph
class TreeDecomposition(Decomposition):
_problem_string = 'td'
# bucket elimination algorithm
... | null | htd_validate/decompositions/td.py | td.py | py | 3,941 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "htd_validate.decompositions.Decomposition",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "htd_validate.utils.Graph.__name__",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "htd_validate.utils.Graph",
"line_number": 21,
"usage_typ... |
549802090 | from telebot import *
from json import dump, load
from config import error, info
BOTS_ = {
"Test": "724876434:AAG2Cp51nhI8T5Vm4TyWVG0bC7zUETJI5vE",
}
def bot_init(token, name="noName"):
BOTS_[name.get()] = token.get()
info("Бот был успешно добавлен / изменен. Можете закрыть окно или изменить добавленого ... | null | telegram_bot.py | telegram_bot.py | py | 460 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "config.info",
"line_number": 12,
"usage_type": "call"
}
] |
544652244 | import torch.nn as nn
import torch
# ########## 说明 ################
# 参考PSPNet b站作者的代码,dice loss 的gt是onehot矩阵
# 参考链接:https://www.aiuai.cn/aifarm1159.html
# ################################
# dice系数:https://github.com/pytorch/pytorch/issues/1249
def dice_coeff(pred, target):
"""
是dice系数,与docelos... | null | loss/dice_loss.py | dice_loss.py | py | 2,930 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.nn.Module",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "torch.sigmoid",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "torch.zeros",
"line_n... |
346576930 | #!/usr/bin/python
# USE 640x480
import cv2
import matplotlib.pyplot as plt
import socket
def filter_fn(img):
frame = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
return frame
def filter(img):
camera = cv2.VideoCapture(0)
camera.set(cv2.CAP_PROP_FRAME_HEIGHT, 640)
camera.set(cv2.CAP_PROP_FRAME_WIDTH, 48... | null | rasp/positioning/streamer.py | streamer.py | py | 1,816 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.cvtColor",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.CAP_PROP_FR... |
220145651 | import pygame
from abc import ABC
from logger import Logger
class Game_Core(ABC):
"""eine Klasse, die die Grundfunktionen eines 2D-Spiels darstellt"""
def __init__(self, name, color):
"""erstellt einen farbigen Screen mit fester Größe"""
super().__init__()
onInit()
self.logger = Logger()
self... | null | quickblit/game_Core.py | game_Core.py | py | 589 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "abc.ABC",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "logger.Logger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"li... |
494211301 | import os
import sys
import arcpy
import time
from arcpy.sa import *
import logging
# Source Rasters
ResRastersGDB = r'F:\BuildSuicideRasters\LITS_20210112\NatHotSpots_06_18\Rasters_Residences.gdb'
IncRastersGDB = r'F:\BuildSuicideRasters\LITS_20210112\NatHotSpots_06_18\Rasters_Incidents.gdb'
PopRastersGDB = r'F:\Buil... | null | BatchSuicidePopDifFBuilder.py | BatchSuicidePopDifFBuilder.py | py | 36,106 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.split",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "arcpy.Exists",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_nu... |
539758000 | from django import forms
from django.contrib.auth.models import User
from django.forms import CheckboxInput, ModelForm, TextInput, DateInput, Select, SelectMultiple, Textarea, NumberInput, \
BooleanField, \
RadioSelect
from nocaptcha_recaptcha.fields import NoReCaptchaField
from .models import Scholarship, Fou... | null | home/forms.py | forms.py | py | 7,953 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.forms.Form",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.forms.CharField",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.for... |
457914365 | # Copyright The IETF Trust 2021, All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | null | utility/tests/test_parseException.py | test_parseException.py | py | 1,510 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "unittest.TestCase",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "utility.yangParser.ParseException",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": ... |
79470738 | from urllib.parse import urlparse
import psycopg2
import scraper
import config
# DATABASE METHODS
# returns a psycopg2 connection
def init_db():
return psycopg2.connect(
"dbname=%s user=%s host=%s password=%s" % (config.db_name, config.db_user, config.db_host, config.db_password))
# returns all unique ... | null | database.py | database.py | py | 1,392 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "psycopg2.connect",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "config.db_name",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "config.db_user",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "config.db_ho... |
345874716 | import sys
sys.path.append('..')
from typing import Optional, List
from bot import commands
from bot.commands import register
from bot.commands import Command, FunctionWrapper
from bot.commands import PERMISSIONS_CATEGORY
from bot.cmdcommon import validate_filter, permissions_embed, get_command_wrappers
from bot impo... | null | bot/cmd_modules/cmd_perms.py | cmd_perms.py | py | 1,336 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "bot.commands.Command",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
... |
98544053 |
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras.utils import to_categorical
from tensorflow.keras.models import Sequential, Model #, Input
from tensorflow.keras.layers import Dense, Dropout, Flatten
from tensorflow.keras.layers import Conv2D... | null | Keras/Fashion MNIST with Keras.py | Fashion MNIST with Keras.py | py | 4,822 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tensorflow.keras.datasets",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.keras",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "numpy.unique",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "matplotl... |
524232624 | import argparse
import json
import base64
import invoke
from tabulate import tabulate
def get_args():
args = argparse.ArgumentParser(description="Kubernetes Utility")
sub_parser = args.add_subparsers(help='Operation')
# Load subargs
parser_load = sub_parser.add_parser('env', help='Print pod/contain... | null | k8s/k8s.py | k8s.py | py | 2,905 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "argparse.PARSER",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "invoke.run",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "json.loads",
... |
389749552 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#==============================================================================#
# HISTORY #
# ------- #
# Developed by D. Henne... | null | updateMasterGDB.py | updateMasterGDB.py | py | 6,997 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "arcpy.Parameter",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "arcpy.Parameter",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 87,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numb... |
206986694 | from django.shortcuts import get_object_or_404, render
import face_recognition
import cv2
import os
import numpy as np
from acount.models import Account
def facedetaction(request):
video_capture = cv2.VideoCapture(0)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
MEDIA_ROOT ... | null | polls/fecedect.py | fecedect.py | py | 3,585 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"... |
542102743 | import os
from config import INPUT_DIRECTORY
from config import OUTPUT_DIRECTORY
def get_best_score():
best_scores = {}
for output_filename in os.listdir(OUTPUT_DIRECTORY):
if output_filename.startswith('.'):
continue
current_score = 0
input_filename = get_input_from_ou... | null | score.py | score.py | py | 861 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.listdir",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "config.OUTPUT_DIRECTORY",
"line_number": 10,
"usage_type": "argument"
},
{
"api_name": "os.path.splitext",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
130153495 | import pytest
import agentpy as ap
from SALib.sample import saltelli
out = [{'a': 1, 'b': 3.0, 'c': 5},
{'a': 1, 'b': 3.5, 'c': 5},
{'a': 2, 'b': 3.0, 'c': 5},
{'a': 2, 'b': 3.5, 'c': 5}]
def test_sample():
parameters = {'a': (1, 2), 'b': (3., 3.5), 'c': 5}
sample = ap.samp... | null | tests/test_sampling.py | test_sampling.py | py | 1,258 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "agentpy.sample",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "agentpy.sample",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "agentpy.sample_discrete",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "agentpy.sample_... |
177053618 | import os
import random
import shutil
import time
import cv2
import lmdb
from caffe.proto import caffe_pb2
import caffe_lmdb
def create_lmdb(image_to_window, lmdb_dir, label, step_size):
start_time = time.time()
crop_radius = 21
if os.path.exists(lmdb_dir):
shutil.rmtree(lmdb_dir)
if not o... | null | create_lmdb.py | create_lmdb.py | py | 1,761 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "time.time",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "shutil.rmtree",
"line_numbe... |
269627356 | from django.test import TestCase
# Create your tests here.
from certificates.models import Person, Entity, Official, Doctor, Capacitation
class TestPerson(TestCase):
def setUp(self):
Person.objects.create(
name='jorge',
last_name='cuenca',
identification='1121943206',... | null | certificates/tests/tests.py | tests.py | py | 4,531 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.test.TestCase",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "certificates.models.Person.objects.create",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "certificates.models.Person.objects",
"line_number": 10,
"usage_type": "attr... |
289273626 | import os
import json
import errno
from jinja2 import Environment, FileSystemLoader
from markdown import markdown
import urllib
from livereload import Server
def load_config_json(filepath):
if not os.path.exists(filepath):
return None
with open(filepath, 'r') as file_handler:
return json.load(... | null | site_generator.py | site_generator.py | py | 2,736 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.exists",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_numb... |
355219633 | import random
random.seed(0)
import numpy as np
np.random.seed(0)
import tensorflow as tf
import onnx_graphsurgeon as gs
from onnx2tf.utils.common_functions import (
get_constant_or_variable,
print_node_info,
inverted_operation_enable_disable,
make_tf_node_info,
)
@print_node_info
@inverted_operation_... | null | onnx2tf/ops/QLinearAdd.py | QLinearAdd.py | py | 5,027 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "random.seed",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "onnx_graphsurgeon.Node",... |
431803933 | #6d657774776f mewtwo hj packet
import pydivert
import threading
import socket
HostIPs = set()
HostIPs.add(socket.gethostbyname(socket.gethostname()))
def networking():
with pydivert.WinDivert("udp.PayloadLength > 0") as w:
for packet in w:
Hex1 = packet.payload.hex()
if packet.dst_addr not in HostIPs:
... | null | hostiprevealer.py | hostiprevealer.py | py | 859 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "socket.gethostbyname",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "socket.gethostname",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pydivert.WinDivert",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "threading.Th... |
21745647 | """" This contains decorators for making returns nicer to work with in and
IDLE or Ipython """
import pprint
import sys
if sys.version==[2]:
from StringIO import StringIO
else:
from io import StringIO
unicode = str
PPRINT_INDENT = 2
PPRINT_WIDTH = 80
PPRINT_DEPTH = 5
REPR_UNICODE_U = False
PPRINT_FOR... | null | seaborn/request_client/repr_wrapper.py | repr_wrapper.py | py | 13,737 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.version",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "io.StringIO",
"line_number": 108,
"usage_type": "call"
},
{
"api_name": "pprint.pprint",
"line_number": 109,
"usage_type": "call"
},
{
"api_name": "io.StringIO",
"line_n... |
177697834 | from PIL import Image
import time
import os
mypath = os.getcwd() + "\\maze_v2_food.png"
print(mypath)
img = Image.open(mypath)
width, height = img.size
pix = img.load()
positions = []
for x in range(width):
for y in range(height):
#print(pix[x, y])
if pix[x, y][0:3] == (250, 185, 176):
... | null | images/get_food.py | get_food.py | py | 473 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.getcwd",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 8,
"usage_type": "name"
}
] |
487022381 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
ipl_df = pd.read_csv('data/ipl_dataset.csv', index_col=None)
# Solution
def plot_deliveries_by_team():
df=ipl_df[['batting_team','delivery']]
counts=df.groupby('batting_team').count()
sort=counts.sort_values(by='delivery',ascending=Fa... | null | q01_plot_deliveries_by_team/build.py | build.py | py | 366 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.show",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 14,
"usage_type": "name"
}
] |
144590600 | from grizzlygame import BaseGame
from grizzlygame.plugins.config import Bindings
from grizzlygame.plugins.flow import StandardFlow
from grizzlygame.plugins.scene import Scene, Intro, NullOutro
from menus import MainMenu
from modes import Singleplayer
from panda3d.core import loadPrcFileData
loadPrcFileData("", "\n".... | null | main.py | main.py | py | 1,310 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "panda3d.core.loadPrcFileData",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "grizzlygame.BaseGame",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "grizzlygame.plugins.config.Bindings",
"line_number": 26,
"usage_type": "call"
},
{
... |
340703183 | # !/usr/bin/env python
# -*- coding: utf-8 -*-
# 测试训练好的模型
import warnings
warnings.filterwarnings(action='ignore', category=UserWarning, module='gensim') # 忽略警告
import sys
# reload(sys)
# sys.setdefaultencoding('utf-8')
import gensim
if __name__ == '__main__':
fdir = 'D:\\file\\pythonwork\\stitp\\'
model =... | null | code/test.py | test.py | py | 621 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "gensim.models.Word2Vec.load",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "gensim.models",
"line_number": 15,
"usage_type": "attribute"
}
] |
236578831 | from typing import Dict
import math
import torch
from torch import nn
import torch.nn.functional as F
from fvcore.nn import sigmoid_focal_loss_jit
from detectron2.layers import ShapeSpec, Conv2d
from detectron2.layers.batch_norm import get_norm
# from adet.layers import conv_with_kaiming_uniform
# from adet.utils.co... | null | projects/DensePose/densepose/modeling/condinst/iuv_scaleattn_head.py | iuv_scaleattn_head.py | py | 7,892 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.nn.Module",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "torch.tensor",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "iuv_head.get_embedder",
... |
508250867 | import matplotlib.pyplot as plt
from abc import ABC, abstractmethod
from fbprophet import Prophet
from fbprophet.diagnostics import cross_validation
from fbprophet.diagnostics import performance_metrics
from fbprophet.plot import plot_cross_validation_metric
from neuralprophet import NeuralProphet
class Prediction(AB... | null | classes/forecast.py | forecast.py | py | 2,384 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "abc.ABC",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "fbprophet.Prophet",
... |
133379690 | #!/usr/bin/python3
""" Python Script """
import requests
def top_ten(subreddit):
""" Python Method """
link = "https://api.reddit.com/r/{}/hot".format(subreddit)
headers = {
'User-Agent': 'My User Agent 1.0',
'From': 'mechken.atef@gmail.com'
}
reddit_req = requests.get(link, heade... | null | 0x16-api_advanced/1-top_ten.py | 1-top_ten.py | py | 563 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
}
] |
29455923 | from keras.engine.topology import Input
from keras.layers.core import Activation, Reshape
from keras.layers.advanced_activations import LeakyReLU
from keras.layers.convolutional import Conv2D, Conv2DTranspose
from keras.layers.normalization import BatchNormalization
from keras.layers.pooling import GlobalAveragePooling... | null | dcgan_cifar10.py | dcgan_cifar10.py | py | 8,467 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "keras.engine.topology.Input",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "keras.layers.core.Reshape",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "keras.layers.convolutional.Conv2DTranspose",
"line_number": 15,
"usage_type": "call... |
327390004 | import paho.mqtt.client as mqtt
import paho.mqtt.publish as publish
import time
import numpy as np
import json
def receive_data_type(data):
datax = []
datay = []
if 'model' in mqtt_topic:
d = json.loads(data)
d2 = np.array(d[0],dtype=float)
d3 = np.array(d[1],dtype=float)
... | null | Yu/server/protocol_utils.py | protocol_utils.py | py | 2,344 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "json.loads",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 18... |
644388111 | import numpy as np
import pandas as pd
from keras.models import Sequential
from keras.layers import Dense
from sklearn.model_selection import KFold
from sklearn.preprocessing import MinMaxScaler
from sklearn.metrics import roc_curve, auc
import matplotlib.pyplot as plt
df = pd.read_excel("heart.xlsx")
prin... | null | CNN_3layer_FullyConected_kfolds.py | CNN_3layer_FullyConected_kfolds.py | py | 1,860 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_excel",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.KFold",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.MinMaxScaler",
"line_number": 31,
"usage_type": "call"
},
{
... |
479155505 | '''
classifier_types.py contains the types of classifiers and parameters that the model
'''
from sklearn.svm import SVC, LinearSVC
from sklearn.neighbors import KNeighborsClassifier, DistanceMetric
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import BaggingClassifier, RandomForestClassifier... | null | PA3/project_files/classifier_types.py | classifier_types.py | py | 2,961 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sklearn.svm.LinearSVC",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sklearn.neighbors.KNeighborsClassifier",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sklearn.tree.DecisionTreeClassifier",
"line_number": 18,
"usage_type": "call... |
65129294 | # Copyright (c) 2021 by Apex.AI Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | null | iceoryx_integrationtest/iceoryx_integrationtest/test_waitset_in_c_example.py | test_waitset_in_c_example.py | py | 3,863 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.environ.copy",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line... |
53940376 | from django.shortcuts import render
from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect
import MySQLdb
import time
# Updated July 12,2015
# Module to run test variables
def test_mode(request):
request.session["var_test"] = "No Information"
request.session["var_start"] =... | null | firstsite/wec/stackpole_files/mod_test.py | mod_test.py | py | 1,771 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "time.time",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "time.localtime",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "MySQLdb.connect",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
... |
359328563 | import time
import tensorflow as tf
# Import MNIST data
from tensorflow.examples.tutorials.mnist import input_data
import aim
aim.init(overwrite=True)
from aim import Profiler
Profiler.init(auto_detect_cycles=False, aggregate=Profiler.MEAN)
mnist = input_data.read_data_sets('/tmp/data/', one_hot=True)
learning_rat... | null | examples/tf_profiler_while_loop.py | tf_profiler_while_loop.py | py | 4,364 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "aim.init",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "aim.Profiler.init",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "aim.Profiler",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "aim.Profiler.MEAN",
"line_... |
289351836 | #!/usr/bin/env python
# PyRadio: Curses based Internet Radio Player
# http://www.coderholic.com/pyradio
# Ben Dowling - 2009 - 2010
# Kirill Klenov - 2012
# Peter Stevenson (2E0PGS) - 2018
# Spiros Georgaras - 2018
import curses
import logging
import os
import random
#import signal
from sys import version as python_v... | null | pyradio/radio.py | radio.py | py | 53,456 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "locale.setlocale",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "locale.LC_ALL",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path.join",
... |
516700961 | from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from models import Base, Category, Item, User
engine = create_engine(
'sqlite:///categoryitem.db',
connect_args={
'check_same_thread': False})
Base.metadata.bind = engine
DBSession = sessionmaker(bind=engine)
session = DBSess... | null | vagrant/catalog/seed.py | seed.py | py | 1,263 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "models.Base.metadata",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "models.Base",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "sqlalch... |
137647349 | import matplotlib
matplotlib.use("AGG")
import os
import glob
import momentsml
import config
import argparse
import fitsio
import simparams
import measfcts
import numpy as np
import yaml
import logging
logger = logging.getLogger(__name__)
def parse_args():
parser = argparse.ArgumentParser(description='Basic c... | null | scripts/neighbors/run_tp_sim_sexpp.py | run_tp_sim_sexpp.py | py | 8,698 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.use",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "simparams.Fid... |
384055346 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2020/11/20 10:40
# @Author : uyplayer
# @Site : uyplayer.pw
# @File : autograd_tutorial.py
# @Software: PyCharm
import torch
import numpy as np
# xx = torch.ones(2,2)
# print(xx)
# x = torch.ones(2,2,requires_grad=True)
# print(x)
#
# y... | null | pytorch/autograd_tutorial.py | autograd_tutorial.py | py | 1,927 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.ones",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "torch.randn",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "torch.tensor",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "torch.float",
"line_number": ... |
169948775 | """
Script to clean LFB animal rescue data and create an animated map over time of the most frequently rescued animals per
borough.
"""
import imageio as imageio
import matplotlib.pyplot as plt
import matplotlib
import pandas as pd
import geopandas as gpd
# colourmap settings
# the map is matplotlib's Dark2, with one... | null | main.py | main.py | py | 5,260 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.colors.Normalize",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.colors",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.colors.ListedColormap",
"line_number": 16,
"usage_type": "call"
},
{
... |
400694117 | # -*- coding: utf-8 -*-
from openerp.tests import common
import logging
logger = logging.getLogger(__name__)
class TestResPartnerSecurityFields(common.TransactionCase):
def setUp(self):
super(TestResPartnerSecurityFields, self).setUp()
# ATTENTION: It is necessary to clean the ir.model.data cac... | null | addons-own/fso_sosync_partner_security/tests/test_create_list_contact.py | test_create_list_contact.py | py | 3,351 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "openerp.tests.common.TransactionCase",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "openerp.tests.common",
"line_number": 9,
"usage_type": "name"
}
] |
214001357 | import redis
from datetime import datetime
import csv
#decode_responses, da die Rueckgabewerte von z.B. r.get(...) sonst als 'binaer' codiert
r = redis.Redis(decode_responses=True)
colInd = 0
recDateBeg = datetime(1989, 1, 9, 12, 0, 0)
recDateEnd = datetime(1989, 1, 9, 12, 0, 0)
recDateMax = datetime(2010, 1, 9, 12, ... | null | key-value-store/structure/read_data/bitOutStructure.py | bitOutStructure.py | py | 4,022 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "redis.Redis",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
... |
230140177 | '''
Created on Jul 4, 2014
@author: eze
'''
import logging
import os
from collections import defaultdict
import Bio.SeqIO as bpio
import pandas as pd
from Bio.Data.IUPACData import protein_letters_3to1
from Bio.PDB import PDBList
from Bio.PDB.PDBParser import PDBParser
from Bio.PDB.Polypeptide import is_aa,CaPPBuilde... | null | SNDG/Structure/PDBs.py | PDBs.py | py | 8,255 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "Bio.PDB.PDBParser.PDBParser",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "Bio.PDB.Polypeptide.is_aa",
"line_number": 44,
"usage_type": "call"
},
{
"api_name"... |
252144931 | from rest_framework.views import APIView
from rest_framework.generics import ListAPIView
from rest_framework.response import Response
from .serializers import *
from rest_framework.permissions import IsAuthenticated
from rest_framework_jwt.authentication import JSONWebTokenAuthentication
from common.common import get_e... | null | viewedapp-backend-deepak_branch/posts/api/views.py | views.py | py | 43,545 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.db.models.F",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "django.db.models.F",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "rest_framewor... |
414787961 | # functions for communicating with an admin
import os
import sys
import traceback
import yaml
import logging
import re
import smtplib
import email.utils
from email.mime.text import MIMEText
import json
import urllib.request
import urllib.parse
# read in an opt-in config file for changing directories and supplying e... | null | inspectors/utils/admin.py | admin.py | py | 5,659 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.exists",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "yaml.load",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "logging.error",
"line_numbe... |
237727678 | from wordcloud import WordCloud, STOPWORDS
import numpy as numpy
from PIL import Image
class wordCloudGenerator:
def __init__(self, wordFrequencies):
self.freqTuples = wordFrequencies
def generateWordCloudPNG(self):
freqDict = dict(self.freqTuples)
wc = WordCloud(width = 500, height =... | null | backend/wordCloudGenerator.py | wordCloudGenerator.py | py | 444 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "wordcloud.WordCloud",
"line_number": 12,
"usage_type": "call"
}
] |
355290334 | #!/usr/bin/env python3
import argparse
from bibtexparser import bibdatabase, bparser
import bibtexparser
# Argument parser
parser = argparse.ArgumentParser(
description="Checks the bibtex layout.", epilog="Use carefully!"
)
# Needed arguments.
parser.add_argument('file', type=str, help='The bibtex file')
parser.... | null | bibtexchecker/bibtexchecker.py | bibtexchecker.py | py | 8,001 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "bibtexparser.bparser.BibTexParser",
"line_number": 97,
"usage_type": "call"
},
{
"api_name": "bibtexparser.bparser",
"line_number": 97,
"usage_type": "name"
},
{
"api... |
454950899 | import uuid
from collections import Counter
from django.core.exceptions import ObjectDoesNotExist
from django.db import IntegrityError, models
from django.utils.translation import gettext_lazy as _
from dook.events.mixins import ModelEventMixin
from dook.news.constants import VerdictType
from dook.news.events import ... | null | dook/news/models.py | models.py | py | 5,255 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "dook.events.mixins.ModelEventMixin",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "django.db.models.Model",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 16,
"usage_type": "name"
},
{
"a... |
450046915 | from pathlib import Path
import re
import subprocess
from tqdm import tqdm
import gzip
# Config
main_folder = Path("./results")
# This script turns results into a csv file, one per subfolder of
# {main_folder}, with each subfolder thereof containing parameters
# separated by a double underscore.
def process_subfolde... | null | source-singleobjective/csvify.py | csvify.py | py | 2,666 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pathlib.Path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "gzip.open",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 75,
... |
483088328 | from django.views import View
from ..models import Tutor, CourseCode, Review
from .apiresponse import ApiResponse
class SearchTutorsView(View):
http_method_names = ['get']
def get(self, request, *args, **kwargs):
tutors = []
for entry in Tutor.objects.all():
user = entry.user
... | null | tutoriaapi/views/tutors.py | tutors.py | py | 1,086 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.views.View",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "models.Tutor.objects.all",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "models.Tutor.objects",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "m... |
566035371 | #!/usr/bin/env python
from distutils.core import setup
import setuptools # noqa
import os
with open('requirements.txt', mode='r') as f:
requirements = f.read().split()
with open('README.md') as f:
readme = f.read()
setup(name='ikkuna',
version='0.0.1.post1',
description='Ikkuna Neural Network M... | null | setup.py | setup.py | py | 2,096 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "distutils.core.setup",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 29,
"usage_type": "call"
}
] |
632232550 | import socket
import time
import threading
# import commands
import random
import json
import hashlib
# from settings.terminal_set import bcolors
# from helpers.terminal_helper import print_colored
import os
import jsonpickle
# import Node
# from Node import Node
from Message import Message
from Network import Network... | null | src/ballotbox/BallotBoxNetwork.py | BallotBoxNetwork.py | py | 2,022 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "Network.Network",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "socket.socket",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_STREAM"... |
455774022 | import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Output, Input
import plotly.express as px
import pandas as pd
import numpy as np
# Working with Data Frame
dff = pd.read_csv("https://raw.githubusercontent.com/javedhassans/demoapp/main/workingsheet.csv")
... | null | dash_app.py | dash_app.py | py | 2,651 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "dash.Dash",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "dash_html_components.Div",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "dash_html_componen... |
33836763 | from sklearn.metrics import precision_score, recall_score, accuracy_score
import numpy as np
import pickle
import json
# Read in data
X_test = np.genfromtxt("data/test_features.csv")
y_test = np.genfromtxt("data/test_labels.csv")
with open('model.pickle', 'rb') as f:
clf = pickle.load(f)
print("Testing model..."... | null | test.py | test.py | py | 638 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.genfromtxt",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.genfromtxt",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_num... |
600184617 | import os
from typing import TYPE_CHECKING, Iterable, Mapping, Optional, Union
from airflow.exceptions import AirflowException
from airflow.models import BaseOperator
from airflow.providers.microsoft.mssql.hooks.mssql import MsSqlHook
if TYPE_CHECKING:
from airflow.hooks.dbapi import DbApiHook
class ToCSVMsSqlOp... | null | plugins/df_to_csv_mssql_operator.py | df_to_csv_mssql_operator.py | py | 1,104 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "airflow.models.BaseOperator",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "os.ge... |
408082774 | from PyQt4 import QtCore, QtGui
from PyQt4.QtGui import QSizePolicy
from PyQt4.QtCore import QSize
import matplotlib
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as Canvas
from matplotlib.backends.backend_qt4 import NavigationToolbar2QT as NavigationToolbar
from matplotlib.figure import Figure
from... | null | tweekyV0.02/mplwidget.py | mplwidget.py | py | 3,182 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.rcParams",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "matplotlib.backends.backend_qt4.NavigationToolbar2QT",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "matplotlib.backends.backend_qt4agg.FigureCanvasQTAgg",
"line_number":... |
169540677 | from django.core.exceptions import ImproperlyConfigured
from rest_framework.authentication import CSRFCheck
from rest_framework.exceptions import PermissionDenied
from rest_framework.response import Response
from rest_framework.views import APIView
from django_postcode_lookup import loading, serializers
from django_po... | null | src/django_postcode_lookup/views.py | views.py | py | 2,226 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "rest_framework.views.APIView",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django_postcode_lookup.serializers.PostcodeLookupSerializer",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "django_postcode_lookup.serializers",
"line_numb... |
161367476 | """
Module with reading functionalities for filter profiles.
"""
import os
import warnings
import configparser
from typing import Union, Tuple
import h5py
import numpy as np
from typeguard import typechecked
from scipy.interpolate import interp1d, InterpolatedUnivariateSpline, interpolate
from species.data import ... | null | species/read/read_filter.py | read_filter.py | py | 4,717 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "configparser.ConfigParser",
"... |
221465284 | import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import os
import copy
###################################################################################################
######### Auxiliary Functions
#####################################################... | null | tunable_gan_class_optimization.py | tunable_gan_class_optimization.py | py | 31,694 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "matplotlib.gridspec.GridSpec",
"line_number": 14,
"usage_type": "call"
},
{
"api_name"... |
560028993 | from flask import *
import pickle
import docx2txt
import PyPDF2
import docx
from docx import Document
import re
import os
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.metrics.pairwise import cosine_similarity
from werkzeug.utils import secure_filename
import urllib.request
import pandas a... | null | app.py | app.py | py | 5,826 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 4... |
254119957 | # -*- coding: UTF-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
from itsdangerous import (TimedJSONWebSignatureSerializer
as Serializer, BadSignature, SignatureExpired)
from uradar import app
def generate_token(data, expiration=None):
if expiration is None:
expira... | null | RESTService/security/token.py | token.py | py | 717 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.setdefaultencoding",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "uradar.app.config",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "uradar.app",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "itsdangerous.... |
217087058 | #!/usr/bin/env python
"""The setup script."""
from setuptools import find_packages, setup
with open('README.md') as readme_file:
readme = readme_file.read()
with open('requirements.txt') as requirement_file:
requirements = requirement_file.readlines()
with open('peptide_fragmentor/version.txt') as version_... | null | setup.py | setup.py | py | 1,520 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "setuptools.setup",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 42,
"usage_type": "call"
}
] |
111773890 |
# coding: utf-8
# In[ ]:
#This Enum represents the list of features in a human readable way.
#The number (key) will later be the index of the corresponding entry.
#Author: Thorsten
from enum import Enum
class Features(Enum):
#First pseudo-features, helpful for reconstructing the structure.
#Some might help... | null | feature generation/Features.py | Features.py | py | 26,113 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "enum.Enum",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "numericalPostagging.posTag",
"line_number": 190,
"usage_type": "call"
},
{
"api_name": "word2vec3.Word2Vec",
"line_number": 222,
"usage_type": "call"
},
{
"api_name": "IsVerb.posT... |
139712679 | from django.shortcuts import render
from django.conf import settings
from django.http import HttpResponse
from .stats import *
from .forms import *
from .models import *
def index(request):
if request.method == 'POST':
form = RankTableForm(request.POST)
if form.is_valid():
obj = form... | null | RankTracker/RankTrackerImpl/views.py | views.py | py | 2,376 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "stats.evaluate",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "django... |
247592687 | # tmux attach
# pip install flask
# export FLASK_APP=app.py
# flask run --host=0.0.0.0
from flask import Flask, request, redirect, url_for, render_template, send_from_directory
import shutil, subprocess, logging
from itertools import product
from werkzeug.utils import secure_filename
import os, urllib
import requests
... | null | app.py | app.py | py | 4,531 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "logging.FileHandler",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "flask.redirect",
... |
193577800 | import pyopencl as cl
import numpy
set_simple_args(model_params)
set_device()
create_buffers(np.array(particles, dtype=np.float64))
program = cl.Program(self.context, open('worker.cl').read()).build()
def set_device():
device = cl.get_platforms()[settings.DEVICE_NUM].get_devices(getattr(cl.device_type, settings.C... | null | Playgendary/MyOpenCL.py | MyOpenCL.py | py | 1,757 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pyopencl.Program",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pyopencl.get_platforms",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pyopencl.device_type",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pyop... |
613030479 | #!/usr/bin/env python
#
#
from os import listdir, rename
from os.path import join, isdir, isfile, isabs
from re import sub, findall
from logging import exception
from shutil import move
# Path stuff
SHOWS_Path = '/mnt/main_pool/media/shows'
SHOWS_Exts = '.mkv'
SRC_Path = '/mnt/main_pool/media/downloads'
def file_Sub... | null | python/FNAS/file_Sorter_original.py | file_Sorter_original.py | py | 1,776 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.isabs",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.rename",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 25,
"u... |
331142601 | # (C) Copyright 2015 Hewlett Packard Enterprise Development LP
# 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/LICEN... | null | opstestfw/host/hostIperfClientStop.py | hostIperfClientStop.py | py | 2,818 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "opstestfw.LogOutput",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "opstestfw.returnStruct",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "pexpect.TIMEOUT",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_name": "re.se... |
118851884 | import requests
import re
from bs4 import BeautifulSoup as BS
AFISHA_URL = 'http://www.afisha.ru/msk/schedule_cinema/'
KINOPOISK_URL = 'https://www.kinopoisk.ru/get'
NUMBER_MOVIES_TO_SHOW = 10
def fetch_afisha_page():
response = requests.get(AFISHA_URL)
return response.content
def parse_afisha_list(html):... | null | cinemas.py | cinemas.py | py | 2,204 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"... |
105062842 | from bs4 import BeautifulSoup
import requests
import time
#商品列表页面
url = 'http://bj.58.com/pbdn/0/'
#获取列表页所有符合要求的商品对应的详情页链接列表函数
def getItemUrls(url):
web_data = requests.get(url)
soup = BeautifulSoup(web_data.text,'lxml')
items = soup.select('#infolist > table > tr > td.img > a')
itemUrls = []
for ... | null | week1/get58.py | get58.py | py | 2,221 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"... |
650779891 | # MODULES
from os import system
import time
# - basic
import numpy as np
import pandas as pd
# - Binance
import binance
from binance.client import Client
from binance.websockets import BinanceSocketManager
# grant access
def test_connection(k,s):
try:
client = Client(k,s)
test = c... | null | OLD_main.py | OLD_main.py | py | 1,813 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "binance.client.Client",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_numb... |
14391295 | """
Purpose : Extract data for Us Banks
##################### Change log ###############################
##------------------------------------------------------------------##
## Author ##Date ##Current Version ##
##----------------------... | null | Script/multithreading_master_us.py | multithreading_master_us.py | py | 5,743 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "time.time",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "maks_lib.logpath",
"line_number": 32,
"usage_type": "argument"
},
{
"api_name": "maks_lib.log_config",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "maks_lib.logpath",... |
466683320 | import itertools
from enum import Enum
from typing import List, Dict
from abc import abstractmethod, ABC
class State(Enum):
RUNNING = 0
WAITING = 1
FINISHED = 2
class ParameterMode(Enum):
POSITION = 0
IMMEDIATE = 1
RELATIVE = 2
class OutputDevice(ABC):
@abstractmethod
def receivei... | null | python/11/intcode.py | intcode.py | py | 9,054 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "enum.Enum",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "abc.ABC",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 21... |
527509340 | from helper import Helper
# creating object for Helper class
helper = Helper("audioFiles", {}, "audioFiles.json")
# this function provides to run Helper class methods
def test_runner():
helper.play_mp3_from_folder_and_then_label_it()
helper.json_parser()
# call test_runner function
test_runner()
| null | runner.py | runner.py | py | 310 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "helper.Helper",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "helper.play_mp3_from_folder_and_then_label_it",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "helper.json_parser",
"line_number": 10,
"usage_type": "call"
}
] |
616687272 | from django.shortcuts import render_to_response
from django.http import Http404
from django.template import RequestContext
from django.core.exceptions import ObjectDoesNotExist
from websites.shopping.models import Item, Media
from websites.content.models import Section
from urllib import urlencode
import url... | null | django_apps/websites/shopping/views.py | views.py | py | 1,270 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "websites.content.models.Section.objects.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "websites.content.models.Section.objects",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "websites.content.models.Section",
"line_number": 17,... |
2295075 | #!/usr/bin/python3
'''testing the index route'''
import unittest
import pep8
from os import getenv
import requests
import json
from api.v1.app import *
storage = getenv("HBNB_TYPE_STORAGE")
class TestIndex(unittest.TestCase):
'''test index'''
def test_status(self):
'''test status function'''... | null | tests/test_api/test_v1/test_views/test_index.py | test_index.py | py | 1,134 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.getenv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "unittest.TestCase",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_nu... |
253381576 | import sys
import argparse
import time
import datetime
import xml.etree.ElementTree as ET
HTML_START = '<!DOCTYPE html><html lang="en"><head><title>BEP E2E Test Run Times</title><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1"> \
<link rel="stylesheet" type="text/css" hr... | null | python_libs/get_run_times.py | get_run_times.py | py | 2,957 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "xml.etree.ElementTree.fromstring",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 41,
"usage_type": "call"
},
{
... |
277946954 | #!/usr/bin/env python3
#
### DEFINE ###
import os, sys, time
import multiprocessing
import matplotlib.pyplot as mpl
import numpy as np
#import ase, ase.io
#import descriptors
#import pickle, json
import scipy.sparse
from describe.descriptors import MBTR
from describe.core import System
from describe.data.element_dat... | null | python/visualise_mbtr_from_tensor.py | visualise_mbtr_from_tensor.py | py | 3,434 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_... |
136860336 | import numpy as np
import pandas as pd
from joblib import Parallel, delayed
import multiprocessing
from sklearn.base import clone, OutlierMixin, BaseEstimator
from sklearn.cluster import KMeans
__all__ = ['DividedOutlierDetector']
class DividedOutlierDetector(BaseEstimator, OutlierMixin):
_estimator_type =... | null | outliers/divided.py | divided.py | py | 1,311 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sklearn.base.BaseEstimator",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "sklearn.base.OutlierMixin",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "sklearn.cluster.KMeans",
"line_number": 20,
"usage_type": "call"
},
{
"api_n... |
82531133 | import sqlite3
# do poprawnego działania należy najpierw mieć bazę stworzoną za pomocą skryptu `baza_drop_and_create.py`
conn = sqlite3.connect('baza.db')
c = conn.cursor()
zapytanie = """
SELECT * FROM produkty WHERE cena > ? AND cena < ? ORDER BY cena ASC;
"""
cena_min = input("Podaj dolny zakres ceny: ")
cena_ma... | null | Python - advanced/zajecia09/baza_select04b.py | baza_select04b.py | py | 462 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sqlite3.connect",
"line_number": 5,
"usage_type": "call"
}
] |
556522444 | # Gets palette from image
from PIL import Image
palette = set()
fp = 'palette.png'
im = Image.open(fp)
width, height = im.size
for x in range(width):
for y in range(height):
color = im.getpixel((x, y))
palette.add(color)
for color in palette:
print('\t\t(%s, %s, %s),'%(color[0], color[1], co... | null | Utilities/Animations/palette_grabber.py | palette_grabber.py | py | 330 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PIL.Image.open",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 7,
"usage_type": "name"
}
] |
511055058 | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
from collections import namedtuple
import time
AUTHOR = u'John Vrbanac'
SITENAME = u'Flux.Ninja'
SITESUBTITLE = u'The opinionated comments of a software engineer'
SITEURL = 'https://flux.ninja'
COPYRIGHT = '© 2012-{0} John Vrb... | null | pelicanconf.py | pelicanconf.py | py | 2,134 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "time.strftime",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 58,
"usage_type": "call"
}
] |
458583874 | import json
import pytest
from gazpacho import get
def test_get():
url = "https://en.wikipedia.org/wiki/Gazpacho"
content = get(url)
assert "<title>Gazpacho - Wikipedia" in content
def test_get_headers():
url = "https://httpbin.org/headers"
UA = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:... | null | tests/test_get.py | test_get.py | py | 869 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "gazpacho.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "gazpacho.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "gazpacho.get",
"line_number":... |
652303677 | import pandas as pd
import numpy as np
import json
from bs4 import BeautifulSoup
import re
'''codes for reading one .json, create one dataframe with user-item info'''
data = json.load(open('dataset/tripadvisor_json/258990.json'))
data.keys()
'''[u'Reviews', u'HotelInfo']'''
'''function read json into user-item matri... | null | 0_project_src/0_tripadvisor_json.py | 0_tripadvisor_json.py | py | 6,353 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "json.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_numb... |
606712254 | import nose
import pandas.util.testing as tm
import pandas_datareader.data as web
class TestEdgarIndex(tm.TestCase):
def test_get_index(self):
ed = web.DataReader('full', 'edgar-index')
assert len(ed > 1000)
if __name__ == '__main__':
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--... | null | pandas_datareader/tests/test_edgar.py | test_edgar.py | py | 366 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.util.testing.TestCase",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pandas.util.testing",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "pandas_datareader.data.DataReader",
"line_number": 9,
"usage_type": "call"
},
{
... |
136739755 | # -*- coding: utf-8 -*-
# Copyright 2014 Objectif Libre
#
# 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 ... | null | cloudkitty/collector/ceilometer.py | ceilometer.py | py | 6,372 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cloudkitty.collector.BaseCollector",
"line_number": 59,
"usage_type": "attribute"
},
{
"api_name": "cloudkitty.collector",
"line_number": 59,
"usage_type": "name"
},
{
"api_name": "ceilometerclient.client.get_client",
"line_number": 74,
"usage_type": "call"... |
387237612 | #!/usr/bin/env python3
import argparse
import sys
import functools
import wikipedia
import requests
from time import sleep
from urllib.parse import urlparse, urlunparse
from functional import compose, partial
from filecache import filecache
multi_compose = partial(functools.reduce, compose)
def main():
parser ... | null | build/lib/urlinfer.py | urlinfer.py | py | 7,983 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "functional.partial",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "functional.compose",
"line_number": 14,
"usage_type": "argument"
},
{
"api_name": "functools.reduce",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "argpa... |
179973588 | from core import Live_Worker
from core import Live_env
from threading import Thread
import keyboard
import datetime
class Live_session(Thread):
def __init__(self, mode="train", gui=0, contract_type="classic", config='config/', db=None):
self.db = db
if not "/" in config[len(config)-1]:
... | null | core/session/live.py | live.py | py | 1,951 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "threading.Thread",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "core.Live_env",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime... |
501813045 | import os
import cv2
import imutils
import time
import dlib
import json
import datetime
import numpy as np
from collections import OrderedDict
from scipy.spatial import distance as dist
from django.shortcuts import render
from django.views.decorators import gzip
from django.http import StreamingHttpResponse
class Cen... | null | cam/views.py | views.py | py | 8,510 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.OrderedDict",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "scipy.spa... |
492523344 | from __future__ import annotations
import typing
import weakref
from typing import Callable, Iterator, List, Optional, Sequence, Tuple, Union
from flask import request
from flask.wrappers import Response
from limits import RateLimitItem, parse_many
from limits.strategies import RateLimiter
if typing.TYPE_CHECKING:
... | null | flask_limiter/wrappers.py | wrappers.py | py | 5,608 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "limits.RateLimitItem",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "extension.Limiter",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "limi... |
542751928 | from Tkinter import *
from easysnmp import Session
root = Tk()
session = Session(hostname='192.168.1.70', community='public', version=2)
totals = '.1.3.6.1.4.1.18334.1.1.1.5.7.2.1.1.0'
def getnum(oid):
description = session.get(oid)
val = str(description)
num = val.find("' ", 22, 30)
total = int(val[21:... | null | tests/tkint.py | tkint.py | py | 782 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "easysnmp.Session",
"line_number": 4,
"usage_type": "call"
}
] |
312449085 | # -*- coding: utf-8 -*-
#
# @author: Antoine, Christian
#
import re
import gzip
import json
from copy import deepcopy
import numpy as np
from pprint import pprint
directionWords = ["je", "moi", "j'", "mon", "ma", "mes", "mien", "miens", "tu", "t'", "toi", "ton", "ta", "tes", "tien", "tiens", 'il', 'elle', 'ils', 'el... | null | scripts/extractor.py | extractor.py | py | 9,285 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.sub",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 79,
"usage_t... |
443701354 | import urllib.parse
from sources import scraper
from sources import knitter
import simplejson as json
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = 'Run ingest job'
def add_arguments(self, parser):
parser.add_argument('--knitonly',
... | null | sebastian/sources/management/commands/ingestvessels.py | ingestvessels.py | py | 708 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "sources.scraper.scrape",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "sources.scraper",
"line_number": 25,
"usage_type": "name"
},
{
"ap... |
226510927 | # Copyright (c) 2017 Ryuichi Ueda
# Released under the MIT license
# https://github.com/ryuichiueda/probrobo_practice/blob/master/state_equations/no_noise.ipynb
import numpy as np
import math, random
import matplotlib.pyplot as plt
def move(x_old, u):
pos_x, pos_y, pos_theta = x_old
act_fw, act_rot = u
po... | null | slam_notes/prob_robot/src/noise_less_motion.py | noise_less_motion.py | py | 1,024 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "math.cos",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "math.sin",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 21,
... |
403589549 | # -*- coding: utf-8 -*-
"""
Created on Sun Mar 15 13:50:51 2020
@author: robin
"""
import numpy as np
import matplotlib.pyplot as plt
import scipy.special as sc
x = np.linspace(-1,5,1000)
a=0.15 #Scale
v1 = x*np.sqrt(a)
v2 = np.inf
S = sc.fresnel(v2)[0] + sc.fresnel(v1)[0]
C = sc.fresnel(v2)[1] +... | null | 4th Year/Phys 408/Homeworks/hw7Plot.py | hw7Plot.py | py | 936 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.linspace",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.inf",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "scipy.special.fresnel",
... |
12485186 | import sys
import os
sys.path.insert(0, os.path.abspath("../"))
from flask import Flask
from flask_restaction import Resource, Api
app = Flask(__name__)
api = Api(app)
class Hello(Resource):
schema_inputs = {
"get": {
"name": {
"desc": "you name",
"required": T... | null | examples/hello.py | hello.py | py | 579 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.insert",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.