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
67546195
import cv2 # for reading and writing or showing image import numpy as np import matplotlib.pyplot as plt from keras.models import load_model import keras import tensorflow as tf from keras.preprocessing import image from keras.models import load_model # from net import Net from resnet_build import Net import sys # fro...
null
ocr_reinforce/CharClassification2/CharClassification_git/mp.py
mp.py
py
2,525
python
en
code
null
code-starcoder2
76
[ { "api_name": "keras.preprocessing.image.load_img", "line_number": 17, "usage_type": "call" }, { "api_name": "keras.preprocessing.image", "line_number": 17, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.imshow", "line_number": 20, "usage_type": "call" }, { ...
54669744
# Copyright 2015 The TensorFlow 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 applica...
null
tensorflow/python/keras/_impl/keras/engine/sequential.py
sequential.py
py
38,139
python
en
code
null
code-starcoder2
76
[ { "api_name": "tensorflow.python.keras._impl.keras.engine.training.Model", "line_number": 45, "usage_type": "name" }, { "api_name": "tensorflow.python.keras._impl.keras.backend.get_uid", "line_number": 101, "usage_type": "call" }, { "api_name": "tensorflow.python.keras._impl.kera...
129136539
# -*- coding: utf-8 -*- """ account.forms :copyright: (c) 2013 by Openlabs Technologies & Consulting (P) Limited :license: see LICENSE for more details. """ from django import forms from account.models import UserProfile, TrainingProfile, StudentProfile, \ GovernmentProfile, IndustryProfile __all__ = ...
null
pursuite/django-pursuite/apps/account/forms.py
forms.py
py
1,535
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.forms.Form", "line_number": 18, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 18, "usage_type": "name" }, { "api_name": "django.forms.CharField", "line_number": 22, "usage_type": "call" }, { "api_name": "django.for...
544515252
import os.path import csv import datetime from django.contrib.auth import get_user_model from django.core.management.base import BaseCommand from django.utils import timezone from hub.apps.content.models import Website from hub.apps.metadata.models import ( Organization, SustainabilityTopic, AcademicDisci...
null
hub/apps/content/management/commands/import_academic_programs.py
import_academic_programs.py
py
4,069
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 19, "usage_type": "call" }, { "api_name": "django.core.management.base.BaseCommand", "line_number": 22, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 29, "usage_type": "call...
437178078
from math import inf, floor from typing import Union, Optional, List, Dict from num import Num from options import options from row import Row from sym import Sym from utils import copy class Range: def __init__(self, at, txt, lo, hi=None): self.at = at self.txt = txt self.lo = lo ...
null
src/HW6/discretization.py
discretization.py
py
5,242
python
en
code
null
code-starcoder2
76
[ { "api_name": "sym.Sym", "line_number": 19, "usage_type": "call" }, { "api_name": "typing.Union", "line_number": 28, "usage_type": "name" }, { "api_name": "sym.Sym", "line_number": 28, "usage_type": "name" }, { "api_name": "num.Num", "line_number": 28, "us...
130753459
import requests import time import sys # You will need to register for a Wunderground API key and set it below # API_KEY = 'Your API key here' def get_weather(date, location): """ Return the json response as a Python dictionary""" base_url = "http://api.wunderground.com/api/{api_key}/histo...
null
Exercises/solutions/Ex2a_source(solution).py
Ex2a_source(solution).py
py
1,054
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 24, "usage_type": "call" } ]
392611694
from abc import abstractmethod import trio from async_service import background_trio_service from lahja import EndpointAPI from asyncio_run_in_process import open_in_process_with_trio from trinity._utils.logging import child_process_logging, get_logger from trinity._utils.profiling import profiler from trinity.even...
null
trinity/extensibility/trio.py
trio.py
py
3,503
python
en
code
null
code-starcoder2
76
[ { "api_name": "component.BaseComponent", "line_number": 18, "usage_type": "name" }, { "api_name": "component.BaseIsolatedComponent", "line_number": 26, "usage_type": "name" }, { "api_name": "trinity._utils.logging.get_logger", "line_number": 27, "usage_type": "call" }, ...
253024831
import os import numpy as np import pyqtgraph as pg import qtawesome as qta from qtpy.QtWidgets import QMainWindow, QMdiSubWindow, QListWidget, QAction from qtpy.QtCore import Signal, QObject, Property from qtpy.uic import loadUi from ..core.models import PlotProxyModel from ..utils import UI_PATH class PlotWindow(...
null
specviz/widgets/plotting.py
plotting.py
py
4,115
python
en
code
null
code-starcoder2
76
[ { "api_name": "qtpy.QtWidgets.QMdiSubWindow", "line_number": 14, "usage_type": "name" }, { "api_name": "qtpy.QtWidgets.QMainWindow", "line_number": 20, "usage_type": "call" }, { "api_name": "qtpy.uic.loadUi", "line_number": 23, "usage_type": "call" }, { "api_name"...
498538400
import random import datetime from candidate import Candidate from project import Project from experience import Experience class DataGenerator: __first_names = ["Alene", "Alessandra", "Aleta", "Alethea", "Alex", "Alexa", "Alexandra", "Deedee", "Deena", "Deerdre", "Deeyn", "Dehlia", "Deidre"...
null
FlaskAPI_ENV/scripts/Section 1/Video 1.4/source_code/datagenerator.py
datagenerator.py
py
3,421
python
en
code
null
code-starcoder2
76
[ { "api_name": "random.randint", "line_number": 31, "usage_type": "call" }, { "api_name": "candidate.Candidate", "line_number": 32, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 46, "usage_type": "call" }, { "api_name": "random.randint", ...
392836180
import base64 from flask import g from service.auth import SimpleAuth from service import db from models.user import User from app import app basic_auth = SimpleAuth(auth_type="Basic") @basic_auth.post_authentication def check_confirmed(): return g.user.confirmed @basic_auth.auth_error_handler def basic_error...
null
service/auth_config.py
auth_config.py
py
2,541
python
en
code
null
code-starcoder2
76
[ { "api_name": "service.auth.SimpleAuth", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.g.user", "line_number": 14, "usage_type": "attribute" }, { "api_name": "flask.g", "line_number": 14, "usage_type": "name" }, { "api_name": "base64.b64decode", ...
376084962
#!/usr/bin/python # Importando modulo de leitura de planilhas import datetime import xlrd import xlsxwriter import sys import os # ----------------------------------INICIO DO CODIGO DE LEITURA DO PIPELINE -----------------------------------------# print('Iniciando leitura das Planilhas PIPELINE, GSA e Textile....\n\n...
null
main_pipe.py
main_pipe.py
py
3,986
python
en
code
null
code-starcoder2
76
[ { "api_name": "xlrd.open_workbook", "line_number": 14, "usage_type": "call" }, { "api_name": "xlrd.open_workbook", "line_number": 15, "usage_type": "call" }, { "api_name": "xlrd.open_workbook", "line_number": 16, "usage_type": "call" }, { "api_name": "xlrd.xldate_...
355507046
import re import xml.etree.ElementTree as metree import random INPUT_FILENAME = "./GKfiles/GKvocab_n4_raw.xml" DICT_FILENAME = "/tools/dict/JMdict_e" OUTPUT_FILENAME = "./GKvocab_n4_updated.xml" pos_switch = { "Godan verb with `bu' ending": {"VERB_5_BU"}, "Godan verb with `gu' ending": {"VERB_5_GU"}, "Godan verb with...
null
update_vocabulary.py
update_vocabulary.py
py
13,348
python
en
code
null
code-starcoder2
76
[ { "api_name": "xml.etree.ElementTree.parse", "line_number": 98, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 98, "usage_type": "name" }, { "api_name": "xml.etree.ElementTree.parse", "line_number": 99, "usage_type": "call" }, { "api...
1194269
import time import subprocess import digitalio import board from PIL import Image, ImageDraw, ImageFont import adafruit_rgb_display.st7789 as st7789 # Configuration for CS and DC pins (these are FeatherWing defaults on M0/M4): cs_pin = digitalio.DigitalInOut(board.CE0) dc_pin = digitalio.DigitalInOut(board.D25) reset_...
null
Lab 2/screen_clock.py
screen_clock.py
py
3,338
python
en
code
null
code-starcoder2
76
[ { "api_name": "digitalio.DigitalInOut", "line_number": 9, "usage_type": "call" }, { "api_name": "board.CE0", "line_number": 9, "usage_type": "attribute" }, { "api_name": "digitalio.DigitalInOut", "line_number": 10, "usage_type": "call" }, { "api_name": "board.D25"...
455454861
# coding=utf-8 """ repl Plugin for DecoraterBot. """ import traceback import inspect from contextlib import redirect_stdout import io import discord from discord.ext import commands from DecoraterBotUtils.utils import * class REPL: """ repl Plugin class. """ def __init__(self): self.sessions...
null
repl.py
repl.py
py
4,425
python
en
code
null
code-starcoder2
76
[ { "api_name": "io.StringIO", "line_number": 97, "usage_type": "call" }, { "api_name": "contextlib.redirect_stdout", "line_number": 100, "usage_type": "call" }, { "api_name": "inspect.isawaitable", "line_number": 102, "usage_type": "call" }, { "api_name": "tracebac...
10090221
import json from db import db, Faculty, Class, Research from flask import Flask, request app = Flask(__name__) db_filename = 'todo.db' #Class.students.append(user) app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///%s' % db_filename app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False app.config['SQLALCHEMY_ECHO'] = T...
null
app.py
app.py
py
4,316
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "db.db.init_app", "line_number": 12, "usage_type": "call" }, { "api_name": "db.db", "line_number": 12, "usage_type": "name" }, { "api_name": "db.db.create_all", "line_number":...
214237525
#-*- coding: utf-8 -*- import os import pickle import maya.cmds as rig import maya.OpenMaya as om import maya.OpenMayaAnim as omAnim from RIG.simulation.simulationMain import SM_warning from RIG.commonly.base import SK_getSkinCluster from RIG.tools.IOWeights.IOgetOptionUI import SK_IOgetOptionUI def IO_newFile(allPoly...
null
OLD/COMMON/set/RIG/tools/IOWeights/IOFile.py
IOFile.py
py
4,891
python
en
code
null
code-starcoder2
76
[ { "api_name": "maya.cmds.fileDialog", "line_number": 12, "usage_type": "call" }, { "api_name": "maya.cmds", "line_number": 12, "usage_type": "name" }, { "api_name": "maya.cmds.ls", "line_number": 17, "usage_type": "call" }, { "api_name": "maya.cmds", "line_num...
368279820
import numpy as np from numpy.linalg import pinv from ex2c import X_train, X_cv, X_test, Y_train, Y_cv, Y_test import matplotlib matplotlib.use('Qt4Agg') import matplotlib.pyplot as plt train_errors = [] num_train_errors = [] cv_errors = [] num_cv_errors = [] reg_parameters = [ 0.00001, 0.00003, 0.0001...
null
list_2/ex2d.py
ex2d.py
py
3,810
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.use", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.random.rand", "line_number": 41, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 41, "usage_type": "attribute" }, { "api_name": "numpy.exp", "li...
482261541
# coding: utf-8 # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # --------------------------------------------------------------------...
null
sdk/formrecognizer/azure-ai-formrecognizer/samples/v3.2_and_later/sample_compose_model.py
sample_compose_model.py
py
6,031
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ", "line_number": 49, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 50, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 51, "usage_type": "attribute" }, { "api_name": "os.environ", "lin...
452918870
"""Display a graph of the corona virus spread""" import pandas as pd import plotly.graph_objs as go URL = (f"https://docs.google.com/" f"spreadsheets/d/18X1VM1671d99V_yd-cnUI1j8oSG2ZgfU_q1HfOizErA/" f"export?format=csv&id") class CoronaVirusGrapher(): """ Visualize cases of the corona virus ...
null
main.py
main.py
py
5,275
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 16, "usage_type": "call" }, { "api_name": "plotly.graph_objs.Figure", "line_number": 64, "usage_type": "call" }, { "api_name": "plotly.graph_objs", "line_number": 64, "usage_type": "name" }, { "api_name": "plotly.gra...
371644456
#!/usr/bin/env python # encoding: utf-8 import redis import sys import os sys.path.append(os.getcwd()) from sina.settings import LOCAL_REDIS_HOST, LOCAL_REDIS_PORT, PROXY_BASEURL import urllib.parse from sina.spiders.utils import get_random_proxy r = redis.Redis(host=LOCAL_REDIS_HOST, port=LOCAL_REDIS_PORT) #delete...
null
crawl_search/sina/redis_init.py
redis_init.py
py
1,366
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 7, "usage_type": "call" }, { "api_name": "redis.Redis", "line_number":...
409999360
import numpy as np import networkx as nx from networkx import is_strongly_connected, is_strongly_connected_dev from garageofcode.common import benchmarking from garageofcode.probing.utils import get_random_graph def is_strongly_connected_v001(G): N = len(G) u = next(iter(G)) #return len(reachable_from(G,...
null
garageofcode/networkx/networkx_scc.py
networkx_scc.py
py
2,235
python
en
code
null
code-starcoder2
76
[ { "api_name": "networkx.descendants", "line_number": 15, "usage_type": "call" }, { "api_name": "networkx.ancestors", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.rando...
68470369
from flask import Flask # StatsD: https://statsd.readthedocs.io/en/v3.2.1/timing.html from statsd import StatsClient import time import random app = Flask(__name__) statsd = StatsClient(host='localhost', port=8126, prefix='services', maxudpsize=512) @app....
null
python3.8/app/main.py
main.py
py
624
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "statsd.StatsClient", "line_number": 7, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 16, "usage_type": "call" }, { "api_name": "random.uniform", "line_nu...
111099353
import numpy as np from modules.entity import Entity from modules.ray import Ray from utils import normalize class Sphere(Entity): def __init__(self, params, materials): super().__init__(params, materials) self.center = np.array(params[0:3], dtype=float) self.radius = float(params[3]) ...
null
modules/sphere.py
sphere.py
py
1,090
python
en
code
null
code-starcoder2
76
[ { "api_name": "modules.entity.Entity", "line_number": 7, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.full", "line_num...
304992800
from django.urls import path from . import views urlpatterns = [ path('', views.index_view, name="home_view"), path('register/', views.register_view, name="register_view"), path('login/', views.login_view, name="login_view"), path('profile/', views.profile_view, name="profile_view"), path('log-out/...
null
login_reg_proj/login_reg_app/urls.py
urls.py
py
519
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", ...
77563310
from django.core.management.base import BaseCommand, CommandError from django.core.management import call_command from django.conf import settings ECOMMERCE_FIXTURES = [ 'categories.json', 'products.json', ] class Command(BaseCommand): def handle(self, *args, **options): for fixture in ECOMMERCE_...
null
ecommerce_projec/ecommerce/management/commands/eccomerce_fixtures.py
eccomerce_fixtures.py
py
542
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 11, "usage_type": "name" }, { "api_name": "django.core.management.call_command", "line_number": 15, "usage_type": "call" }, { "api_name": "django.conf.settings.DJANGO_ROOT", "line_number": 15, "usage_...
585718932
# univariate multi-step lstm from math import sqrt import numpy import pandas as pd from numpy import array from pandas import read_csv from pandas import DataFrame from pandas import concat from sklearn.metrics import mean_absolute_error from sklearn.metrics import mean_squared_error from matplotlib import pyplot fro...
null
time-serials/LSTM_Attention_multi2one.py
LSTM_Attention_multi2one.py
py
6,962
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.DataFrame", "line_number": 21, "usage_type": "call" }, { "api_name": "pandas.concat", "line_number": 35, "usage_type": "call" }, { "api_name": "keras.models.Sequential", "line_number": 47, "usage_type": "call" }, { "api_name": "keras.layers.L...
1485268
""" Author: Rehman Ali RA dated=25 auguest 2020 A Program which gives covid 19 notifiction """ from plyer import notification # module for notifiction import requests from bs4 import BeautifulSoup # beautify all the html data import time def notif_me(title,message): # notifiction function which igave notif...
null
Covid out break notifiction Project.py
Covid out break notifiction Project.py
py
1,899
python
en
code
null
code-starcoder2
76
[ { "api_name": "plyer.notification.notify", "line_number": 14, "usage_type": "call" }, { "api_name": "plyer.notification", "line_number": 14, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 22, "usage_type": "call" }, { "api_name": "bs4.Beautif...
548932499
import datetime import os import pickle import re from typing import Union, List from .. import params from .. import util, settings from ..api.defaultclient import DefaultAPIClient, DefaultAPIUser from ..exceptions import ReqException, LoginError, APIUserError __all__ = ['WebAPIClient'] class BaseClient: _logi...
null
pikax/api/webclient.py
webclient.py
py
13,841
python
en
code
null
code-starcoder2
76
[ { "api_name": "exceptions.ReqException", "line_number": 26, "usage_type": "name" }, { "api_name": "os.path.isfile", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path", "line_number": 32, "usage_type": "attribute" }, { "api_name": "pickle.dump", ...
487378033
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Mar 10 09:56:11 2021 """ import json from Lookup import LookupTable # Load periodic table info from file table_path = "Put json file path here" with open(table_path, 'r') as data: periodic_table = json.load(data) table = LookupTable(periodic_table...
null
main.py
main.py
py
1,137
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.load", "line_number": 13, "usage_type": "call" }, { "api_name": "Lookup.LookupTable", "line_number": 15, "usage_type": "call" } ]
65099084
#airlines sentiment anaysis #Importing libraries import pandas as pd import numpy as np import matplotlib.pyplot as pt import re from html.parser import HTMLParser from nltk.corpus import stopwords #from nltk.stem.porter import PorterStemmer from nltk.stem.wordnet import WordNetLemmatizer import string from nltk import...
null
airlines_sentiment_anlyse.py
airlines_sentiment_anlyse.py
py
6,451
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 16, "usage_type": "call" }, { "api_name": "html.parser.HTMLParser", "line_number": 18, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 22, "usage_type": "call" }, { "api_name": "re.DOTALL", "li...
371162937
# -*- coding: utf-8 -*- __author__ = 'wangli' __date__ = '2020-02-10 16:12' # 导入相关扩展类库 from flask_bootstrap import Bootstrap # 邮件 from flask_mail import Mail # 时间 from flask_moment import Moment # 数据库 from flask_sqlalchemy import SQLAlchemy # 登录 from flask_login import LoginManager # 上传文件 from flask_uploads import Up...
null
app/extensions.py
extensions.py
py
1,395
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask_bootstrap.Bootstrap", "line_number": 25, "usage_type": "call" }, { "api_name": "flask_mail.Mail", "line_number": 26, "usage_type": "call" }, { "api_name": "flask_moment.Moment", "line_number": 27, "usage_type": "call" }, { "api_name": "flask_s...
635653304
import argparse import json import logging import os import random from io import open import numpy as np from tensorboardX import SummaryWriter from tqdm import tqdm from bisect import bisect import yaml from easydict import EasyDict as edict import pdb import sys import torch import torch.nn.functional as F import ...
null
train_cider.py
train_cider.py
py
15,155
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.seed", "line_number": 41, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 41, "usage_type": "attribute" }, { "api_name": "torch.manual_seed", "line_number": 42, "usage_type": "call" }, { "api_name": "torch.cuda.manu...
497969526
# -*- coding: utf-8 -*- import paddle class Merger(paddle.nn.Layer): def __init__(self, cfg): super(Merger, self).__init__() self.cfg = cfg # Layer Definition self.layer1 = paddle.nn.Sequential( paddle.nn.Conv3D(9, 16, kernel_size=3, padding=1, weight_attr=paddle.nn.i...
null
Pix2Vox-F/models/merger.py
merger.py
py
3,958
python
en
code
null
code-starcoder2
76
[ { "api_name": "paddle.nn", "line_number": 6, "usage_type": "attribute" }, { "api_name": "paddle.nn.Sequential", "line_number": 12, "usage_type": "call" }, { "api_name": "paddle.nn", "line_number": 12, "usage_type": "attribute" }, { "api_name": "paddle.nn.Conv3D", ...
494668208
''' The exercises and classes are configured in json/yaml. Each directory inside exercises/ holding an index.json/yaml is a course. ''' from django.conf import settings import os, time, json, yaml, re import logging import copy from util.dict import iterate_kvp_with_dfs, get_rst_as_html from util.importer import impor...
null
access/config.py
config.py
py
14,312
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "django.conf.settings.BASE_DIR", "line_number": 14, "usage_type": "attribute" }, { "api_name": "django.c...
391547726
""" @Description: This python collects data from YouTube Videos @ such as views, likes, dislikes, etc @ @Author: Ken Zeng """ import requests from lxml import html from datetime import datetime import csv class Collector(object): """ A collector that takes a list of url...
null
collector.py
collector.py
py
7,941
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.now", "line_number": 26, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 26, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 90, "usage_type": "call" }, { "api_name": "lxml.html.fromst...
108506728
import numpy as np import cv2 img = cv2.imread('/home/meghnadixit38/Pictures/tiger.jpg',0) cv2.imshow('image',img) k = cv2.waitKey(0) if k == 27: cv2.destroyAllWindows() elif k == ord('s'): cv2.imwrite('tigergray.jpg',img) cv2.destroyAllWindows()
null
OpenCV/Assignment_1.1.py
Assignment_1.1.py
py
271
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.imread", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.waitKey", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.destroyAllWindows", "line_numb...
601633915
import multiprocessing from abc import ABCMeta, abstractmethod from multiprocessing import Process from typing import Dict, List from datetime import datetime from ...base_crawler import BaseCrawler from ..api import TWEEPY_API class KeywordCrawler(BaseCrawler): def __init__( self, keywords: Lis...
null
fin_app/crawler/twitter/singleshot/tweepy_keyword_crawler.py
tweepy_keyword_crawler.py
py
3,365
python
en
code
null
code-starcoder2
76
[ { "api_name": "base_crawler.BaseCrawler", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 15, "usage_type": "name" }, { "api_name": "multiprocessing.cpu_count", "line_number": 25, "usage_type": "call" }, { "api_name": "typing...
616097075
from urllib.request import urlretrieve import os import zipfile if __name__ == '__main__': os.system('sudo apt install python3-pip') os.system('sudo -H pip3 install selenium') urlretrieve('https://chromedriver.storage.googleapis.com/2.35/chromedriver_linux64.zip', 'chromedriver_linux64.zip') zip_ref =...
null
setup.py
setup.py
py
649
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.system", "line_number": 7, "usage_type": "call" }, { "api_name": "os.system", "line_number": 8, "usage_type": "call" }, { "api_name": "urllib.request.urlretrieve", "line_number": 9, "usage_type": "call" }, { "api_name": "zipfile.ZipFile", "li...
403732331
import matplotlib.pyplot as plt import numpy as np cupcakes = open('CupcakeInvoices.csv') print("---------------PROBLEM 3---------------") # print(cupcakes) # for line in cupcakes: # print(line) print("---------------PROBLEM 4---------------") # for flavor in cupcakes: # flavor = flavor.strip('\r\n').split(',...
null
Labs/data-python-lab/data_presenter.py
data_presenter.py
py
2,143
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.bar", "line_number": 67, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 67, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.xlabel", "line_number": 70, "usage_type": "call" }, { "api_name": "matp...
292234049
import boto3 import json import os # configurations from file config_filename = "_src/configs.json" if os.path.isfile(config_filename): with open(config_filename) as f: all_configs = json.loads(f.read()) environment = all_configs['environment'] if 'environment' in all_configs.keys() else "dev" region = all...
null
work/insta-spike/FeedBearBot/create_kms_key.py
create_kms_key.py
py
3,037
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.isfile", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "json.loads", "line_number": 9, "usage_type": "call" }, { "api_name": "boto3.client", "line_number":...
360290964
#! /usr/bin/env python import Tkinter as tk import tkFileDialog from datetime import datetime import os class ConvertMe(object): """Docstring""" buttonfont = ("Arial", 10) def __init__(self, master): self.master = master # frame which will contain buttons and entry field self.t...
null
ConvertMe/convertme.py
convertme.py
py
8,891
python
en
code
null
code-starcoder2
76
[ { "api_name": "Tkinter.Frame", "line_number": 18, "usage_type": "call" }, { "api_name": "Tkinter.Frame", "line_number": 25, "usage_type": "call" }, { "api_name": "Tkinter.Button", "line_number": 32, "usage_type": "call" }, { "api_name": "Tkinter.Button", "line...
429321530
import scrapy from spiders.items import SpidersItem class MoviewSpider(scrapy.Spider): name = 'moview' allowed_domains = ['https://maoyan.com/'] start_urls = ['https://maoyan.com/films?showType=3'] def parse(self, response): moview = SpidersItem() dl = response.xpath('//div[@class="mo...
null
week01/work2/spiders/spiders/spiders/moview.py
moview.py
py
786
python
en
code
null
code-starcoder2
76
[ { "api_name": "scrapy.Spider", "line_number": 5, "usage_type": "attribute" }, { "api_name": "spiders.items.SpidersItem", "line_number": 11, "usage_type": "call" } ]
45175480
import pickle import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.utils import shuffle from datetime import datetime from sortedcontainers import SortedList with open('user2movie.json','rb') as f: user2movie = pickle.load(f) with open('movie2user.json','rb') as f: movie2user = ...
null
usercollab.py
usercollab.py
py
4,117
python
en
code
null
code-starcoder2
76
[ { "api_name": "pickle.load", "line_number": 10, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 13, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 16, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": ...
383170368
# this is the ellipse bluff body grid generator script # developed by ramkumar import numpy as np import matplotlib.pyplot as plt import pandas as pd from copy import copy as cp # geometric parameters a1 = 0.2 b1 = 0.1 a2 = 1.0 b2 = 0.5 nx = 101 ny = 51 theta1 = 3*np.pi/2.0 theta2 = np.pi/2.0 # computing the mes...
null
fortran/bluff_body/old_files/geometry_codes/ellipse_creator.py
ellipse_creator.py
py
1,207
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.pi", "line_number": 19, "usage_type": "attribute" }, { "api_name": "numpy.pi", "line_number": 20, "usage_type": "attribute" }, { "api_name": "numpy.sqrt", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number"...
115380059
#!/usr/bin/env python3 from elasticsearch import Elasticsearch from elasticsearch import helpers from elasticsearch.connection import create_ssl_context from error import send_jira_event, send_ms_teams_message import ssl from itertools import islice import sys import os import re import json from config impo...
null
es.py
es.py
py
24,103
python
en
code
null
code-starcoder2
76
[ { "api_name": "urllib3.disable_warnings", "line_number": 16, "usage_type": "call" }, { "api_name": "urllib3.exceptions", "line_number": 16, "usage_type": "attribute" }, { "api_name": "re.search", "line_number": 98, "usage_type": "call" }, { "api_name": "re.search"...
432371789
# -*- coding: utf-8 -*- import os.path import tornado.escape import tornado.httpserver import tornado.ioloop import tornado.options import tornado.web import markdown from tornado.options import define, options from django_settings import * import re import unicodedata import markdown define("port", default=8888, help...
null
tornado_app/server.py
server.py
py
5,311
python
en
code
null
code-starcoder2
76
[ { "api_name": "tornado.options.define", "line_number": 15, "usage_type": "call" }, { "api_name": "tornado.escape.web", "line_number": 18, "usage_type": "attribute" }, { "api_name": "tornado.escape", "line_number": 18, "usage_type": "name" }, { "api_name": "os.path...
30837663
# -*- coding: utf8 -*- import sys, os import time import datetime import json import configparser import threading import psycopg2 import psycopg2.extras sys.path.append('C:\\Python34\\mysite\\tcb_bank_gate_way\\') import FXDP import FXSE #path = "C:\\Python34\\mysite\\tcb_bank_gate_way\\" path = "" #程式執行時間序log def wr...
null
tcb_bank_gw.py
tcb_bank_gw.py
py
8,256
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.isdir", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_numbe...
383983000
# -*- coding: utf-8 -*- """ Created on Tue Nov 24 16:28:49 2020 @author: user """ import librosa import matplotlib.pyplot as plt import numpy as np y , sr = librosa.load( 'audio_files/ah_2.wav' , 44100 ) # plt.plot( np.arange(y.size) , y ) # select a window size w_size = 2048 # take a segment number of samples a ...
null
dsp_meeting_0.py
dsp_meeting_0.py
py
750
python
en
code
null
code-starcoder2
76
[ { "api_name": "librosa.load", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.fft.fft", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.fft", "line_number": 25, "usage_type": "attribute" }, { "api_name": "numpy.sqrt", "line_numb...
174940863
import logging import collections import datetime from google.appengine.ext import ndb from consts.event_type import EventType from models.event import Event from models.match import Match from models.team import Team CHAMPIONSHIP_EVENTS = set(['arc', 'cur', 'gal', 'new', 'ein', 'cmp']) CHAMPIONSHIP_EVENTS_LABEL = ...
null
helpers/event_helper.py
event_helper.py
py
6,620
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.OrderedDict", "line_number": 30, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 50, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 52, "usage_type": "call" }, { "api_name": "datetim...
233811846
import logging from linebot.models import ( TextMessage, ImageMessage, VideoMessage, AudioMessage, LocationMessage, StickerMessage, FileMessage ) from flags import MessageType from extline import LINE, ExtraKey, event_dest_fmt from ..error import handle_error from .text import handle_text from .image import handl...
null
extline/handler/message/main.py
main.py
py
1,789
python
en
code
null
code-starcoder2
76
[ { "api_name": "flags.MessageType.UNKNOWN", "line_number": 17, "usage_type": "attribute" }, { "api_name": "flags.MessageType", "line_number": 17, "usage_type": "name" }, { "api_name": "flags.MessageType.TEXT", "line_number": 18, "usage_type": "attribute" }, { "api_...
525924555
import io import cv2 from splitWavProcess import * def get_img_from_fig(fig, dpi=100): buf = io.BytesIO() fig.savefig(buf, format="png", dpi=dpi) buf.seek(0) img_arr = np.frombuffer(buf.getvalue(), dtype=np.uint8) buf.close() img = cv2.imdecode(img_arr, 1) img = cv2.cvtColor(img, cv2.COLOR_...
null
2-Preprocessing/preProcessing.py
preProcessing.py
py
3,064
python
en
code
null
code-starcoder2
76
[ { "api_name": "io.BytesIO", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.imdecode", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2RGB", "line_num...
302475870
from queue import Queue from collections import defaultdict class Node: def __init__(self, i, connects): self.i = i self.colour = None self.connects = connects def inject_intersections(self, inter): self.inter = inter def get_neigh_colours(self): cols = set() ...
null
basincity.py
basincity.py
py
1,585
python
en
code
null
code-starcoder2
76
[ { "api_name": "queue.Queue", "line_number": 39, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 41, "usage_type": "call" } ]
305699815
import meshio import matplotlib.pyplot as plt import numpy as np import matplotlib.animation as animation mesh = meshio.read("circle-2d-drag_1000.vtu") cells=mesh.cells_dict pointData=mesh.point_data Velocity=pointData['Pressure'] points=mesh.points data=points[:,[0,1]] plt.figure(1) a=plt.scatter(data[:,0],data...
null
2. interpolating on structured grid (worked)/extract.py
extract.py
py
1,093
python
en
code
null
code-starcoder2
76
[ { "api_name": "meshio.read", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 18, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 18, "usage_type": "name" }, { "api_name": "matplotlib.pypl...
577838647
import torch from IPython import display import matplotlib.pyplot as plt import torchvision from torchvision import transforms from torch.utils import data def synthetic_data(w, b, num_examples): #@save """Generate y = Xw + b + noise.""" X = torch.normal(0, 1, (num_examples, len(w))) y = torch.matmul(X, w...
null
torch/Chapter3/func.py
func.py
py
7,087
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.normal", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.matmul", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.normal", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.reshape", "line_numb...
269591779
#!/usr/bin/env python3 import datetime from click import prompt from jinja2 import Template from mena import mena_kc from ares import firma_info parameter_sablony = dict() today = datetime.date.today() print("Odběratel", "=" * 80) parameter_sablony["odberatel"] = firma_info(prompt("IČ")) print("Faktura", "=" * 80) ...
null
faktura.py
faktura.py
py
2,087
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.date.today", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 10, "usage_type": "attribute" }, { "api_name": "ares.firma_info", "line_number": 13, "usage_type": "call" }, { "api_name": "click.prompt",...
244794242
#!/usr/bin/env python3 import os from setuptools import setup, find_packages import sys sys.path.append(os.getcwd()) import build_cffi def add_pkg_data_dirs(pkg, dirs): pkg_data = [] for d in dirs: for root, _, files in os.walk(os.path.join(pkg, d)): r = os.path.relpath(root, pkg) pkg_data.extend([os.path.j...
null
setup.py
setup.py
py
1,002
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 6, "usage_type": "call" }, { "api_name": "os.walk", "line_number": 12,...
608590408
import matplotlib.pyplot as plt import numpy as np import pandas as pd row_labels = ['Self', 'Other', 'News', 'Irrelevant', 'Other Relevant'] column_labels = ['7/13/14', '7/20/14', '7/27/14', '8/3/14', '8/10/14', '8/17/14', '8/24/14', '8/31/14', '9/7/14', '9/14/14', '9/21/14', '9/28/12', '10/5/14', '10/12/14', '10/19...
null
heatmap.py
heatmap.py
py
903
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 11, "usage_type": "name" }, { "api_name": "matplotli...
77817499
from django.urls import path from . import views urlpatterns = [ #### following followers 목록 # path('follows/<username>/',views.follows), #### 회원등급을 올려주는 거 (admin 계정만 올수 있다.) path('grade/<username>/',views.grade), #### 해당 회원의 좋아하는 게시글들 #### path('like_article/<username>/',views.like_article), ...
null
last_pjt/backend/accounts/urls.py
urls.py
py
810
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 11, "usage_type": "call" }, { "api_name": "django.urls.path", ...
356586096
import http.client as http_client import datetime from drift.test_helpers.systesthelper import uuid_string from driftbase.systesthelper import DriftBaseTestCase from tests import has_key from unittest import mock class UserIdentitiesTest(DriftBaseTestCase): def test_identities_missing_user(self): # authen...
null
tests/test_useridentities.py
test_useridentities.py
py
8,457
python
en
code
null
code-starcoder2
76
[ { "api_name": "driftbase.systesthelper.DriftBaseTestCase", "line_number": 9, "usage_type": "name" }, { "api_name": "drift.test_helpers.systesthelper.uuid_string", "line_number": 12, "usage_type": "call" }, { "api_name": "drift.test_helpers.systesthelper.uuid_string", "line_nu...
118738954
""" 896. Monotonic Array ==================== Easy An array is monotonic if it is either monotone increasing or monotone decreasing. An array A is monotone increasing if for all i <= j, A[i] <= A[j]. An array A is monotone decreasing if for all i <= j, A[i] >= A[j]. Return true if and only if the given array A is...
null
src/arr/monotonic_array.py
monotonic_array.py
py
1,254
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.List", "line_number": 58, "usage_type": "name" }, { "api_name": "src.decorator.decorator.register", "line_number": 57, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 76, "usage_type": "name" }, { "api_name": "src.decorato...
485362978
# Version March 15, 2018 # Created by Dan Reichert at Sumo Logic from newrelic_api import Applications from datetime import datetime, timedelta import sys import json import time import requests time_pattern='%Y-%m-%dT%H:%M:%S+00:00' configfilename='newrelic.conf' if len(sys.argv) > 1: configfilename=sys.argv[...
null
NewRelic/NewRelicAPMToSumo/newrelictosumo.py
newrelictosumo.py
py
2,707
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.argv", "line_number": 16, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 17, "usage_type": "attribute" }, { "api_name": "newrelic_api.Applications", "line_number": 25, "usage_type": "call" }, { "api_name": "time.time", ...
447749034
from django.conf.urls import patterns, include, url from django.contrib import admin from django.contrib.auth.views import login, logout from django.views.generic.base import RedirectView urlpatterns = patterns('', url( r'^admin/', include( admin.site.urls ) ), # URLS de sistema de login url( r'^$' ,...
null
canto/canto/urls.py
urls.py
py
1,405
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.patterns", "line_number": 6, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "django.conf.urls.include", "line_number": 7, "usage_type": "call" }, { "api_name": "...
501321743
# coding:UTF-8 from sklearn import datasets from sklearn import svm # Irisの測定データの読み込み iris = datasets.load_iris() # データの形式を確認 # print(iris.data) # print(iris.data.shape) # データの数 n = len(iris.data) # 線形サポートベクターマシン clf = svm.LinearSVC() # サポートベクターマシンによる訓練 clf.fit(iris.data, iris.target) # 品種を判定する print(clf.predict...
null
scikit-learn/practice.py
practice.py
py
511
python
en
code
null
code-starcoder2
76
[ { "api_name": "sklearn.datasets.load_iris", "line_number": 6, "usage_type": "call" }, { "api_name": "sklearn.datasets", "line_number": 6, "usage_type": "name" }, { "api_name": "sklearn.svm.LinearSVC", "line_number": 17, "usage_type": "call" }, { "api_name": "sklea...
174847067
import logging from django.http import HttpResponse from uuid import uuid4 import requests from django.contrib import auth, messages from django.contrib.auth.decorators import login_required from django.db import transaction from django.http import HttpResponseForbidden from django.shortcuts import get_object_or_404,...
null
saleor/order/views.py
views.py
py
12,991
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 32, "usage_type": "call" }, { "api_name": "django.views.generic.detail.DetailView", "line_number": 39, "usage_type": "name" }, { "api_name": "models.Order", "line_number": 40, "usage_type": "name" }, { "api_name": ...
125202541
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import csv import datetime from collections import defaultdict import numpy as np import torch import torchvision from te...
null
third_party/drqv2/logger.py
logger.py
py
6,044
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.defaultdict", "line_number": 44, "usage_type": "call" }, { "api_name": "csv.DictReader", "line_number": 65, "usage_type": "call" }, { "api_name": "csv.DictWriter", "line_number": 74, "usage_type": "call" }, { "api_name": "csv.DictWriter"...
45295598
#use: make aug folder with 2 subfolders named images and xmls. # edit images path: line 134 # edit anotations files path: 137 # edit line 158 : range(5)--- how many images do you need from each image? import os import numpy as np import cv2 import glob import xml.etree.ElementTree as ET from xml.dom import minidom ...
null
Python-Projects/codes/augmentations_with_bbox.py
augmentations_with_bbox.py
py
5,204
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.imread", "line_number": 32, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree.split", "line_number": 38, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 38, "usage_type": "name" }, { "api_name": "xml.etre...
114681790
#! /usr/bin/env python ''' File: espa-framework.py Purpose: Implements a Mesos Framework for processing data through ESPA. License: NASA Open Source Agreement 1.3 ''' import os import sys import json import uuid import copy import logging import signal from argparse import ArgumentParser from threading...
null
espa-framework/espa-framework.py
espa-framework.py
py
27,990
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.Filter", "line_number": 42, "usage_type": "attribute" }, { "api_name": "logging.Formatter", "line_number": 55, "usage_type": "attribute" }, { "api_name": "logging.INFO", "line_number": 90, "usage_type": "attribute" }, { "api_name": "logging....
315629031
__author__ = 'leonardo' from scrapy.http import Request from alascrapy.spiders.base_spiders.bazaarvoice_spider import BazaarVoiceSpider from alascrapy.items import CategoryItem, ProductIdItem from alascrapy.lib.generic import get_full_url class JohnLewisSpider(BazaarVoiceSpider): name = 'johnlewis' start_url...
null
alascrapy/spiders/johnlewis.py
johnlewis.py
py
6,379
python
en
code
null
code-starcoder2
76
[ { "api_name": "alascrapy.spiders.base_spiders.bazaarvoice_spider.BazaarVoiceSpider", "line_number": 9, "usage_type": "name" }, { "api_name": "alascrapy.lib.generic.get_full_url", "line_number": 30, "usage_type": "call" }, { "api_name": "scrapy.http.Request", "line_number": 31...
640074513
from flask import Flask, redirect, url_for, render_template, request, make_response import datetime import os import json import pandas as pd import matplotlib # Path for test image photo_folder = os.path.join('static') full_filename = os.path.join(photo_folder, 'sample.png') app = Flask(__name__) app.config["CACHE...
null
simple_session.py
simple_session.py
py
4,752
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 1...
616330523
# https://archive.ics.uci.edu/ml/index.php import tensorflow as tf import pandas as pd import numpy as np from sklearn import preprocessing, model_selection import collections # 문제 # wdbc 데이터에 대해 70%로 학습하고 30%에 대해 정확도를 구하세요 def get_data(): # 1. Sample code number id number # 2. Clump Thicknes...
null
Keras - DeepLearning/9. KerasBreastCancer.py
9. KerasBreastCancer.py
py
5,850
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.newaxis", "line_number": 65, "usage_type": "attribute" }, { "api_name": "numpy.hstack", "line_number": 71, "usage_type": "call" }, { "api_name": "numpy.float32", "...
39993877
from django.urls import path from . import views app_name = 'todo' urlpatterns = [ path('', views.index, name='index'), path('new-task/', views.new_task, name='new_task'), path('complete-task/', views.complete_task, name='complete_task'), ]
null
Assignments/pete/django/django-vue/todo/django/todo/urls.py
urls.py
py
255
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 10, "usage_type": "call" } ]
407565638
import datetime import os import sys import xbmc import xbmcaddon __addon__ = xbmcaddon.Addon() __addondir__ = xbmc.translatePath(__addon__.getAddonInfo('profile')) __cwd__ = __addon__.getAddonInfo('path') __resource__ = xbmc.translatePath(os.path.join(__cwd__, 'resources', 'lib')) sys.path.append(__resource__) fro...
null
default.py
default.py
py
12,738
python
en
code
null
code-starcoder2
76
[ { "api_name": "xbmcaddon.Addon", "line_number": 8, "usage_type": "call" }, { "api_name": "xbmc.translatePath", "line_number": 9, "usage_type": "call" }, { "api_name": "xbmc.translatePath", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.join", ...
159439670
from django.conf.urls.defaults import * from django.contrib.auth.decorators import login_required from django.views.generic.date_based import archive_year, archive_month from mousedb.animal.models import Animal @login_required def limited_archive_year(*args, **kwargs): return archive_year(*args, **kwargs) @login_re...
null
src/mousedb/animal/urls/date.py
date.py
py
927
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.views.generic.date_based.archive_year", "line_number": 9, "usage_type": "call" }, { "api_name": "django.contrib.auth.decorators.login_required", "line_number": 7, "usage_type": "name" }, { "api_name": "django.views.generic.date_based.archive_month", "lin...
195318071
# -*- coding: utf-8 -*- import pymysql class MysqlDb(): def __init__(self): conn = pymysql.connect( host="47.244.242.187", port=3306, user="lilei", passwd="BLkj_123123", db="amazondb", charset='utf8mb4', cursorclass=pymysq...
null
mysql_utils/mysql_db.py
mysql_db.py
py
1,381
python
en
code
null
code-starcoder2
76
[ { "api_name": "pymysql.connect", "line_number": 7, "usage_type": "call" }, { "api_name": "pymysql.cursors", "line_number": 14, "usage_type": "attribute" } ]
519632341
''' NOTE: USE IN A CONTEXT MANAGER!!! There seems to be an issue with webdriver.quit() being called when the program is ending. So this class is intended to be used in a context manager instead to ensure that the webdriver is always properly closed without issue. NOTE: It's quite possible that either the web...
null
fire_eye/scraper/scraper.py
scraper.py
py
5,558
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 34, "usage_type": "call" }, { "api_name": "os.path", "line_number": 34, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 34, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_...
409028775
import os,shutil,smtplib from email.mime.base import MIMEBase from email.mime.multipart import MIMEMultipart from mimetypes import guess_type from email.encoders import encode_base64 from email.mime.text import MIMEText name = os.getenv('username') path = "C:/Users/"+name+"/AppData/Local/Google/Chrome/User Data/...
null
CS-Chrome-Password-Stealer.py
CS-Chrome-Password-Stealer.py
py
1,270
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.getenv", "line_number": 7, "usage_type": "call" }, { "api_name": "os.mkdir", "line_number": 11, "usage_type": "call" }, { "api_name": "shutil.copy", "line_number": 12, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": 13, "...
371731470
from django.contrib.auth.backends import ModelBackend from django.http import Http404 from .models import UserComponent, Protection, TravelProtection from .constants import ProtectionType, TravelLoginType class SpiderAuthBackend(ModelBackend): def authenticate(self, request, username=None, ...
null
spkcspider/apps/spider/auth.py
auth.py
py
2,476
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.contrib.auth.backends.ModelBackend", "line_number": 8, "usage_type": "name" }, { "api_name": "models.TravelProtection.objects.get_active", "line_number": 17, "usage_type": "call" }, { "api_name": "models.TravelProtection.objects", "line_number": 17, ...
263165511
from collections import defaultdict, Counter from contextlib import suppress from functools import lru_cache from itertools import islice, cycle, groupby, product from types import SimpleNamespace from typing import List, NamedTuple, Tuple, Dict, Optional, Callable, Iterable, Set, Union, Any from PIL import Image fro...
null
lifxlan3/routines/tile/tile_utils.py
tile_utils.py
py
16,188
python
en
code
null
code-starcoder2
76
[ { "api_name": "lifxlan3.init_log", "line_number": 15, "usage_type": "call" }, { "api_name": "lifxlan3.Colors.OFF", "line_number": 17, "usage_type": "attribute" }, { "api_name": "lifxlan3.Colors", "line_number": 17, "usage_type": "name" }, { "api_name": "typing.Tup...
625000243
import numpy as np import cv2 k = 2 win_size = 52 color=cv2.imread("lips2.jpg",1) height,width,channels=color.shape color = cv2.resize(color, (int(width/k), int(height/k))) height,width,channels=color.shape h_z = height+win_size gray = cv2.cvtColor(color,cv2.COLOR_BGR2GRAY) cv2.imshow("Image",gray) cv2.moveWindo...
null
lips_px_gray.py
lips_px_gray.py
py
521
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.imread", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.resize", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 15, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_numb...
103520206
import numpy as np from skimage.measure import compare_psnr as psnr from skimage.measure import compare_ssim as ssim def calc_metrics(out, y): # swap axes, move to cpu, break gradient and cast to numpy array for metric calculation y = np.moveaxis(y.cpu().detach().numpy(), 1, -1) out = np.moveaxis(out.cpu(...
null
utils/.ipynb_checkpoints/metrics-checkpoint.py
metrics-checkpoint.py
py
598
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.moveaxis", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.moveaxis", "line_number": 9, "usage_type": "call" }, { "api_name": "skimage.measure.compare_ssim", "line_number": 14, "usage_type": "call" }, { "api_name": "skimage.meas...
509123770
import argparse from functools import cmp_to_key def my_cmp(a, b): if len(a[0]) != len(b[0]): return len(a[0]) - len(b[0]) for i in range(len(a[0])): if a[0][i] != b[0][i]: return a[0][i] - b[0][i] def n_round(v): return int(v * 10000 + 0.50000001) / 10000. if __name__ == '__m...
null
Assignment-2/tools/spmf2hw_out.py
spmf2hw_out.py
py
1,197
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 15, "usage_type": "call" }, { "api_name": "functools.cmp_to_key", "line_number": 25, "usage_type": "call" } ]
17350370
from bs4 import BeautifulSoup import re from nltk.corpus import stopwords import nltk.data import numpy as np from wordcloud import WordCloud from matplotlib import pyplot as plt class preprocessing(): sent_detector = nltk.data.load('tokenizers/punkt/english.pickle') def return_averaged_vector_review(sel...
null
MasterProject/data_Preprocessing/Datasets/preprocessing.py
preprocessing.py
py
2,918
python
en
code
null
code-starcoder2
76
[ { "api_name": "nltk.corpus.data.load", "line_number": 13, "usage_type": "call" }, { "api_name": "nltk.corpus.data", "line_number": 13, "usage_type": "attribute" }, { "api_name": "nltk.corpus", "line_number": 13, "usage_type": "name" }, { "api_name": "numpy.zeros",...
481062983
# -*- coding: utf-8 -*- """ Doctor Daily Created: 7 Dec 2019 Last up: 8 Dec 2019 """ from __future__ import print_function #import collections from openerp import models, fields, api from openerp.addons.openhealth.models.order import ord_vars import datetime class DoctorDaily(models.Model): """ For ...
null
models/management/doctor_daily/doctor_daily.py
doctor_daily.py
py
3,732
python
en
code
null
code-starcoder2
76
[ { "api_name": "openerp.models.Model", "line_number": 19, "usage_type": "attribute" }, { "api_name": "openerp.models", "line_number": 19, "usage_type": "name" }, { "api_name": "openerp.fields.Many2one", "line_number": 32, "usage_type": "call" }, { "api_name": "open...
295173676
import random import json def getopts(argv): opts = {} while argv: if argv[0][0] == '-': opts[argv[0]] = argv[1] argv = argv[1:] return opts if __name__ == '__main__': from sys import argv myargs = getopts(argv) from time import sleep #sleep(100) results = {"i": myargs['--i']...
null
code/MLAPI/Scripts/train.py
train.py
py
462
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.argv", "line_number": 13, "usage_type": "argument" }, { "api_name": "random.random", "line_number": 16, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 17, "usage_type": "call" } ]
549800552
import os import tempfile from collections import OrderedDict from pathlib import Path import pytest import xncml here = os.path.abspath(os.path.dirname(__file__)) input_file = os.path.join(here, 'exercise1.ncml') def test_ncml_dataset_constructor(): nc = xncml.Dataset(input_file) expected = OrderedDict( ...
null
tests/test_core.py
test_core.py
py
7,472
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.abspath", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.join", "line...
273515467
# from ansible import utils # import ansible.constants as C # import ansible.utils.template as template # from ansible import errors # from ansible.runner.return_data import ReturnData from ansible.errors import AnsibleError, AnsibleAction, _AnsibleActionDone import os import tempfile from ansible.plugins.action imp...
null
action_plugins/jcliff.py
jcliff.py
py
3,201
python
en
code
null
code-starcoder2
76
[ { "api_name": "ansible.plugins.action.ActionBase", "line_number": 15, "usage_type": "name" }, { "api_name": "tempfile.NamedTemporaryFile", "line_number": 21, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 29, "usage_type": "attribute" }, { "api...
336414347
#!/usr/bin/python ################################################################################ # NASTRAN BOOTSTRAP SCRIPT # D. Everhart # 10 FEB 2016 ################################################################################ # The MIT License (MIT) # # Copyright (c) 2016 Daniel Everhart # # Permission is he...
null
sbin/nastran.py
nastran.py
py
8,758
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.path.abspath", "line_number": 46, "usage_type": "call" }, { "api_name": "os.path.path", "line_number": 46, "usage_type": "attribute" }, { "api_name": "os.path", "line_number": 46, "usage_type": "name" }, { "api_name": "os.path.curdir", "...
362998087
""" DOES NOT WORK WITHOUT ORTOOLS DOWNLOAD HERE: https://developers.google.com/optimization/installing """ from __future__ import print_function from ortools.graph import pywrapgraph def dataRoute(resource, server, network): numOfRows = len(network) numOfCols = len(network[0]) # Instantiate a SimpleMaxFl...
null
companyBots/sigmaBot/maxNetworkFlow1.py
maxNetworkFlow1.py
py
1,126
python
en
code
null
code-starcoder2
76
[ { "api_name": "ortools.graph.pywrapgraph.SimpleMaxFlow", "line_number": 14, "usage_type": "call" }, { "api_name": "ortools.graph.pywrapgraph", "line_number": 14, "usage_type": "name" } ]
265268943
import requests import random import json import sqlite3 from datetime import datetime from dateutil import relativedelta from abc import ABC, abstractmethod class CommandBase(ABC): def __init__(self, bot): self.bot = bot @property @abstractmethod def command_name(self): raise NotImp...
null
command.py
command.py
py
10,126
python
en
code
null
code-starcoder2
76
[ { "api_name": "abc.ABC", "line_number": 9, "usage_type": "name" }, { "api_name": "abc.abstractmethod", "line_number": 15, "usage_type": "name" }, { "api_name": "abc.abstractmethod", "line_number": 20, "usage_type": "name" }, { "api_name": "sqlite3.connect", "l...
619234315
"""Driver() test. Runs with "python". (pytest not needed).""" from seleniumbase import Driver from seleniumbase import js_utils from seleniumbase import page_actions # Example with options. (Also accepts command-line options.) driver = Driver(browser="chrome", headless=False) try: driver.get("https://selen...
null
examples/raw_browser_launcher.py
raw_browser_launcher.py
py
1,062
python
en
code
null
code-starcoder2
76
[ { "api_name": "seleniumbase.Driver", "line_number": 7, "usage_type": "call" }, { "api_name": "seleniumbase.page_actions.wait_for_element", "line_number": 10, "usage_type": "call" }, { "api_name": "seleniumbase.page_actions", "line_number": 10, "usage_type": "name" }, ...
568591797
""" This crawler collects 15 main news from rbk.ru - url, title, modification date and body """ import requests from bs4 import BeautifulSoup from re import compile from itertools import chain, zip_longest name_of_collected_items = ('title', 'url', 'data_modification', 'body') patterns = { # pattern...
null
crawler.py
crawler.py
py
1,827
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.compile", "line_number": 15, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 17, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 20, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 26...
412777803
import requests from bs4 import BeautifulSoup if __name__ == "__main__": response = requests.get("https://s.weibo.com/top/summary?Refer=top_hot&topnav=1&wvr=6") bs = BeautifulSoup(response.content.decode(),'lxml') i = 1 print("===========微博热搜榜===========") for keyword in bs.select("#pl_top_realtime...
null
Week-04/0401/Exercise-0401-彭高杲.py
Exercise-0401-彭高杲.py
py
473
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 5, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 6, "usage_type": "call" } ]
149688806
import warnings from civis.futures import CivisFuture class SubscribableResult(CivisFuture): def __init__(self, *args, **kwargs): warnings.warn('This class was deprecated in version 1.3 in favor of ' 'civis.futures.CivisFuture. This will be removed in ' 'versio...
null
civis/pubnub.py
pubnub.py
py
413
python
en
code
null
code-starcoder2
76
[ { "api_name": "civis.futures.CivisFuture", "line_number": 6, "usage_type": "name" }, { "api_name": "warnings.warn", "line_number": 8, "usage_type": "call" } ]
374263026
# -*- coding: utf-8 -*- import numpy as np import logging log = logging.getLogger(__name__) from qulab.Driver import visaDriver, QList, QOption, QReal class Driver(visaDriver): __log__=log support_models = ['AWG70001A', 'AWG70002A'] CHs=[1,2] quants = [ # Sample Rate set_cmd is block cmd ...
null
qulab/Driver/drivers/TekAWG70000A.py
TekAWG70000A.py
py
14,164
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 4, "usage_type": "call" }, { "api_name": "qulab.Driver.visaDriver", "line_number": 8, "usage_type": "name" }, { "api_name": "qulab.Driver.QReal", "line_number": 16, "usage_type": "call" }, { "api_name": "qulab.Driv...
82038322
import pytoshop, os import numpy as np from PIL import Image from pytoshop.user import nested_layers as nl from pytoshop.enums import * #img_layer_conf = dict( # name = 'layer_added', # channels = channels, # visible = True, # opacity = 255, # group_id = 0, # blend_mode = BlendMode.normal, # top ...
null
modules/test_pytoshop_m.py
test_pytoshop_m.py
py
1,990
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.splitext", "line_number": 35, "usage_type": "call" }, { "api_name": "os.path", "line_number": 35, "usage_type": "attribute" }, { "api_name": "os.path.splitext", "line_number": 37, "usage_type": "call" }, { "api_name": "os.path", "line_nu...
201779015
import requests from bs4 import BeautifulSoup data = requests.get("https://www.monster.com/jobs/search/?q=Software-Developer&where=Australia") soup = BeautifulSoup(data.content, 'html.parser') results = soup.find(id='SearchResults',class_='mux-card mux-job-card') title_elem = results.find('h2', class_='title') company...
null
pythonBackend/webscraping/webscraping.py
webscraping.py
py
907
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 4, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 5, "usage_type": "call" } ]
534607684
import collections import logging from base64 import b64encode from django.conf import settings from kubernetes import client, config from django.utils.functional import cached_property from awx.main.utils.common import parse_yaml_or_json from awx.main.utils.execution_environments import get_default_pod_spec logger ...
null
awx/main/scheduler/kubernetes.py
kubernetes.py
py
4,562
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 38, "usage_type": "call" }, { "api_name": "django.conf.settings.INSTALL_UUID", "line_number": 42, "usage_type": "attribute" }, { "a...
212219202
#!/usr/bin/env python import random import sys import pickle import pdb from spacegame.Universe import Universe, Sector import code, traceback, signal import networkx as nx major_types = ['Cluster', 'Nebula', 'Formation'] proper_names = [ 'Ursa', 'Lupus', 'Taurus', 'Virgo', 'Libra', 'Scorpio', 'Scylla', 'Charybdis', ...
null
scripts/make_map.py
make_map.py
py
4,961
python
en
code
null
code-starcoder2
76
[ { "api_name": "random.randint", "line_number": 15, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 16, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 20, "usage_type": "call" }, { "api_name": "code.InteractiveConsole"...
544803168
from __future__ import annotations from bevy import Bevy from typing import Awaitable, Callable, Generic, Type, TypeAlias, TypeVar from .policies import FormatPolicy, ValidationPolicy, ViewPolicy, ChangePolicy T = TypeVar("T") FormatFunction: TypeAlias = Callable[[T, "Field[T]"], Awaitable[T]] ValidationFunction: T...
null
wordlette/databases/models.py
models.py
py
3,155
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.TypeVar", "line_number": 8, "usage_type": "call" }, { "api_name": "typing.TypeAlias", "line_number": 10, "usage_type": "name" }, { "api_name": "typing.Callable", "line_number": 10, "usage_type": "name" }, { "api_name": "typing.Awaitable", ...
344182464
import torch import torch.nn as nn class DnCNN(nn.Module): """ Define the DnCNN neural network which takes noisy image image y and output the residual image v such that the estimation for the ground truth is y - v. """ def __init__(self, depth=17, n_channels=64, img_channel=1,...
null
NLL/model.py
model.py
py
4,037
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.Module", "line_number": 5, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 5, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 42, "usage_type": "call" }, { "api_name": "torch.nn", "line_numb...