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
143221793
from __future__ import print_function, division import sys import torch.nn as nn from torchvision import models from dffml.util.entrypoint import entrypoint from dffml.model.model import Model from .pytorch_base import PyTorchModelConfig, PyTorchModelContext class PyTorchPretrainedContext(PyTorchModelContext): ...
null
model/pytorch/dffml_model_pytorch/pytorch_pretrained.py
pytorch_pretrained.py
py
4,642
python
en
code
null
code-starcoder2
66
[ { "api_name": "pytorch_base.PyTorchModelContext", "line_number": 12, "usage_type": "name" }, { "api_name": "torchvision.models", "line_number": 28, "usage_type": "argument" }, { "api_name": "torch.nn.Sequential", "line_number": 38, "usage_type": "call" }, { "api_n...
597389739
import sys import os sys.path.insert(0,os.path.abspath('.')) sys.path.insert(0,os.path.abspath('..')) sys.path.insert(0,os.path.abspath('../easyreg')) import numpy as np from functools import reduce from easyreg.reg_data_utils import make_dir import random import SimpleITK as sitk from multiprocessing import Pool ...
null
data_pre/reg_preprocess_example/oai_longitude_reg.py
oai_longitude_reg.py
py
25,790
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.path.insert", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path", "line_number...
294540964
# uncompyle6 version 3.7.4 # Python bytecode 3.5 (3351) # Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04) # [GCC 8.4.0] # Embedded file name: /Users/f1nal/Dropbox/python/jet-bridge/src/packages/jet_bridge_base/jet_bridge_base/commands/check_token.py # Compiled at: 2020-03-04 16:40:12 # Size of source mo...
null
pycfiles/jet_bridge_base-0.7.6-py3-none-any/check_token.cpython-35.py
check_token.cpython-35.py
py
1,462
python
en
code
null
code-starcoder2
66
[ { "api_name": "jet_bridge_base.utils.backend.is_token_activated", "line_number": 16, "usage_type": "call" }, { "api_name": "jet_bridge_base.settings.TOKEN", "line_number": 16, "usage_type": "attribute" }, { "api_name": "jet_bridge_base.settings", "line_number": 16, "usage...
183772281
import requests from bs4 import BeautifulSoup import lxml import json url = 'https://www.spr.ru/all/' # req = requests.get(url) # src = req.text # # soup = BeautifulSoup(src, 'lxml') # # sections_dict = {} # sections = soup.find_all(class_='zagolovok') # # for item in sections: # name = item.text.strip() # hr...
null
main.py
main.py
py
3,416
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.load", "line_number": 25, "usage_type": "call" }, { "api_name": "json.load", "line_number": 69, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 79, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number...
60266282
from nltk import word_tokenize, pos_tag #sentance = 'Anna have a cat' def nltk_function(sentance): wt= word_tokenize(sentance) print(wt) pos_tagger = pos_tag(wt) print(pos_tagger) noun = [] verb = [] for tuple in pos_tagger: if tuple[1] == 'NNP': no...
null
Ai Project/Chatbot pythons integration/python_nltk.py
python_nltk.py
py
591
python
en
code
null
code-starcoder2
66
[ { "api_name": "nltk.word_tokenize", "line_number": 6, "usage_type": "call" }, { "api_name": "nltk.pos_tag", "line_number": 9, "usage_type": "call" } ]
252102708
from pyexpat import ExpatError import xmltodict from ..utils.database import save_broken_affiliation from clusterix.utils.dictionaries import flatten_dict def flatten_affiliation_dict(affiliation_dict): """ Parse the xml from GROBID into a dictionary, and then flatten it,in order to make the process of mapp...
null
clusterix/affiliations/utils/dictionaries.py
dictionaries.py
py
3,455
python
en
code
null
code-starcoder2
66
[ { "api_name": "xmltodict.parse", "line_number": 21, "usage_type": "call" }, { "api_name": "clusterix.utils.dictionaries.flatten_dict", "line_number": 22, "usage_type": "call" }, { "api_name": "pyexpat.ExpatError", "line_number": 31, "usage_type": "name" }, { "api_...
76341339
import argparse import sys from lnd import Lnd from output import Output from status import Status from utils import is_umbrel from checkring import CheckRing class RingTools: def __init__(self, arguments): self.lnd = Lnd(arguments.lnddir, arguments.grpc) self.output = Output(self.lnd) sel...
null
ringtools.py
ringtools.py
py
3,215
python
en
code
null
code-starcoder2
66
[ { "api_name": "lnd.Lnd", "line_number": 12, "usage_type": "call" }, { "api_name": "output.Output", "line_number": 13, "usage_type": "call" }, { "api_name": "status.Status", "line_number": 18, "usage_type": "call" }, { "api_name": "checkring.CheckRing", "line_n...
2448991
from sqlalchemy import create_engine import psycopg2 # import config import pandas as pd import os from flask import Flask, jsonify, send_from_directory from flask_cors import CORS, cross_origin import config app = Flask(__name__, static_url_path="",static_folder="") cors = CORS(app) try: DATABASE_URL = os.envi...
null
app.py
app.py
py
1,315
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 12, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 14, "usage_type": "attribute" }, { "api_name": "sqlalchemy.create_engine"...
438248026
# -*- coding: utf-8 -*- import logging import os import oss2 import json import time import subprocess import random import string from task_queue import TaskQueue def handler(event, context): logger = logging.getLogger() evt = json.loads(event) logger.info("Handling event: %s", evt) src_endpoint = 'https://os...
null
test/functions/compareFiles/index.py
index.py
py
1,955
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 14, "usage_type": "call" }, { "api_name": "time.time", "line_number": 23, "usage_type": "call" }, { "api_name": "task_queue.TaskQueue", "li...
548657899
import feedparser import threading from models.episode import Episode from copy import deepcopy import os class EpisodeWorker(threading.Thread): def __init__(self, storer, series, i): """ Constructor for thread that will request the RSS of a particular podcast series, parse the series details and ep...
null
podcasts/episode_worker.py
episode_worker.py
py
1,455
python
en
code
null
code-starcoder2
66
[ { "api_name": "threading.Thread", "line_number": 7, "usage_type": "attribute" }, { "api_name": "feedparser.parse", "line_number": 26, "usage_type": "call" }, { "api_name": "models.episode.Episode", "line_number": 40, "usage_type": "call" }, { "api_name": "copy.dee...
345563230
""" This file runs the main training/val loop, etc... using Lightning Trainer """ import os import numpy as np from pathlib import Path from pytorch_lightning import Trainer from argparse import ArgumentParser from contin_infomax.models import InfoMax, RacingcarMultiviewDataset from pytorch_lightning.logging import Ten...
null
contin_infomax/trainer.py
trainer.py
py
2,453
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 16, "usage_type": "call" }, { "api_name": "contin_infomax.models.InfoMax.add_model_specific_args", "line_number": 26, "usage_type": "call" }, { "api_name": "contin_infomax.models.InfoMax", "line_number": 26, "usage_t...
516869816
# coding=utf-8 from django import forms class ImpressaoForm(forms.Form): CHOICES = ((5, '5 folhas'), (10, '10 folhas'), (15, '15 folhas'), (20, '20 folhas')) quantidade_cheques = forms.ChoiceField( widget=forms.RadioSelect, choices=CHOICES, ...
null
apps/operacoes/impressao/util/forms.py
forms.py
py
469
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.forms.Form", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 5, "usage_type": "name" }, { "api_name": "django.forms.ChoiceField", "line_number": 10, "usage_type": "call" }, { "api_name": "django.for...
71017732
import os import sys from collections import namedtuple Stats = namedtuple('Stats', 'file name rotation_format raw_size compressed_size ratio max_error compression_time duration num_animated_tracks') def parse_argv(): options = {} options['acl'] = "" options['stats'] = "" options['refresh'] = False for i in ran...
null
tools/acl_compressor/acl_compressor.py
acl_compressor.py
py
5,041
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.namedtuple", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 13, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 14, "usage_type": "attribute" }, { "api_name": "sys.exit", "lin...
473660699
import json def set_charact(name, Weapons,Amor): info = { "닉네임" : name, "체력": 50, "무기" : Weapons, "방어구" : Amor, "기본공격" : "기본공격", "스킬" : "치명타" } with open("static/save.txt", "w", encoding='utf-8') as f: json.dump(character, f, ensure_ascii =...
null
game3.py
game3.py
py
754
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.dump", "line_number": 13, "usage_type": "call" } ]
469412377
from helpers.helpers import get_data, get_item_from_dynamo, put_item_dynamo import datetime target_avengers = ['ironman', 'capamerica'] def lambda_handler(event, context): query = ''' SELECT cr.name as character, array_agg(co.title) as Comics FROM target_characters tc JOIN characters ct ON tc.c...
null
avengers/functions/calculate_relation_partners.py
calculate_relation_partners.py
py
997
python
en
code
null
code-starcoder2
66
[ { "api_name": "helpers.helpers.get_data", "line_number": 25, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 27, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 27, "usage_type": "attribute" }, { "api_name": ...
499450526
# -*- coding: utf-8 -*- # @Time : 2018/11/18 14:54 # @Author : Monica # @Email : 498194410@qq.com # @File : my_log.py import logging from Common import project_path class MyLog: def my_log(self, level, msg): # 定义一个日志收集器my_logger my_logger = logging.getLogger("Monica") # 设定级别 my...
null
Common/my_log.py
my_log.py
py
1,993
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "logging.Formatter", "line_number": 20, "usage_type": "call" }, { "api_name": "logging.FileHandler", "line_number": 27, "usage_type": "call" }, { "api_name": "Common.projec...
640641297
__author__ = 'Joshua' import numpy as np import cv2 cap = cv2.VideoCapture(0) imgprocess = 1 none,process = cap.read() process = cv2.pyrDown(process) while(True): key = cv2.waitKey(1) if key == ord('q'): break elif key == ord('2'): ret, frame2 = cap.read() gray2 = cv2.cvtColor...
null
openwebcam.py
openwebcam.py
py
1,353
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.VideoCapture", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.pyrDown", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.waitKey", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_numb...
461737007
#!/usr/bin/env python # encoding: utf-8 ''' @author: 郑祥忠 @license: (C) Copyright 2013-2019, 海格星航 @contact: dylenzheng@gmail.com @project: MTCNN @file: interface.py @time: 8/7/19 7:39 PM @desc: ''' import ctypes import cv2 import time from threading import Lock def call_jeson(num,faceRect): ''' :param num: 人...
null
Fast-MTCNN/interface.py
interface.py
py
2,954
python
en
code
null
code-starcoder2
66
[ { "api_name": "ctypes.c_char_p", "line_number": 67, "usage_type": "attribute" }, { "api_name": "cv2.rectangle", "line_number": 94, "usage_type": "call" }, { "api_name": "traceback.format_exc", "line_number": 110, "usage_type": "call" }, { "api_name": "traceback.pr...
124713040
# Basic client for interacting with RabbitMQ from logging import Logger import pika class RabbitClient: def __init__(self, config, logger): logger.debug("Initializing RabbitClient") self.__logger = logger self.__config = config self.__connection = pika.BlockingConnection(pika.Connec...
null
src/rabbitClient.py
rabbitClient.py
py
1,198
python
en
code
null
code-starcoder2
66
[ { "api_name": "pika.BlockingConnection", "line_number": 10, "usage_type": "call" }, { "api_name": "pika.ConnectionParameters", "line_number": 10, "usage_type": "call" }, { "api_name": "pika.BlockingConnection", "line_number": 18, "usage_type": "call" }, { "api_nam...
190401147
"""Module to test multiprocessing.""" import multiprocessing as mp import queue import os import time import sys from time import sleep def washer(stop_event, input, output): """Washer.""" while (not stop_event.is_set()): try: dish = input.get(True, 1) print('Wash...
null
processes.py
processes.py
py
2,041
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.getpid", "line_number": 15, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 17, "usage_type": "call" }, { "api_name": "queue.Empty", "line_number": 20, "usage_type": "attribute" }, { "api_name": "os.getpid", "line_number": ...
429754411
# !/usr/local/env python # encoding=utf8 import openpyxl import telnetlib def write_info(host, port,flag,server,comm,comm_version): with open("check_info.csv",'a+') as f: f.writelines("{},{},{},{},{}\n".format(host,port,flag,server,comm,comm_version)) def conn_scan(host, port,server,comm,comm_version): ...
null
tmp.py
tmp.py
py
1,296
python
en
code
null
code-starcoder2
66
[ { "api_name": "telnetlib.Telnet", "line_number": 11, "usage_type": "call" }, { "api_name": "openpyxl.load_workbook", "line_number": 25, "usage_type": "call" } ]
8592438
import numpy as np import numpy.testing as npt import pandas as pd from stumpy import ( gpu_stump, _get_QT_kernel, _ignore_trivial_kernel, _calculate_squared_distance_kernel, _update_PI_kernel, ) from stumpy import core, _get_QT from numba import cuda import math import pytest THREADS_PER_BLOCK = 1...
null
tests/test_gpu_stump.py
test_gpu_stump.py
py
7,775
python
en
code
null
code-starcoder2
66
[ { "api_name": "numba.cuda.is_available", "line_number": 18, "usage_type": "call" }, { "api_name": "numba.cuda", "line_number": 18, "usage_type": "name" }, { "api_name": "pytest.skip", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.linalg.norm", ...
238865680
#!/usr/bin/python3 import sys import platform import chardet if platform.system() == "Linux": return_line = "\n"; elif platform.system() == "Windows": return_line = "\r\n"; #识别待读取文件的字符集 def charset_detect(dict): with open(dict, "rb") as f: charset_encoding = chardet.detect( f.read() )["encoding"]...
null
ybdt-dict-cleaner.py
ybdt-dict-cleaner.py
py
1,683
python
en
code
null
code-starcoder2
66
[ { "api_name": "platform.system", "line_number": 7, "usage_type": "call" }, { "api_name": "platform.system", "line_number": 9, "usage_type": "call" }, { "api_name": "chardet.detect", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.argv", "line_num...
165040407
import cv2 def findImageFace(img, count): gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) classifier = cv2.CascadeClassifier(r'.\xml\haarcascade_frontalface_default.xml') color = (0, 255, 0) faceRects = classifier.detectMultiScale(gray, scaleFactor=1.2, minN...
null
createDatasets/viseoCapture.py
viseoCapture.py
py
1,144
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.cvtColor", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 6, "usage_type": "attribute" }, { "api_name": "cv2.CascadeClassifier", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.imwrite",...
618466936
import numpy as np import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt import matplotlib.transforms as transforms import sys from scipy.ndimage import gaussian_filter from pylab import MultipleLocator, LogLocator, FormatStrFormatter import matplotlib import os from P23config import * matplotlib.r...
null
legacy/CV_XRD_plot_P23.py
CV_XRD_plot_P23.py
py
36,184
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.use", "line_number": 3, "usage_type": "call" }, { "api_name": "matplotlib.rc", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.rc", "line_number": 14, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.rcParams....
366233372
import requests from bs4 import BeautifulSoup import geopy.distance from pymongo import MongoClient import time import paho.mqtt.client as mqtt import json def earthquake(): # specify url url = 'http://www.seismo.ethz.ch/fr/earthquakes/switzerland/last-90-days/' home_coords= (46.4886,6.73022) page = requests....
null
old/python/sendmsg.py
sendmsg.py
py
1,060
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 18, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 19, "usage_type": "call" }, { "api_name": "geopy.distance.distance.vincenty", "line_number": 30, "usage_type": "call" }, { "api_name": "geopy...
165998825
from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer from sklearn.decomposition import NMF, LatentDirichletAllocation from sklearn.metrics.pairwise import cosine_similarity import pandas as pd import numpy as np import pickle from nltk.stem.snowball import SnowballStemmer import os from flask im...
null
src/my_app/app.py
app.py
py
3,995
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_json", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.read_json", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.render_template",...
491168161
from datetime import datetime, timedelta import asyncio import pytz import discord from discord.ext import commands from typing import ( Dict, List, Optional ) from .Base import DatabaseChecker class BirthdayMember: def __init__(self, database, table: str, member: discord.Member): self.databa...
null
discordSuperUtils/Birthday.py
Birthday.py
py
6,068
python
en
code
null
code-starcoder2
66
[ { "api_name": "discord.Member", "line_number": 16, "usage_type": "attribute" }, { "api_name": "typing.Dict", "line_number": 22, "usage_type": "name" }, { "api_name": "datetime.datetime.utcfromtimestamp", "line_number": 27, "usage_type": "call" }, { "api_name": "da...
513323310
# uncompyle6 version 3.7.4 # Python bytecode 2.7 (62211) # Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04) # [GCC 8.4.0] # Embedded file name: build/bdist.linux-x86_64/egg/kvlayer/_hbase.py # Compiled at: 2015-07-31 13:31:44 """ Implementation of AbstractStorage using HBase Your use of this software is...
null
pycfiles/kvlayer-0.5.9-py2.7/_hbase.py
_hbase.py
py
6,627
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "kvlayer._abstract_storage.StringKeyedStorage", "line_number": 19, "usage_type": "name" }, { "api_name": "kvlayer._exceptions.ProgrammerError", "line_number": 30, "usage_type": "ca...
355709873
from django.db.models import Q from django.shortcuts import get_object_or_404 from ..models import ProductGroup, SexType, ProductItem, Product, SubProductType, Size, Color, ProductType, Category, \ Brand, UserLike, CartItem def put_navigation_menu_groups_and_types(context): for_men = SexType.objects.get(name...
null
soho/shop/modules/soho_products.py
soho_products.py
py
7,700
python
en
code
null
code-starcoder2
66
[ { "api_name": "models.SexType.objects.get", "line_number": 9, "usage_type": "call" }, { "api_name": "models.SexType.objects", "line_number": 9, "usage_type": "attribute" }, { "api_name": "models.SexType", "line_number": 9, "usage_type": "name" }, { "api_name": "mo...
388863966
from datastore.models import * from tastypie.test import ResourceTestCase from django.test.client import Client from django.contrib.auth.models import User from django.http.response import HttpResponseNotFound, HttpResponseRedirect from tastypie.models import ApiKey from tastypie.http import HttpUnauthorized from datas...
null
datastore/tests/api_tests.py
api_tests.py
py
9,530
python
en
code
null
code-starcoder2
66
[ { "api_name": "datastore.tests.authenticated_tests.AuthenticatedTestCase", "line_number": 15, "usage_type": "name" }, { "api_name": "django.http.response.HttpResponseNotFound", "line_number": 50, "usage_type": "argument" }, { "api_name": "tastypie.http.HttpUnauthorized", "lin...
31476402
# coding = utf-8 # やること # parsed.dill をロードしてヒストグラム表示 # F 値も計算する(正解ステップを設定できるようにしよう) # メソッド # ・visualize # ヒストグラム出す # # ・evaluate # F値求める import os import glob import dill import numpy as np from functools import reduce import matplotlib.pyplot as plt dirpath = "tmp/results/" dillname = "parsed.dill" # dillname...
null
final/VisualiseModel.py
VisualiseModel.py
py
4,176
python
en
code
null
code-starcoder2
66
[ { "api_name": "dill.load", "line_number": 27, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.hist", "line_number": 33, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 33, "usage_type": "name" }, { "api_name": "os.path.exists", ...
82498727
import datetime from typing import List from wakapy.parser import JsonDict from wakapy.exceptions import ContainerNotFound from wakapy.utils import order_dict from wakapy.plot import PieChart from wakapy.day import Day class Slice: """ Given two valid dates it'll slice and save them. It always includes the ...
null
wakapy/user.py
user.py
py
11,471
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.date", "line_number": 47, "usage_type": "attribute" }, { "api_name": "datetime.date", "line_number": 51, "usage_type": "attribute" }, { "api_name": "datetime.datetime.strptime", "line_number": 53, "usage_type": "call" }, { "api_name": "date...
245941418
import discord from redbot.core import commands, checks, Config, bot from redbot.core.utils.chat_formatting import box, humanize_list from redbot.core.utils.menus import menu, DEFAULT_CONTROLS # https://red-discordbot.readthedocs.io/en/latest/framework_utils.html # https://github.com/Cog-Creators/Red-DiscordBot/blob/V...
null
postcount/postcount.py
postcount.py
py
21,344
python
en
code
null
code-starcoder2
66
[ { "api_name": "redbot.core.commands.Cog", "line_number": 32, "usage_type": "attribute" }, { "api_name": "redbot.core.commands", "line_number": 32, "usage_type": "name" }, { "api_name": "redbot.core.Config.get_conf", "line_number": 35, "usage_type": "call" }, { "ap...
381213222
# -*- coding: utf-8 -*- import requests import json def request(event, context): r = requests.get('https://books.rakuten.co.jp/event/book/comic/calendar/2020/02/js/booklist.json') # requestsを用いてgetでapiからjsonを取得 json_dict = json.loads(r.text) # レスポンス(r.text)を辞書型にする books = json_dict['list'] for book in b...
null
serverless/services/test-lambda-2/handler.py
handler.py
py
433
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 6, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 9, "usage_type": "call" } ]
262930595
import os from PIL import Image from PIL import ImageDraw, ImageFont import numpy as np from matplotlib import pyplot as plt import json import skimage.io from sys import argv import shutil import time import random import cv2 def tif2jpg(tif, jpg): im = Image.open(tif) im.save(jpg) return jpg def gener...
null
detect_.py
detect_.py
py
19,775
python
en
code
null
code-starcoder2
66
[ { "api_name": "PIL.Image.open", "line_number": 16, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 16, "usage_type": "name" }, { "api_name": "os.walk", "line_number": 23, "usage_type": "call" }, { "api_name": "skimage.io.io.imread", "line_num...
160318740
import datetime from influxdb import DataFrameClient dbclient = DataFrameClient(host='nangluong.iotmind.vn', port=8086, username='root', password='root', database='SCG') def sumvolume(): if len(dbclient.query('select count(*) from sumvolume').keys()) == 0: upper = dbclient.query('select * from realtime or...
null
SCGinfluxdb1.8-trans.py
SCGinfluxdb1.8-trans.py
py
1,501
python
en
code
null
code-starcoder2
66
[ { "api_name": "influxdb.DataFrameClient", "line_number": 4, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 26, "usage_type": "call" } ]
380781168
# -*- coding: utf-8 -*- from flask_wtf import FlaskForm from wtforms import HiddenField, StringField, ValidationError class SettingShowUserAdd(FlaskForm): user_id = HiddenField("ユーザID") user_mail_address = StringField("メールアドレス") def valiate_user_id(self, user_id): if user_id.data == "": raise ValidationError(...
null
server/ver1_0/BookMarkGroupServer/Validate/settingShowUserAddValidate.py
settingShowUserAddValidate.py
py
916
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask_wtf.FlaskForm", "line_number": 5, "usage_type": "name" }, { "api_name": "wtforms.HiddenField", "line_number": 6, "usage_type": "call" }, { "api_name": "wtforms.StringField", "line_number": 7, "usage_type": "call" }, { "api_name": "wtforms.Vali...
112168272
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler import urlparse import logging import sys from mapfiserver import config from mapfiserver.session import SessionManager logging.basicConfig(format="%(created)s [%(levelname)s] %(filename)s:%(lineno)d %(message)s", stream=sys.stdout, l...
null
server/mapfiserver/server.py
server.py
py
3,523
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.basicConfig", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 11, "usage_type": "attribute" }, { "api_name": "logging.DEBUG", "line_number": 11, "usage_type": "attribute" }, { "api_name": "logging.getLog...
256156058
import json import logging.config import os import random from datetime import datetime from string import ascii_lowercase BASE_LOG_DIR = '/home/georgy/logs/' def configure_loggers_with_file(base_dir): print(base_dir) logging_param_file = os.path.join(base_dir, 'configs/logging_params.json') with open(lo...
null
common/log.py
log.py
py
1,129
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.join", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line...
145196524
from flask import Flask, render_template, session, request, redirect, url_for import os from werkzeug.utils import secure_filename from flask import send_from_directory import pandas as pd import openpyxl from openpyxl.styles.alignment import Alignment #インスタンスの作成 app = Flask(__name__) #暗号鍵の作成 key = os.urandom(21) app...
null
app.py
app.py
py
7,019
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 10, "usage_type": "call" }, { "api_name": "os.urandom", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 20, "usage_type": "call" }, { "api_name": "flask.request.files", ...
550459932
import colorcet as cc import matplotlib.pyplot as plt import numpy as np import scipy.optimize def tri_area(q1, q2, q3): x1, y1 = q1 x2, y2 = q2 x3, y3 = q3 return abs((x1*(y2 - y3) + x2*(y3 - y1) + x3*(y1 - y2))/2) def get_bary(p1, p2, p3, p): A = tri_area(p1, p2, p3) A1 = tri_area(p, p2, ...
null
tri_interp.py
tri_interp.py
py
9,742
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.argmin", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 47, "usage_type": "call" }, { "api_name": "numpy.nan", "line_number": 76, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_numbe...
215654789
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Jul 27 18:11:31 2021 @author: tom verguts simple online updater can be used to check convergence properties etc """ import numpy as np import matplotlib.pyplot as plt n_trials = 200 gamma = 1 mean, std = 1, 0.00 beta_list = [0.1, 1, 1.2, -0.5] fig, a...
null
code by chapter/Chapter 4/ch4_online_updater.py
ch4_online_updater.py
py
638
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 19, "usage_type": "name" }, { "api_name": "numpy.zeros", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.random...
55878868
import esphome.codegen as cg import esphome.config_validation as cv from esphome.components import sensor, spi from esphome.const import CONF_ID, CONF_MAINS_FILTER, CONF_REFERENCE_RESISTANCE, \ CONF_RTD_NOMINAL_RESISTANCE, CONF_RTD_WIRES, ICON_THERMOMETER, UNIT_CELSIUS max31865_ns = cg.esphome_ns.namespace('max318...
null
esphome/components/max31865/sensor.py
sensor.py
py
1,673
python
en
code
null
code-starcoder2
66
[ { "api_name": "esphome.codegen.esphome_ns.namespace", "line_number": 7, "usage_type": "call" }, { "api_name": "esphome.codegen.esphome_ns", "line_number": 7, "usage_type": "attribute" }, { "api_name": "esphome.codegen", "line_number": 7, "usage_type": "name" }, { ...
259857789
#!/usr/bin/env python3 import argparse import re def get_args(): # Usage for user input parser = argparse.ArgumentParser(description='Deduplicate aligned data based on the position of the aligned reads') parser.add_argument("-f", "--file", help = "This needs to be a sorted SAM alignment file. Please provide an order...
null
Prymolenna_deduper.py
Prymolenna_deduper.py
py
7,924
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 6, "usage_type": "call" }, { "api_name": "re.search", "line_number": 33, "usage_type": "call" }, { "api_name": "re.search", "line_number": 43, "usage_type": "call" }, { "api_name": "re.findall", "line_num...
457888877
import requests def get_web_page(url): resp = requests.get( url = url, cookies={'over18':'1'} ) if resp.status_code !=200: #statu_code取得 server 回覆的狀態碼 200 表示正常, 404 表示找不到網頁等 print('Invalid url:', resp.url) return None else: return resp.text if __name__ == '__mai...
null
web_crawler_test.py
web_crawler_test.py
py
534
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 5, "usage_type": "call" } ]
608810899
#!/usr/bin/python3 import sys import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk, Gdk, GObject ACTION = 0 MASK = 1 VALUE = 2 list = [( "Cut", Gdk.ModifierType.CONTROL_MASK, Gdk.KEY_X ), ( "Copy", Gdk.ModifierType.CONTROL_MASK, Gdk.KEY_C ), ( "Paste", Gdk.ModifierType.CONTROL_MAS...
null
book/09-Tree_View_Widget/AccelCellRenderers.py
AccelCellRenderers.py
py
2,686
python
en
code
null
code-starcoder2
66
[ { "api_name": "gi.require_version", "line_number": 5, "usage_type": "call" }, { "api_name": "gi.repository.Gdk.ModifierType", "line_number": 12, "usage_type": "attribute" }, { "api_name": "gi.repository.Gdk", "line_number": 12, "usage_type": "name" }, { "api_name"...
135105378
from utils.data_loader import prepare_data_seq from utils import config from model.transformer import Transformer from model.transformer_mulexpert import Transformer_experts from model.common_layer import evaluate, count_parameters, make_infinite , print_custum import torch import torch.nn as nn import torch.nn.functio...
null
inference_new.py
inference_new.py
py
4,785
python
en
code
null
code-starcoder2
66
[ { "api_name": "utils.data_loader.prepare_data_seq", "line_number": 24, "usage_type": "call" }, { "api_name": "utils.config.batch_size", "line_number": 24, "usage_type": "attribute" }, { "api_name": "utils.config", "line_number": 24, "usage_type": "name" }, { "api_...
251155551
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('assetsinfo', '0011_auto_20160602_1439'), ] operations = [ migrations.AlterField( model_name='server', ...
null
assetsinfo/migrations/0012_auto_20160607_1036.py
0012_auto_20160607_1036.py
py
425
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.AlterField", "line_number": 14, "usage_type": "call" }, {...
349541642
""" 前日 pe が-1だった銘柄を 今日の 15:55 の price を見て 25%以上上がっていたらショート,逆をロング.次の日のクローズでCloseする """ from quantopian.algorithm import attach_pipeline, pipeline_output from quantopian.pipeline import Pipeline from quantopian.pipeline.data.builtin import USEquityPricing from quantopian.pipeline.factors import AverageDollarVolume from ...
null
algorithms/GUGD Surprise/backtests/Backtest 3-597069208f3f7e522056afee.py
Backtest 3-597069208f3f7e522056afee.py
py
5,566
python
en
code
null
code-starcoder2
66
[ { "api_name": "quantopian.algorithm.attach_pipeline", "line_number": 37, "usage_type": "call" }, { "api_name": "quantopian.pipeline.filters.morningstar.Q1500US", "line_number": 50, "usage_type": "call" }, { "api_name": "quantopian.pipeline.factors.eventvestor.BusinessDaysSincePre...
486602638
#!/usr/bin/env python3 from setuptools import setup, Extension __version__ = '0.0.2' long_description = ''' This is a small Python3 extension which sends arbitrary commands to SCSI devices, via the Linux SCSI Generic driver, which provides the SG_IO ioctl for this purpose. Basically, the module includes three method...
null
pypi_install_script/py3_sg-0.0.2.tar/setup.py
setup.py
py
1,094
python
en
code
null
code-starcoder2
66
[ { "api_name": "setuptools.setup", "line_number": 16, "usage_type": "call" }, { "api_name": "setuptools.Extension", "line_number": 20, "usage_type": "call" } ]
95058126
from bottle import route, run, request, static_file import os @route("/") def main_html(): return static_file('fileupload.html', root='./') @route('/upload', method='POST') def do_upload(): category = request.forms.get('category') upload = request.files.get('upload') name, ext = os.path.splitext(uplo...
null
python/my_test/bottle/fileupload_example.py
fileupload_example.py
py
730
python
en
code
null
code-starcoder2
66
[ { "api_name": "bottle.static_file", "line_number": 7, "usage_type": "call" }, { "api_name": "bottle.route", "line_number": 5, "usage_type": "call" }, { "api_name": "bottle.request.forms.get", "line_number": 11, "usage_type": "call" }, { "api_name": "bottle.request...
350226092
from Deck import Deck from Dealer import Dealer from Player import Player from Shoe import Shoe from DiscardPile import DiscardPile from PlayerStrategy import PlayerStrategy from HouseRules import HouseRules import time import config from Game import Game # Represents a table at a casino that is playing many games with...
null
Simulator.py
Simulator.py
py
3,980
python
en
code
null
code-starcoder2
66
[ { "api_name": "config.simulator_settings", "line_number": 18, "usage_type": "attribute" }, { "api_name": "config.game_settings", "line_number": 19, "usage_type": "attribute" }, { "api_name": "Shoe.Shoe", "line_number": 20, "usage_type": "call" }, { "api_name": "Di...
152356889
import msgpack from pyon.core.interceptor.interceptor import Interceptor from pyon.util.log import log class EncodeInterceptor(Interceptor): def outgoing(self, invocation): log.debug("EncodeInterceptor.outgoing: %s", invocation) log.debug("Pre-transform: %s", invocation.message) # msgpack...
null
pyon/core/interceptor/encode.py
encode.py
py
1,174
python
en
code
null
code-starcoder2
66
[ { "api_name": "pyon.core.interceptor.interceptor.Interceptor", "line_number": 6, "usage_type": "name" }, { "api_name": "pyon.util.log.log.debug", "line_number": 8, "usage_type": "call" }, { "api_name": "pyon.util.log.log", "line_number": 8, "usage_type": "name" }, { ...
143551532
import matplotlib.pyplot as plt import pandas as pd import os import numpy as np import RawDataManagement as rdm # define the lines x1 = rdm.data['Día'] y1 = rdm.data['TempMinAbs_1'] y2 = rdm.data['TempMinAbs_2'] y3 = rdm.data['TempMinAbs_3'] y4 = rdm.data['TempMinAbs_4'] y5 = rdm.data['TempMinAbs_5'] y6 = rdm.data['T...
null
Code1/InputDataVisualisation.py
InputDataVisualisation.py
py
2,452
python
en
code
null
code-starcoder2
66
[ { "api_name": "RawDataManagement.data", "line_number": 8, "usage_type": "attribute" }, { "api_name": "RawDataManagement.data", "line_number": 9, "usage_type": "attribute" }, { "api_name": "RawDataManagement.data", "line_number": 10, "usage_type": "attribute" }, { ...
118238971
import trading_api_wrappers as api from cached_property import cached_property from .base import Converter __all__ = ["OpenExchangeRates"] class OpenExchangeRates(Converter): name = "OpenExchangeRates" @cached_property def client(self) -> api.OXR: return api.OXR(**self.client_params) def _...
null
trading_bots/contrib/converters/open_exchange_rates.py
open_exchange_rates.py
py
508
python
en
code
null
code-starcoder2
66
[ { "api_name": "base.Converter", "line_number": 9, "usage_type": "name" }, { "api_name": "trading_api_wrappers.OXR", "line_number": 14, "usage_type": "call" }, { "api_name": "cached_property.cached_property", "line_number": 12, "usage_type": "name" }, { "api_name":...
392279351
# -*- coding: utf-8 -*- from zope.component import queryUtility from plone.registry.interfaces import IRegistry from Products.CMFPlone.utils import safe_unicode from collective.analyticspanel import logger from collective.analyticspanel.interfaces import IAnalyticsSettings def setupVarious(context): if context...
null
collective/analyticspanel/setuphandlers.py
setuphandlers.py
py
1,426
python
en
code
null
code-starcoder2
66
[ { "api_name": "zope.component.queryUtility", "line_number": 19, "usage_type": "call" }, { "api_name": "plone.registry.interfaces.IRegistry", "line_number": 19, "usage_type": "argument" }, { "api_name": "collective.analyticspanel.interfaces.IAnalyticsSettings", "line_number": ...
543852615
import numpy as np import cv2 import time import matplotlib.pyplot as plt #from grab import grab_screen import math from picamera.array import PiRGBArray import RPi.GPIO as GPIO from picamera import PiCamera from forward import movefwd from right import moveright from left import moveleft from back import moveback came...
null
LaneDriver/lanefoll/lane3.py
lane3.py
py
6,135
python
en
code
null
code-starcoder2
66
[ { "api_name": "picamera.PiCamera", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.zeros_like", "line_number": 31, "usage_type": "call" }, { "api_name": "cv2.fillPoly", "line_number": 32, "usage_type": "call" }, { "api_name": "cv2.bitwise_and", ...
491143974
#usr/bin/env python #import roslib; roslib.load_manifest('vision') import cv2 import math import numpy as np import rospy from std_msgs.msg import String from sensor_msgs.msg import Image from cv_bridge import CvBridge, CvBridgeError from dynamic_reconfigure.server import Server as DynServer from srmauv_m...
null
src/vision/scripts/aksbuoy.py
aksbuoy.py
py
5,057
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.array", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 25, "usage_type": "call" }, { "api_name": "cv2.namedWindow", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.array", "line_numbe...
527436895
from baselines import PPO2_SIR from stable_baselines import logger from stable_baselines.common import set_global_seeds from stable_baselines.common.vec_env import SubprocVecEnv from utils.log_utils import eval_model, log_eval, stack_eval_model from utils.parallel_subproc_vec_env import ParallelSubprocVecEnv from stab...
null
run_ppo_augment.py
run_ppo_augment.py
py
5,348
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 17, "usage_type": "call" }, { "api_name": "argparse.ArgumentDefaultsHelpFormatter", "line_number": 17, "usage_type": "attribute" }, { "api_name": "time.strftime", "line_number": 46, "usage_type": "call" }, { ...
97565266
import requests import re from bs4 import BeautifulSoup import xlwt def get_html(url): ''' 访问页面,并返回文本格式的html ''' try: Response=requests.get(url,headers={'User-Agent': "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/535.24 (KHTML, like Gecko) Chrome/19.0.1055.1 Safari/535.24"}) except: ...
null
Python/房产信息v0_2.py
房产信息v0_2.py
py
3,867
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 11, "usage_type": "call" }, { "api_name": "xlwt.Workbook", "line_number": 18, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 36, "usage_type": "call" }, { "api_name": "re.search", "line_nu...
647433950
"""Рассмотрим два HTML-документа A и B. Из A можно перейти в B за один переход, если в A есть ссылка на B, т. е. внутри A есть тег <a href="B">, возможно с дополнительными параметрами внутри тега. Из A можно перейти в B за два перехода если существует такой документ C, что из A в C можно перейти за один переход и из C ...
null
newStepic/httprequest.py
httprequest.py
py
3,928
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 99, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 101, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 105, "usage_type": "call" }, { "api_name": "requests.get", "line_numbe...
17089006
#!/usr/bin/env python # This program takes OpenMC statepoint binary files and creates a variety of # outputs from them which should provide the user with an idea of the # convergence behavior of all the tallies and filters defined by the user in # tallies.xml. The program can directly plot the value and errors of eac...
null
src/utils/tally_conv.py
tally_conv.py
py
16,636
python
en
code
null
code-starcoder2
66
[ { "api_name": "glob.glob", "line_number": 55, "usage_type": "call" }, { "api_name": "statepoint.StatePoint", "line_number": 80, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 87, "usage_type": "call" }, { "api_name": "scipy.stats.stats.t.ppf",...
397196272
from django.shortcuts import render from django.http import HttpResponse,Http404 from rest_framework.views import APIView from rest_framework.response import Response from rest_framework import status from rest_framework.authentication import SessionAuthentication, BasicAuthentication from rest_framework.permissions i...
null
gift/views.py
views.py
py
9,895
python
en
code
null
code-starcoder2
66
[ { "api_name": "rest_framework.authentication.SessionAuthentication", "line_number": 14, "usage_type": "name" }, { "api_name": "rest_framework.views.APIView", "line_number": 22, "usage_type": "name" }, { "api_name": "notice.models", "line_number": 26, "usage_type": "name" ...
614422545
import atexit import datetime import logging import os import json import re import time import pickle import argparse import dateutil.parser from random import randrange, uniform from sqlite3 import dbapi2 as sqlite3 from apscheduler.schedulers.background import BackgroundScheduler from flask import Flask, request, ...
null
serve.py
serve.py
py
20,186
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.isfile", "line_number": 33, "usage_type": "call" }, { "api_name": "os.path", "line_number": 33, "usage_type": "attribute" }, { "api_name": "flask.Flask", "line_number": 37, "usage_type": "call" }, { "api_name": "flask_limiter.Limiter", "...
272403949
# -*- coding: utf-8 -*- ######################################################### # # # Programa que: # # # # - Lee del directorio de SNORT los logs creados # # convertidos a ficheros json (de forma continua) # # directorio de logs: /home...
null
SCRIPTS/snort-json/lecturaSnortjson.py
lecturaSnortjson.py
py
9,104
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime.now", "line_number": 76, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 76, "usage_type": "attribute" }, { "api_name": "datetime.datetime.strptime", "line_number": 77, "usage_type": "call" }, { "api_name"...
474609664
import json import os class Venta: def __init__(self,archivo): self.archivo = archivo self.lista = [] self.dic = {} self.ventas = {} def read_line(self): i = 1 for line in self.archivo.readlines(): self.lista = line.split(",") self.venta...
null
58103-Scalco-Valentina/TP1/Ej17OOP.py
Ej17OOP.py
py
1,159
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.dirname", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 25, "usage_type": "call" }, { "api_name": "json.dump", "line_nu...
384336468
# functions # Example - Adding two numbers and print it import argparse import sys def sum_of_two_numbers(a,b): """This functiono finds sum of two numbers""" print(a+b) parser = argparse.ArgumentParser(description = "Adds two numbers") parser.add_argument("num1", type=int, help="1st number") ...
null
Python/Session2/Lab/Functions/Lab_7_functions_1.py
Lab_7_functions_1.py
py
486
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 13, "usage_type": "call" } ]
152939939
# Copyright 2018 Contributors to Hyperledger Sawtooth # # 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 ...
null
tests/unit/providers/ldap/ldap_message_validator_test.py
ldap_message_validator_test.py
py
2,796
python
en
code
null
code-starcoder2
66
[ { "api_name": "pytest.raises", "line_number": 23, "usage_type": "call" }, { "api_name": "rbac.providers.error.unrecoverable_error.LdapValidationException", "line_number": 23, "usage_type": "argument" }, { "api_name": "rbac.providers.ldap.ldap_message_validator.validate_next_paylo...
124790305
from functools import reduce lista = [1,3,-1, 15, 19] listaDobles = map(lambda x: x*2, lista) listaPares = filter(lambda x: x%2 == 0, list(range(1,101))) suma100 = reduce(lambda x, y: x + y , range(101)) sumaPares = reduce(lambda x, y: x + y, listaPares) print(list(listaDobles)) #print(list(listaPares)) print(sumaPar...
null
Modulo2/mapfilter.py
mapfilter.py
py
324
python
en
code
null
code-starcoder2
66
[ { "api_name": "functools.reduce", "line_number": 7, "usage_type": "call" }, { "api_name": "functools.reduce", "line_number": 8, "usage_type": "call" } ]
168748
#!/usr/bin/env python import sqlite3 import sys con = sqlite3.connect('dw_esc.db') CREATE_STATEMENT = ''' CREATE TABLE escapes ( dtmin REAL, dtmax REAL, threshold REAL, noise REAL, escapetime REAL ) ''' with con: cur = con.cursor() cur.execute(CREATE_STATEMENT)
null
dw_dbscript.py
dw_dbscript.py
py
295
python
en
code
null
code-starcoder2
66
[ { "api_name": "sqlite3.connect", "line_number": 6, "usage_type": "call" } ]
63903990
# coding: utf-8 import argparse from sklearn.externals import joblib from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.feature_extraction import DictVectorizer from sklearn.datasets import dump_svmlight_file from pymongo import MongoClient import scipy.sparse as sp import os import multiprocessi...
null
scripts/featurize.py
featurize.py
py
4,029
python
en
code
null
code-starcoder2
66
[ { "api_name": "sklearn.feature_extraction.DictVectorizer", "line_number": 27, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 43, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 65, "usage_type": "call" }, { ...
387041251
import pygame import start_settings import text def button(msg,x,y,w,h,ic,ac,action=None): mouse = pygame.mouse.get_pos() click = pygame.mouse.get_pressed() print(click) if x + w > mouse[0] > x and y + h > mouse[1] > y: pygame.draw.rect(start_settings.gameDisplay, ac, (x, y...
null
button_signals.py
button_signals.py
py
708
python
en
code
null
code-starcoder2
66
[ { "api_name": "pygame.mouse.get_pos", "line_number": 10, "usage_type": "call" }, { "api_name": "pygame.mouse", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pygame.mouse.get_pressed", "line_number": 11, "usage_type": "call" }, { "api_name": "pygam...
506440324
from collections import namedtuple from dateutil.parser import parse from .exceptions import ParseError _List = namedtuple('List', [ 'bounced', 'date', 'id', 'name', 'total', 'unsubscribed', 'updated', ]) class List(_List): def __new__(cls, bounced, date, id, name, total, unsubscribed...
null
mailerlite_client/datastructures.py
datastructures.py
py
1,831
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.namedtuple", "line_number": 6, "usage_type": "call" }, { "api_name": "dateutil.parser.parse", "line_number": 18, "usage_type": "call" }, { "api_name": "dateutil.parser.parse", "line_number": 19, "usage_type": "call" }, { "api_name": "col...
197306647
import numpy as np import cv2 as cv import tensorflow as tf class ImageMaskDataset: def __init__(self, images, labels, image_shape=None, label_shape=None, size=None): assert images.shape[0] == labels.shape[0] self.images = images self.labels = labels self.image_shape = (image_sha...
null
datasets.py
datasets.py
py
3,776
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.all", "line_number": 35, "usage_type": "call" }, { "api_name": "cv2.INTER_CUBIC", "line_number": 36, "usage_type": "attribute" }, { "api_name": "numpy.all", "line_number": 37, "usage_type": "call" }, { "api_name": "cv2.INTER_AREA", "line_n...
231272642
# Copyright 2017, Big Switch Networks # 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 requ...
null
networking_bigswitch/plugins/bigswitch/db/migration/alembic_migrations/versions/66cc6bc031de_tenant_policy_plugin.py
66cc6bc031de_tenant_policy_plugin.py
py
4,122
python
en
code
null
code-starcoder2
66
[ { "api_name": "alembic.op.create_table", "line_number": 36, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 36, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 38, "usage_type": "call" }, { "api_name": "sqlalchemy.Strin...
80438900
from setuptools import setup, find_packages import os version = '1.0' setup(name='apprepo.site', version=version, description="", long_description=open("README.txt").read() + "\n" + open(os.path.join("docs", "HISTORY.txt")).read(), # Get more strings from # http://...
null
setup.py
setup.py
py
1,231
python
en
code
null
code-starcoder2
66
[ { "api_name": "setuptools.setup", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "setuptools.find_packages", ...
490913958
from flask import Flask # import pyodbc app = Flask(__name__) @app.route("/") def hello(): # Some other example server values are # server = 'localhost\sqlexpress' # for a named instance # server = 'myserver,port' # to specify an alternate port # server = 'tcp:mytest.centralus.cloudapp.azure.com...
null
application.py
application.py
py
751
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 3, "usage_type": "call" } ]
642779444
import random import matplotlib.pyplot as plt from matplotlib.patches import Circle import numpy as np from sklearn import linear_model import time import matplotlib.patches as mpatches # Problem 3.3 # For the double semi-circle task in Problem 3.1, set sep = -5 and generate # 2,000 examples. # semi-cir...
null
hw2/hw2_p3_3.py
hw2_p3_3.py
py
10,115
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.patches.Circle", "line_number": 33, "usage_type": "call" }, { "api_name": "matplotlib.patches.Circle", "line_number": 34, "usage_type": "call" }, { "api_name": "matplotlib.patches.Circle", "line_number": 37, "usage_type": "call" }, { "api...
436391946
import pystk import numpy as np def control(aim_point, current_vel): """ Set the Action for the low-level controller :param aim_point: Aim point, in local coordinate frame :param current_vel: Current velocity of the kart :return: a pystk.Action (set acceleration, brake, steer, drift) """ ac...
null
homework6/homework/controller.py
controller.py
py
2,252
python
en
code
null
code-starcoder2
66
[ { "api_name": "pystk.Action", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.clip", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.abs", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.sign", "line_number": 24,...
265562851
import sys from itertools import groupby from operator import itemgetter def read_from_mapper(file): for edges in file: yield edges.strip().split('\t') def main(): n = m = 0 data = read_from_mapper(sys.stdin) groups = groupby(data, itemgetter(0)) # 0 for u/sourceNode and 1 for v/destNode for v, group...
null
hadoop_naive/remove_edge_second_reducer.py
remove_edge_second_reducer.py
py
620
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.stdin", "line_number": 12, "usage_type": "attribute" }, { "api_name": "itertools.groupby", "line_number": 13, "usage_type": "call" }, { "api_name": "operator.itemgetter", "line_number": 13, "usage_type": "call" } ]
263041862
# -*- coding: utf-8 -*- from .VocBboxDataset import VOC_BBOX_LABEL_NAMES from .VocBboxDataset import VocBboxDataset import torch from torch.utils.data import DataLoader from torchvision import transforms def getVocDataLoader(config): assert config.dataset == 'VOC07' or config.dataset == 'VOC12' transform = t...
null
dataLoader/dataLoader.py
dataLoader.py
py
1,624
python
en
code
null
code-starcoder2
66
[ { "api_name": "torchvision.transforms.Compose", "line_number": 12, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 12, "usage_type": "name" }, { "api_name": "torchvision.transforms.ToTensor", "line_number": 13, "usage_type": "call" }, { ...
67701888
import os from bs4 import BeautifulSoup from urllib import request from datetime import date def getUrl(rawList): newList=[] for raw in rawList: equalPosition=[] for letter in range(len(raw)): if raw[letter]=="=": equalPosition.ap...
null
afwing.py
afwing.py
py
1,270
python
en
code
null
code-starcoder2
66
[ { "api_name": "urllib.request.urlopen", "line_number": 20, "usage_type": "call" }, { "api_name": "urllib.request", "line_number": 20, "usage_type": "name" }, { "api_name": "bs4.BeautifulSoup", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.date...
417313300
""" Inherit class to customize an command """ from django.core.management.base import BaseCommand from django.utils.translation import gettext_lazy as _ from api_food.api import ApiFood from product.models import Category, Product class Command(BaseCommand): """ Customize command to populate the database products...
null
project/api_food/management/commands/populate_db.py
populate_db.py
py
3,257
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 8, "usage_type": "name" }, { "api_name": "django.utils.translation.gettext_lazy", "line_number": 11, "usage_type": "call" }, { "api_name": "api_food.api", "line_number": 12, "usage_type": "name" }, ...
207903254
import os import logging import argparse from model.seq2seq import Seq2Seq from model.loss import * from model.metric import * from data_loader import * from trainer import CaptionTrainer from preprocess.embedding import * from logger import Logger logging.basicConfig(level=logging.INFO, format='') def main(config, ...
null
hw2/hw2_1/model_seq2seq.py
model_seq2seq.py
py
2,360
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.basicConfig", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 12, "usage_type": "attribute" }, { "api_name": "logger.Logger", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.join", ...
261170241
import time from fastapi.encoders import jsonable_encoder import asyncio import time def form_output_data(data, error=None): data = jsonable_encoder(data) return { "status": True, "message": "success" if not error else "fail", "error": error, "data": data } async def te...
null
utils.py
utils.py
py
391
python
en
code
null
code-starcoder2
66
[ { "api_name": "fastapi.encoders.jsonable_encoder", "line_number": 10, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 22, "usage_type": "call" } ]
230115490
from rest_framework import serializers from aaee_front.apps.locations.serializers import LocationSerializer from .models import Event, EventOrganiser class EventOrganiserSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = EventOrganiser fields = ('name', 'slug_name', 'email', ...
null
aaee_front/apps/events/serializers.py
serializers.py
py
1,087
python
en
code
null
code-starcoder2
66
[ { "api_name": "rest_framework.serializers.HyperlinkedModelSerializer", "line_number": 6, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 6, "usage_type": "name" }, { "api_name": "models.EventOrganiser", "line_number": 9, "usage_type...
575546952
from model_code.IRmodel import IRmodel import os import pickle from sklearn.naive_bayes import MultinomialNB class IR_MNB(IRmodel): def __init__(self,args): self.data_name = args.data_name if args.train: self.model = self.get_model() elif args.test: self.model = s...
null
project/model_code/IRmodel_MNB.py
IRmodel_MNB.py
py
1,494
python
en
code
null
code-starcoder2
66
[ { "api_name": "model_code.IRmodel.IRmodel", "line_number": 9, "usage_type": "name" }, { "api_name": "os.path.exists", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.path.join", ...
177573339
"""Discrete transitions.""" from functools import lru_cache from typing import Callable, Optional import numpy as np from probnum import randvars from probnum.randprocs.markov import _transition from probnum.randprocs.markov.discrete import _condition_state from probnum.typing import FloatArgType, IntArgType class...
null
src/probnum/randprocs/markov/discrete/_nonlinear_gaussian.py
_nonlinear_gaussian.py
py
5,796
python
en
code
null
code-starcoder2
66
[ { "api_name": "probnum.randprocs.markov._transition.Transition", "line_number": 14, "usage_type": "attribute" }, { "api_name": "probnum.randprocs.markov._transition", "line_number": 14, "usage_type": "name" }, { "api_name": "probnum.typing.IntArgType", "line_number": 46, ...
199275962
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # 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
main.py
main.py
py
3,301
python
en
code
null
code-starcoder2
66
[ { "api_name": "webapp2.RequestHandler", "line_number": 36, "usage_type": "attribute" }, { "api_name": "logging.info", "line_number": 38, "usage_type": "call" }, { "api_name": "webapp2.RequestHandler", "line_number": 42, "usage_type": "attribute" }, { "api_name": "...
293669107
''' This problem was asked by Google. Given a stack of N elements, interleave the first half of the stack with the second half reversed using only one other queue. This should be done in-place. Recall that you can only push or pop from a stack, and enqueue or dequeue from a queue. For example, if the stack is [1, 2,...
null
1_DCP.py
1_DCP.py
py
2,586
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.deque", "line_number": 16, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 34, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 46, "usage_type": "call" } ]
216366613
import shlex import subprocess import sys import re import json import os def run(command: str, timeout=60000): if not command: return print("\n$ {}".format(command)) return subprocess.Popen(shlex.split(command), stdout=sys.stdout, stderr=sys.stderr).wait(timeout=timeout) INITIAL_COMMANDS = '''...
null
multiple_specs_subfolder/invoker.py
invoker.py
py
3,296
python
en
code
null
code-starcoder2
66
[ { "api_name": "subprocess.Popen", "line_number": 14, "usage_type": "call" }, { "api_name": "shlex.split", "line_number": 14, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 14, "usage_type": "attribute" }, { "api_name": "sys.stderr", "line_n...
155966008
# uncompyle6 version 3.7.4 # Python bytecode 2.7 (62211) # Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04) # [GCC 8.4.0] # Embedded file name: build/bdist.linux-x86_64/egg/plasma/models/runner.py # Compiled at: 2017-02-17 21:50:27 from __future__ import print_function import matplotlib matplotlib.use('A...
null
pycfiles/plasma-0.0.2-py2.7/runner.py
runner.py
py
9,451
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.use", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 21, "usage_type": "attribute" }, { "api_name": "plasma.conf.conf", ...
482758445
#!/usr/bin/env python3 import sys import rclpy import argparse from std_msgs.msg import String from geometry_msgs.msg import Pose, Twist from rclpy.node import Node from rclpy.utilities import remove_ros_args from sockets import TCPSocket, UDPSocket def cl_red(msge): return '\033[31m' + msge + '\033[0m' def cl_green(...
null
ros2/kmr_communication/kmr_communication/nodes/kmp_command_node.py
kmp_command_node.py
py
3,437
python
en
code
null
code-starcoder2
66
[ { "api_name": "rclpy.node.Node", "line_number": 16, "usage_type": "name" }, { "api_name": "sockets.TCPSocket", "line_number": 33, "usage_type": "call" }, { "api_name": "sockets.UDPSocket", "line_number": 35, "usage_type": "call" }, { "api_name": "geometry_msgs.msg...
564665773
import shelve import uuid from datetime import datetime import os class Person: def __init__(self): self.data = shelve.open('mydata.dat') def create_data(self,nama=None,connection=None): if (nama is None or connection is None): return False now = datetime.now() curr...
null
Tugas4/person.py
person.py
py
2,462
python
en
code
null
code-starcoder2
66
[ { "api_name": "shelve.open", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 13, "usage_type": "name" }, { "api_name": "uuid.uuid4", "...
370408455
#!/usr/bin/python3 # -*- coding: utf-8 -*- __author__ = "Jakub 'Gradam' Semik" from PyQt5 import QtWidgets from PyQt5 import QtCore from PyQt5 import QtGui import functools import sys import threading import webbrowser import os import re import TorrentSearch import YoutubeSearch import Downloader import Settings ...
null
GUI.py
GUI.py
py
22,790
python
en
code
null
code-starcoder2
66
[ { "api_name": "PyQt5.QtWidgets.QFrame", "line_number": 23, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets", "line_number": 23, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QFrame", "line_number": 24, "usage_type": "attribute" }, { "api_name": "Py...
11125146
import numpy as np from scipy.spatial.distance import directed_hausdorff from MultiVehicleEnv.basic import World, Vehicle,Obstacle,Landmark from MultiVehicleEnv.scenario import BaseScenario from MultiVehicleEnv.utils import coord_data_dist, naive_inference, hsv2rgb, coord_dist ''' use Hausdorff distance as reward fu...
null
src/MultiVehicleEnv/scenarios/formation_hd_boundless_env.py
formation_hd_boundless_env.py
py
8,551
python
en
code
null
code-starcoder2
66
[ { "api_name": "MultiVehicleEnv.basic.Vehicle", "line_number": 15, "usage_type": "call" }, { "api_name": "MultiVehicleEnv.scenario.BaseScenario", "line_number": 28, "usage_type": "name" }, { "api_name": "MultiVehicleEnv.basic.World", "line_number": 31, "usage_type": "call"...
265223216
# КОД НАПИСАН НА ЯЗЫКЕ PYTHON v3.7 # Импортирование основных библиотек # Остальные библиотеки импортируются по ходу исполнения программы import pandas as pd import matplotlib.pyplot as plt import numpy as np from statsmodels.tsa.arima_model import ARIMA from itertools import product from tqdm import tqdm imp...
null
ARIMA.py
ARIMA.py
py
6,486
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 24, "usage_type": "call" }, { "api_name": "scipy.stats.stats.jarque_bera", "line_number": 44, "usage_type": "call" }, { "api_name": "scipy.stats.stats", "line_number": 44, "usage_type": "attribute" }, { "api_name": "...
353755970
import json # Internal framework imports from .io_helper import IOHelper # Typing imports imports class JsonHelper: """ Class used to read/write a JSON file """ def __init__(self): pass @staticmethod def read_json(input_json_file_path: str, check_if_file_exists: bool = True, cus...
null
image_classification/image_classification/utils/helpers/json_helper.py
json_helper.py
py
1,177
python
en
code
null
code-starcoder2
66
[ { "api_name": "io_helper.IOHelper.file_exists", "line_number": 18, "usage_type": "call" }, { "api_name": "io_helper.IOHelper", "line_number": 18, "usage_type": "name" }, { "api_name": "json.load", "line_number": 25, "usage_type": "call" }, { "api_name": "json.dump...
559709899
__author__ = 'tombnorwood' import logging from flask import Blueprint, request, jsonify from avkoptionsmodels.models import VolCurve from avkportfoliomanager.database import db_session from avkportfoliomanager.app.api.utils import get_underlying_price_from_request, get_underlying_price, calc_normalization_sensitivi...
null
app/api/volcurvemanager/views.py
views.py
py
2,552
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.Blueprint", "line_number": 14, "usage_type": "call" }, { "api_name": "avkportfoliomanager.database.db_session.query", "line_number": 19, "usage_type": "call" }, { "a...