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
38099157
from __future__ import absolute_import from collections import defaultdict, namedtuple from datetime import datetime, date, time import logging import re from lxml import etree import os from django.conf import settings from corehq.apps.app_manager.util import all_apps_by_domain from corehq.util.quickcache import quick...
null
custom/openclinica/utils.py
utils.py
py
14,955
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.namedtuple", "line_number": 19, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 20, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 21, "usage_type": "call" }, { "api_name": "...
407003783
import datetime import logging import random import spotframework.util.monthstrings as monthstrings from spotframework.model.uri import Uri from spotframework.filter import remove_local, get_track_objects from spotframework.filter.added import added_after from spotframework.filter.sort import sort_by_release_date from...
null
music/tasks/run_user_playlist.py
run_user_playlist.py
py
8,283
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 21, "usage_type": "call" }, { "api_name": "music.model.user.User.collection.filter", "line_number": 26, "usage_type": "call" }, { "api_name": "music.model.user.User.collection", "line_number": 26, "usage_type": "attribute"...
233963499
import time #required for pausing the script import RPi.GPIO as GPIO from picamera import PiCamera from time import sleep import requests import os import json from gpiozero import DistanceSensor def photo(): path = '/home/pi/Documents/smartbin2/smartbin2-master/images' name_list = os.listdir(path) full_li...
null
smartbin.py
smartbin.py
py
4,991
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.listdir", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.path", "line_number": 14,...
451245026
from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import serialization from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.asymmetric import padding with open('private_key.pem','rb') as key_file: private_key = serialization.load_pem...
null
encryptusingkeys.py
encryptusingkeys.py
py
906
python
en
code
null
code-starcoder2
76
[ { "api_name": "cryptography.hazmat.primitives.serialization.load_pem_private_key", "line_number": 7, "usage_type": "call" }, { "api_name": "cryptography.hazmat.primitives.serialization", "line_number": 7, "usage_type": "name" }, { "api_name": "cryptography.hazmat.backends.default...
564882138
# Modules to import for project import tensorflow as tf import h5py import time import numpy as np #Load the data h5f = h5py.File('sat-6.h5','r') X_train = h5f['X_train'][:] y_train = h5f['y-train'][:] X_test = h5f['X_test'][:] y_test = h5f['y_test'][:] X_valid = h5f['X_valid'][:] y_valid = h5f['y_valid'][:] h5f.clo...
null
capstone_project_exploration/nn_3.py
nn_3.py
py
4,623
python
en
code
null
code-starcoder2
76
[ { "api_name": "h5py.File", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.argmax", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 33,...
327858112
from __future__ import print_function from __future__ import division """ test: True """ from six.moves import range import numpy as np import sympy as sp import mpi4py.MPI as mpi import pyLBM X, Y = sp.symbols('X, Y') rho, qx, qy, LA = sp.symbols('rho, qx, qy, LA', real=True) def bc_up(f, m, x, y, driven_velocity): ...
null
demo/2D/Kelvin_Helmotz.py
Kelvin_Helmotz.py
py
3,873
python
en
code
null
code-starcoder2
76
[ { "api_name": "sympy.symbols", "line_number": 12, "usage_type": "call" }, { "api_name": "sympy.symbols", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.abs", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.zeros_like", "line_nu...
96709249
# ***Using Tensorflow 1.4.0 and Keras 2.1.2*** import tensorflow as tf import keras from keras.callbacks import ModelCheckpoint from keras.models import Sequential from keras.layers import Activation, Flatten, Dense, Lambda, Conv2D, MaxPooling2D, Dropout from keras.optimizers import Adam from keras import backend as ...
null
model.py
model.py
py
5,474
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.exists", "line_number": 55, "usage_type": "call" }, { "api_name": "os.path", "line_number": 55, "usage_type": "attribute" }, { "api_name": "pandas.read_pickle", "line_number": 63, "usage_type": "call" }, { "api_name": "pandas.read_pickle", ...
200010689
import pygame import car, trackmap, math, torch import numpy as np def main(): clock = pygame.time.Clock() player_pool = [] for i in range(50): player_pool.append(car.Player()) racemap = trackmap.Track() font = pygame.font.Font(None, 24) game_flag = True dr...
null
MAIN.py
MAIN.py
py
6,218
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.time.Clock", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.time", "line_number": 6, "usage_type": "attribute" }, { "api_name": "car.Player", "line_number": 9, "usage_type": "call" }, { "api_name": "trackmap.Track", "line...
40008108
# -*- coding: utf-8 -*- """ Created on Mon Apr 23 17:08:16 2018 @author: Erik """ from glob import glob import cv2 import fnmatch from sklearn.model_selection import train_test_split import matplotlib.pylab as plt import pandas as pd import numpy as np import random as rand def get_file_paths(num_files = -1, randoml...
null
src/get_data.py
get_data.py
py
2,084
python
en
code
null
code-starcoder2
76
[ { "api_name": "glob.glob", "line_number": 18, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 26, "usage_type": "call" }, { "api_name": "fnmatch.filter", "line_number": 39, "usage_type": "call" }, { "api_name": "fnmatch.filter", "line_nu...
349952521
import json from typing import List, Union import os import requests from bs4 import BeautifulSoup from steamCLI.utils import sanitize_title, calculate_discount class SteamApp: def __init__(self, config=None): """ Values shown for clarity. In an ideal case, we aim to assign values to all...
null
steamCLI/steamapp.py
steamapp.py
py
14,582
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 70, "usage_type": "call" }, { "api_name": "requests.HTTPError", "line_number": 72, "usage_type": "attribute" }, { "api_name": "requests.HTTPError", "line_number": 73, "usage_type": "call" }, { "api_name": "typing.Union"...
30737163
import requests import json from datetime import datetime import time, threading #setup #pull in API key from text file APIKey_file = open('Steam API Key.txt', 'rt') APIKey = APIKey_file.read() #get list of company numbers from text file App_ID_File = open('App IDs.txt', 'rt') App_IDs = App_ID_File.read() App_ID_Lis...
null
Steam API Current Users.py
Steam API Current Users.py
py
1,670
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.request", "line_number": 37, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 40, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 40, "usage_type": "name" }, { "api_name": "requests.req...
509585586
import numpy as np import seaborn as sns from sklearn.metrics import confusion_matrix import matplotlib.pyplot as plt data=np.load('../re/all_weak_super.npy') y_pred=np.array(data[:,1:-1],np.float) y_pred=np.argmax(y_pred,1) y_true = np.array(data[:,-1],np.uint8) sns.set() f,ax=plt.subplots() C2= confusion_matrix(y_t...
null
result_plt/plot_confusion_matrix.py
plot_confusion_matrix.py
py
725
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.load", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.float", "line_number": 6, "usage_type": "attribute" }, { "api_name": "numpy.argmax", "line_number"...
120500638
import collections class UF: def __init__(self): self.parent = {} def find(self, x): self.parent.setdefault(x, x) while x != self.parent[x]: x = self.parent[x] return x def union(self, p, q): self.parent[self.find(p)] = self.find(q) class Solution: ...
null
problems/uf/721.py
721.py
py
1,150
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.defaultdict", "line_number": 20, "usage_type": "call" } ]
634883555
# -*- coding: utf-8 -*- from odoo import models, fields, api from unidecode import unidecode import re def _compute_slug(name, id): name = unidecode(name) name = re.sub('\s+','-',name) name = re.sub('\W','-',name, flags=re.I) name = re.sub('-{2,}','-', name) name = name.lower() name = name + ...
null
backend/addons/ndt_brand_url_image/models/product_brand.py
product_brand.py
py
681
python
en
code
null
code-starcoder2
76
[ { "api_name": "unidecode.unidecode", "line_number": 8, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 9, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 10, "usage_type": "call" }, { "api_name": "re.I", "line_number": 10, "us...
240625245
import pygame import math import numpy as np import pandas as pd from matplotlib import pyplot as plt from pendulum import DampedPendulum from utils import FRAME_TIME, WHITE, SCREEN_WIDTH, SCREEN_HEIGHT, PI, LINEAR_SPEED_CONSTANT, QUADRATIC_SPEED_CONSTANT, PENDULUM_LENGTH, PENDULUM_MASS def main(): # Simulating pe...
null
simulations/simulation_lab_fis26/simulation.py
simulation.py
py
1,134
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.init", "line_number": 12, "usage_type": "call" }, { "api_name": "pendulum.DampedPendulum", "line_number": 14, "usage_type": "call" }, { "api_name": "utils.PENDULUM_LENGTH", "line_number": 14, "usage_type": "argument" }, { "api_name": "utils.P...
242035811
from django.test import Client from django.shortcuts import render, render_to_response, redirect from django.contrib.auth.hashers import make_password, check_password from django.db import models from .models import * from main.forgiving_check import full_check from django.test import TestCase, RequestFactory def over...
null
Backend/Dev/main/testing_system.py
testing_system.py
py
15,489
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.test.Client", "line_number": 10, "usage_type": "call" }, { "api_name": "main.forgiving_check.full_check", "line_number": 78, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 80, "usage_type": "call" } ]
348610940
from lib.game import Game from lib.config import config import offshoot class YouMustBuildABoatGame(Game): def __init__(self, **kwargs): kwargs["platform"] = "steam" kwargs["app_id"] = "290890" kwargs["app_args"] = None kwargs["window_name"] = "#ymbab" super().__init__...
null
plugins/YouMustBuildABoatGamePlugin/files/you_must_build_a_boat_game.py
you_must_build_a_boat_game.py
py
654
python
en
code
null
code-starcoder2
76
[ { "api_name": "lib.game.Game", "line_number": 7, "usage_type": "name" } ]
166175479
from lib.quotation.clients.awesome_api import AwesomeAPI import requests import requests_mock import responses def test_requests_get(): currency_from = "USD" currency_to = "BRL" url = f"https://economia.awesomeapi.com.br/all/{currency_from}-{currency_to}" response = { "USD": { "co...
null
currency-quotation-python/tests/clients/test_awesome_api.py
test_awesome_api.py
py
1,580
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests_mock.Mocker", "line_number": 28, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 30, "usage_type": "call" }, { "api_name": "lib.quotation.clients.awesome_api.AwesomeAPI", "line_number": 54, "usage_type": "call" }, { "ap...
642376222
# Code adapted from Satya Mallik # https://github.com/spmallick/learnopencv/tree/master/PyTorch-Mask-RCNN from PIL import Image import matplotlib.pyplot as plt import torch import torchvision.transforms as T import torchvision import torch import numpy as np import cv2 import random import time import os ...
null
Torchvision/torchvision camera functions WORKING (inst).py
torchvision camera functions WORKING (inst).py
py
6,971
python
en
code
null
code-starcoder2
76
[ { "api_name": "torchvision.models.detection.maskrcnn_resnet50_fpn", "line_number": 24, "usage_type": "call" }, { "api_name": "torchvision.models", "line_number": 24, "usage_type": "attribute" }, { "api_name": "cv2.VideoCapture", "line_number": 28, "usage_type": "call" }...
503843426
# -*- coding: utf-8 -*- import sys from time import clock from inspect import isclass from pkgutil import iter_modules def walk_modules(path): """Loads a module and all its submodules from a the given module path and returns them. If *any* module throws an exception while importing, that exception is thro...
null
libs/yourdocs/utils/__init__.py
__init__.py
py
2,987
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.modules", "line_number": 17, "usage_type": "attribute" }, { "api_name": "sys.modules", "line_number": 18, "usage_type": "attribute" }, { "api_name": "pkgutil.iter_modules", "line_number": 24, "usage_type": "call" }, { "api_name": "inspect.isclas...
74041905
import torch import cv2 import numpy as np def xywh2xyxy(x): # Convert bounding box format from [x, y, w, h] to [x1, y1, x2, y2] y = torch.zeros_like(x) if isinstance(x, torch.Tensor) else np.zeros_like(x) y[:, 0] = x[:, 0] - x[:, 2] / 2 y[:, 1] = x[:, 1] - x[:, 3] / 2 y[:, 2] = x[:, 0] + x[:, 2] /...
null
evaluate/evaluate_detrac_coco_api/utils_detrac.py
utils_detrac.py
py
5,432
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.Tensor", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.zeros_like", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.zeros_like", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "...
647688050
import cv2 import pytesseract import numpy as np import re import os, sys try: from PIL import Image except ImportError: import Image import pytesseract def boxeveryword(): #boxing every character filename = 'test.png' # read the image and get the dimensions img = cv2.imread(filenam...
null
Get All Images/All.py
All.py
py
7,070
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.imread", "line_number": 19, "usage_type": "call" }, { "api_name": "pytesseract.image_to_boxes", "line_number": 23, "usage_type": "call" }, { "api_name": "cv2.rectangle", "line_number": 28, "usage_type": "call" }, { "api_name": "cv2.imshow", ...
524715354
import requests __histominuteurl = 'https://min-api.cryptocompare.com/data/histominute?' __histohoururl = 'https://min-api.cryptocompare.com/data/histohour?' __histodayurl = 'https://min-api.cryptocompare.com/data/histoday?' def histoMinute(from_curr, to_curr, e=None, extraParams=None, sign=False, tryConversion=Tru...
null
thirdparty/cryCompare/history.py
history.py
py
2,111
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 51, "usage_type": "call" } ]
403779737
""" This file provides the environment for a player to interact with the Risk game board # TODO: smart importing """ import numpy as np # from OLD import risk_graph as rg import risk_graph as rg from enum import Enum # ActionType = Enum('ActionType','ALLOT ATTACK REINFORCE FORTIFY GAMEOVER') class ActionType(Enum): ...
null
risk_game.py
risk_game.py
py
26,335
python
en
code
null
code-starcoder2
76
[ { "api_name": "enum.Enum", "line_number": 12, "usage_type": "name" }, { "api_name": "risk_graph.RiskGraph", "line_number": 48, "usage_type": "call" }, { "api_name": "numpy.random.permutation", "line_number": 77, "usage_type": "call" }, { "api_name": "numpy.random"...
365740433
import airflow from airflow.models import DAG from airflow.operators.bash_operator import BashOperator from airflow.operators.dummy_operator import DummyOperator from airflow.operators.python_operator import PythonOperator from datetime import datetime args = {"owner": "Bjorn_Rijpert", "start_date": airflow.utils.d...
null
dags/Exercise2.py
Exercise2.py
py
953
python
en
code
null
code-starcoder2
76
[ { "api_name": "airflow.utils.dates.days_ago", "line_number": 9, "usage_type": "call" }, { "api_name": "airflow.utils", "line_number": 9, "usage_type": "attribute" }, { "api_name": "airflow.models.DAG", "line_number": 11, "usage_type": "call" }, { "api_name": "date...
624657815
#coding: utf-8 import matplotlib.pyplot as plt import numpy as np import json def prendi_json(path): dati=json.load(open(path,"r")) return dati def salva_json(dati,path): with open(path,"w") as outfile: json.dump(dati,outfile,indent=8) return def creazione_grafico(stelle): n_stelle=len(stel...
null
Grafico.py
Grafico.py
py
1,006
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.load", "line_number": 7, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.title", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "l...
232405616
from .models import AcademicCalendar, Holiday from .serializers import AcademicCalendarSerializer, HolidaySerializer from rest_framework.permissions import IsAuthenticatedOrReadOnly, AllowAny from rest_framework import generics from rest_framework.pagination import PageNumberPagination from rest_framework import filte...
null
gurukul_calendar/views.py
views.py
py
1,687
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.generics.ListCreateAPIView", "line_number": 10, "usage_type": "attribute" }, { "api_name": "rest_framework.generics", "line_number": 10, "usage_type": "name" }, { "api_name": "models.AcademicCalendar.objects.all", "line_number": 11, "usage_ty...
120465850
# Copyright 2022 IBM Corp. 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 agre...
null
tests/unit/zhmcclient/testutils/test_hmc_vault_file.py
test_hmc_vault_file.py
py
3,139
python
en
code
null
code-starcoder2
76
[ { "api_name": "zhmcclient.testutils._hmc_vault_file.HMCVaultFileError", "line_number": 86, "usage_type": "name" }, { "api_name": "zhmcclient.testutils._hmc_vault_file.HMCVaultFileError", "line_number": 93, "usage_type": "name" }, { "api_name": "zhmcclient.testutils._hmc_vault_fil...
3798690
import tornado.web import tornado.ioloop class IndexHandler(tornado.web.RequestHandler): @tornado.web.asynchronous def get(self, *args, **kwargs): self.handler() print('asdasd') def handler(self): import time time.sleep(5) self.write('ok') self.finish() ap...
null
weibo/test.py
test.py
py
493
python
en
code
null
code-starcoder2
76
[ { "api_name": "tornado.web.web", "line_number": 5, "usage_type": "attribute" }, { "api_name": "tornado.web", "line_number": 5, "usage_type": "name" }, { "api_name": "tornado.web.web", "line_number": 6, "usage_type": "attribute" }, { "api_name": "tornado.web", ...
51533002
# coding=UTF-8 # -------------------------------------------------------------- # class_article文件 # @class: Article # @introduction: Article类用来创建latex文档 # @dependency: pylatex模块 # @author: plutoese # @date: 2016.02.18 # -------------------------------------------------------------- import re from lib.base.pylatex.cl...
null
lib/base/pylatex/class_article.py
class_article.py
py
2,955
python
en
code
null
code-starcoder2
76
[ { "api_name": "lib.base.pylatex.class_latexdoc.LatexDoc", "line_number": 23, "usage_type": "call" }, { "api_name": "lib.base.pylatex.class_latexfromtemplate.LatexFromTemplate", "line_number": 23, "usage_type": "call" } ]
623541422
import json import re from logging import getLogger from typing import Any, Dict, Optional, Union try: from inspect import iscoroutinefunction except ImportError: # We must be on Python < 3.5! def iscoroutinefunction(func): # type: ignore return False from twisted.internet.defer import CancelledE...
null
retwist/json_resource.py
json_resource.py
py
8,093
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 24, "usage_type": "call" }, { "api_name": "retwist.param_resource.ParamResource", "line_number": 27, "usage_type": "name" }, { "api_name": "re.compile", "line_number": 33, "usage_type": "call" }, { "api_name": "twi...
628437871
# Python DHD data and TEI suite # This software is free to share and use. import re import os import io import json YEAR = "2019" OUT_DIR = os.path.join("converted_data", YEAR) RESULTS_FILE = os.path.join(OUT_DIR, "results_lines.txt") OUT_FILE = os.path.join(OUT_DIR, "final.json") OUT_FILE_NONE = os.path.join(OUT_DI...
null
GoResultsCleaner.py
GoResultsCleaner.py
py
1,590
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10,...
254916691
import glob import os import wfdb from wfdb import processing import numpy as np import heartpy as hp #from torchvision import transforms import matplotlib.pyplot as plt """Defines the window_size. 360 values are recorded every second. A window size of 10800 corresponds to a 30 second ECG window. We use a lag of ap...
null
code/preprocess.py
preprocess.py
py
4,021
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.chdir", "line_number": 39, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 41, "usage_type": "call" }, { "api_name": "wfdb.rdrecord", "line_number": 48, "usage_type": "call" }, { "api_name": "heartpy.remove_baseline_wander", ...
500789071
import boto3 client = boto3.client('ec2') instanceid = ['i-08b2f464d4cfa3e6d','i-0daa8f905c0bfc426'] for i in range(len(instanceid)): instance_state = client.describe_instance_status(InstanceIds=[instanceid[i]]) if not instance_state['InstanceStatuses']: print("Already Stop") else: current_s...
null
Boto3/stop_ec2.py
stop_ec2.py
py
627
python
en
code
null
code-starcoder2
76
[ { "api_name": "boto3.client", "line_number": 2, "usage_type": "call" } ]
128459192
from __future__ import print_function import sqlite3 from operator import itemgetter from typing import List, Any, Union ipldb = sqlite3.connect('ipl.db') cur = ipldb.cursor() a=[] b=[] cur.execute('''SELECT player_name,player_id FROM PLAYER ''') d=1 for row in cur: a.append([d,row[0],0,0,0]) b.append([]) ...
null
outlab10/average_balls.py
average_balls.py
py
1,266
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlite3.connect", "line_number": 6, "usage_type": "call" }, { "api_name": "operator.itemgetter", "line_number": 29, "usage_type": "call" } ]
14791301
import re from base64 import b64encode from urllib.parse import urlsplit from django.core.validators import URLValidator from django.core.exceptions import ValidationError from .settings import ALLOWED_HOSTS, URLNAME_LENGTH ORDER = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-" BASE = len(ORDER) ...
null
urlshort/link_actions.py
link_actions.py
py
1,743
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.compile", "line_number": 13, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 15, "usage_type": "call" }, { "api_name": "re.escape", "line_number": 16, "usage_type": "call" }, { "api_name": "settings.ALLOWED_HOSTS", "line_nu...
15118787
import tools import modules import sessions import playback import os import json NGINX_EXECUTABLE = "/usr/local/nginx/sbin/nginx" NGINX_CONFIGURATION_PATH = "/usr/local/nginx/conf/nginx.conf" class StreamConnection(): def __init__(self, streamOutput, transcodeWidth, transcodeHeight, transcodeFramerate, sampleRa...
null
streaming.py
streaming.py
py
9,668
python
en
code
null
code-starcoder2
76
[ { "api_name": "modules.Module", "line_number": 20, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 71, "usage_type": "call" }, { "api_name": "os.path", "line_number": 71, "usage_type": "attribute" }, { "api_name": "os.makedirs", "li...
317855281
import sys sys.path.append("G:/New Folder/utils") import os import re import numpy as np import pandas as pd import seaborn as sns from keras.models import Model from keras.preprocessing.sequence import pad_sequences from keras.preprocessing.text import Tokenizer from keras.layers.embeddings import Embedding ...
null
2019-december/9.sentence or pargraph or document vectors/layer understanding-embedding.py
layer understanding-embedding.py
py
3,163
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "re.sub", "line_number": 16, "usage_type": "call" }, { "api_name": "keras.preprocessing.text.Tokenizer...
114618756
from keras.activations import relu, elu from keras.models import Sequential from keras.layers import Dense, Dropout from keras.activations import sigmoid from talos import early_stopper from talos import Scan from talos import Evaluate from talos import Deploy p = {'activation1':[relu, elu], 'activation2':[relu,...
null
model_neu/testing_methods/talos_test.py
talos_test.py
py
2,427
python
en
code
null
code-starcoder2
76
[ { "api_name": "keras.activations.relu", "line_number": 11, "usage_type": "name" }, { "api_name": "keras.activations.elu", "line_number": 11, "usage_type": "name" }, { "api_name": "keras.activations.relu", "line_number": 12, "usage_type": "name" }, { "api_name": "k...
507926593
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Predict classes """ import os import argparse import numpy as np np.random.seed(13) from src.class_prediction_lstm import prepare_data, predict from sklearn.externals import joblib parser = argparse.ArgumentParser() parser.add_argument("-id", "--movie-id", default=3...
null
class_prediction.py
class_prediction.py
py
1,223
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.seed", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 10, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.e...
413229186
from __future__ import print_function import sys, os, os.path, operator, shutil, glob, json, ast import openface, numpy as np net = openface.TorchNeuralNet(model="models/openface/nn4.small2.v1.t7", cuda=True) def connected_components(graph): visited = [] clusters = [] for start_node in list(graph.keys())...
null
analysis/clustering/conn_comp_analysis.py
conn_comp_analysis.py
py
5,705
python
en
code
null
code-starcoder2
76
[ { "api_name": "openface.TorchNeuralNet", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path", "line_number": 29, "usage_type": "attribute" }, { "api_name": "json.load", "l...
465773971
""" Basic functions to interact with different customers """ # pylint: disable=too-many-arguments import logging import peewee as pw import customer_model as cm logging.basicConfig(level=logging.INFO) LOGGER = logging.getLogger(__name__) def add_customer(customer_id, customer_firstname, customer_lastname, customer...
null
students/andrew_garcia/lesson03-assignment/basic_operations.py
basic_operations.py
py
2,715
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 9, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "customer_model....
524626010
# !/usr/bin/python import os, sys import sys import re import numpy as np import networkx as nx import matplotlib.pyplot as plt import random from random import randrange ###### SEIR model : ###### #In this category of models, individuals experience a long incubation duration (the “exposed” category), # such tha...
null
SEIRmodel.py
SEIRmodel.py
py
7,069
python
en
code
null
code-starcoder2
76
[ { "api_name": "networkx.barabasi_albert_graph", "line_number": 21, "usage_type": "call" }, { "api_name": "random.randrange", "line_number": 35, "usage_type": "call" }, { "api_name": "random.sample", "line_number": 53, "usage_type": "call" }, { "api_name": "matplot...
573824563
import numpy as np from sklearn.metrics import roc_auc_score import torch import torchvision.transforms as transforms from openvino.inference_engine import IECore, StatusCode import argparse import timeit from datasets import ChestXrayDataSet from model import CLASS_NAMES, N_CLASSES def main(modelfile): model_xml...
null
async.py
async.py
py
4,125
python
en
code
null
code-starcoder2
76
[ { "api_name": "openvino.inference_engine.IECore", "line_number": 17, "usage_type": "call" }, { "api_name": "torchvision.transforms.Normalize", "line_number": 27, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 27, "usage_type": "name" }, ...
468997968
# -*- coding: utf-8 -*- import re import random from scrapy import Request, FormRequest, Spider from loginform import fill_login_form from general.items import ProductItems, PriceItems class CowtanSpider(Spider): name = 'cowtan' allowed_domains = ['www.cowtan.com'] def __init__(self, **kwargs): s...
null
general/spiders/cowtan.py
cowtan.py
py
9,188
python
en
code
null
code-starcoder2
76
[ { "api_name": "scrapy.Spider", "line_number": 9, "usage_type": "name" }, { "api_name": "random.choice", "line_number": 43, "usage_type": "call" }, { "api_name": "scrapy.Request", "line_number": 47, "usage_type": "call" }, { "api_name": "scrapy.Request", "line_...
445986204
# 不想混吃等死 import pandas as pd from matplotlib import pyplot as plt # trying to get data from sheet df01 = pd.read_csv('01.csv');df02 = pd.read_csv('02.csv');df03 = pd.read_csv('03.csv') param01 = df01.head();param02 = df02.head();param03 = df03.head() print(param01);print(param02);print(param03) print(plt.style.availab...
null
datacamp_tutorial/data_science/matplot.py
matplot.py
py
1,042
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style", "line_number": 9, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 9, "usage_type": "name" }, { "api_name": "matplotli...
523999619
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: yutingyw """ import numpy as np class Transformers(object): @staticmethod def autoencoder(*args, **kwargs): from Feedforward import Autoencoder class AutoencoderTransformer(Autoencoder): def fit_transform(self, x, y=None):...
null
Preprocessors.py
Preprocessors.py
py
14,359
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.uniform", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 23, "usage_type": "attribute" }, { "api_name": "numpy.random.choice", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.rand...
319825013
import pandas as pd import numpy as np import spacy import matplotlib.pyplot as plt import seaborn as sns import multiprocessing as mp from functools import wraps def multi_map_fn(fn): @wraps(fn) def wrap(x): df, args, kwargs = x return fn(df, *args, **kwargs) return wrap def multi_map(df...
null
trash/parallel_because.py
parallel_because.py
py
2,249
python
en
code
null
code-starcoder2
76
[ { "api_name": "functools.wraps", "line_number": 11, "usage_type": "call" }, { "api_name": "multiprocessing.cpu_count", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.array_split", "line_number": 18, "usage_type": "call" }, { "api_name": "multiproc...
123570136
import pandas as pd import Quandl from wrapper_v2 import IBWrapper, IBclient from swigibpy import Contract as IBcontract from accessrights import q_access_key import os import time import logging def set_logging(): logger = logging.getLogger('Downloads') logger.setLevel(logging.DEBUG) # create file handle...
null
private/data/prod2_downloader.py
prod2_downloader.py
py
9,227
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 12, "usage_type": "attribute" }, { "api_name": "logging.FileHandler", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.DEBU...
601512888
from os import path from setuptools import setup def load_long_descriprion(): this_directory = path.abspath(path.dirname(__file__)) with open(path.join(this_directory, "README.rst")) as readme: return readme.read() setup( name="Airpixel", version="0.8", url="https://github.com/mmEissen/a...
null
pypi_install_script/Airpixel-0.8.tar/setup.py
setup.py
py
806
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.abspath", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "name" }, { "api_name": "os.path.dirname", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path.join", "line_number"...
642664149
import torch import torch.nn as nn import matplotlib.pyplot as plt import constants print ("cuda available = " + str(torch.cuda.is_available())) cuda = torch.device('cuda') #read all_article_words_deduped.txt and gather the 1-hot encoding size. file1 = open(constants.filepath_all_article_words_deduped, 'r') Lines...
null
stockthingy/train_network.py
train_network.py
py
1,806
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.cuda.is_available", "line_number": 7, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.device", "line_number": 9, "usage_type": "call" }, { "api_name": "constants.filepath_...
598710182
import os from datetime import datetime from flask import Flask, render_template, url_for, request, redirect, flash from flask_sqlalchemy import SQLAlchemy from forms import BookmarkForm import models basedir = os.path.abspath(os.path.dirname(__file__)) app = Flask(__name__) #app.logger.debug(basedir) bookmarks...
null
thermos.py
thermos.py
py
2,139
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.abspath", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.Flask", "line_...
634907103
import pygame class Ship(): def __init__(self, screen, ai_settings): self.screen = screen self.ai_settings = ai_settings self.image = pygame.image.load('image/ship.dib.bmp') self.rect = self.image.get_rect() self.screen_rect = screen.get_rect() self.rect.centerx = se...
null
alien_invasion/ship.py
ship.py
py
1,012
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.image.load", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 6, "usage_type": "attribute" } ]
155221816
from _datetime import datetime import pymysql import pytest from src.my_db import MyDB YEAR = datetime.now().year OTHER_YEAR = datetime.now().year + 2 DB_NAME = 'home_budget' OTHER_DB_NAME = 'other_db' TABLE_NAME = 'budget' OTHER_TABLE_NAME = 'other_table' @pytest.fixture(scope='module') def my_connect_to_my_db(requ...
null
tests/my_db_operations_test.py
my_db_operations_test.py
py
1,632
python
en
code
null
code-starcoder2
76
[ { "api_name": "_datetime.datetime.now", "line_number": 6, "usage_type": "call" }, { "api_name": "_datetime.datetime", "line_number": 6, "usage_type": "name" }, { "api_name": "_datetime.datetime.now", "line_number": 7, "usage_type": "call" }, { "api_name": "_dateti...
26943566
import logging from ad_api.base import AdvertisingApiException, Marketplaces from ad_api.api.sp import Campaigns logging.basicConfig( level=logging.DEBUG, format="%(asctime)s:%(levelname)s:%(message)s" ) try: states = 'enabled' res = Campaigns().list_campaigns_extended_request( stateFilter=sta...
null
docs/example.py
example.py
py
475
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 5, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 6, "usage_type": "attribute" }, { "api_name": "ad_api.api.sp.Campaigns", "line_number": 12, "usage_type": "call" }, { "api_name": "logging....
219299061
from datetime import datetime from flask import Blueprint from sqlalchemy.exc import IntegrityError, DataError from anubis.models import db, Assignment, AssignedStudentQuestion, AssignedQuestionResponse from anubis.utils.auth.http import require_user from anubis.utils.auth.user import current_user from anubis.utils.d...
null
api/anubis/views/public/questions.py
questions.py
py
3,993
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Blueprint", "line_number": 16, "usage_type": "call" }, { "api_name": "anubis.models.Assignment", "line_number": 23, "usage_type": "name" }, { "api_name": "anubis.utils.http.success_response", "line_number": 31, "usage_type": "call" }, { "api_n...
90044921
from django.test import TestCase from django.contrib.staticfiles.testing import StaticLiveServerTestCase from selenium.webdriver.firefox.webdriver import WebDriver from selenium.common.exceptions import NoSuchElementException from core.models import User # Create your tests here. # Per volcar db per a test cal fer am...
null
core/tests.py
tests.py
py
10,235
python
en
code
null
code-starcoder2
76
[ { "api_name": "selenium.common.exceptions.NoSuchElementException", "line_number": 79, "usage_type": "name" }, { "api_name": "core.models.User.objects.get", "line_number": 90, "usage_type": "call" }, { "api_name": "core.models.User.objects", "line_number": 90, "usage_type"...
299242658
from django.urls import path,include from . import views urlpatterns=[ path('',views.home,name='home'), path('contact/',views.contact,name='contact'), path('about/',views.about,name='about'), path('services/',views.services,name='services'), path('learnmore/',views.learnmore,name='learnmore'), ...
null
stocknet/appp/urls.py
urls.py
py
3,178
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", ...
582375622
# -*- coding: utf-8 -*- # 格值点转换为NetCDF文件 import netCDF4 as nc import numpy as np import os import pdb import errno import sys import math inp_dir = "D:\\ResearchProjects\\2020\\zw" out_dir = "D:\\ResearchProjects\\2020" # inp_file = '地下水等效水高变化ewh.dat' # inp_file = '地下水等效水高变化ewh_gps10.dat' # inp_file = '地下水等效水高变化ewh0...
null
DataProcess/gridpts2netCDF.py
gridpts2netCDF.py
py
2,827
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "line_number": 23, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 29, "usage_type": "call" }, { "api_name": "errno.EEXIST", "line_number...
316241862
""" Programme réalisé le, 08/08/2021 """ from os import remove import pygame, sys from pygame.locals import * from classes import * from time import sleep from functools import partial from PIL import Image import os from tkinter import filedialog, Tk from tkinter.messagebox import * ### VARIABLES ### fps = 60 grid...
null
main.py
main.py
py
15,350
python
en
code
null
code-starcoder2
76
[ { "api_name": "tkinter.Tk", "line_number": 30, "usage_type": "call" }, { "api_name": "pygame.transform.scale", "line_number": 36, "usage_type": "call" }, { "api_name": "pygame.transform", "line_number": 36, "usage_type": "attribute" }, { "api_name": "pygame.image....
605705985
#!/usr/bin/env python3 # coding: utf-8 # Example 18 IoT チャイム WSGI 版 【チャイム音の排他処理対応】 port = 4 # GPIO ポート番号 ping_f = 554 # チャイム音の周波数1 pong_f = 440 # チャイム音の周波数2 from wsgiref.simple_server import make_server from R...
null
learning/example18_iot_chime_n.py
example18_iot_chime_n.py
py
3,577
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.sleep", "line_number": 19, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 21, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 27, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": ...
93606610
# TODO MultiFrame -> GroupedFrame # new MultiFrame for multidata from __future__ import print_function from future.builtins import * import os # import re import shelve from collections import OrderedDict from pandas import Series, DataFrame, Index # from pandas import concat from . import plot as plt from .pl...
null
Owls/FoamFrame.py
FoamFrame.py
py
25,065
python
en
code
null
code-starcoder2
76
[ { "api_name": "shelve.open", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path.expanduser", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path", "line_number": 32, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_...
417070315
import sqlite3 import sys import datetime import argparse def currentTime(): return datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") def expOfLevel(level): return int(1.04 ** (level + 100)) def showNotes(): conn = sqlite3.connect("note.db") curs = conn.cursor() curs.execute("select * from note") print("No...
null
noteUI/test/build-interC-Desktop_Qt_5_10_1_MinGW_32bit-Debug/note.py
note.py
py
5,321
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.now", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 7, "usage_type": "attribute" }, { "api_name": "sqlite3.connect", "line_number": 13, "usage_type": "call" }, { "api_name": "sqlite3.co...
186919267
# -*- coding: utf-8 -*- # @Time : 18-10-19 上午10:43 # @Author : 张帆 # @Site : # @File : loginDialogControl.py # @Software: PyCharm import json import os import sys import time from PyQt5.QtCore import pyqtSlot, pyqtSignal, QUrl, QSettings, QTimer from PyQt5.QtNetwork import QAbstractSocket from PyQt5.QtWebSo...
null
app/UIControl/loginDialogControl.py
loginDialogControl.py
py
37,288
python
en
code
null
code-starcoder2
76
[ { "api_name": "PyQt5.QtWidgets.QDialog", "line_number": 31, "usage_type": "name" }, { "api_name": "app.UIView.loginDialog.Ui_LoginDialog", "line_number": 31, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.pyqtSignal", "line_number": 32, "usage_type": "call" }, { ...
551865098
# -*- coding: utf-8 -*- # by digiteng... from Renderer import Renderer from enigma import ePixmap, eTimer, loadJPG from Components.Pixmap import Pixmap import json, os, re from urllib2 import urlopen, quote tmdb_api = "3c3efcf47c3577558812bb9d64019d65" path_folder = "/tmp/" class pstr(Renderer): def __...
null
Poster/pstr.py
pstr.py
py
1,365
python
en
code
null
code-starcoder2
76
[ { "api_name": "Renderer.Renderer", "line_number": 12, "usage_type": "name" }, { "api_name": "Renderer.Renderer.__init__", "line_number": 15, "usage_type": "call" }, { "api_name": "Renderer.Renderer", "line_number": 15, "usage_type": "name" }, { "api_name": "enigma...
322386470
from selenium import webdriver from selenium.common.exceptions import * from webdriver_manager.chrome import ChromeDriverManager driver = webdriver.Chrome(ChromeDriverManager().install()) driver.get('https://antoogle.testoneo.com/') xpath_list = ['*yolo_this_is_not_xpath*', '//*[@class="this xpath cannot be found"]'...
null
try_except/scratch_2.py
scratch_2.py
py
757
python
en
code
null
code-starcoder2
76
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 6, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 6, "usage_type": "name" }, { "api_name": "webdriver_manager.chrome.ChromeDriverManager", "line_number": 6, "usage_type": "call" } ]
383476793
import torch import torch.nn as nn from ..builder import QUANLAYERS import torch.nn.functional as F @QUANLAYERS.register_module() class DRFLinear(nn.Linear): """Applies a quantized linear layers in DoReFa-Net way. args: in_features(int): Size of each input sample out_features(int): Size of e...
null
quantrans/quantops/DOREFA/DRFLinear.py
DRFLinear.py
py
4,376
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.Linear", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 8, "usage_type": "name" }, { "api_name": "torch.fake_quantize_per_tensor_affine", "line_number": 57, "usage_type": "call" }, { "api_name": "tor...
132042698
# encoding: utf-8 """ pychievments.icons includes the :py:mod:`Icon` class as well as a number of pre-defined icons useful for CLI applications. * unicodeCheck * unicdeCheckBox * star """ class ColorCatcher(object): def __getattr__(self, name): return lambda s: s try: from clint.textui import colore...
null
pychievements/icons.py
icons.py
py
2,048
python
en
code
null
code-starcoder2
76
[ { "api_name": "clint.textui.colored", "line_number": 19, "usage_type": "name" }, { "api_name": "clint.textui.colored.white", "line_number": 55, "usage_type": "call" }, { "api_name": "clint.textui.colored", "line_number": 55, "usage_type": "name" }, { "api_name": "...
217038969
import jinja2 import webapp2 from google.appengine.ext import db from google.appengine.api import memcache # not gonna use it, will just use a dictionary for caching import time import logging jinja_env = jinja2.Environment(loader=jinja2.FileSystemLoader('./templates'),autoescape=True) updated=True CACHE = {} var=0 ...
null
blog-with-caching.py
blog-with-caching.py
py
2,800
python
en
code
null
code-starcoder2
76
[ { "api_name": "jinja2.Environment", "line_number": 9, "usage_type": "call" }, { "api_name": "jinja2.FileSystemLoader", "line_number": 9, "usage_type": "call" }, { "api_name": "google.appengine.ext.db.Model", "line_number": 19, "usage_type": "attribute" }, { "api_n...
213779086
# -*- coding: utf-8 -*- """ Latte activity log analyzer """ from datetime import datetime, timedelta import errno from sqlalchemy import * from .Config import Config from .Log import Log from .latte import Latte class Analyzer(object): """ Analyzes Latte log data """ def __init__(self, config, session, a...
null
latte/Analyzer.py
Analyzer.py
py
6,608
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.now", "line_number": 85, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 85, "usage_type": "name" }, { "api_name": "datetime.timedelta", "line_number": 85, "usage_type": "call" }, { "api_name": "errno.EPIP...
520991395
import json import os from typing import Dict, TextIO HERE = os.path.dirname(__file__) def parse_object(obj_file: TextIO) -> Dict[str, str]: lines = list(obj_file.readlines()) obj = {} for heading, content in zip(lines[0::2], lines[1::2]): name = heading.lstrip('#').split('(')[0].strip() ...
null
build.py
build.py
py
893
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.dirname", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "typing.TextIO", "line_number": 9, "usage_type": "name" }, { "api_name": "typing.Dict", "line_numbe...
400380426
import sys import sqlite3 import asyncio from ..utils import update_file class SqliteStorage: def __init__(self, filename='data/db.sqlite3', loop=None): if loop is None: loop = asyncio.get_event_loop() self.loop = loop self.conn = sqlite3.connect(filename) self.conn.row_...
null
wallpainter/db/__init__.py
__init__.py
py
2,036
python
en
code
null
code-starcoder2
76
[ { "api_name": "asyncio.get_event_loop", "line_number": 9, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 11, "usage_type": "call" }, { "api_name": "sqlite3.Row", "line_number": 12, "usage_type": "attribute" }, { "api_name": "sys.stdout.flu...
490077777
"""This module is part of the CFSAN SNP Pipeline. It contains the code to remove the abnormal snps. """ from __future__ import print_function from __future__ import absolute_import from Bio import SeqIO from collections import defaultdict import os import sys import shutil import vcf from snppipeline import utils d...
null
snppipeline/filter_regions.py
filter_regions.py
py
14,364
python
en
code
null
code-starcoder2
76
[ { "api_name": "snppipeline.utils.print_log_header", "line_number": 69, "usage_type": "call" }, { "api_name": "snppipeline.utils", "line_number": 69, "usage_type": "name" }, { "api_name": "snppipeline.utils.print_arguments", "line_number": 70, "usage_type": "call" }, {...
651462514
from Test import Test import json from Utils import Connector class TestSumAllMoney(Test): __result_db=[] __result_test_data=[] __r=Connector.Connector().getConnector() def _createResult(self,mas_val): for k in range(2): sum = 0 myId = "" i = 0 ...
null
simcord_study/Redis_Class_2/Tests/TestSumAllMoney.py
TestSumAllMoney.py
py
967
python
en
code
null
code-starcoder2
76
[ { "api_name": "Test.Test", "line_number": 5, "usage_type": "name" }, { "api_name": "Utils.Connector.Connector", "line_number": 9, "usage_type": "call" }, { "api_name": "Utils.Connector", "line_number": 9, "usage_type": "name" }, { "api_name": "json.loads", "li...
366910488
# pip3 install fastapi python-multipart uvicorn # uvicorn onsei.api:app --reload """ API to perform an audio comparison and get a graph """ import logging import os import subprocess import traceback from io import BytesIO from tempfile import TemporaryDirectory import matplotlib.pyplot as plt from fastapi import Fast...
null
onsei/api.py
api.py
py
8,217
python
en
code
null
code-starcoder2
76
[ { "api_name": "fastapi.FastAPI", "line_number": 21, "usage_type": "call" }, { "api_name": "onsei.speech_record.AlignmentMethod", "line_number": 32, "usage_type": "name" }, { "api_name": "fastapi.UploadFile", "line_number": 34, "usage_type": "name" }, { "api_name":...
429320128
import os import re import warnings import nbformat import sys import numpy as np import matplotlib.pyplot as plt _plt = plt from unittest import mock from itertools import dropwhile, takewhile def run_cell(source, variables=None, nb_path=''): def repl(m): command, args = m.groups() if command != ...
null
nbtester/loader.py
loader.py
py
6,003
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot", "line_number": 8, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "lin...
509612130
from flask import Flask, render_template, url_for, request, redirect, session,flash import pymysql import os import pandas as pd import datetime import numpy as np from sklearn.svm import SVR app = Flask(__name__) app.secret_key = os.urandom(24) # configuaring database db = pymysql.connect("localhost", ...
null
Stock-Pice-Prediction/webapp/app.py
app.py
py
16,041
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "os.urandom", "line_number": 11, "usage_type": "call" }, { "api_name": "pymysql.connect", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.render_template", "li...
285220861
from collections import deque def wordFind(board,word,row,col): index = 0 q = deque() is_visited = [] q.append([row,col]) is_visited.append([row,col]) while q: popped_ele = q.pop() for [neighbor_row,neighbor_col] in [[popped_ele[0]-1,popped_ele[1]],[popped_ele[0],poppe...
null
problem70.py
problem70.py
py
1,196
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.deque", "line_number": 5, "usage_type": "call" } ]
575609433
import numpy as np import pylab import matplotlib.pyplot as plt import os from astropy.io import fits import argparse import shutil import readflat as rf import simpixlc as sp import gentraj as gt import addnoise as an import transitmodel as tm import pld import sys if __name__ == "__main__": parser = argparse....
null
src/faketarg.py
faketarg.py
py
9,278
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.int", "line_number": 59, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 63, "usage_type": "call" }, { "api_name": "os.path", "line_nu...
157831326
import requests import json import pprint def travel_time_demo(): url = 'https://maps.googleapis.com/maps/api/directions/json' param = { 'origin': '2001 Carrington Park Cir, Morrisville, NC 27560', 'destination': '3020 Carrington Mill Blvd, Morrisville, NC 27560', 'key': 'AIzaSyDaf1DdB...
null
api_test/googleapi_test.py
googleapi_test.py
py
646
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 14, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 16, "usage_type": "call" } ]
463297108
from typing import Union import asyncpg from asyncpg import Connection from asyncpg.pool import Pool from data import config class Database: def __init__(self): self.pool: Union[Pool, None] = None async def create(self): self.pool = await asyncpg.create_pool( us...
null
utils/db_api/postgresql.py
postgresql.py
py
7,692
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.Union", "line_number": 13, "usage_type": "name" }, { "api_name": "asyncpg.pool.Pool", "line_number": 13, "usage_type": "name" }, { "api_name": "asyncpg.create_pool", "line_number": 16, "usage_type": "call" }, { "api_name": "data.config.DB_USE...
219496221
import os from operator import add import json import argparse import numpy as np import hydra from omegaconf import DictConfig from hydra import slurm_utils @hydra.main(config_path=os.path.expandvars('$HOME/conf/$PROJ'), config_name='config') def display_results(cfg: DictConfig): res_string = "" std_string =...
null
scripts/display_avg_noise.py
display_avg_noise.py
py
5,040
python
en
code
null
code-starcoder2
76
[ { "api_name": "omegaconf.DictConfig", "line_number": 12, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "line_number": 23, "usage_type": "attribute" }, { "api_name": "os.path.join", "li...
328773499
from ftw.builder import Builder from ftw.builder import create from ftw.testbrowser import browser as default_browser from ftw.testbrowser import browsing from ftw.testbrowser.pages.statusmessages import info_messages from opengever.task.adapters import IResponseContainer from opengever.task.browser.modify_deadline imp...
null
opengever/task/tests/test_deadline_modification.py
test_deadline_modification.py
py
8,184
python
en
code
null
code-starcoder2
76
[ { "api_name": "opengever.testing.FunctionalTestCase", "line_number": 18, "usage_type": "name" }, { "api_name": "opengever.task.response_syncer.deadline.ModifyDeadlineResponseSyncerReceiver._check_internal_request", "line_number": 24, "usage_type": "attribute" }, { "api_name": "op...
144254634
import json import sys from hourlycpu import CPUGetter from mec import MECGetter from wpcount import WPCountGetter # print("Welcome to Report Creator") class CPMReport(object): def __init__(self): self.system = "" self.report = "" self.month = "" def loadFile(self): try: with open('systems.json') as ...
null
myreport.py
myreport.py
py
3,475
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.load", "line_number": 21, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 27, "usage_type": "call" }, { "api_name": "sys.exc_info", "line_number": 30, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 31, ...
554513819
from flask import Blueprint, request, jsonify, make_response from app.auth.models import Auth, basic_auth, token_auth, Security from app.haulers.models import Haulers, HaulersSchema, db from app.representative.models import Representative, RepresentativeSchema from app.helper.helper import Format from flask_restful imp...
null
app/auth/views.py
views.py
py
10,446
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Blueprint", "line_number": 13, "usage_type": "call" }, { "api_name": "flask_restful.Api", "line_number": 14, "usage_type": "call" }, { "api_name": "flask_restful.Resource", "line_number": 16, "usage_type": "name" }, { "api_name": "app.auth.mod...
509688520
from pylab import * import numpy as np import xarray as xr import pandas as pd import matplotlib.pyplot as plt plt.rc('text', usetex=True) plt.rc('font', family='serif') import matplotlib #from IPython.display import set_matplotlib_formats #set_matplotlib_formats('png', 'pdf') import glob import os import cartopy.crs ...
null
figure_2.py
figure_2.py
py
3,971
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.rc", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 6, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.rc", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.p...
371671105
import torch import torch.nn as nn import torch.nn.functional as fn import torch.utils.data as data import torchvision.transforms as transforms import torchvision.datasets as datasets import os from tqdm import tqdm import numpy as np import matplotlib.pyplot as plt import seaborn as sns from sklearn.manifold import TS...
null
MNISTBasicVAEDataVisualization.py
MNISTBasicVAEDataVisualization.py
py
2,287
python
en
code
null
code-starcoder2
76
[ { "api_name": "torchvision.transforms.Compose", "line_number": 16, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 16, "usage_type": "name" }, { "api_name": "torchvision.transforms.Grayscale", "line_number": 17, "usage_type": "call" }, {...
495385008
import csv import json import sys timeframe = 10 def minimum(a, b): return a < b def maximum(a, b): return a > b def get_sentiment_strength( sentiment_array ): sum = 0.0 cnt = 0 for item in sentiment_array: if( item == "positive" ): sum += 1.0 return sum / len( sentiment_...
null
Python-PHP-Codes/svm_feature_calculator.py
svm_feature_calculator.py
py
4,183
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.load", "line_number": 28, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 32, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 136, "usage_type": "call" } ]
551714326
""" MIT License Copyright (c) 2019 InternetExplorer404 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, pu...
null
plugins/utils.py
utils.py
py
11,545
python
en
code
null
code-starcoder2
76
[ { "api_name": "plugins.colors.color1.return_color", "line_number": 49, "usage_type": "call" }, { "api_name": "imgurpython.ImgurClient", "line_number": 50, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 50, "usage_type": "call" }, { "api_name": "...
565239597
from transformation_utilities import * import logging """A list of all possible status of the projects. Any status not covered will be assumed as False.""" IMPORT_STATUS = { 'Published': True, 'Verified': False, 'Verified-plus': False, 'Incomplete': False, 'Erased': False, 'Under Revision': Fal...
null
publications.py
publications.py
py
6,943
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 57, "usage_type": "call" }, { "api_name": "logging.WARNING", "line_number": 57, "usage_type": "attribute" } ]
409189536
from src.core.plot_settings_handler import setup_ax import matplotlib.pyplot as plt from pandas.core import frame import pandas as pd from collections import Counter import re class DataAnalysis: def __init__(self, data_frame: pd.core.frame.DataFrame): self.data_frame = data_frame def make_a_histogra...
null
src/core/data_analysis.py
data_analysis.py
py
10,161
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.core", "line_number": 10, "usage_type": "attribute" }, { "api_name": "src.core.plot_settings_handler.setup_ax", "line_number": 41, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.savefig", "line_number": 42, "usage_type": "call" }, { ...
559755622
# coding=utf-8 from numpy import equal, is_busday, mat, right_shift class ListNode: def __init__(self, val=0, next=None): self.val = val self.next = next class solution: def decode_at_index(self, s: str, k: int): ''' s=a234567899999999时系统卡死 Q: 给定一个编...
null
LeetCode/LeetCode.py
LeetCode.py
py
66,750
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.fullmatch", "line_number": 222, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 802, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 810, "usage_type": "call" }, { "api_name": "collections.C...
380889595
import io import random from flask import * from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from matplotlib.figure import Figure import matplotlib.pyplot as plt import warnings import itertools import numpy as np import pandas as pd import statsmodels.api as sm import matplotlib app = Flask...
null
app.py
app.py
py
2,837
python
en
code
null
code-starcoder2
76
[ { "api_name": "warnings.filterwarnings", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style.use", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style", "line_number": 16, "usage_type": "attribute" }, { "...
127288736
# -*- coding: utf-8 -*- from django.http import HttpResponse from django.utils import simplejson from django.views.decorators.cache import never_cache from django.contrib.auth.decorators import login_required from apps.notifications.models import * from django.http import HttpResponseRedirect from apps.core.utils ...
null
apps/notifications/views.py
views.py
py
8,104
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.http.HttpResponse", "line_number": 43, "usage_type": "call" }, { "api_name": "django.http.HttpResponseRedirect", "line_number": 45, "usage_type": "call" }, { "api_name": "django.views.decorators.cache.never_cache", "line_number": 20, "usage_type": "n...
57945004
import os import math import copy import ROOT import argparse parser = argparse.ArgumentParser(description = "Receive the parameters") parser.add_argument('--config', action = 'store', type = str, dest = 'cfg', help = 'Input configuration file') parser.add_argument('--var' , action = 'store', type = str, dest = 'var...
null
Configurations/monoHWW/SemiLep/Full2018_v7/darkHiggs/mkNContr.py
mkNContr.py
py
4,050
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "call" }, { "api_name": "ROOT.TFile", "line_number": 70, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 104, "usage_type": "call" }, { "api_name": "math.sqrt", "line_nu...
642790888
import numpy as np import torch import torch.nn as nn import torch.optim as optim from torch.nn.utils.rnn import pad_sequence from transformers import BertJapaneseTokenizer from transformers import BertForSequenceClassification import os from utils import load_mydataset, load_ICD_from_pickle from sklearn.metrics import...
null
code/BERT_for_classification.py
BERT_for_classification.py
py
4,337
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.getcwd", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.device", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.cuda", "line...
271923029
import requests from requests.exceptions import HTTPError from urllib.parse import urljoin import os, codecs import sqlite3 import hashlib from urllib.parse import unquote connection = sqlite3.connect("webcrawler_timeout_2.db") cursor = connection.cursor() cursor.execute("CREATE TABLE true_q (No INTEGER,...
null
webcrawler.py
webcrawler.py
py
4,385
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlite3.connect", "line_number": 9, "usage_type": "call" }, { "api_name": "hashlib.sha256", "line_number": 31, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 41, "usage_type": "call" }, { "api_name": "requests.exceptions.HTTPEr...
161321607
#!/usr/bin/env python3 import xml.sax import xml.sax.handler class Default(object): def __init__(self, value, part): self.value = value self.part = part class Multipart(object): def __init__(self, id, subparts): self.id = id self.subparts = subparts class Subpart(object): ...
null
legacy/electronics/digibom/digibom/projectinfo.py
projectinfo.py
py
2,553
python
en
code
null
code-starcoder2
76
[ { "api_name": "xml.sax.sax", "line_number": 24, "usage_type": "attribute" }, { "api_name": "xml.sax", "line_number": 24, "usage_type": "name" }, { "api_name": "xml.sax.sax.handler.ContentHandler.__init__", "line_number": 26, "usage_type": "call" }, { "api_name": "...
297103599
"""Models to represent task types and instances.""" import json from uuid import uuid4 from django.contrib.auth.models import User from django.contrib.postgres.fields import JSONField from django.core.exceptions import ValidationError from django.core.validators import RegexValidator from django.db import models from ...
null
tasksapi/models.py
models.py
py
11,979
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.core.validators.RegexValidator", "line_number": 29, "usage_type": "call" }, { "api_name": "django.db.models.Model", "line_number": 34, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 34, "usage_type": "name" }, { ...
526924133
import tensorflow as tf import os import numpy as np from utils.config import config_class from utils.factory import ku_dataset import pdb import time class train_class(config_class): def __init__(self, model_name, exp_num, input_normalize, new_Ls, new_Ls_shift): tf.reset_default_graph() print('[i] Train Or...
null
train_utils/train_centerloss.py
train_centerloss.py
py
13,193
python
en
code
null
code-starcoder2
76
[ { "api_name": "utils.config.config_class", "line_number": 9, "usage_type": "name" }, { "api_name": "tensorflow.reset_default_graph", "line_number": 11, "usage_type": "call" }, { "api_name": "tensorflow.placeholder", "line_number": 27, "usage_type": "call" }, { "ap...