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
379114860
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed May 15 10:49:19 2019 @author: matteo """ import argparse import screenutils as su parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument('--name', help='First characters of screens to kill', type=s...
null
script/killer.py
killer.py
py
483
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 12, "usage_type": "call" }, { "api_name": "argparse.ArgumentDefaultsHelpFormatter", "line_number": 12, "usage_type": "attribute" }, { "api_name": "screenutils.list_screens", "line_number": 16, "usage_type": "call" ...
131727712
# -*- coding: utf-8 -*- """ This spider is a GameJobKR spider created on top of the ATSSpider scrapy crawl gamejob_kr -a mining_job_id=9999 -a iteration=1 -a extract=1 -a url="http://www.gamejob.co.kr/List_Gi/GI_Total_List.asp" sample job url: http://www.gamejob.co.kr/List_GI/GIB_Read.asp?GI_No=109...
null
brightcorp/brightcorp/spiders/gamejob_kr.py
gamejob_kr.py
py
4,714
python
en
code
null
code-starcoder2
66
[ { "api_name": "brightcorp.base.atsspiders.ATSSpider", "line_number": 20, "usage_type": "name" }, { "api_name": "re.compile", "line_number": 23, "usage_type": "call" }, { "api_name": "scrapy.selector.Selector", "line_number": 27, "usage_type": "call" }, { "api_name...
347144208
from django.shortcuts import render, redirect from django.contrib import messages from django.contrib.auth.mixins import LoginRequiredMixin from django.views.generic import ListView, CreateView, DetailView, UpdateView, View from ..models import Employee, Job from ..mixins import IsStaffMixin from ..forms import JobEmpl...
null
employees/views/job.py
job.py
py
2,458
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.contrib.auth.mixins.LoginRequiredMixin", "line_number": 10, "usage_type": "name" }, { "api_name": "mixins.IsStaffMixin", "line_number": 10, "usage_type": "name" }, { "api_name": "django.views.generic.ListView", "line_number": 10, "usage_type": "name"...
82462026
#!/usr/bin/env python import sys import webbrowser from pathlib import Path import wx import nucos # the GUI imports from . import __version__ from . import oil_quantity from . import icons from .about_dialog import AboutDialog from .bringing_up_help_dialog import BringingUpHelpDialog from .utilities import Signifi...
null
src/wxnucos/gui.py
gui.py
py
16,803
python
en
code
null
code-starcoder2
66
[ { "api_name": "nucos.GetUnitTypes", "line_number": 26, "usage_type": "call" }, { "api_name": "wx.Panel", "line_number": 30, "usage_type": "attribute" }, { "api_name": "wx.Panel.__init__", "line_number": 34, "usage_type": "call" }, { "api_name": "wx.Panel", "li...
267772634
#coding:utf-8 import random import numpy as np import matplotlib.pyplot as plt def tirer(n): return 0 def f(diff, alpha): #Fonction ÉLO return 1/(1 + np.exp((diff/alpha))) mu = 0.9 listePropReussite = [mu, 1 - mu] n = len(listePropReussite) listeScoreELO = [100]*n #On initialise tous les arcs à 100 points...
null
simulationConvergenceGeo.py
simulationConvergenceGeo.py
py
3,090
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.exp", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.random.normal", "line_number": 51, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 51, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.plo...
265982198
import base64 import io from flask import Flask, render_template, send_file, abort, redirect, request, flash, jsonify from werkzeug.utils import secure_filename from Services.CfgService import CfgService from Services.FileFolderService import FileFolderService from Services.Greenscreen.GreenscreenBackgroundService im...
null
serverMain.py
serverMain.py
py
11,052
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 21, "usage_type": "call" }, { "api_name": "Services.Db.ServerDbService.ServerDbSevice.getPictureNames", "line_number": 26, "usage_type": "call" ...
112050484
import pymysql.cursors import os import threading import time import sys clearFunc = lambda: os.system('clear') # name that appears in application name = "YOUR NAME" def receiving(name, lastId): try: while True: # connecting to the database # change these connection ...
null
Online_Chat/Online_Chat_Linux.py
Online_Chat_Linux.py
py
6,202
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.system", "line_number": 8, "usage_type": "call" }, { "api_name": "pymysql.cursors.connect", "line_number": 18, "usage_type": "call" }, { "api_name": "pymysql.cursors", "line_number": 18, "usage_type": "name" }, { "api_name": "pymysql.cursors.curs...
282484317
import torch import torch.nn as nn from torchvision import models class Encoder(nn.Module): channels_in = 3 channels_code = 512 def __init__( self, pretrained: bool = True ): super(Encoder, self).__init__() vgg = models.vgg16_bn(pretrained=pretrained) del vgg.c...
null
autoencoder/backbone/vgg16_bn.py
vgg16_bn.py
py
5,169
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.nn.Module", "line_number": 5, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 5, "usage_type": "name" }, { "api_name": "torchvision.models.vgg16_bn", "line_number": 15, "usage_type": "call" }, { "api_name": "torchvision.m...
298587954
from __future__ import division, absolute_import, print_function import os import backtrader as bt from btconfig import BTConfigDataloader from btconfig.helper import get_data_dates from btconfig.feeds.misc import CSVAdjustTime, CSVAdjustTimeMVRVData, CSVAdjustTimeCloseOnly from btconfig.utils.dataloader import CoinM...
null
btconfig/feeds/coinmetrics.py
coinmetrics.py
py
3,346
python
en
code
null
code-starcoder2
66
[ { "api_name": "btconfig.BTConfigDataloader", "line_number": 13, "usage_type": "name" }, { "api_name": "btconfig.feeds.misc.CSVAdjustTime", "line_number": 18, "usage_type": "name" }, { "api_name": "backtrader.TimeFrame.TFrame", "line_number": 22, "usage_type": "call" }, ...
133878920
r"""!\file Routines for working with HDF5. """ from logging import getLogger from pathlib import Path import yaml import h5py as h5 import numpy as np from . import Vector, isleVersion, pythonVersion, blazeVersion, pybind11Version from .random import readStateH5 from .collection import listToSlice, parseSlice, subsl...
null
src/isle/h5io.py
h5io.py
py
11,132
python
en
code
null
code-starcoder2
66
[ { "api_name": "h5py.Group", "line_number": 25, "usage_type": "attribute" }, { "api_name": "h5py.File", "line_number": 39, "usage_type": "call" }, { "api_name": "yaml.dump", "line_number": 41, "usage_type": "call" }, { "api_name": "yaml.dump", "line_number": 42...
24024715
import os os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3" import cv2 import pickle import time from skimage.feature import hog import matplotlib.pyplot as plt print("Starting HOG feature extraction and saving...") start = time.time() BASE_DIR = os.path.dirname(os.path.abspath(__file__)) pickles_dir = os.path.join(BASE_DIR, "...
null
venv/src/hog_features.py
hog_features.py
py
960
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ", "line_number": 2, "usage_type": "attribute" }, { "api_name": "time.time", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number":...
339707109
#QIE.py #QIE settings - Ordered by most significant bits from collections import OrderedDict serialShiftRegisterBits = OrderedDict( [("LVDS/SLVS", [0]), ("P0, P1", [1, 2]), ("DiscOn", [3]), ("TGain", [4]), ("TimingThresholdDAC", [5,6,7,8,9,10,11,12]), ("TimingIref", [13,14,15]), ("PedastalD...
null
client/TestSoftware/QIE.py
QIE.py
py
6,753
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.OrderedDict", "line_number": 5, "usage_type": "call" } ]
165608044
import bct as bctDevV2 import numpy as np from tqdm import tqdm from struct import pack import sys ##################################################################################################################### infile='mergedLJ_.0' outfile='cutLJ_.0' trees=bctDevV2.read_binary(infile) count = 0 branchingTrees ...
null
CPAC/treebuilding/oldCode/massCutLJ2.py
massCutLJ2.py
py
9,518
python
en
code
null
code-starcoder2
66
[ { "api_name": "bct.read_binary", "line_number": 11, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.delete", "line_number": 45, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number":...
547750269
# # tsne.py # # Implementation of t-SNE in Python. The implementation was tested on Python # 2.7.10, and it requires a working installation of NumPy. The implementation # comes with an example on the MNIST dataset. In order to plot the # results of this example, a working installation of matplotlib is required. # # Th...
null
tflib/tsne.py
tsne.py
py
7,764
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.array", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.log", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 28, ...
37375091
#!/usr/bin/env python3 # Copyright (c) 2018-present, Jaron Powser, all rights reserved. # # Licensed under the MIT License accompanying this project. # See the LICENSE file in root directory of the source tree. """rargparse.py: Argument parsing with many options preconfigured.""" import argparse import os __version...
null
riga/rargparse.py
rargparse.py
py
10,464
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 32, "usage_type": "attribute" }, { "api_name": "argparse.HelpFormatter", "line_number": 66, "usage_type": "attribute" }, { "api_name": "argparse.REMAINDER", "line_number": 122, "usage_type": "attribute" }, { ...
24065350
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html import pymysql from xiaodiaodaya.config.db_config import DB_CONFIG from xiaodiaodaya.util.encryption_util import get_md5_value...
null
python/xiaodiaodaya/xiaodiaodaya/pipelines.py
pipelines.py
py
1,696
python
en
code
null
code-starcoder2
66
[ { "api_name": "pymysql.connect", "line_number": 17, "usage_type": "call" }, { "api_name": "xiaodiaodaya.config.db_config.DB_CONFIG", "line_number": 17, "usage_type": "name" }, { "api_name": "xiaodiaodaya.util.encryption_util.get_md5_value", "line_number": 37, "usage_type"...
339406969
# coding=utf-8 # Copyright 2021 The IDEA Authors. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by a...
null
19.sentence_rewrite/Fengshenbang-LM/fengshen/examples/zen2_finetune/fengshen_token_level_ft_task.py
fengshen_token_level_ft_task.py
py
28,693
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.basicConfig", "line_number": 33, "usage_type": "call" }, { "api_name": "logging.ERROR", "line_number": 35, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 36, "usage_type": "call" }, { "api_name": "math.ceil", ...
93886077
import os from pathlib import Path import shutil class DEFAULTS: # The home dir HOME_DIR = str(Path.home()) # The default song dir SONG_DIR = os.path.join(HOME_DIR, 'Music') # The temp dir SONG_TEMP_DIR = os.path.join(SONG_DIR, 'ytmdl') # The default song quality SONG_QUALITY = '...
null
setupConfig.py
setupConfig.py
py
1,921
python
en
code
null
code-starcoder2
66
[ { "api_name": "pathlib.Path.home", "line_number": 7, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 7, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number"...
259603869
# -*- coding: utf-8 -*- """ TcEx Notification Module """ import json class TcExNotificationV2(object): """TcEx Notification Class""" def __init__(self, tcex): """ Initialize the Class properties. Args: tcex (obj): An instance of TcEx object. """ self._tcex = tcex ...
null
tcex/tcex_notification_v2.py
tcex_notification_v2.py
py
3,451
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.dumps", "line_number": 83, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 88, "usage_type": "call" } ]
381290578
#! /usr/bin/env python # # This script compares RFMIP results from RTE+RRTMGP against a benchmark # import os import numpy as np import xarray as xr ref_dir = "reference" tst_dir = "." rrtmg_suffix = "_Efx_RTE-RRTMGP-181204_rad-irf_r1i1p1f1_gn.nc" tst = xr.open_mfdataset(os.path.join(tst_dir, "r??" + rrtmg_suffix))...
null
examples/rfmip-clear-sky/compare-to-reference.py
compare-to-reference.py
py
1,203
python
en
code
null
code-starcoder2
66
[ { "api_name": "xarray.open_mfdataset", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "xarray.open_mfdataset...
276196567
from telebot import types def g_markup(L): markup = types.ReplyKeyboardMarkup() markup.add(*[types.KeyboardButton(b) for b in L]) return markup def g_inl_mark(L, prefix=''): # prefix is needed when you want call back with commands like: # /ls inline-name if prefix: prefix += ' ' ...
null
src/markups.py
markups.py
py
1,032
python
en
code
null
code-starcoder2
66
[ { "api_name": "telebot.types.ReplyKeyboardMarkup", "line_number": 5, "usage_type": "call" }, { "api_name": "telebot.types", "line_number": 5, "usage_type": "name" }, { "api_name": "telebot.types.KeyboardButton", "line_number": 6, "usage_type": "call" }, { "api_nam...
57147762
"""initial migration Revision ID: 21f8ed125d43 Revises: 3b523ea66eb1 Create Date: 2017-06-04 09:42:52.937553 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '21f8ed125d43' down_revision = '3b523ea66eb1' branch_labels = None depends_on = None def upgrade(): ...
null
MyFlask/migrations/versions/21f8ed125d43_initial_migration.py
21f8ed125d43_initial_migration.py
py
977
python
en
code
null
code-starcoder2
66
[ { "api_name": "alembic.op.drop_table", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "alembic.op.drop_table", "line_number": 22, "usage_type": "call" }, { "api_name": "alembic.op", ...
543143408
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('web_chat', '0021_sengimg_test'), ] operations = [ migrations.RenameField( model_name='sengimg', old_...
null
web_chat/migrations/0022_auto_20170513_1756.py
0022_auto_20170513_1756.py
py
387
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.RenameField", "line_number": 14, "usage_type": "call" }, ...
347350147
import pygame, random, os from modules import players, items, enemies, consts, platforms class Level: def __init__(self, player = None): self.set_of_platforms = set() self.set_of_bullets = pygame.sprite.Group() self.set_of_enemy_bullets = pygame.sprite.Group() self.set_of_items = p...
null
modules/levels.py
levels.py
py
10,769
python
en
code
null
code-starcoder2
66
[ { "api_name": "pygame.sprite.Group", "line_number": 8, "usage_type": "call" }, { "api_name": "pygame.sprite", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pygame.sprite.Group", "line_number": 9, "usage_type": "call" }, { "api_name": "pygame.sprite...
513871656
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import division from sys import argv from ete3 import Tree, faces, TreeStyle, NodeStyle, CircleFace import script_tree PREFIX = argv[1] if len(argv)==3: OUT_PREFIX=argv[2] else: OUT_PREFIX=PREFIX species_tree = script_tree.readTree(open(PREFIX+".s...
null
scripts/ArbreConflit.py
ArbreConflit.py
py
5,224
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.argv", "line_number": 9, "usage_type": "name" }, { "api_name": "sys.argv", "line_number": 10, "usage_type": "argument" }, { "api_name": "sys.argv", "line_number": 11, "usage_type": "name" }, { "api_name": "script_tree.readTree", "line_number...
123356244
from os import path import seaborn as sns import matplotlib.pyplot as plt import pandas as pd import numpy as np from tqdm import tqdm import lightgbm as lgb from sklearn.preprocessing import StandardScaler from sklearn.model_selection import KFold class LgbmPipeline(): def __init__(self, modelName): sel...
null
lgbmPipeline.py
lgbmPipeline.py
py
5,866
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 18, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.floor", "line_number": 25, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "l...
392329635
#!/usr/bin/env python3 ##-*- coding:utf-8 -*- #pyy -i #eg: pyy pdb2.py aa # kill to signal by self ''' 关于python:使用pdb附加进程 https://www.codenong.com/25308847/ os.kill(pid, sig) kill -30 ## 有一个pdb的克隆,想象中称为pdb克隆,它可以附加到正在运行的进程上。 只需在主进程的代码中添加from pdb_clone import pdbhandler; pdbhandler.register(),然后就可以用pdb-attach --kill ...
null
tx19/python/pdb2.py
pdb2.py
py
959
python
en
code
null
code-starcoder2
66
[ { "api_name": "pdb.Pdb", "line_number": 22, "usage_type": "call" }, { "api_name": "time.time", "line_number": 28, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 29, "usage_type": "call" }, { "api_name": "signal.signal", "line_number": 32, ...
362390973
import torch import torch.nn.functional as F class Trainer: def __init__(self, model, optimizer, loader): self.model = model self.optimizer = optimizer self.loader = loader self.epochs = 50 self.data_variance = None self.phases = ['train'] self.train_recon_e...
null
trainer.py
trainer.py
py
1,884
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.device", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 15, "usage_type": "attribute" }, { "api_name": "torch.nn.functio...
384374310
from django.urls import re_path, path from .views import ChargingStationTopNearListView app_name = 'volt_finder' urlpatterns = [ path('near_poi/<poi_location>/', ChargingStationTopNearListView.as_view( {'get': 'get_top_cs_near_poi_no_date'}), name='cs_near_poi_status_any'), path('near_poi/<poi_locati...
null
django-server/api_django/volt_finder/urls.py
urls.py
py
478
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "views.ChargingStationTopNearListView.as_view", "line_number": 8, "usage_type": "call" }, { "api_name": "views.ChargingStationTopNearListView", "line_number": 8, "usage_type": "name"...
149076651
from common.utils import create_matrix, copy_matrix class FloidMethodCalculator(object): def __init__(self, graph=None, d=None): self.d = d if d else self._init_d(graph) self.r = self._init_r() def _init_d(self, graph): d = create_matrix(graph.vertex_count, graph.vertex_count) ...
null
8 semester/SAIO/lab4/algoritms.py
algoritms.py
py
1,347
python
en
code
null
code-starcoder2
66
[ { "api_name": "common.utils.create_matrix", "line_number": 11, "usage_type": "call" }, { "api_name": "common.utils.create_matrix", "line_number": 20, "usage_type": "call" }, { "api_name": "common.utils.copy_matrix", "line_number": 29, "usage_type": "call" }, { "ap...
462727912
#! /usr/bin/env python # -*- coding: utf-8 -*- # __author__ = "anyux" # Date: 2018/11/8 from django.conf.urls import url from study.views import user from study.views import course from study.views import classList urlpatterns = [ # 用户 url(r'^login/', user.login), url(r'^register/', user.register), ur...
null
study/urls.py
urls.py
py
866
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.conf.urls.url", "line_number": 13, "usage_type": "call" }, { "api_name": "study.views.user.login", "line_number": 13, "usage_type": "attribute" }, { "api_name": "study.views.user", "line_number": 13, "usage_type": "name" }, { "api_name": "dja...
113769977
""" Prepare basic datapack dirs for Mcdp lancher. """ import os import asyncio from shutil import copyfile from functools import partial from pathlib import Path, PurePath from typing import Any, Callable, Dict, Optional, Set, Union from .context import get_context, Context, TagManager from .config import get_version...
null
mcdp/file_struct.py
file_struct.py
py
3,709
python
en
code
null
code-starcoder2
66
[ { "api_name": "config.T_version", "line_number": 16, "usage_type": "name" }, { "api_name": "aio_stream.Stream", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "lin...
101615874
from selenium.webdriver.support import expected_conditions as EC from selenium.common.exceptions import TimeoutException from selenium.webdriver.support.ui import WebDriverWait from selenium import webdriver from selenium.webdriver.common.by import By def click_by_xpath(driver, path): try: wait = W...
null
amazon/pages/finding_locators.py
finding_locators.py
py
850
python
en
code
null
code-starcoder2
66
[ { "api_name": "selenium.webdriver.support.ui.WebDriverWait", "line_number": 9, "usage_type": "call" }, { "api_name": "selenium.webdriver.support.expected_conditions.element_to_be_clickable", "line_number": 10, "usage_type": "call" }, { "api_name": "selenium.webdriver.support.expe...
270710909
from pathlib import Path import setuptools README = Path(__file__).parent.absolute() / "readme.md" README = README.read_text(encoding="utf8") setuptools.setup( name="ogc", version="1.99.37", author="Adam Stokes", author_email="adam.stokes@ubuntu.com", description="ogc, a runner of things", lo...
null
setup.py
setup.py
py
1,209
python
en
code
null
code-starcoder2
66
[ { "api_name": "pathlib.Path", "line_number": 5, "usage_type": "call" }, { "api_name": "setuptools.setup", "line_number": 8, "usage_type": "call" } ]
253043272
import datetime from abc import abstractmethod class Field(object): attribute = None default = None def __init__(self, attribute=None, default=None): self.attribute = attribute self.default = default @abstractmethod def format(self, value): pass class StringField(Field): ""...
null
flask_toolbox/serializer.py
serializer.py
py
2,901
python
en
code
null
code-starcoder2
66
[ { "api_name": "abc.abstractmethod", "line_number": 13, "usage_type": "name" }, { "api_name": "datetime.datetime", "line_number": 82, "usage_type": "attribute" }, { "api_name": "datetime.datetime.strftime", "line_number": 84, "usage_type": "call" }, { "api_name": "...
266192414
# from datasets_loader from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer from test.datasets_loader import DatasetsLoader x_train, y_train, x_test, y_test, x_val, y_val = DatasetsLoader.load_data( '/home/lucjan/PycharmProjects/kaggle/tweet-sentimental-extraction/data/train.csv', '/ho...
null
tweet-sentimental-extraction/test/worksheet.py
worksheet.py
py
842
python
en
code
null
code-starcoder2
66
[ { "api_name": "test.datasets_loader.DatasetsLoader.load_data", "line_number": 6, "usage_type": "call" }, { "api_name": "test.datasets_loader.DatasetsLoader", "line_number": 6, "usage_type": "name" }, { "api_name": "sklearn.feature_extraction.text.TfidfVectorizer", "line_numbe...
83743084
from flask import Flask, render_template, request from src.bracket import find_all_brackets, Bracket from src.char_pred import PRED_TYPES from src.show_state import get_curr_show_state from src.utils import CHAR_TIERS, TIERS, CHAR_NAMES application = Flask(__name__) @application.route('/') def home(): return re...
null
wsgi.py
wsgi.py
py
2,242
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 13, "usage_type": "call" }, { "api_name": "src.bracket.find_all_brackets", "line_number": 29, "usage_type": "call" }, { "api_name": "src.sh...
651250434
'''' @author Lukas Huber @email lukas.huber@epfl.ch @date 2018-10-12 ''' import numpy as np from math import pi import matplotlib.pyplot as plt # only for debugging import warnings import sys lib_string = "/home/lukas/Code/MachineLearning/ObstacleAvoidanceAlgroithm/lib_obstacleAvoidance/" if not any (lib_string in...
null
lib_obstacleAvoidance/intersection_points.py
intersection_points.py
py
7,148
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 18, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_n...
649402476
#!/usr/bin/env python """ Your task in this exercise is to modify 'extract_carrier()` to get a list of all airlines. Exclude all of the combination values like "All U.S. Carriers" from the data that you return. You should return a list of codes for the carriers. All your changes should be in the 'extract_carrier()' f...
null
notes/udacity/data_wrangling_with_mongodb/lesson04/01-quiz.py
01-quiz.py
py
1,924
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.Session", "line_number": 22, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 40, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 42, "usage_type": "call" } ]
394630851
import yaml def write_data(): data = {'Search_Data': { 'search_test_002': {'expect': {'value': '你好'}, 'value': '你 好'}, 'search_test_001': {'expect': [4, 5, 6], 'value': 456}}} with open("./data3.yml", "a") as f: yaml.safe_dump(data, f, encoding="utf-8", allow_unicode=True) if __name_...
null
Data/write_data.py
write_data.py
py
362
python
en
code
null
code-starcoder2
66
[ { "api_name": "yaml.safe_dump", "line_number": 9, "usage_type": "call" } ]
390600096
import Helper import openpyxl import time from sklearn import svm start_time = time.time() rootPath = "G:\semester\semester 4-1\ML Lab\Dataset\Fake_News_Detection\Fake_News_Detection" path = "\{}".format("fake_or_real_news.xlsx") path = rootPath + path book = openpyxl.load_workbook(path) sheet = book.active # Initi...
null
Codes/Fake_News_Detection/Fake_News_Detection.py
Fake_News_Detection.py
py
1,868
python
en
code
null
code-starcoder2
66
[ { "api_name": "time.time", "line_number": 6, "usage_type": "call" }, { "api_name": "openpyxl.load_workbook", "line_number": 12, "usage_type": "call" }, { "api_name": "Helper.init", "line_number": 16, "usage_type": "call" }, { "api_name": "Helper.getWordList", ...
436892917
#!/usr/bin/env python # coding: utf-8 # In[1]: import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns get_ipython().run_line_magic('matplotlib', 'inline') # In[2]: df = pd.read_csv('train.csv') # In[3]: df.head() # Looks like 4 columns have high variance and would poss...
null
ML project/Customer churn prediction/Customer_churn_prediction_piped.py
Customer_churn_prediction_piped.py
py
5,571
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 17, "usage_type": "call" }, { "api_name": "seaborn.heatmap", "line_number": 31, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.xticks", "line_number": 40, "usage_type": "call" }, { "api_name": "matplotlib.p...
26178236
import numpy as np import matplotlib.pyplot as plt n_samples = 500 C = np.array([[0.1, 0.6], [2., .6]]) X = np.random.randn(n_samples, 2) @ C + np.array([-6, 3]) plt.axis('equal') plt.scatter(X[:, 0], X[:, 1], s=10, alpha=0.8) plt.title("Raw Data") plt.show() Xc = X - np.mean(X,axis=0) plt.axis('equal') plt.scatter(X...
null
05-svd/svd-pca.py
svd-pca.py
py
807
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.array", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.random.randn", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 6, "usage_type": "attribute" }, { "api_name": "numpy.array", "line...
395955061
from scipy import misc import numpy as np import tensorflow as tf import random # -------------------------------------------------- # setup ntrain = 1000 # per class ntest = 100 # per class nclass = 2 # number of classes imsize = 28 nchannels = 1 vsize = imsize*imsize # vector size batchsize = 100 Train = np.zeros(...
null
TensorFlowTutorial/ex7.py
ex7.py
py
4,052
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.zeros", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": ...
449939261
import json #read superheroes json with open('superheroes.json', 'r') as f: superheroes = json.load(f) #save data for each member into a csv row import csv with open('superheroes.csv', 'w') as f: writer = csv.writer(f) #write headers header = ['name', 'age', 'secretIdentity', 'powers', 'squadName' 'homeTown', '...
null
superherocsvmaker.py
superherocsvmaker.py
py
916
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.load", "line_number": 5, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 12, "usage_type": "call" } ]
100697999
""" storage:core.subsystem """ import asyncio import radiality from core.eventers import storage from core.effectors import center from core.effectors import console class Storage(radiality.Subsystem): """ The `storage` subsystem """ eventer = storage.Eventer effectors = { 'center': cent...
null
example/storage/core/subsystem.py
subsystem.py
py
679
python
en
code
null
code-starcoder2
66
[ { "api_name": "radiality.Subsystem", "line_number": 13, "usage_type": "attribute" }, { "api_name": "core.eventers.storage.Eventer", "line_number": 17, "usage_type": "attribute" }, { "api_name": "core.eventers.storage", "line_number": 17, "usage_type": "name" }, { ...
78709254
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Jun 20 20:46:16 2019 @author: yhosni18 """ import numpy as np import nibabel as nib import sys import math import matplotlib.pyplot as plt import time import sklearn from sklearn.svm import SVC from sklearn.model_selection import StratifiedKFold from s...
null
masking_with_pca.py
masking_with_pca.py
py
5,908
python
en
code
null
code-starcoder2
66
[ { "api_name": "nibabel.load", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 39, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.vstack", "line_number":...
241927166
import json import os import pickle import argparse import numpy as np from tqdm import tqdm from vocab import Vocab def tokens_to_ids(args, token_infile=None): debug_str = '_mini' if args.debug else '' phrase_str = '_phrase' if args.combine_phrases else '' if token_infile is None: token_infile...
null
preprocess/tokens_to_ids.py
tokens_to_ids.py
py
1,570
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.load", "line_number": 19, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 24, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 28, "usage_type": "call" }, { "api_name": "vocab.get_ids", "line_number": 30...
343995679
import torch from torch import nn from utils import Flatten class LeNet(nn.Module): def __init__(self): super(LeNet, self).__init__() self.conv1 = nn.Conv2d(1, 6, kernel_size=5, stride=1, padding=0) self.max1 = nn.MaxPool2d(kernel_size=2, stride=2) self.conv2 = nn.Conv2d(6, 16, ke...
null
ConvNets/LeNet.py
LeNet.py
py
1,087
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.nn.Module", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 6, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.nn", "line_numbe...
535038012
import discord import json from discord.ext import commands class Announcement(commands.Cog): def __init__(self, client): self.client = client print(f"{__name__} 로드 완료!") @commands.command() async def 공지(self, ctx, *, ann): if not ctx.author.id == 288302173912170497: ...
null
bb2cogs/announcement.py
announcement.py
py
1,213
python
en
code
null
code-starcoder2
66
[ { "api_name": "discord.ext.commands.Cog", "line_number": 6, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 6, "usage_type": "name" }, { "api_name": "json.load", "line_number": 16, "usage_type": "call" }, { "api_name": "discord.ut...
204407408
# -*- coding: utf-8 -*- """ Created on Tue Jun 30 11:55:29 2020 @author: 李博 """ import os import pandas as pd import json import datetime import time # MONGODB CONNECT import tushare as ts pro = ts.pro_api('003137d7baa1439f01f9d2917992de6b8511f70f84612c78574d6996') today=time.strftime('%Y%m%d',) #计算指定日期的前N天的时间戳 def g...
null
getData/toMongodb_dailybasic.py
toMongodb_dailybasic.py
py
1,799
python
en
code
null
code-starcoder2
66
[ { "api_name": "tushare.pro_api", "line_number": 15, "usage_type": "call" }, { "api_name": "time.strftime", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 20, "usage_type": "call" }, { "api_name": "datetime.datetime...
27953585
#!/usr/bin/env python # -*- coding: utf-8 -*- import json import datetime import logging import hashlib import uuid from optparse import OptionParser from http.server import HTTPServer, BaseHTTPRequestHandler from scoring import get_interests, get_score from store import Store, RedisStore SALT = "Otus" ADMIN_LOGIN = ...
null
dz3.1/api.py
api.py
py
10,778
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime.strptime", "line_number": 110, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 110, "usage_type": "attribute" }, { "api_name": "datetime.datetime.strftime", "line_number": 116, "usage_type": "call" }, { "a...
454223778
import numpy as np from lifetimes.datasets import load_donations from lifetimes.fitters.beta_geo_beta_binom_fitter import BetaGeoBetaBinomFitter from pytest import fixture from bgbb import BGBB from bgbb.sql.bgbb_udfs import mk_udfs from bgbb.wrappers import to_abgd_od df = fixture(load_donations) @fixture def dfs(...
null
tests/test_bgbb_udfs.py
test_bgbb_udfs.py
py
1,555
python
en
code
null
code-starcoder2
66
[ { "api_name": "pytest.fixture", "line_number": 10, "usage_type": "call" }, { "api_name": "lifetimes.datasets.load_donations", "line_number": 10, "usage_type": "argument" }, { "api_name": "pytest.fixture", "line_number": 13, "usage_type": "name" }, { "api_name": "p...
629686638
from businessView.page_首页 import page_首页 from selenium.webdriver.common.by import By import logging from time import sleep class page_取纸机(page_首页): "!!!!定位器!!!!" "按钮定位器" btn_热线 = (By.XPATH, "//*[@bounds='[0,1984][1080,2060]']") "文本定位器" txt_设施位置 = (By.XPATH, '//*[@text="设施位置"]') "!!!操作层!!!!" ...
null
businessView/page_取纸机.py
page_取纸机.py
py
1,197
python
en
code
null
code-starcoder2
66
[ { "api_name": "businessView.page_首页.page_首页", "line_number": 6, "usage_type": "name" }, { "api_name": "selenium.webdriver.common.by.By.XPATH", "line_number": 10, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.common.by.By", "line_number": 10, "usage_type":...
79808610
import json import unittest from spn.structure.Base import Context from spn.structure.leaves.parametric.Parametric import * class TestParametric(unittest.TestCase): def setUp(self): self.tested = set() def assert_correct(self, expected, data): self.tested.add(type(expected)) domains...
null
src/spn/tests/test_parametric_mle.py
test_parametric_mle.py
py
1,662
python
en
code
null
code-starcoder2
66
[ { "api_name": "unittest.TestCase", "line_number": 8, "usage_type": "attribute" }, { "api_name": "spn.structure.Base.Context", "line_number": 17, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 22, "usage_type": "call" }, { "api_name": "unittest....
374480414
import random import math import networkx as nx def load_graph(): Data = open('musae_facebook_edges.csv', "r") next(Data, None) # skip the first line in the input file Graphtype = nx.Graph() G = nx.parse_edgelist(Data, delimiter=',', create_using=Graphtype, nodetype=str) retu...
null
Exercises1_project2.py
Exercises1_project2.py
py
4,071
python
en
code
null
code-starcoder2
66
[ { "api_name": "networkx.Graph", "line_number": 8, "usage_type": "call" }, { "api_name": "networkx.parse_edgelist", "line_number": 9, "usage_type": "call" }, { "api_name": "networkx.single_source_dijkstra", "line_number": 34, "usage_type": "call" }, { "api_name": "...
177319327
import pdb import random import pandas as pd from sklearn.linear_model import LinearRegression import yfinance TICKER = 'TQQQ' STRATEGY = 'random' def calculate_pnl(row): TAKE_PROFIT = 0.02 STOP_LOSS = 0.05 # STOP_LOSS = 0.1 if row['Direction'] == 1: # long if row['Open/Low'] >= STOP_LOSS:...
null
research.py
research.py
py
3,468
python
en
code
null
code-starcoder2
66
[ { "api_name": "yfinance.Ticker", "line_number": 39, "usage_type": "call" }, { "api_name": "pandas.merge", "line_number": 54, "usage_type": "call" }, { "api_name": "pandas.merge", "line_number": 55, "usage_type": "call" } ]
29588586
#!/usr/bin/python # -*- coding: utf-8 -*- """ 主界面 """ import os import re import xlrd import xlwt from Tkinter import Tk from Tkinter import Label from Tkinter import Entry from Tkinter import Button from Tkinter import StringVar from Tkinter import BooleanVar from Tkinter import Checkbutton from tkFileDialog impor...
null
gui_main.py
gui_main.py
py
15,888
python
en
code
null
code-starcoder2
66
[ { "api_name": "Tkinter.Tk", "line_number": 31, "usage_type": "call" }, { "api_name": "re.match", "line_number": 48, "usage_type": "call" }, { "api_name": "re.match", "line_number": 55, "usage_type": "call" }, { "api_name": "re.match", "line_number": 62, "u...
342659013
url = "https://api.soccerama.pro/v1.2/countries?api_token=&include=competitions" import requests from footballapi.FAConnetion import get_mongodb db = get_mongodb() def get_bookmakers(): payload = {'api_token': "I32Smt5Ize0fH0lwmiwY2lo26VgGmuQXd2MkAND0WjZjBlCKk4gJQ50JGbN9"} r = requests.get('https://api.so...
null
soccerama/odds.py
odds.py
py
1,584
python
en
code
null
code-starcoder2
66
[ { "api_name": "footballapi.FAConnetion.get_mongodb", "line_number": 7, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 13, "usage_type": "call" } ]
358964442
from django.apps import apps from django.conf import settings class ListasController(object): """ listas de objetos para los combos """ def __init__(self): # propiedades self.modelo_name = 'unknow' self.modelo_id = 'unknow' self.modelo_app = 'unknow' def get_lista...
null
controllers/ListasController.py
ListasController.py
py
9,725
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.apps.apps.get_model", "line_number": 27, "usage_type": "call" }, { "api_name": "django.apps.apps", "line_number": 27, "usage_type": "name" }, { "api_name": "django.conf.settings.STATUS_ACTIVO", "line_number": 27, "usage_type": "attribute" }, { ...
394524841
import scipy.io as sio import numpy as np from sklearn import linear_model, cluster FULL_DIR = "../MSdata.mat" TRAIN_DIR = "data/md_train.mat" TEST_DIR = "data/md_test.mat" TEST_SIZE = 10000 def kmeans(n_cls): train_size = 463715 test_size = 51630 train_x, train_y, test_x = (sio.loadmat(FULL_DIR)['trainx'...
null
kmeans.py
kmeans.py
py
2,726
python
en
code
null
code-starcoder2
66
[ { "api_name": "scipy.io.loadmat", "line_number": 13, "usage_type": "call" }, { "api_name": "scipy.io", "line_number": 13, "usage_type": "name" }, { "api_name": "numpy.concatenate", "line_number": 20, "usage_type": "call" }, { "api_name": "sklearn.cluster.KMeans", ...
228740199
from os import environ from os.path import join, dirname from dotenv import load_dotenv import requests from lxml import html import json from datetime import datetime from pytz import timezone dotenv_path = join(dirname(__file__), '.env') load_dotenv(dotenv_path) PERIOD1_SELECTOR = '//*[@id="page-wrapper"]/div[3]/di...
null
scrape.py
scrape.py
py
6,607
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 10, "usage_type": "call" }, { "api_name": "dotenv.load_dotenv", "line_number": 11, "usage_type": "call" }, { "api_name": "os.environ.get", ...
84072365
import numpy as np from scipy import special from great_expectations.rule_based_profiler.parameter_builder.numeric_metric_range_multi_batch_parameter_builder import ( NP_SQRT_2, ) # Please refer to "https://en.wikipedia.org/wiki/Normal_distribution" and references therein for background. def test_standard_deviat...
null
tests/rule_based_profiler/parameter_builder/test_parameter_computations.py
test_parameter_computations.py
py
1,051
python
en
code
null
code-starcoder2
66
[ { "api_name": "great_expectations.rule_based_profiler.parameter_builder.numeric_metric_range_multi_batch_parameter_builder.NP_SQRT_2", "line_number": 17, "usage_type": "name" }, { "api_name": "scipy.special.erfinv", "line_number": 17, "usage_type": "call" }, { "api_name": "scipy....
622688364
class DebugLog: __logger = None @staticmethod def instance(): if DebugLog.__logger is None: import logging import os # create logger with 'spam_application' DebugLog.__logger = logging.getLogger('aiohttp_framework') DebugLog.__logger.setL...
null
http/core/helpers/DebugLog.py
DebugLog.py
py
851
python
en
code
null
code-starcoder2
66
[ { "api_name": "{'logging': 'logging', 'os': 'os'}.__logger", "line_number": 11, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "{'logging': 'logging', 'os': 'os'}.__logger.setLevel", "line_number": 12, ...
619887933
"""For storing, manipulating, and measuring molecular structures""" import itertools import re from collections import deque from copy import copy as shallow_copy from copy import deepcopy from warnings import warn from urllib.request import urlopen from urllib.error import HTTPError import numpy as np import AaronTo...
null
geometry.py
geometry.py
py
52,676
python
en
code
null
code-starcoder2
66
[ { "api_name": "AaronTools.utils.prime_numbers.Primes", "line_number": 32, "usage_type": "call" }, { "api_name": "AaronTools.fileIO.FileReader", "line_number": 53, "usage_type": "argument" }, { "api_name": "AaronTools.fileIO.FileReader", "line_number": 58, "usage_type": "c...
422712206
from flask import Flask, render_template, request from caesar import cipher # set up app app = Flask(__name__, static_folder="static", static_url_path="") SHIFT = 3 @app.route("/") def homepage(): return render_template("home.html") @app.route("/encrypt") def encrypt(): message = request.args.get("message") ...
null
ClassExercise & studio/crypto_app/routes.py
routes.py
py
538
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.request.args.get", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.request...
11109905
import drawSvg as draw import numpy as np import random as rnd import hashlib import time import webcolors t = str(time.time()) s = t.encode() hash_object = hashlib.sha256(s) seed = hash_object.hexdigest() print(seed) rnd.seed(seed,version=2) ########### parameters#################################...
null
rectwave.py
rectwave.py
py
2,583
python
en
code
null
code-starcoder2
66
[ { "api_name": "time.time", "line_number": 9, "usage_type": "call" }, { "api_name": "hashlib.sha256", "line_number": 11, "usage_type": "call" }, { "api_name": "random.seed", "line_number": 15, "usage_type": "call" }, { "api_name": "webcolors.hex_to_rgb", "line_...
169589420
# coding: utf-8 # author: benyuan liu """ reproducible code for EIT2016 """ from __future__ import division, absolute_import, print_function import numpy as np import matplotlib.pyplot as plt # import matplotlib # matplotlib.rcParams.update({'font.size': 3}) import matplotlib.gridspec as gridspec # pyEIT 2D algorithm...
null
demo/eit2016b.py
eit2016b.py
py
3,042
python
en
code
null
code-starcoder2
66
[ { "api_name": "pyeit.mesh.create", "line_number": 22, "usage_type": "call" }, { "api_name": "pyeit.mesh", "line_number": 22, "usage_type": "name" }, { "api_name": "pyeit.mesh.set_alpha", "line_number": 30, "usage_type": "call" }, { "api_name": "pyeit.mesh", "l...
639469548
import json import logging import pytest import requests from models.error_response import * from models.user_basic import * from models.sign_in_body import * from models.edit_profile_body import * from constants import SUCCESS, BASE_URL, UNAUTHORIZED, BAD_REQUEST, HEADERS logging.basicConfig(filename="patch_me.log"...
null
tests_api/test_patch_me.py
test_patch_me.py
py
1,885
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.basicConfig", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 13, "usage_type": "attribute" }, { "api_name": "requests.post", "line_number": 24, "usage_type": "call" }, { "api_name": "constants.BASE_UR...
332450686
""" This script will get all the jobs which are stuck in RUNNABLE state """ #!/usr/bin/env python import sys import boto3 from pprint import pprint import datetime import argparse def get_all_jobqueues(): """ Get all the Job queues """ client = boto3.client('batch') response = client.describe_job_queues() queues ...
null
checkRunnableBatchJobs.py
checkRunnableBatchJobs.py
py
1,753
python
en
code
null
code-starcoder2
66
[ { "api_name": "boto3.client", "line_number": 12, "usage_type": "call" }, { "api_name": "boto3.client", "line_number": 22, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 35, "usage_type": "call" }, { "api_name": "datetime.datetime", ...
5550011
from typing import List, Optional, Sequence, cast from llama_index.indices.query.schema import QueryBundle from llama_index.indices.service_context import ServiceContext from llama_index.llm_predictor.base import BaseLLMPredictor from llama_index.output_parsers.base import StructuredOutput from llama_index.types impor...
null
llama_index/question_gen/llm_generators.py
llm_generators.py
py
2,987
python
en
code
null
code-starcoder2
66
[ { "api_name": "llama_index.question_gen.types.BaseQuestionGenerator", "line_number": 19, "usage_type": "name" }, { "api_name": "llama_index.llm_predictor.base.BaseLLMPredictor", "line_number": 22, "usage_type": "name" }, { "api_name": "llama_index.prompts.base.Prompt", "line_...
76441532
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import io import sys from setuptools import setup version = "1.6.0" if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') os.system('python setup.py bdist_wheel upload') sys.exit() if sys.argv[-1] == 'tag': os.system("git tag...
null
setup.py
setup.py
py
2,528
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.argv", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.system", "line_number": 13, "usage_type": "call" }, { "api_name": "os.system", "line_number": 14, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 15, ...
524760372
import csv import logging from typing import List, Type from xml.etree import ElementTree from utils.data_helper import get_phrases_and_nodes, get_sentence_variables, get_document_id_variables from utils.data_structures import UFDS from utils.feature_extractors import PairSyntacticFeatureExtractor, BudiFeatureExtracto...
null
extract_mention_pair_features.py
extract_mention_pair_features.py
py
4,461
python
en
code
null
code-starcoder2
66
[ { "api_name": "typing.List", "line_number": 13, "usage_type": "name" }, { "api_name": "csv.DictWriter", "line_number": 18, "usage_type": "call" }, { "api_name": "utils.training_instances_generator.TrainingInstancesGenerator", "line_number": 24, "usage_type": "name" }, ...
185147491
#program1216.py import matplotlib.pyplot as plt import numpy as np mu=100 #设置起始值 sigma=20 #每个点的放大倍数 x=mu+sigma*np.random.randn(20) #为简单直观,样本量取20 plt.hist(x,bins=10,color='green',density=True) print(x) plt.show() #plt.hist(x,bins=30,color='green',density=True)
null
ch13a/ex1316.py
ex1316.py
py
319
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.random.randn", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 6, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.hist", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.p...
413458436
#coding=utf-8 """ 超市销售管理系统功能 1.欢迎用户使用超市销售管理系统,提示用户登录,如果是用户名为admin,密码为123456,则管理员身份。 如果是其他用户(可以自己设置也可随意接收),则是顾客身份。 2.如果用户是管理员身份,提示用户输入编号,选择对应功能 输入编号"1":显示商品的信息 (编号 商品名称 价格) 输入编号"2":添加商品信息 (输入编号,商品名称,价格) 输入编号"3":删除商品信息 (输入编号,删除对应的名称和价格) 输入编号"4":退出系统功能 3.如果用户是顾客身份,只有一个功能:购买商品, 展示所有商品信息,用户循环输入商品编号...
null
shop/Market.py
Market.py
py
5,631
python
en
code
null
code-starcoder2
66
[ { "api_name": "io.open", "line_number": 34, "usage_type": "call" } ]
216872703
import argparse from pathlib import Path import numpy as np from ts2vg import NaturalVG, HorizontalVG from ts2vg.graph.base import _DIRECTED_OPTIONS, _WEIGHTED_OPTIONS _OUTPUT_MODES = { 'el': 'edge list', 'ds': 'degree sequence', 'dd': 'degree distribution', 'dc': 'degree counts' } _GRAPH_TYPES = { ...
null
ts2vg/cli.py
cli.py
py
3,723
python
en
code
null
code-starcoder2
66
[ { "api_name": "ts2vg.NaturalVG", "line_number": 17, "usage_type": "name" }, { "api_name": "ts2vg.HorizontalVG", "line_number": 18, "usage_type": "name" }, { "api_name": "argparse.HelpFormatter", "line_number": 22, "usage_type": "attribute" }, { "api_name": "argpar...
383966995
from django.contrib.sessions.models import Session from accounts.models import Profile class OneSessionPerUserMiddleware(object): def __init__(self, get_response): self.get_response = get_response def __call__(self, request): response = self.get_response(request) return response def process_view(self, requ...
null
accounts/middleware.py
middleware.py
py
800
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.contrib.sessions.models.Session.objects.filter", "line_number": 19, "usage_type": "call" }, { "api_name": "django.contrib.sessions.models.Session.objects", "line_number": 19, "usage_type": "attribute" }, { "api_name": "django.contrib.sessions.models.Session"...
305198871
# Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html """ An example of how other TTS services can be added to Anki. This add-on registers all voices with the name 'gTTS', meaning if the user wishes to use it in preference to any other TTS drive...
null
code/gtts_player/__init__.py
__init__.py
py
5,287
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.path.append", "line_number": 27, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 27, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path", "line_number...
44874228
import argparse import sys from . import exceptions # NOTE: Originally I wanted the docstring for each module to be within their # file. However, this means that composing the global helptext would require # importing those modules, which will subsequently import PRAW and a whole lot # of other things. This made TS v...
null
scripts/redditSearch/timesearch/__init__.py
__init__.py
py
14,279
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 332, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 436, "usage_type": "attribute" } ]
458534488
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import matplotlib.pyplot as plt import numpy as np from time import time from dynamicgem.embedding.static_graph_embedding import StaticGraphEmbedding fro...
null
dynamicgem/embedding/incrementalSVD.py
incrementalSVD.py
py
8,079
python
en
code
null
code-starcoder2
66
[ { "api_name": "dynamicgem.embedding.static_graph_embedding.StaticGraphEmbedding", "line_number": 20, "usage_type": "name" }, { "api_name": "dynamicgem.utils.timers_utils.incrementalSVD", "line_number": 132, "usage_type": "call" }, { "api_name": "dynamicgem.utils.timers_utils", ...
24448567
""" Main file for running """ import os import numpy as np import cv2 import argparse def str2bool(v): if v.lower() in ('yes', 'true', 't', 'y', '1'): return True elif v.lower() in ('no', 'false', 'f', 'n', '0'): return False else: raise argparse.ArgumentTypeError('Expected a bool')...
null
run.py
run.py
py
428
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentTypeError", "line_number": 15, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 17, "usage_type": "call" } ]
409965154
"""Whitebox AutoML presets.""" import os from copy import deepcopy from typing import Optional, Sequence, Any, cast, Iterable from log_calls import record_history from .base import AutoMLPreset, upd_params from ...dataset.np_pd_dataset import NumpyDataset from ...ml_algo.whitebox import WbMLAlgo from ...pipelines.ml...
null
lightautoml/automl/presets/whitebox_presets.py
whitebox_presets.py
py
7,935
python
en
code
null
code-starcoder2
66
[ { "api_name": "utils.logging.get_logger", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "base.AutoMLPres...
70895987
from datetime import datetime from django.test import TestCase from django.urls import reverse from core.tests_utils import setup_current_user from core.models import Entity, MatierePremiere, Biocarburant, Pays from saf.models import SafTicketSource, SafTicket class SafTicketDetailsTest(TestCase): fixtures = [ ...
null
web/saf/api/airline/tests/tests_ticket_details.py
tests_ticket_details.py
py
5,838
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.test.TestCase", "line_number": 11, "usage_type": "name" }, { "api_name": "core.models.Entity.objects.filter", "line_number": 21, "usage_type": "call" }, { "api_name": "core.models.Entity.objects", "line_number": 21, "usage_type": "attribute" }, {...
55065415
import matplotlib.pyplot as plt from cartpole import CartPoleEnv import os import spinup.algos.vpg.core as core from spinup import vpg from spinup.utils.test_policy import load_policy, run_policy from spinup.utils.run_utils import setup_logger_kwargs from spinup.utils.plot import make_plots from spinup.utils.mpi_tools ...
null
run_hybrid_controller_vpg.py
run_hybrid_controller_vpg.py
py
4,985
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 45, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 45, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 46, "usage_type": "call" }, { "api_name": "mat...
198877665
import subprocess from typing import AsyncGenerator, Generator import pytest from billing import settings from billing.db.clauses import truncate from billing.db.tables import tables from billing.db.wrapper import Database @pytest.fixture(scope="session", autouse=True) def migrate_db() -> Generator[None, None, None...
null
tests/fixtures/db.py
db.py
py
1,527
python
en
code
null
code-starcoder2
66
[ { "api_name": "pytest.fixture", "line_number": 12, "usage_type": "call" }, { "api_name": "typing.Generator", "line_number": 13, "usage_type": "name" }, { "api_name": "billing.db.wrapper.Database", "line_number": 20, "usage_type": "name" }, { "api_name": "billing.d...
611454367
# coding:utf-8 from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtGui import * from PyQt5.QtWidgets import * from PyQt5.QtCore import * import qtawesome from time import sleep, ctime import numpy as np import sys import cv2 from net import Classifier from Camera.in_GUI_init_layout import Initor_for_event class...
null
Camera/in_main_gui.py
in_main_gui.py
py
2,560
python
en
code
null
code-starcoder2
66
[ { "api_name": "Camera.in_GUI_init_layout.Initor_for_event", "line_number": 17, "usage_type": "name" }, { "api_name": "net.Classifier", "line_number": 25, "usage_type": "call" }, { "api_name": "PyQt5.QtCore.Qt", "line_number": 47, "usage_type": "attribute" }, { "ap...
207937721
# -*- coding: utf-8 -*- import os import random import re import sys import time import platform from urllib.parse import urlencode from urllib.parse import urljoin import requests from information.config import * from gtaasmysql import MySQL from loggtaas import Log from lxml import etree from gtaasutils import getH...
null
information/pojie.py
pojie.py
py
7,664
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.split", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...
625752826
# -*- coding: utf-8 -*- """ Created on Mon Mar 18 18:51:26 2019 @author: ibiyt """ import os import pandas as pd import numpy as np import cv2 from multiprocessing import Pool from functools import partial np.random.seed(146) dir_pref = 'animals10/raw-img' classes = os.listdir(dir_pref) class_labels = {x: classes....
null
dataShifting.py
dataShifting.py
py
3,026
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.random.seed", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 18, "usage_type": "call" }, { "api_name": "os.listdir", "line...
592475368
import cv2 img=cv2.imread("../img/14.jpg") #对原图做高亮处理 img=cv2.convertScaleAbs(img,alpha=6,beta=0) #高斯模糊 img=cv2.GaussianBlur(img,(5,5),0) ret,img=cv2.threshold(img,80,255,cv2.THRESH_BINARY) kernel=cv2.getStructuringElement(cv2.MORPH_RECT,(5,5)) img=cv2.morphologyEx(img,cv2.MORPH_CLOSE,kernel,iterations=5) ...
null
Day004/python/opencv/医学CT关键点定位.py
医学CT关键点定位.py
py
434
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.imread", "line_number": 3, "usage_type": "call" }, { "api_name": "cv2.convertScaleAbs", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.GaussianBlur", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.threshold", "lin...
379683727
import urllib, json import datetime from django.core.urlresolvers import reverse from django.http import HttpResponse from django.utils import timezone from ..models import Event, Track, Movement, Vote def events(request): event_id_response = request.GET.get('id') response_data = [] events = [] if ...
null
alpacastats/views/apis.py
apis.py
py
12,664
python
en
code
null
code-starcoder2
66
[ { "api_name": "models.Event.objects.get", "line_number": 19, "usage_type": "call" }, { "api_name": "models.Event.objects", "line_number": 19, "usage_type": "attribute" }, { "api_name": "models.Event", "line_number": 19, "usage_type": "name" }, { "api_name": "model...
597161248
import json import logging from os import path import pkg_resources from uuid import uuid4 from requests import post from contextlib import contextmanager from logging.handlers import WatchedFileHandler from manager_rest import config, server, premium_enabled from manager_rest.storage import get_storage_manager, mode...
null
cfy_manager/components/usage_collector/scripts/script_utils.py
script_utils.py
py
2,711
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 20, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 21, "usage_type": "attribute" }, { "api_name": "logging.Formatter", "line_number": 22, "usage_type": "call" }, { "api_name": "logging.handler...
290427250
import sqlite3 conn = sqlite3.connect('Prof11.db') c = conn.cursor() class prof1(): def __init__(self): pass def __del__(self): print('destructor') def create_table(self): c.execute("""CREATE TABLE IF NOT EXISTS question1_1 (Question, Val1, Val2, Val3, Val4)""") c.execut...
null
Skipanalinu_leikur/Prof1.py
Prof1.py
py
2,109
python
en
code
null
code-starcoder2
66
[ { "api_name": "sqlite3.connect", "line_number": 2, "usage_type": "call" } ]
642332620
from django.shortcuts import render, get_object_or_404, redirect from core.models import Dog, Event from core.forms import SearchForm, AdoptionApplicationForm # Create your views here. def index_view(request): if request.GET: form = SearchForm(request.GET) dogs = form.search() else: f...
null
w5/examples/shelter-demo/core/views.py
views.py
py
1,177
python
en
code
null
code-starcoder2
66
[ { "api_name": "core.forms.SearchForm", "line_number": 10, "usage_type": "call" }, { "api_name": "core.forms.SearchForm", "line_number": 13, "usage_type": "call" }, { "api_name": "core.models.Dog.objects.all", "line_number": 14, "usage_type": "call" }, { "api_name"...
439493827
import ssl import http.client, urllib.request, urllib.parse, urllib.error, base64 from azure.Azure import Azure class Video(Azure): def __init__(self, api_key): Azure.__init__(self, api_key) ssl._create_default_https_context = ssl._create_unverified_context self._connection() def _...
null
azure/Video.py
Video.py
py
6,979
python
en
code
null
code-starcoder2
66
[ { "api_name": "azure.Azure.Azure", "line_number": 6, "usage_type": "name" }, { "api_name": "azure.Azure.Azure.__init__", "line_number": 9, "usage_type": "call" }, { "api_name": "azure.Azure.Azure", "line_number": 9, "usage_type": "name" }, { "api_name": "ssl._crea...
495979683
import datetime import logging import os import subprocess import sys from typing import List import azure.batch.models as batch_models import azure.storage.blob as blob import yaml from aztk.utils.command_builder import CommandBuilder from core import config # limit azure.storage logging logging.getLogger("azure.st...
null
aztk/node_scripts/submit.py
submit.py
py
7,146
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.CRITICAL", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.path.basename", "line_number": 44, "usage_type": "call" }, { "api_name": "os.path", ...
186633612
import torch import time import numpy as np import pandas as pd import torch.nn as nn from torch.utils.data import Dataset, DataLoader from utils.data_filter import * from collections import Counter from torch.nn.utils.rnn import pad_sequence def my_collate(batch_data): texts, aspects, texts2num, aspects2num, lab...
null
trainer/semeval_trainer.py
semeval_trainer.py
py
6,595
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.Tensor", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.Tensor", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.nn.utils.rnn.pad_sequence", "line_number": 21, "usage_type": "call" }, { "api_name": "torch.nn.ut...
227724317
""" PLOTTING LIVE DATA AND ANALYSIS FOR USE WITH ARDUINO CODE "NEW3D" (OR SIMILAR) |||||Contents List||||| A. Initialization and Setup 1. Libraries 2. Constants 3. Variables 4. Functions 5. Options 6. Serial 7. Plot 8. Time B. Data Collection and Analysis 1. Loop 2. Centroids...
null
test/livedata/testing/linear_regression_testing.py
linear_regression_testing.py
py
13,253
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.abspath", "line_number": 46, "usage_type": "call" }, { "api_name": "os.path", "line_number": 46, "usage_type": "attribute" }, { "api_name": "numpy.sqrt", "line_number": 98, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number...
328830329
import csv import datetime import os from django.utils.timezone import make_aware from django.db import transaction from polestarapplication.models import ShipPositionDetails, ShipDetail """Import data class designed to group the import csv functionality """ class ImportService: """ Description:This method ...
null
polestarproject/ImportService.py
ImportService.py
py
2,961
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.getcwd", "line_number": 22, "usage_type": "call" }, { "api_name": "csv.DictReader", "line_number": 23, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 28, "usage_type": "call" }, { "api_name": "datetime.datetime...
430045011
############################################################## # # # FileName : commons # # Author : BoyLJS # # Date : 2016-01-11 # # Hi...
null
FileUtils/commons.py
commons.py
py
2,014
python
en
code
null
code-starcoder2
66
[ { "api_name": "enum.Enum", "line_number": 21, "usage_type": "name" }, { "api_name": "os.path.basename", "line_number": 34, "usage_type": "call" }, { "api_name": "os.path", "line_number": 34, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_n...
531005739
from time import time import os from lib.utils import Logger logger = Logger() def delete_images(in_path,out_path,max_allowed_time): """ delete all faces not recognized if the stay in the directory for max_allowed_time """ while True: image_names,paths = [],[] for img in os.listd...
null
Face-Track-Detect-Extract-master/clean_facedirs.py
clean_facedirs.py
py
1,410
python
en
code
null
code-starcoder2
66
[ { "api_name": "lib.utils.Logger", "line_number": 4, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...