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
23268605
import argparse import os import shutil import time import platform import torch from torch.autograd import Variable import torch.nn as nn import torch.backends.cudnn as cudnn import torchvision.datasets as datasets from taskonomy_losses import * from taskonomy_loader import TaskonomyLoader from apex.parallel impo...
null
train_taskonomy.py
train_taskonomy.py
py
26,764
python
en
code
null
code-starcoder2
76
[ { "api_name": "model_definitions.__dict__", "line_number": 33, "usage_type": "attribute" }, { "api_name": "model_definitions.__dict__", "line_number": 35, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 38, "usage_type": "call" }, ...
634517242
import collections from operator import attrgetter import pandas as pd import numpy as np from trtools.monkey import AttrProxy, AttrNameSpace class UserPandasObject(object): """ Base methods of a quasi pandas subclass. The general idea is that all methods from this class will wrap the o...
null
trtools/tools/composition.py
composition.py
py
6,379
python
en
code
null
code-starcoder2
76
[ { "api_name": "operator.attrgetter", "line_number": 74, "usage_type": "call" }, { "api_name": "trtools.monkey.AttrNameSpace", "line_number": 86, "usage_type": "argument" }, { "api_name": "trtools.monkey.AttrProxy", "line_number": 90, "usage_type": "call" }, { "api...
59415856
""" Investigate an email with a suspicious file attachment detected by Splunk Enterprise Security. Detonate the file attachment in a sandbox, gather network behavior from the sandbox results, and pivot on those network indicators with both external reputation queries and internal Splunk Common Information Model searche...
null
suspicious_email_attachment_investigate_and_delete.py
suspicious_email_attachment_investigate_and_delete.py
py
29,354
python
en
code
null
code-starcoder2
76
[ { "api_name": "phantom.rules.debug", "line_number": 17, "usage_type": "call" }, { "api_name": "phantom.rules", "line_number": 17, "usage_type": "name" }, { "api_name": "phantom.rules.debug", "line_number": 28, "usage_type": "call" }, { "api_name": "phantom.rules",...
432512893
import cv2 img = cv2.imread('../20.jpg') print('') w = 128 h = 128 y = int(img.shape[0] / 2) x = int(img.shape[1] / 2) resize = cv2.resize(img, (w, h)) crop = img[y:y + h, x:x + w] cv2.imshow("img", img) cv2.imshow("resize", resize) cv2.imshow("crop", crop) cv2.waitKey(0)
null
scripts/test.py
test.py
py
277
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.imread", "line_number": 3, "usage_type": "call" }, { "api_name": "cv2.resize", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 14, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 15, ...
338629695
#!/usr/bin/env python # Examples from Cisco Live Preso # https://www.ciscolive.com/c/dam/r/ciscolive/us/docs/2020/pdf/DGTL-BRKPRG-2432.pdf ''' Example 2 ''' # Create a Login HANDLE and Login from ucsmsdk.ucshandle import UcsHandle HANDLE = UcsHandle("172.16.125.2", "ucspe", "ucspe" ) HANDLE.login() # Print HANDLE '...
null
ucs_ex2_dump_xml.py
ucs_ex2_dump_xml.py
py
898
python
en
code
null
code-starcoder2
76
[ { "api_name": "ucsmsdk.ucshandle.UcsHandle", "line_number": 10, "usage_type": "call" } ]
334198426
# -*- coding: utf-8 -*- # 스케줄 종류에는 여러가지가 있는데 대표적으로 BlockingScheduler, BackgroundScheduler 입니다 # BlockingScheduler 는 단일수행에, BackgroundScheduler은 다수 수행에 사용됩니다. # 여기서는 BackgroundScheduler 를 사용하겠습니다. from apscheduler.schedulers.background import BackgroundScheduler from apscheduler.jobstores.base import JobLookupError ...
null
prediction/(backup)prediction/Model_test.py
Model_test.py
py
7,754
python
en
code
null
code-starcoder2
76
[ { "api_name": "apscheduler.schedulers.background.BackgroundScheduler", "line_number": 22, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 28, "usage_type": "call" }, { "api_name": "time.localtime", "line_number": 30, "usage_type": "call" }, { "a...
9871200
import uuid import numpy as np import math from datetime import datetime, timedelta def main(): """ This saves lines of log in the csv file. :return: a csv file """ gen_logs = make_multiple_cid_logs(1000, '2015-01-01', '2015-02-28', 2, .1) with open('./fake_logs.csv', 'w') as f: for ge...
null
gen_logs.py
gen_logs.py
py
3,189
python
en
code
null
code-starcoder2
76
[ { "api_name": "uuid.uuid4", "line_number": 42, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 53, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 53, "usage_type": "name" }, { "api_name": "datetime.date...
113890871
from discord.ext import commands as discord_commands from discord.ext.commands import Bot from discord import Activity, ActivityType class BastionBot(Bot): def __init__(self, config, *args, **kwargs): self.token = config['client']['token'] self.config = config super().__init__(*args, **kw...
null
bastion/__init__.py
__init__.py
py
1,125
python
en
code
null
code-starcoder2
76
[ { "api_name": "discord.ext.commands.Bot", "line_number": 6, "usage_type": "name" }, { "api_name": "discord.Activity", "line_number": 15, "usage_type": "call" }, { "api_name": "discord.ActivityType.playing", "line_number": 15, "usage_type": "attribute" }, { "api_na...
296783094
#!/usr/bin/env python # filename: orangejuice/utils/umeng.py import os import configparser import requests class UmengHandler: """ This class try to get statistic data from umeng """ def __init__(self, section_name='UMENG_CONFIG', file_name='orangejuice.conf'): # build con...
null
orangejuice/utils/umeng.py
umeng.py
py
4,669
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.split", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 19, "usage_type": "call" }, { "api_name": "configparser.ConfigParser"...
640238628
import cv2 import os from os.path import isfile, join import re from spinner import Spinner def read_png_to_video(read_dir, vid_path, fps): if not os.path.exists(read_dir): raise Exception(read_dir+'does not exist!') files = [f for f in os.listdir(read_dir) if isfile(join(read_dir, f))] if len(f...
null
pngtovideo.py
pngtovideo.py
py
1,179
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.exists", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_num...
516729577
import requests from urllib.parse import urljoin from datetime import datetime class IndianKanoon: """ Search query https://api.indiankanoon.org/search/?formInput=<query>&pagenum=<pagenum> Document https://api.indiankanoon.org/doc/<docid>/ Document fragments https://api.indiankanoon.org/docfragment/<doci...
null
scraper/kanoon/indianKanoon.py
indianKanoon.py
py
2,085
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.Session", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 34, "usage_type": "argument" }, { "api_name": "datetime.datetime", "line_number": 38, "usage_type": "argument" }, { "api_name": "urllib.p...
326691095
#! /usr/bin/python import cv2 import sys from ann.train import train from ann.test import test def main(): if len(sys.argv) < 2: print('Please specify your option [test/train]') return 1 emotions = ['NEUTRAL', 'HAPPY', 'SAD', 'SURPRISED'] if sys.argv[1] == 'train': train(emo...
null
main.py
main.py
py
1,086
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.argv", "line_number": 11, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 19, "usage_type": "attribute" }, { "api_name": "ann.train.train", "line_number": 21, "usage_type": "call" }, { "api_name": "sys.argv", "line_numb...
602584711
#!/usr/bin/python -tt # -*- coding: utf-8 -*- ################################################################################ # This is the confidential unpublished intellectual property of EMC Corporation, # and includes without limitation exclusive copyright and trade secret rights # of EMC throughout the world. ##...
null
hypervisor_test_model/utils.py
utils.py
py
5,916
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path.basename", "line_number": 61, "usage_type": "call" }, { "api_name": "os.path", "line_number": 61, "usage_type": "attribute" }, { "api_name": "os.path.splitext", ...
501442499
import shelve import threading from logging import getLogger from celery.events import EventReceiver from celery.events.state import State as EventsState from celery_worker.celery import app as capp from environment_settings import CELERY_UI_EVENTS_MAX_WORKERS, CELERY_UI_EVENTS_MAX_TASKS logger = getLogger() class...
null
celery_ui/events.py
events.py
py
1,461
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 14, "usage_type": "attribute" }, { "api_name": "threading.Thread.__init__", "line_number": 16, "usage_type": "call" }, { "api_name": "thr...
633432425
#!/usr/bin/env python from setuptools import setup, find_packages with open('README.md') as f: long_description = f.read() setup( name='skuid', version='1.0.0', description='Simple coding exercise for Skuid', long_description=long_description, author='Joshua Goodlett', author_email='josh...
null
setup.py
setup.py
py
935
python
en
code
null
code-starcoder2
76
[ { "api_name": "setuptools.setup", "line_number": 9, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 18, "usage_type": "call" } ]
207857732
from flask import Flask, request import json app = Flask(__name__) @app.route("/v1/subcenter", methods=["GET"]) def test(): tids = request.args.get("tids") return json.dumps({"errno": 10000, "errmsg": "", "data": {"uids": ["letv_23212413"]}}) app.run(host="0.0.0.0", port=5000)
null
notifyapi/ut/tsubcenter.py
tsubcenter.py
py
289
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "flask.request.args.get", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.request.args", "line_number": 8, "usage_type": "attribute" }, { "api_name": "flask.request...
614626035
""" Normal way: class Address: def __init__(self, name: str = "", line1: str = "", line2: str = "", city: str = "", state: str = "", zip_code: str = "" ): self.name: str = name self.line1: str = line1 self.line2: str = line2 se...
null
ScratchWork/classes_constructors_attributes.py
classes_constructors_attributes.py
py
1,740
python
en
code
null
code-starcoder2
76
[ { "api_name": "dataclasses.dataclass", "line_number": 23, "usage_type": "name" } ]
65732137
from functools import partial from typing import Any, Callable, Dict, List, Optional, Union import lvsfunc as lvf import vapoursynth as vs import vardefunc as vdf from lvsfunc.kernels import BicubicSharp, Kernel, Spline36 from lvsfunc.util import get_prop from vsutil import depth, get_w, get_y, iterate, join, plane f...
null
[OPMan]/Seasonals [TV]/2011-3 - Summer/[a8370] Kamisama no Memo-chou/project_module/filter.py
filter.py
py
10,007
python
en
code
null
code-starcoder2
76
[ { "api_name": "vapoursynth.core", "line_number": 13, "usage_type": "attribute" }, { "api_name": "vapoursynth.VideoNode", "line_number": 16, "usage_type": "attribute" }, { "api_name": "lvsfunc.kernels.Kernel", "line_number": 17, "usage_type": "name" }, { "api_name"...
184708683
import pygame from pygame.locals import * from OpenGL.GL import * from OpenGL.GLU import * from OpenGL.GLUT import * import ode import traceback import sys import warnings import scenes import games import players from graphics import render, init_graphics, lights, cameras, textures from math_classes.vectors import V...
null
rots/shadow_test.py
shadow_test.py
py
3,199
python
en
code
null
code-starcoder2
76
[ { "api_name": "physics_engine.physics.update_physics", "line_number": 35, "usage_type": "call" }, { "api_name": "physics_engine.physics", "line_number": 35, "usage_type": "name" }, { "api_name": "graphics.render.render_with_shadows", "line_number": 42, "usage_type": "call...
329144608
from pathlib import Path import logging import sys from astrosource.analyse import find_variable_stars, photometric_calculations, calibrated_photometry from astrosource.comparison import find_comparisons, find_comparisons_calibrated from astrosource.detrend import detrend_data from astrosource.eebls import plot_bls fr...
null
astrosource/astrosource.py
astrosource.py
py
5,379
python
en
code
null
code-starcoder2
76
[ { "api_name": "pathlib.Path", "line_number": 18, "usage_type": "call" }, { "api_name": "astrosource.utils.folder_setup", "line_number": 38, "usage_type": "call" }, { "api_name": "astrosource.utils.setup_logger", "line_number": 39, "usage_type": "call" }, { "api_na...
228972600
# -*- coding: utf-8 -*- """ Created on Fri Dec 20 11:24:16 2013 @author: ellen """ import numpy as np import matplotlib.pyplot as plt import ListUitpakken as get data = np.loadtxt('data2.csv', skiprows=1, delimiter=',').transpose() N = 41 # number of points in x direction M = 1 #...
null
ALLMEASUREMENTS/20140320/plotjes.py
plotjes.py
py
801
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.loadtxt", "line_number": 12, "usage_type": "call" }, { "api_name": "ListUitpakken.ReShape", "line_number": 18, "usage_type": "call" }, { "api_name": "ListUitpakken.ReShape", "line_number": 19, "usage_type": "call" }, { "api_name": "ListUitpakk...
402728904
import pandas as pd import time as _time import requests import numpy as np import datetime # from yahoo_finance_api import YahooFinance as yf class YahooFinance: def __init__(self, ticker, result_range='1mo', start=None, end=None, interval='15m', dropna=True): """ Return the stock data of the...
null
big_day.py
big_day.py
py
16,788
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.mktime", "line_number": 27, "usage_type": "call" }, { "api_name": "time.strptime", "line_number": 27, "usage_type": "call" }, { "api_name": "time.mktime", "line_number": 28, "usage_type": "call" }, { "api_name": "time.strptime", "line_numbe...
343491812
#!/usr/bin/env python # coding: utf-8 # In[98]: import numpy as np import pandas as pd from sklearn.ensemble import RandomForestClassifier from sklearn.metrics import confusion_matrix import numpy as np from sklearn.metrics import roc_curve, plot_roc_curve from sklearn.metrics import roc_auc_score from sklearn.metr...
null
exploration_and_model_finalized.py
exploration_and_model_finalized.py
py
15,706
python
en
code
null
code-starcoder2
76
[ { "api_name": "warnings.filterwarnings", "line_number": 35, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 46, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 61, "usage_type": "call" }, { "api_name": "pandas.concat...
306089999
#!/usr/bin/python # -*- coding: utf-8 -*- # # BallAndBrick # Copyright (C) 2017 Hitesh Agarwal # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (...
null
TestGame.py
TestGame.py
py
30,480
python
en
code
null
code-starcoder2
76
[ { "api_name": "gi.require_version", "line_number": 24, "usage_type": "call" }, { "api_name": "pygame.time.Clock", "line_number": 44, "usage_type": "call" }, { "api_name": "pygame.time", "line_number": 44, "usage_type": "attribute" }, { "api_name": "pygame.mixer.mu...
104641924
from marketplace import Marketplace import os import sqlite3 from logbook import NullHandler, Logger from six import with_metaclass, iteritems from abc import ABCMeta, abstractmethod from unittest import TestCase def bases_mro(bases): """ Yield classes in the order that methods should be looked up fr...
null
enigmampc/test.py
test.py
py
11,048
python
en
code
null
code-starcoder2
76
[ { "api_name": "six.iteritems", "line_number": 35, "usage_type": "call" }, { "api_name": "six.with_metaclass", "line_number": 64, "usage_type": "call" }, { "api_name": "abc.ABCMeta", "line_number": 64, "usage_type": "argument" }, { "api_name": "abc.abstractmethod",...
75148585
import os import sys import ctypes import serial.tools.list_ports from mlx90640 import * USB_VID = 1001 USB_PID = 32 def load_driver(): dev = MLX90640() cfp = os.path.dirname(os.path.realpath(__file__)) machine = 'windows' shared_lib_file = 'mlx90640_driver_evb9064x.dll' if os.environ.get('OS','...
null
evb9064x/evb9064x.py
evb9064x.py
py
2,457
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.dirname", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 14, "usage_type": "call" }, { "api_name": "os.environ.get", "l...
109706269
# -*- coding: utf-8 -*- """ Created on Thu Nov 19 19:32:47 2015 @author: cassis """ import raytracingpack as rt import numpy as np import matplotlib.pyplot as plt from matplotlib import gridspec ''' Teste do ray tracing a partir da comparação entre o parâmetro de raio de referência e o parâmetro de raio interpolado n...
null
python/ray_tracing/exemplo_raytracing.py
exemplo_raytracing.py
py
1,658
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.arange", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 18, "usage_type": "call" }, { "api_name": "raytracingpack.pp_raytracing", "line_number": 23, "usage_type": "call" }, { "api_name": "matplotlib.pyp...
502933390
import os from glob import glob import threading import multiprocessing import signal import sys from datetime import datetime from vectornet.preprocess import thinning import cairosvg from PIL import Image import io import xml.etree.ElementTree as et import matplotlib.pyplot as plt from vectornet.ops import * clas...
null
vectornet/data_kanji.py
data_kanji.py
py
14,051
python
en
code
null
code-starcoder2
76
[ { "api_name": "glob.glob", "line_number": 24, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 25, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 55, "usage_type": "call" }, { "api_name": "datetime.datetime", "li...
425447192
# -*- coding: utf-8 -*- """ Created on Sun Apr 15 18:33:00 2018 @author: User """ # Importing the Keras libraries and packages from keras.models import Sequential, Model from keras.layers import Convolution2D from keras.layers import MaxPooling2D from keras.layers import Flatten from keras.layers import Den...
null
Scripts/CNNGenerator.py
CNNGenerator.py
py
4,017
python
en
code
null
code-starcoder2
76
[ { "api_name": "keras.models.Sequential", "line_number": 26, "usage_type": "call" }, { "api_name": "keras.layers.Convolution2D", "line_number": 28, "usage_type": "call" }, { "api_name": "keras.layers.MaxPooling2D", "line_number": 29, "usage_type": "call" }, { "api_...
540004382
from django.shortcuts import render from .models import Student, StudentSerializer from rest_framework.response import Response from rest_framework import status from rest_framework.views import APIView from course.models import CourseRecord from getid.views import session2openid class StudentList(APIView): def ge...
null
onlineClasses/student/views.py
views.py
py
1,857
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.views.APIView", "line_number": 9, "usage_type": "name" }, { "api_name": "models.Student.objects.all", "line_number": 11, "usage_type": "call" }, { "api_name": "models.Student.objects", "line_number": 11, "usage_type": "attribute" }, { ...
244884172
from uuid import UUID from aiohttp import web from pb_admin_api.models.paste import PasteSchema schema = PasteSchema() class PasteView(web.View): async def delete(request): result = await request.app['db'].pastes.delete_one( { '_id': UUID(request.match_info['id']).hex ...
null
pb_admin_api/views/paste.py
paste.py
py
449
python
en
code
null
code-starcoder2
76
[ { "api_name": "pb_admin_api.models.paste.PasteSchema", "line_number": 7, "usage_type": "call" }, { "api_name": "aiohttp.web.View", "line_number": 10, "usage_type": "attribute" }, { "api_name": "aiohttp.web", "line_number": 10, "usage_type": "name" }, { "api_name":...
594358758
from fastapi import APIRouter, Response, status import subprocess import os import json from datetime import datetime from gamechangerml.src.utilities import utils from gamechangerml.api.fastapi.model_config import Config from gamechangerml.api.fastapi.version import __version__ from gamechangerml.api.fastapi.settings ...
null
gamechangerml/api/fastapi/routers/controls.py
controls.py
py
11,337
python
en
code
null
code-starcoder2
76
[ { "api_name": "fastapi.APIRouter", "line_number": 16, "usage_type": "call" }, { "api_name": "gamechangerml.api.fastapi.model_loader.ModelLoader", "line_number": 17, "usage_type": "call" }, { "api_name": "gamechangerml.api.fastapi.version.__version__", "line_number": 27, "...
425051712
# coding: utf-8 from __future__ import unicode_literals import re import json from collections import OrderedDict from .common import InfoExtractor class AnimevostIE(InfoExtractor): _TESTS = [{ 'url': 'https://animevost.org/tip/tv/1864-renai-boukun.html', 'info_dict': { 'title': 'Л...
null
youtube_dl/extractor/animevost.py
animevost.py
py
3,655
python
en
code
null
code-starcoder2
76
[ { "api_name": "common.InfoExtractor", "line_number": 13, "usage_type": "name" }, { "api_name": "re.UNICODE", "line_number": 61, "usage_type": "attribute" }, { "api_name": "re.UNICODE", "line_number": 65, "usage_type": "attribute" }, { "api_name": "re.UNICODE", ...
184506736
from django.contrib.auth.models import User from django.shortcuts import render # Create your views here. from django.contrib import messages from django.contrib.auth import authenticate, login, logout from django.contrib.auth.decorators import login_required from django.shortcuts import redirect, render from django....
null
account/views.py
views.py
py
2,627
python
en
code
null
code-starcoder2
76
[ { "api_name": "forms.SignUpForm", "line_number": 26, "usage_type": "call" }, { "api_name": "django.shortcuts.redirect", "line_number": 29, "usage_type": "call" }, { "api_name": "forms.SignUpForm", "line_number": 31, "usage_type": "call" }, { "api_name": "django.sh...
44253146
from unittest import TestCase, mock from parameterized import parameterized from src.CSVDataTable import CSVDataTable from tests.unit_tests import logger_load, data_dir, t_load # Testing Methodology Used # 1. For Find Methods: Tested on testing CSV data # 2. For Load & Save Methods: Tested on actual CSV data # 3. F...
null
HW_Assignments/HW1_Template/tests/test_CSVDataTable.py
test_CSVDataTable.py
py
13,554
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 16, "usage_type": "name" }, { "api_name": "tests.unit_tests.logger_load", "line_number": 21, "usage_type": "call" }, { "api_name": "tests.unit_tests.t_load", "line_number": 22, "usage_type": "call" }, { "api_name":...
63036278
# -*- coding: utf-8 -*- from __future__ import absolute_import import datetime import hashlib import json import logging import os import random import re import time # handle python 2 and python 3 imports try: from urllib.parse import urlencode import html.parser as htmlparser except ImportError: from ur...
null
src/imdbpie/imdbpie.py
imdbpie.py
py
24,539
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 24, "usage_type": "call" }, { "api_name": "hashlib.sha1", "line_number": 28, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 61, "usage_type": "attribute" }, { "api_name": "time.mktime", "...
448075062
""" Check database if box needs to be done or not Script example to put selfcal in progress status for box 21: python db_update.py --box=21 --selfcal_inprogress Script example to check selfcal and extract status for box 12: python db_update.py --box=12 --check_selfcal --check_extract Use following status: * DONE -->...
null
database/db_update.py
db_update.py
py
2,813
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 22, "usage_type": "call" }, { "api_name": "recalibration_db.SurveysDB", "line_number": 35, "usage_type": "call" } ]
54148750
import urllib.request, urllib.parse, urllib.error import xml.etree.ElementTree as ET import ssl ctx = ssl.create_default_context() ctx.check_hostname = False ctx.verify_mode = ssl.CERT_NONE address = input('Enter location: ') #URL: http://py4e-data.dr-chuck.net/comments_42.xml #URL: http://py4e-data.dr-chuck.net/comm...
null
Web Services/XML.py
XML.py
py
743
python
en
code
null
code-starcoder2
76
[ { "api_name": "ssl.create_default_context", "line_number": 5, "usage_type": "call" }, { "api_name": "ssl.CERT_NONE", "line_number": 7, "usage_type": "attribute" }, { "api_name": "urllib.request.request.urlopen", "line_number": 13, "usage_type": "call" }, { "api_na...
642211490
# Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html # For details: https://github.com/PyCQA/astroid/blob/master/LICENSE """Transform utilities (filters and decorator)""" import itertools import wrapt # pylint: disable=dangerous-default-value from astroid.exceptions import Inference...
null
proyecto1/ambiente1/ambiente1/Lib/site-packages/astroid/inference_tip.py
inference_tip.py
py
2,317
python
en
code
null
code-starcoder2
76
[ { "api_name": "itertools.tee", "line_number": 23, "usage_type": "call" }, { "api_name": "wrapt.decorator", "line_number": 14, "usage_type": "attribute" }, { "api_name": "astroid.exceptions.InferenceOverwriteError", "line_number": 59, "usage_type": "call" } ]
271650205
import sys import pygame from bullet import Bullet from zombie import Zombie from time import sleep def check_events(ai_settings,screen,tower,bullets): #检查游戏事件 for event in pygame.event.get(): if event.type==pygame.QUIT: sys.exit() elif event.type==pygame.KEYDOWN: if event....
null
塔防/game_function.py
game_function.py
py
2,151
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.event.get", "line_number": 9, "usage_type": "call" }, { "api_name": "pygame.event", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pygame.QUIT", "line_number": 10, "usage_type": "attribute" }, { "api_name": "sys.exit", "lin...
294628569
import config import hashlib import boto3 import base64 from enum import Enum import re from sqlalchemy import func import boto3 import json import traceback s3 = boto3.client('s3') hash_md5 = hashlib.md5() # s3 = boto3.client( # 's3', # aws_access_key_id=config.AWS_ID, # aws_secret_access_key=config.AWS_...
null
bondback/helpers.py
helpers.py
py
3,582
python
en
code
null
code-starcoder2
76
[ { "api_name": "boto3.client", "line_number": 12, "usage_type": "call" }, { "api_name": "hashlib.md5", "line_number": 13, "usage_type": "call" }, { "api_name": "config.SECRET_SALT", "line_number": 27, "usage_type": "attribute" }, { "api_name": "base64.b64decode", ...
247752595
# coding: utf-8 import copy import logging import tools import define from define import TOKEN_HOUSE_CORE from zbase.base.dbpool import get_connection_exception from zbase.web.validator import T_INT, T_STR log = logging.getLogger() class Questions: TABLE = 'questions' TABLE_ID = 'id' MUST_KEY = { ...
null
questions.py
questions.py
py
7,470
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "zbase.web.validator.T_INT", "line_number": 20, "usage_type": "name" }, { "api_name": "zbase.web.validator.T_STR", "line_number": 21, "usage_type": "name" }, { "api_name": ...
2737941
# -*- coding: utf-8 -*- import locale import logging from django.conf import settings from django.contrib.auth.models import Group from apps.authentication.models import OnlineUser as User from apps.mommy import Task, schedule class SynchronizeGroups(Task): @staticmethod def run(): logger = logging....
null
apps/authentication/mommy.py
mommy.py
py
4,441
python
en
code
null
code-starcoder2
76
[ { "api_name": "apps.mommy.Task", "line_number": 11, "usage_type": "name" }, { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "locale.setlocale", "line_number": 16, "usage_type": "call" }, { "api_name": "locale.LC_ALL", ...
330751998
# import the necessary packages import cv2 import time import imutils # CONSTANTS total_time = 300 W = 320 # Width of the images taken by the camera H = 240 # Height of the images taken by the camera if __name__ == "__main__": version = 4 # Cameras Initialization cameras = [] print("[INFO] Opening ...
null
demo/take_images.py
take_images.py
py
1,716
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.VideoCapture", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.CAP_PROP_FOURCC", "line_number": 20, "usage_type": "attribute" }, { "api_name": "cv2.VideoWriter_fourcc", "line_number": 20, "usage_type": "call" }, { "api_name": "cv2....
236101324
from tensorflow.examples.tutorials.mnist import input_data import tensorflow as tf import pandas as pd import numpy as np import sklearn.cross_validation as skcv import csv flags = tf.app.flags FLAGS = flags.FLAGS flags.DEFINE_string('data_dir', '/tmp/data/', 'Directory for storing data') training_iters = 200000 bat...
null
Project4/project4.py
project4.py
py
4,676
python
en
code
null
code-starcoder2
76
[ { "api_name": "tensorflow.app", "line_number": 9, "usage_type": "attribute" }, { "api_name": "csv.writer", "line_number": 21, "usage_type": "call" }, { "api_name": "tensorflow.truncated_normal", "line_number": 34, "usage_type": "call" }, { "api_name": "tensorflow....
302545439
# %load q01_plot_deliveries_by_team/build.py import pandas as pd import numpy as np import matplotlib.pyplot as plt ipl_df = pd.read_csv('data/ipl_dataset.csv', index_col=None) ipl_df.head(2) #print(ipl_df['batting_team']) # Solution def plot_deliveries_by_team(): iplGroupBy = ipl_df.groupby('batting_team').sum() ...
null
q01_plot_deliveries_by_team/build.py
build.py
py
598
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.bar", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 11, "usage_type": "name" }, { "api_name": "matplotlib.pyp...
68407321
def emit_event(event_type, event_data, user=None, note=None, uid=None): from events.models import Event defaults = { 'user': user, 'event_note': note, 'event_type': event_type, 'event_data': event_data, } if uid is None: Event.objects.create(**defaults) else...
null
events/__init__.py
__init__.py
py
389
python
en
code
null
code-starcoder2
76
[ { "api_name": "events.models.Event.objects.create", "line_number": 12, "usage_type": "call" }, { "api_name": "events.models.Event.objects", "line_number": 12, "usage_type": "attribute" }, { "api_name": "events.models.Event", "line_number": 12, "usage_type": "name" }, ...
105420412
# # Unity ML-Agents Toolkit from typing import Dict from collections import defaultdict from mlagents.trainers.optimizer.tf_optimizer import TFOptimizer from mlagents.trainers.buffer import AgentBuffer from mlagents.trainers.trainer import Trainer from mlagents.trainers.exception import UnityTrainerException from mlag...
null
ml-agents/mlagents/trainers/trainer/rl_trainer.py
rl_trainer.py
py
3,028
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.Dict", "line_number": 11, "usage_type": "name" }, { "api_name": "mlagents.trainers.components.reward_signals.RewardSignalResult", "line_number": 11, "usage_type": "name" }, { "api_name": "mlagents.trainers.trainer.Trainer", "line_number": 14, "usage_...
617571854
import requests import json import os import requests key = os.environ.get('rdtoken') def criarLead(cliente, pedido): url = "https://api.rd.services/platform/conversions?api_key="+key payload = json.dumps({ "event_type": "CONVERSION", "event_family": "CDP", "payload": { "conversion_identi...
null
clientflow/app/rd.py
rd.py
py
832
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ.get", "line_number": 6, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 6, "usage_type": "attribute" }, { "api_name": "json.dumps", "line_number": 11, "usage_type": "call" }, { "api_name": "requests.request", "line_...
93386189
import os import numpy as np import json from PIL import Image def normalization(I): ''' This function normalize picture in windows ''' I_norm = I.astype(float) * 2/ 255 - 1 I_norm = I_norm / np.sqrt(np.sum(I_norm * I_norm)) return I_norm def smaller(I, k): ''' This function reduce the...
null
run_predictions.py
run_predictions.py
py
6,111
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.sqrt", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.size", "line_number": 18,...
266607401
import datasets import time def test_load_fashion_product_small(): t0 = time.time() dataset = datasets.FashionProductSmall() print(dataset) count = 0 for i, d in enumerate(dataset): print(i, d) if d[0].size != (60, 80): count += 1 print(count) print(time.time()-...
null
submodules/datasets/tests/test_fashion.py
test_fashion.py
py
592
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.time", "line_number": 6, "usage_type": "call" }, { "api_name": "datasets.FashionProductSmall", "line_number": 7, "usage_type": "call" }, { "api_name": "time.time", "line_number": 15, "usage_type": "call" }, { "api_name": "datasets.FashionProduc...
389660160
#!/usr/bin/env python # coding=utf-8 #中译英 import json import nltk import numpy as np from nltk.translate import ibm1,AlignedSent,Alignment,PhraseTable,stack_decoder def translation_model_generation(): bilingual_text = [] english_file = open("english_tokens.json","r") english_text = english_file.read() ...
null
SMT.py
SMT.py
py
1,979
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.loads", "line_number": 15, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 18, "usage_type": "call" }, { "api_name": "nltk.translate.AlignedSent", "line_number": 20, "usage_type": "call" }, { "api_name": "nltk.translate.ibm1....
54416648
from js9 import j JSBASE = j.application.jsbase_get_class() class CodeDirs(JSBASE): def __init__(self): JSBASE.__init__(self) self.path = j.dirs.CODEDIR self.load() def load(self): data = j.core.state.stateGetFromDict("develop", "codedirs", "") self.tree = j.data.tre...
null
JumpScale9/tools/develop/CodeDirs.py
CodeDirs.py
py
5,548
python
en
code
null
code-starcoder2
76
[ { "api_name": "js9.j.application.jsbase_get_class", "line_number": 3, "usage_type": "call" }, { "api_name": "js9.j.application", "line_number": 3, "usage_type": "attribute" }, { "api_name": "js9.j", "line_number": 3, "usage_type": "name" }, { "api_name": "js9.j.di...
464553364
from jira import JIRA from tkinter import * from prettytable import PrettyTable class Extractor: def __init__(self, master): self.master = master self.jira = self.initialization() self.create_widgets() self.jql = None self.project_name = None self.compon...
null
main.py
main.py
py
2,801
python
en
code
null
code-starcoder2
76
[ { "api_name": "jira.JIRA", "line_number": 17, "usage_type": "call" }, { "api_name": "prettytable.PrettyTable", "line_number": 57, "usage_type": "call" } ]
578277142
# import required libraries import numpy as np import matplotlib.pyplot as plt import cv2 import math from numpy.core.numerictypes import maximum_sctype def regionOfInterest(img, vertices): mask = np.copy(img)*0 cv2.fillPoly(mask, vertices, 255) masked_image = cv2.bitwise_and(img,mask) return masked_i...
null
code/modelcam.py
modelcam.py
py
4,481
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.copy", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.fillPoly", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.bitwise_and", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_...
481694521
import os import sys import argparse import numpy as np import subprocess import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt sys.path.append('lib/') import analysis_utils as au import timeit from scipy.optimize import curve_fit import pickle as pk import h5_io as h5 import h5py import CythonModules...
null
Sigma_term_conn.py
Sigma_term_conn.py
py
39,650
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.use", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.path.append", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "numpy.sqrt", "line_numb...
336056196
#!/usr/bin/python import wsgiref.handlers import forbidden import login import notFound import ok from printUsers import getUserProfiles, countUserProfiles from cgi import parse_qs #import cgitb; cgitb.enable() __author__ = 'WS02admin' import genHTML def printAlphabetChooser(): return 'a' def printPage(environ, ...
null
browse.py
browse.py
py
1,898
python
en
code
null
code-starcoder2
76
[ { "api_name": "login.isLoggedIn", "line_number": 18, "usage_type": "call" }, { "api_name": "login.getLoginToken", "line_number": 18, "usage_type": "call" }, { "api_name": "forbidden.forbidden", "line_number": 19, "usage_type": "call" }, { "api_name": "cgi.parse_qs...
422556595
from django.conf.urls import url from . import views from rest_framework import routers urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^login/', views.login, name='login'), url(r'^logout/', views.logout, name='logout'), url(r'^avatar/(?P<profile_id>[0-9]+)/$', views.avatar, name...
null
pokerscores/api/urls.py
urls.py
py
809
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 9, "usage_type": "call" }, { "api_name": "django.co...
334511938
import json import multiprocessing as mp import pickle import threading import fire import flask from logzero import logger import numpy as np # Run Keras model in a separate process def net_worker(job_q, res_q, model_path): import ddnet from keras import backend as K import tensorflow as tf config...
null
ddnet/app.py
app.py
py
5,719
python
en
code
null
code-starcoder2
76
[ { "api_name": "tensorflow.ConfigProto", "line_number": 17, "usage_type": "call" }, { "api_name": "tensorflow.Session", "line_number": 21, "usage_type": "call" }, { "api_name": "keras.backend.set_session", "line_number": 22, "usage_type": "call" }, { "api_name": "k...
213858179
import datetime import itertools import unittest from spotify_spire import proto_utils, spire_pb2 from spotify_spire_node import job, task from spotify.util import mock10 as mock class MockedDatetime(datetime.datetime): @classmethod def utcnow(cls): return cls(2010, 11, 12, 13, 14, 15) class StatusTe...
null
test/task_test.py
task_test.py
py
5,351
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime", "line_number": 9, "usage_type": "attribute" }, { "api_name": "unittest.TestCase", "line_number": 14, "usage_type": "attribute" }, { "api_name": "spotify_spire.spire_pb2.TS_UNKNOWN", "line_number": 17, "usage_type": "attribute" }, { ...
192254995
import re import scrapy from scrapy import log from scrapy.contrib.spiders import CrawlSpider, Rule from scrapy.contrib.linkextractors import LinkExtractor from w3lib.html import remove_tags from html2text import HTML2Text from abstracts.items import AbstractItem def css2xpath(css): """Utility function to conve...
null
abstracts/abstracts/spiders/mrs_org.py
mrs_org.py
py
5,510
python
en
code
null
code-starcoder2
76
[ { "api_name": "scrapy.Selector", "line_number": 15, "usage_type": "call" }, { "api_name": "scrapy.contrib.spiders.CrawlSpider", "line_number": 19, "usage_type": "name" }, { "api_name": "scrapy.contrib.spiders.Rule", "line_number": 25, "usage_type": "call" }, { "ap...
419763416
import torch import torch.autograd as autograd import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import math # Starting and ending tokens START_TOKEN = 'START_TOKEN' END_TOKEN = 'END_TOKEN' UNK_TOKEN = 'UNK' def evaluate(dataset, encoder, decoder, word_to_index): sequence_length...
null
evaluate_model.py
evaluate_model.py
py
1,509
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.autograd.Variable", "line_number": 35, "usage_type": "call" }, { "api_name": "torch.autograd", "line_number": 35, "usage_type": "name" }, { "api_name": "torch.LongTensor", "line_number": 35, "usage_type": "call" }, { "api_name": "torch.autogra...
100194834
import json import os from numpy import load validation_count = 0 # Check if data folder exists or not def initial_setup(): if not os.path.exists('app_data'): os.makedirs('app_data') os.makedirs('app_data/event') os.makedirs('app_data/validataion') os.makedirs('app_data/automata')...
null
VarysCode/service/FileHandler.py
FileHandler.py
py
1,511
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.exists", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 11, "usage_type": "call" }, { "api_name": "os.makedirs", "line_numbe...
358734003
import sys from PyQt5.QtWidgets import (QMainWindow, QPushButton, QWidget, QAction, QApplication, QFileDialog, QHBoxLayout, QLabel, QSizePolicy, QSlider, QStyle, QVBoxLayout, QRubberBand) from PyQt5.QtMultimedia import QMediaContent, QMediaPlayer from PyQt5.QtMultimediaWidgets import QVideoWidget from PyQt5.QtC...
null
src/old(PyQt5)/main.py
main.py
py
4,992
python
en
code
null
code-starcoder2
76
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 11, "usage_type": "name" }, { "api_name": "PyQt5.QtMultimedia.QMediaPlayer", "line_number": 26, "usage_type": "call" }, { "api_name": "PyQt5.QtMultimedia.QMediaPlayer.VideoSurface", "line_number": 26, "usage_type...
279924977
import exam import pytest from pathlib import Path from utility import safe_int import random def test_answer_load0(): """test empty iterator without attribute: StopIteration must not be raised """ a = exam.Answer() a.load_sequentially(iter(tuple())) assert True def test_answer_load1(): ...
null
tests/unit/test_exam.py
test_exam.py
py
31,208
python
en
code
null
code-starcoder2
76
[ { "api_name": "exam.Answer", "line_number": 12, "usage_type": "call" }, { "api_name": "exam.Answer", "line_number": 22, "usage_type": "call" }, { "api_name": "exam.Answer", "line_number": 35, "usage_type": "call" }, { "api_name": "pytest.raises", "line_number"...
441329358
from django.http.response import HttpResponse from meuapp.models.Classificacao import CLASSIFICACAO_CHOICE from meuapp.models import Classificacao from django.http.request import HttpRequest from django.shortcuts import render def create_category(request: HttpRequest): if request.method == 'GET': category_type ...
null
meuapp/views/classificacao.py
classificacao.py
py
794
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.http.request.HttpRequest", "line_number": 8, "usage_type": "name" }, { "api_name": "meuapp.models.Classificacao.CLASSIFICACAO_CHOICE", "line_number": 10, "usage_type": "name" }, { "api_name": "django.shortcuts.render", "line_number": 11, "usage_type"...
158440385
#!/usr/bin/python3 # -*- coding:utf-8 -*- from typing import List class Solution: def findPeakElement(self, nums: List[int]) -> int: for i in range(len(nums) - 1): if nums[i] > nums[i + 1]: return i return len(nums) - 1 if __name__ == '__main__': s = Solution() ...
null
数组/162.py
162.py
py
386
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.List", "line_number": 7, "usage_type": "name" } ]
30798056
#**************************************************** # Import Packages import time import http.client, urllib import json import sys # import Adafruit_SSD1306 # from PIL import Image # from PIL import ImageDraw # from PIL import ImageFont from pynput.keyboard import Key, Listener from mcs_functions import * #**...
null
lab3/second_rpi/temp/control_local_pc.py
control_local_pc.py
py
2,930
python
en
code
null
code-starcoder2
76
[ { "api_name": "pynput.keyboard.Key.space", "line_number": 17, "usage_type": "attribute" }, { "api_name": "pynput.keyboard.Key", "line_number": 17, "usage_type": "name" }, { "api_name": "pynput.keyboard.Key.space", "line_number": 56, "usage_type": "attribute" }, { ...
316046251
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2/24/2018 4:12 PM # @Author : Siyuan(Saiun) # @Site : # @File : main.py.py # @Software: PyCharm Community Edition import sys, os import win32gui, win32con, win32com.client import queue from PyQt5.QtWidgets import QApplication, QMainWindow, QFileDialog, ...
null
rw.py
rw.py
py
16,448
python
en
code
null
code-starcoder2
76
[ { "api_name": "PyQt5.QtCore.QThread", "line_number": 27, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.pyqtSignal", "line_number": 28, "usage_type": "call" }, { "api_name": "win32com.client.client.Dispatch", "line_number": 34, "usage_type": "call" }, { "api_...
567690904
import sys from b2ghelper import B2gWebappjsonManager if sys.version_info >= (2, 7): from argparse import ArgumentParser else: raise Exception('It has only been tested on Python 2.7 and above.') def parseArgs(): '''Parse arguments''' parser = ArgumentParser(description='Create a webapps.json to add we...
null
addwebapp.py
addwebapp.py
py
716
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.version_info", "line_number": 4, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 14, "usage_type": "attribute" }, { "api_name": "b2ghelper....
159841811
# 모듈로딩 ------------------------------------------------- from openpyxl import Workbook # 데이터 변수 선언 ------------------------------------------- filename = '../DATA/sample02.xlsx' names=['Name','Tom', 'Jane', 'Park', 'Kim'] ages=['Age', 14, 21, 19, 20] # 엑셀 파일 생성 -------------------------------------------- wb = Workbo...
null
PythonAI/Source/W1D5/EXCEL/excel_write_basic_02.py
excel_write_basic_02.py
py
1,127
python
en
code
null
code-starcoder2
76
[ { "api_name": "openpyxl.Workbook", "line_number": 10, "usage_type": "call" } ]
125112182
import json from pathlib import Path from typing import Union from urllib import parse as urlparse from urllib.request import urlopen import httpx import yaml from jsonref import JsonRef, JsonLoader class JSONOrYAMLRefLoader(JsonLoader): """ Replacement for `jsonref.JsonLoader` Can load both json and ya...
null
openapi_orm/loader.py
loader.py
py
1,425
python
en
code
null
code-starcoder2
76
[ { "api_name": "jsonref.JsonLoader", "line_number": 12, "usage_type": "name" }, { "api_name": "urllib.parse.urlsplit", "line_number": 20, "usage_type": "call" }, { "api_name": "urllib.parse", "line_number": 20, "usage_type": "name" }, { "api_name": "httpx.get", ...
492769186
#!/usr/bin/env python import sys from copy import copy, deepcopy import serial import struct import time class Ship: 'Common base class for all ships' shipCount = 0 def __init__(self, length, sunk, orientation, locations): self.length = length #self.sunk = sunk self.orientation = orientation #might not eve...
null
ooRaspi.py
ooRaspi.py
py
49,912
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.sleep", "line_number": 760, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 1157, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 1207, "usage_type": "call" }, { "api_name": "serial.Serial", "line_numbe...
6255554
from . import views from django.urls import path from django.conf.urls import include, url app_name = 'orders' urlpatterns = [ url(r'^create/$', views.order_create, name='order_create'), path('create/<str:cart>', views.order_create2, name='order_create2'), url(r'^likePost/(?P<pk>[0-9]+)/$', views.likePo...
null
orders/urls.py
urls.py
py
573
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.url", "line_number": 10, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 11, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 12, "usage_type": "call" }, { "api_name": "django.con...
482580393
from http import HTTPStatus from itertools import islice import sys, io, struct, socket, select from .utils import status_phrase FILE_EXTENSION_TO_MIME = { '.html': 'text/html', '.css': 'text/css', '.json': 'application/json', } class HttpConnection: """Deals with parsing HTTP request and sending finalized respo...
null
web_server/http_connection.py
http_connection.py
py
2,911
python
en
code
null
code-starcoder2
76
[ { "api_name": "itertools.islice", "line_number": 40, "usage_type": "call" }, { "api_name": "http.HTTPStatus.OK", "line_number": 50, "usage_type": "attribute" }, { "api_name": "http.HTTPStatus", "line_number": 50, "usage_type": "name" }, { "api_name": "select.selec...
467307264
# Concentration analysis # Input #G0S1.txt-G2S2.txt #wavenumber.txt #Compounds from database #Directory of standard compounds # To do: #- Perform (nonlinear) least squares regression on all compounds (too slow?) # - Filter out compounds: # - Dump all with concentration<whatever ...
null
Python scripts/Unfinished/spectrum_from_concentration.py
spectrum_from_concentration.py
py
2,966
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.sep", "line_number": 24, "usage_type": "attribute" }, { "api_name": "re.compile", "line_number": 27, "usage_type": "call" }, { "api_name": "re.match", "line_number": 29, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 29, ...
171636019
# Copyright 2014-2015 PUNCH Cyber Analytics Group # # 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
connector/fluentd/fluentd/fluentd.py
fluentd.py
py
1,969
python
en
code
null
code-starcoder2
76
[ { "api_name": "stoq.plugins.StoqConnectorPlugin", "line_number": 28, "usage_type": "name" }, { "api_name": "stoq.plugins", "line_number": 34, "usage_type": "name" }, { "api_name": "fluent.sender.FluentSender", "line_number": 70, "usage_type": "call" } ]
110948165
"""Cryptocurrency Discovery Controller""" __docformat__ = "numpy" # pylint: disable=R0904, C0302, W0622 import argparse import os from prompt_toolkit.completion import NestedCompleter from gamestonk_terminal import feature_flags as gtff from gamestonk_terminal.helper_funcs import get_flair from gamestonk_terminal.menu...
null
gamestonk_terminal/cryptocurrency/discovery/discovery_controller.py
discovery_controller.py
py
6,390
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 47, "usage_type": "call" }, { "api_name": "os.system", "line_number": 108, "usage_type": "call" }, { "api_name": "gamestonk_terminal.cryptocurrency.cryptocurrency_helpers.all_coins", "line_number": 129, "usage_type":...
300171010
import copy from anytree import Node from pydnameth.config.config import Config from pydnameth.config.experiment.types import Task, Method from pydnameth.config.experiment.experiment import Experiment from pydnameth.config.attributes.attributes import Observables, Cells, Attributes from pydnameth.model.tree import buil...
null
pydnameth/scripts/develop/plot.py
plot.py
py
2,539
python
en
code
null
code-starcoder2
76
[ { "api_name": "pydnameth.config.experiment.types.Method.linreg", "line_number": 17, "usage_type": "attribute" }, { "api_name": "pydnameth.config.experiment.types.Method", "line_number": 17, "usage_type": "name" }, { "api_name": "pydnameth.config.config.Config", "line_number":...
134384996
import numpy as np import cv2 import pickle face_cascade = cv2.CascadeClassifier('Cascades/data/haarcascade_frontalface_alt2.xml') eye_cascade = cv2.CascadeClassifier('Cascades/data/haarcascade_eye.xml') recognizer = cv2.face.LBPHFaceRecognizer_create() recognizer.read("trainner.yml") labels = {"person_name":1} wit...
null
scr/faces.py
faces.py
py
1,799
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.CascadeClassifier", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.CascadeClassifier", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.face.LBPHFaceRecognizer_create", "line_number": 8, "usage_type": "call" }, { "api_n...
204445307
from appium import webdriver import unittest import time from pytest_testconfig import config timeout = 30 poll = 2 class IAppBVT(unittest.TestCase): def setUp(self): desired_caps = { "platformName": "Android", "deviceName": "192.168.31.188:9999", "udid": "192.168.31.188:9999", ...
null
test_androidSample.py
test_androidSample.py
py
1,664
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 10, "usage_type": "attribute" }, { "api_name": "appium.webdriver.Remote", "line_number": 23, "usage_type": "call" }, { "api_name": "appium.webdriver", "line_number": 23, "usage_type": "name" }, { "api_name": "time....
405857867
import matplotlib from matplotlib import pyplot as plt import pandas as pd from libs import datalib file_name = 'Trial_3_data' data = datalib.get_data(file_name) matplotlib.style.use('classic') # matplotlib.style.use('ggplot') data.plot( x=0, y=[1,2,3], kind='line', ax=None, subplots=True, ...
null
grapher.py
grapher.py
py
841
python
en
code
null
code-starcoder2
76
[ { "api_name": "libs.datalib.get_data", "line_number": 9, "usage_type": "call" }, { "api_name": "libs.datalib", "line_number": 9, "usage_type": "name" }, { "api_name": "matplotlib.style.use", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.styl...
203249505
#!/usr/bin/env python # coding: utf-8 import uuid import datetime import authorization from google.appengine.ext import ndb from google.appengine.api import search from google.appengine.ext import deferred from model.address import ( Address, Tel, Email, Url, Note, JournalItem, Anniversary ) from model.address_his...
null
application/common/addresses.py
addresses.py
py
31,890
python
en
code
null
code-starcoder2
76
[ { "api_name": "authorization.check_authorization", "line_number": 155, "usage_type": "call" }, { "api_name": "authorization.ADDRESS_CREATE", "line_number": 155, "usage_type": "attribute" }, { "api_name": "datetime.datetime.utcnow", "line_number": 165, "usage_type": "call"...
125068300
#!/usr/bin/env python3 """Program that creates and trains a genism fastText model""" from gensim.models import FastText def fasttext_model(sentences, size=100, min_count=5, negative=5, window=5, cbow=True, iterations=5, seed=0, workers=1): """Function that creates and trains a genism fastText m...
null
supervised_learning/0x0F-word_embeddings/4-fasttext.py
4-fasttext.py
py
662
python
en
code
null
code-starcoder2
76
[ { "api_name": "gensim.models.FastText", "line_number": 9, "usage_type": "call" } ]
378238754
"""Create a logger""" import os import logging import sys import time from pathlib import Path # Get the path to the home directory for the current user and create an 'lcmap_tap' subfolder HOME = os.path.join(str(Path.home()), 'lcmap_tap') __version__ = '0.3.2' if not os.path.exists(HOME): os.ma...
null
lcmap_tap/logger.py
logger.py
py
1,428
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "pathlib.Path.home", "line_number": 11, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_...
15515216
from typing import List from cs54_list import nil, head, tail, add, instance_as_list from cs54_tools import read_instances def croissante(list: List[str]) -> bool: if nil(list) or nil(tail(list)): return True elif head(list) > head(tail(list)): return False else: return croissante(...
null
S5/CS54/Algo/Cours/cs54-lab2-solution/croissante.py
croissante.py
py
843
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.List", "line_number": 6, "usage_type": "name" }, { "api_name": "cs54_list.nil", "line_number": 7, "usage_type": "call" }, { "api_name": "cs54_list.tail", "line_number": 7, "usage_type": "call" }, { "api_name": "cs54_list.head", "line_numb...
183074585
# Copyright 2017 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
null
upvote/gae/modules/upvote_app/api/handlers/constants_test.py
constants_test.py
py
1,923
python
en
code
null
code-starcoder2
76
[ { "api_name": "upvote.gae.shared.common.basetest.UpvoteTestCase", "line_number": 25, "usage_type": "attribute" }, { "api_name": "upvote.gae.shared.common.basetest", "line_number": 25, "usage_type": "name" }, { "api_name": "webapp2.WSGIApplication", "line_number": 29, "usa...
549646924
import discord import threading import asyncio # 원죄위키에서 붙여넣기 하세요~~ # 원죄위키에서 붙여넣기 하세요~~ client = discord.Client() class AlertMessage: def __init__(self): self.msg_to_push = [] def get_msg(self): return self.msg_to_push.pop(0) if len(self.msg_to_push) > 0 else (False, False) ALERT_MSG =...
null
Server/_discord.py
_discord.py
py
1,168
python
en
code
null
code-starcoder2
76
[ { "api_name": "discord.Client", "line_number": 11, "usage_type": "call" }, { "api_name": "discord.Object", "line_number": 35, "usage_type": "call" }, { "api_name": "asyncio.sleep", "line_number": 47, "usage_type": "call" }, { "api_name": "threading.Thread", "l...
651690491
import numpy as np from utils import simu_block_log from simus import run_log from sklearn.linear_model import LogisticRegression # Parameters n_samples = 10000 # number of samples n_features = 250 # dimension of the problem 𝜆 = 1/(n_samples)#regularization parameter # Simulate data for regression seed=0 puiss=5...
null
code/StoFirstOrder_optimization/linear_models/scripts/logistic_alpha5.py
logistic_alpha5.py
py
2,823
python
en
code
null
code-starcoder2
76
[ { "api_name": "utils.simu_block_log", "line_number": 16, "usage_type": "call" }, { "api_name": "sklearn.linear_model.LogisticRegression", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.log", "line_number": 25, "usage_type": "call" }, { "api_name":...
608059440
#-*-coding:utf-8-*- import requests import time #from fake_useragent import UserAgent import re import threading import random import os import sys import codecs import csv import sys import unittest import tushare.stock.trading as fd import os from sqlalchemy import create_engine from sqlalchemy.orm im...
null
fund/fundcrawler.py
fundcrawler.py
py
13,987
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.setdefaultencoding", "line_number": 27, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 31, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 32, "usage_type": "call" }, { "api_name": "requests.get...
386276874
import os import numpy as np import matplotlib.pyplot as plt from matplotlib import cm # import colormaps def plotModified(reference, histo, color = 1 ): # plot original histogram (reference) with ones resampled from it (histo), # histo is either an array of histograms or a single histogram. # refere...
null
DatasetCrafting/plotters.py
plotters.py
py
6,274
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.cm.viridis", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.cm", "line_number": 12, "usage_type": "name" }, { "api_name": "numpy.linspace", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.cm.plas...
83820138
from argparse import ArgumentParser from datetime import datetime, timezone from io import StringIO, TextIOWrapper import glob import itertools import os import re import xml.etree.ElementTree as etree import zipfile fns= '{xmlns://www.fortifysoftware.com/schema/fvdl}' VULN_PATH = f'{fns}Vulnerabilities/{fns}Vulnerab...
null
src/fpr/fvdl.py
fvdl.py
py
9,806
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.compile", "line_number": 36, "usage_type": "call" }, { "api_name": "io.StringIO", "line_number": 66, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree.iterparse", "line_number": 67, "usage_type": "call" }, { "api_name": "xml.etree.Elem...
515881307
""" @author: viet This program draws bounding boxes around numbers in the modified-MNIST Please don't use """ import pickle import pandas as pd import numpy as np import PIL.Image as pil import matplotlib.pyplot as plt import random as rng import cv2 as cv from models import load_data, view_image print(__doc__) da...
null
models/boundingbox_drawing.py
boundingbox_drawing.py
py
2,424
python
en
code
null
code-starcoder2
76
[ { "api_name": "models.load_data", "line_number": 24, "usage_type": "call" }, { "api_name": "random.seed", "line_number": 26, "usage_type": "call" }, { "api_name": "cv2.Canny", "line_number": 31, "usage_type": "call" }, { "api_name": "cv2.findContours", "line_n...
283517946
import torch from transformers import AutoTokenizer, AutoModelForSequenceClassification import sys model_dir = '/app/python/model' tokenizer = AutoTokenizer.from_pretrained(model_dir, use_fast=False) model = AutoModelForSequenceClassification.from_pretrained(model_dir) model.eval() text = sys.argv[1] prin...
null
server/python/test.py
test.py
py
605
python
en
code
null
code-starcoder2
76
[ { "api_name": "transformers.AutoTokenizer.from_pretrained", "line_number": 7, "usage_type": "call" }, { "api_name": "transformers.AutoTokenizer", "line_number": 7, "usage_type": "name" }, { "api_name": "transformers.AutoModelForSequenceClassification.from_pretrained", "line_n...
413928947
import cPickle import mxnet as mx import numpy as np import cv2 def extractImagesAndLabels(path, file): f = open(path + file, 'rb') dict = cPickle.load(f) images = dict['data'] images = np.reshape(images, (10000, 3, 32, 32)) labels = dict['labels'] imagearray = mx.nd.array(images) ...
null
createImages.py
createImages.py
py
1,092
python
en
code
null
code-starcoder2
76
[ { "api_name": "cPickle.load", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.reshape", "line_number": 11, "usage_type": "call" }, { "api_name": "mxnet.nd.array", "line_number": 13, "usage_type": "call" }, { "api_name": "mxnet.nd", "line_number"...
303371196
import json from typing import Optional class BasePacket: """ Base packet class """ command = str() def __init__(self, topic: str, uid: Optional[str] = None, timestamp: Optional[int] = None, config_hash: Optional[str] = None...
null
skabenproto/packets.py
packets.py
py
5,896
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.Optional", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 16, "usage_type": "name" }, { "api_name": "json.dumps", "lin...
579890953
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2018 <boutin_arnaud@hotmail.com> # # 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....
null
src/core/StreamVocal.py
StreamVocal.py
py
9,201
python
en
code
null
code-starcoder2
76
[ { "api_name": "gi.require_version", "line_number": 21, "usage_type": "call" }, { "api_name": "gi.repository.Gst", "line_number": 35, "usage_type": "name" }, { "api_name": "core.PATH_VOCAL", "line_number": 37, "usage_type": "argument" }, { "api_name": "core.KEYPHRA...
211511551
#!/usr/bin/python # -*- coding: utf-8 -*- import argparse import sys import json import socket import threading import time from tools.settings import * from tools.funcs import * import logging import logs.client_log from decorators import log logger = logging.getLogger('client_log') print('Messenger') # function - ...
null
hw7/client.py
client.py
py
5,312
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "decorators.log", "line_number": 20, "usage_type": "name" }, { "api_name": "time.time", "line_number": 39, "usage_type": "call" }, { "api_name": "decorators.log", "line...
211212520
# coding: utf-8 from pprint import pprint from collections import OrderedDict, defaultdict from getpass import getpass import multiprocessing as mp import argparse, sys, os, time, json, subprocess, re, itertools, random, itertools, codecs from common import str2bool, timewatch, multi_process try: import pickle as p...
null
wp_extract_all.py
wp_extract_all.py
py
15,020
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path", "line_number": 27, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 27, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_nu...
204753901
import datetime import functools import logging import sys import time import traceback import schedule sys.path.append("./../") from PublicOpinion.jfinfo.jfinfo_runner import JFSchedule from PublicOpinion.takungpao.takungpao_runner import TakungpaoSchedule logger = logging.getLogger() def catch_exceptions(cancel_...
null
PublicOpinion/main_1.py
main_1.py
py
1,654
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "traceback.format_exc", ...