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
498760756
# -*- coding: utf-8 -*- """Soft Margin SVM classification with kernels for machine learning. Soft margin SVM is basically an SVM (see folder **supportVectorMachine**) which has some 'slack' and allows features to be 'wrongly' classified to avoid overfitting the classifier. This also includes kernels. Kernels use the i...
null
Classification/KernelSVM/howItWorksSoftMarginSVM.py
howItWorksSoftMarginSVM.py
py
9,187
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.dot", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number": 45, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 54, "usage_type": "call" }, { "api_name": "numpy.linalg.norm", "line_number": ...
276716149
''' Implementation of the Robust Random Cut Forest Algorithm for anomaly detection by Guha et al. (2016). S. Guha, N. Mishra, G. Roy, & O. Schrijvers. Robust random cut forest based anomaly detection on streams, in Proceedings of the 33rd International conference on machine learning, New York, NY, 2016 (pp. 2712-2721)...
null
Streaming-Anomaly-Detection/manatee/robust_rcf.py
robust_rcf.py
py
12,471
python
en
code
null
code-starcoder2
66
[ { "api_name": "sklearn.preprocessing.scale", "line_number": 66, "usage_type": "call" }, { "api_name": "sklearn.preprocessing", "line_number": 66, "usage_type": "name" }, { "api_name": "numpy.random.choice", "line_number": 72, "usage_type": "call" }, { "api_name": ...
55844012
#!/usr/bin/env python # -*- coding: utf-8 -*- # -------------------------------------------------------- # hcmgis_library - hcmgis operation functions # -------------------------------------------------------- import io import re import csv import sys import time import locale import random #import urllib2 import ...
null
hcmgis_library.py
hcmgis_library.py
py
57,302
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.utils.quote", "line_number": 69, "usage_type": "call" }, { "api_name": "requests.utils", "line_number": 69, "usage_type": "attribute" }, { "api_name": "qgis.core.utils.iface.addRasterLayer", "line_number": 70, "usage_type": "call" }, { "api...
640376976
# Add Jekyll Frontmatter to a markdown files from pathlib import Path import re paths = Path('.').glob('*.md') for path in paths: # because path is object not string path_in_str = str(path) # Do thing with the path print(path_in_str) with open(path_in_str,'r') as f: content = f.read() ...
null
add_frontmatter.py
add_frontmatter.py
py
821
python
en
code
null
code-starcoder2
66
[ { "api_name": "pathlib.Path", "line_number": 6, "usage_type": "call" }, { "api_name": "re.search", "line_number": 19, "usage_type": "call" } ]
641779750
import unittest import time from selenium import webdriver from selenium.webdriver.common.by import By from selenium.common.exceptions import NoSuchElementException from selenium.webdriver.common.keys import Keys from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.ui import ...
null
tests/booking_test_Chrome.py
booking_test_Chrome.py
py
11,326
python
en
code
null
code-starcoder2
66
[ { "api_name": "unittest.TestCase", "line_number": 13, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 16, "usage_type": "call" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 18, "usage_type": "call" }, { ...
298928161
from setuptools import setup, find_packages from distutils.extension import Extension import numpy USE_CYTHON = True try: from Cython.Build import cythonize except Exception: USE_CYTHON = False ext = '.pyx' if USE_CYTHON else '.c' extensions = [Extension("tmhmm.hmm", ["tmhmm/hmm" + ext], include_dirs = [nu...
null
setup.py
setup.py
py
842
python
en
code
null
code-starcoder2
66
[ { "api_name": "distutils.extension.Extension", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.get_include", "line_number": 15, "usage_type": "call" }, { "api_name": "Cython.Build.cythonize", "line_number": 18, "usage_type": "call" }, { "api_name":...
36378332
import os import pickle import importlib import numpy as np import pandas as pd from sklearn.metrics.pairwise import cosine_similarity from ckiptagger import data_utils, construct_dictionary, WS from config import MODULE_DIR os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # MODULE_DIR = os.getcwd() MODEL_DIR = "qa_module/mo...
null
app/modules/qa_module/qa.py
qa.py
py
2,610
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 15, "usage_type": "call" }, { "api_name": "config.MODULE_DIR", "line_number": 15, "usage_type": "argument" }, { "api_name": "os.path", "lin...
597574536
import numpy as np import matplotlib.pyplot as plt import astropy.units as u from spectral_cube import SpectralCube from astropy.coordinates import SkyCoord, Angle, SkyOffsetFrame, ICRS, Distance from astropy.table import Table, hstack, join, Column from astropy.stats import histogram from scipy.spatial.distance import...
null
check_SN/check_fidelity.py
check_fidelity.py
py
3,439
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.arange", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.max", "line_number": 32, "usage_type": "call" }, { "api_name": "astropy.table.Table.read", "line_number": 49, "usage_type": "call" }, { "api_name": "astropy.table.Table",...
377331140
"""Secure_Bank URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.0/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-b...
null
internal_user/urls.py
urls.py
py
1,955
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.urls.path", "line_number": 25, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 26, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 27, "usage_type": "call" }, { "api_name": "django.urls.path",...
199147906
import itertools from . import text_buffer from . import tok as token EOF = 'EOF' EOL = 'EOL' INTEGER = 'INTEGER' FLOAT = 'FLOAT' LITERAL = 'LITERAL' NAME = 'NAME' class TokenError(ValueError): pass class CalcLexer: def __init__(self): self.buffer = text_buffer.TextBuffer() self.positions = ...
null
smallcalc/calc_lexer.py
calc_lexer.py
py
2,772
python
en
code
null
code-starcoder2
66
[ { "api_name": "itertools.takewhile", "line_number": 38, "usage_type": "call" }, { "api_name": "itertools.takewhile", "line_number": 47, "usage_type": "call" } ]
463397170
import os,sys,json import networkx as nx import pandas as pd from tqdm import tqdm import numpy as np def use_notebook(): from bokeh.io import output_notebook output_notebook() def is_url(x): return type(x)==str and x.strip().startswith('http') def is_path(x): return type(x) == str and os.path.exists(x) ...
null
hairball.py
hairball.py
py
9,032
python
en
code
null
code-starcoder2
66
[ { "api_name": "bokeh.io.output_notebook", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "networkx.Graph", ...
228872024
# -*- coding: utf-8 -*- # Authored by: Zuojia Jiang (jiangzuojia@gmail.com) import importlib from flask import Flask def create_app(config='settings/config.py', name=__name__): app = Flask(name) app.config.from_pyfile(config) for path in app.config['INSTALL_APPS']: info = path.rsplit('.', 1) ...
null
api/__init__.py
__init__.py
py
496
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "importlib.import_module", "line_number": 13, "usage_type": "call" } ]
525783435
import torch class CNN(torch.nn.Module): def __init__(self, input_shape, output_shape, alpha, device=torch.device('cuda:0')): """[summary] Args: input_shape ([type]): Dimension de la imagen, que estara reescalada a 84x84 output_shape ([type]): dimension de la salida ...
null
A2C PPO/libs/cnn.py
cnn.py
py
1,356
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.nn", "line_number": 4, "usage_type": "attribute" }, { "api_name": "torch.device", "line_number": 6, "usage_type": "call" }, { "api_name": "torch.nn.Sequential", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.nn", "line_num...
282609321
# -*- coding:utf8 -*- import urllib import json def ltp(text): url_get_base = "http://api.ltp-cloud.com/analysis/" args = { 'api_key' : 'I1o081O3m0aX7ixaqVAD7tRZ6JEQiI6jHliJUJcK', 'text' : text, 'pattern' : 'ws', 'format' : 'json' } result = urllib.urlopen(url_get_base, ...
null
utils/ltp.py
ltp.py
py
425
python
en
code
null
code-starcoder2
66
[ { "api_name": "urllib.urlopen", "line_number": 13, "usage_type": "call" }, { "api_name": "urllib.urlencode", "line_number": 13, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 15, "usage_type": "call" } ]
426179274
from __future__ import print_function, absolute_import, division from ctypes import * import sys import threading import numpy from numba import unittest_support as unittest from numba.compiler import compile_isolated from numba import jit, types from .support import MemoryLeakMixin, tag from .ctypes_usecases import ...
null
pkgs/numba-0.24.0-np110py27_0/lib/python2.7/site-packages/numba/tests/test_ctypes.py
test_ctypes.py
py
4,289
python
en
code
null
code-starcoder2
66
[ { "api_name": "support.MemoryLeakMixin", "line_number": 15, "usage_type": "name" }, { "api_name": "numba.unittest_support.TestCase", "line_number": 15, "usage_type": "attribute" }, { "api_name": "numba.unittest_support", "line_number": 15, "usage_type": "name" }, { ...
430833555
# -*- coding: utf-8 -*- import pandas as pd import numpy as np import math from keras.models import load_model from tensorflow import set_random_seed from keras.models import Sequential from keras.layers import Dense,BatchNormalization from keras.layers import GRU, Bidirectional, TimeDistributed from sklearn.preprocess...
null
gru_learn/paper_model/gru_model.py
gru_model.py
py
5,940
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.random.seed", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 17, "usage_type": "attribute" }, { "api_name": "tensorflow.set_random_seed", "line_number": 18, "usage_type": "call" }, { "api_name": "keras....
526012666
#!/usr/bin/env python # -*-encoding: utf-8-*- # t27_2 # перевірка чи є рядок паліндромом через WSGI сервер import cgi # тіло HTML сторінки, на якій все буде відбуватись HTML_PAGE = """<html> <title>Перевірка, чи є рядок паліндромом</title> <body> <h3>Перевірка заданого рядка</h3> <br> {} <br> <br> <form method=POST ...
null
dz_others/subject27_norm_web_server/t27_2/t27_2(wsgi).py
t27_2(wsgi).py
py
2,678
python
en
code
null
code-starcoder2
66
[ { "api_name": "cgi.FieldStorage", "line_number": 59, "usage_type": "call" }, { "api_name": "wsgiref.simple_server.make_server", "line_number": 84, "usage_type": "call" } ]
311573153
# # Curses example program # import string def message(window, text,row=23): window.move(row,0) window.clrtoeol() window.addstr(row,5,text) window.refresh() def sure(win,msg_text): while 1: message(win,msg_text) comm_ch = win.getch() ans = chr(comm_ch) if ans ...
null
console/test.py
test.py
py
2,207
python
en
code
null
code-starcoder2
66
[ { "api_name": "string.center", "line_number": 31, "usage_type": "call" }, { "api_name": "curses.initscr", "line_number": 76, "usage_type": "call" }, { "api_name": "curses.noecho", "line_number": 77, "usage_type": "call" }, { "api_name": "curses.cbreak", "line_...
276960654
""" zoom.packages Provide a simple shorthand way to include external components in projects. """ import json import os import zoom default_packages = { 'c3': { 'libs': [ 'https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.min.js', 'https://cdnjs.cloudflare.com/ajax/libs...
null
zoom/packages.py
packages.py
py
2,280
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.isfile", "line_number": 33, "usage_type": "call" }, { "api_name": "os.path", "line_number": 33, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 35, "usage_type": "call" }, { "api_name": "zoom.system", "line_number"...
83446595
import logging logger = logging.getLogger('XiaoQiang') logger.setLevel(logging.INFO) ch = logging.StreamHandler() ch.setLevel(logging.DEBUG) fh = logging.FileHandler('access.log') fh.setLevel(logging.CRITICAL) formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s") ch.setFormatter(fo...
null
my_mission/BRUSH/aliexpress_order/localtest/test_logging.py
test_logging.py
py
556
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 4, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 5, "usage_type": "attribute" }, { "api_name": "logging.StreamHandler", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.DEBUG"...
172374538
""" CSV https://janakiev.com/blog/csv-in-python/ https://www.biostars.org/p/357678/ """ import argparse import numpy as np # python3 e4client -u pietromota@hotmail.com -p PietrXXXX! -a -o out # pega os dados vindos do .csv from CSV.libEmotionDetection import get_data, addInterrogationEmotion, session_path raiz_temp...
null
Python/CSV/createEmotionDatabase.py
createEmotionDatabase.py
py
1,099
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 17, "usage_type": "call" }, { "api_name": "CSV.libEmotionDetection.session_path", "line_number": 24, "usage_type": "call" }, { "api_name": "CSV.libEmotionDetection.get_data", "line_number": 26, "usage_type": "call" ...
629188795
from django.contrib.auth.mixins import LoginRequiredMixin from django.http import HttpResponse, HttpRequest from django.shortcuts import redirect from django.urls import reverse from django.views import View from main.modules.search import search_algorithm class BaseView(LoginRequiredMixin, View): """ Базовый...
null
main/modules/base.py
base.py
py
1,577
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.contrib.auth.mixins.LoginRequiredMixin", "line_number": 9, "usage_type": "name" }, { "api_name": "django.views.View", "line_number": 9, "usage_type": "name" }, { "api_name": "django.http.HttpRequest", "line_number": 19, "usage_type": "name" }, { ...
530180620
from django.conf.urls import patterns, url, include from farmers import views from rest_framework.routers import DefaultRouter # Create a router and register our viewsets with it. router = DefaultRouter() router.register(r'farmers', views.FarmerViewSet) router.register(r'users', views.UserViewSet) router.register(r're...
null
urls.py
urls.py
py
729
python
en
code
null
code-starcoder2
66
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 6, "usage_type": "call" }, { "api_name": "farmers.views.FarmerViewSet", "line_number": 7, "usage_type": "attribute" }, { "api_name": "farmers.views", "line_number": 7, "usage_type": "name" }, { "...
353099474
# coding: utf-8 """ Application of all sites QC mode We apply the model built from data from all sites. This has to be run by submission to the LSF queue on the cluster. This script was generated from an ipython notebook of the same name then modified into its current form """ import sys import os im...
null
external_tools/src/main/python/images/qc_apply_all_sites_model.py
qc_apply_all_sites_model.py
py
9,124
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 27, "usage_type": "call" }, { "api_name": "qc_helper.parse_model_desc", "line_number": 67, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 77, "usage_type": "call" }, { "api_name": "sys.exit"...
285234030
import json from math import fabs from flask import Flask, render_template, request, jsonify app = Flask(__name__) file = open('RU.txt', 'r', encoding='utf-8') # Файл обработанной базы данных (Оставлены только города) ''' Перенос базы данных из файла в список ''' cities_list = [] for line in file: ...
null
script.py
script.py
py
8,683
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.request.args.get", "line_number": 31, "usage_type": "call" }, { "api_name": "flask.request.args", "line_number": 31, "usage_type": "attribute" }, { "api_name": "flask.reque...
453299023
from random import randint from django import forms from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.models import User from account.models import HomeworkAssignment, Class, SUBJECTS, Teacher, Student, Parent class RegistrationForm(UserCreationForm): first_name = forms.CharField(m...
null
account/forms.py
forms.py
py
5,293
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.contrib.auth.forms.UserCreationForm", "line_number": 10, "usage_type": "name" }, { "api_name": "django.forms.CharField", "line_number": 11, "usage_type": "call" }, { "api_name": "django.forms", "line_number": 11, "usage_type": "name" }, { "ap...
461364617
# -*- coding: utf-8 -*- """ Created on Thu Feb 04 18:38:48 2016 @author: lcalvo """ import pandas as pd import numpy as np import matplotlib.pyplot as pl import operator ######################################################################### def guarde_Frente_Pareto(pDatos, pTipos, maxX, maxY, pCategX, pCateg...
null
fig/2016-02-19-Graficar Dispersion.py
2016-02-19-Graficar Dispersion.py
py
6,893
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.DataFrame", "line_number": 24, "usage_type": "call" }, { "api_name": "operator.itemgetter", "line_number": 56, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.clf", "line_number": 89, "usage_type": "call" }, { "api_name": "matplotlib...
462482380
from app import app, helpers from app.forms import SignupForm, UnsubscribeForm, BugReportForm, HolidayPartyTickets, DuesForm, MugsForm from classes.TextClient import TextClient from flask import render_template, flash, redirect, request # request added 25 Jun import logging import os import random import sendgrid from ...
null
app/views.py
views.py
py
15,611
python
en
code
null
code-starcoder2
66
[ { "api_name": "app.forms.SignupForm", "line_number": 21, "usage_type": "call" }, { "api_name": "app.helpers.get_db_conn_and_cursor", "line_number": 25, "usage_type": "call" }, { "api_name": "app.helpers", "line_number": 25, "usage_type": "name" }, { "api_name": "a...
13934520
#!/usr/bin/env python """ Plot SWP That's all folks. """ __author__ = "Martin De Kauwe" __version__ = "1.0 (18.10.2017)" __email__ = "mdekauwe@gmail.com" import xarray as xr import matplotlib.pyplot as plt import sys import datetime as dt import pandas as pd import numpy as np from matplotlib.ticker import FixedLoca...
null
plot_hist_psi_leaf.py
plot_hist_psi_leaf.py
py
12,037
python
en
code
null
code-starcoder2
66
[ { "api_name": "glob.glob", "line_number": 57, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 57, "usage_type": "call" }, { "api_name": "os.path", "line_number": 57, "usage_type": "attribute" }, { "api_name": "numpy.nan", "line_number": 59...
31795521
import sqlite3 class DAO(object): def __init__(self): self.dbname = 'database.db' self.con = sqlite3.connect(self.dbname) self.cursor = self.con.cursor() try: self.con.execute("PRAGMA foreign_keys = 1") acc_table = """ CREATE TABLE acc_data( ...
null
Expenses/DAO/dao.py
dao.py
py
3,639
python
en
code
null
code-starcoder2
66
[ { "api_name": "sqlite3.connect", "line_number": 5, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 35, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 52, "usage_type": "call" }, { "api_name": "sqlite3.connect", ...
588768901
#!/usr/bin/python3 # -*- coding: utf-8 -*- import numpy as np import cv2 import argparse import yaml import os import glob import time from joblib import Parallel, delayed from classes.image import Image def parse_arguments(): """ Simple parser for yml settings file """ params= yaml.load(open("settings.yml")...
null
archv/process.py
process.py
py
1,795
python
en
code
null
code-starcoder2
66
[ { "api_name": "yaml.load", "line_number": 17, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 35, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 35, "usage_type": "call" }, { "api_name": "os.path", "line_number": 35, ...
493169096
import numpy as np from astropy.convolution import Gaussian2DKernel,convolve class GrismModel: def poly2ddeg3(x,y,p): X,Y = np.meshgrid(x,y,copy=True) Z = p[0] + \ p[1]*X + p[2]*Y + \ p[3]*X**2 + p[4]*X*Y + p[5]*Y**2 + \ p[6]*X**3 + p[7]*(X**2)*Y + p[8]*X*(Y**2) +...
null
build/lib/kbastroutils/grismmodel.py
grismmodel.py
py
672
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.meshgrid", "line_number": 5, "usage_type": "call" }, { "api_name": "astropy.convolution.Gaussian2DKernel", "line_number": 12, "usage_type": "call" }, { "api_name": "astropy.convolution.convolve", "line_number": 13, "usage_type": "call" }, { "a...
176755396
import matplotlib.pyplot as plt import commlib as cl import numpy as np # Parameters TS = 1e-9 samples_per_symbol = 20 tinitial = 0 tguard = 10 * TS f0 = 10 / TS N0 = 1e-10 B = 3e9 Nbits = 32 # system transfer function H = lambda f : np.exp( -f**2.0 / f0 ** 2.0 / 2) # Signal constellation c = cl.pam_constellation(4,...
null
lecture6/noise.py
noise.py
py
940
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.exp", "line_number": 16, "usage_type": "call" }, { "api_name": "commlib.pam_constellation", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.close", "line_number": 22, "usage_type": "call" }, { "api_name": "matplotli...
485745170
import time from pynput.mouse import Button, Controller mouse = Controller() def Mzlego0(): fbe = open('koordinata.txt', 'r') for data in fbe: data = data.strip().split(',') print(data[0], data[1]) mouse.position = (int(data[0]), int(data[1])) time.sleep(1) ...
null
grepo sarcer.py
grepo sarcer.py
py
496
python
en
code
null
code-starcoder2
66
[ { "api_name": "pynput.mouse.Controller", "line_number": 4, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 13, "usage_type": "call" }, { "api_name": "pynput.mouse.Button.left", "line_number": 14, "usage_type": "attribute" }, { "api_name": "pynpu...
604674446
import glob, os import time from PIL import Image import numpy as np from scipy import ndimage import matplotlib.pyplot as plt from skimage.io import imsave from skimage import exposure def load_img_seq(data=None): if data is not None: imfiles = sorted([os.path.join(data, f) for f in os.listdir(data) if f...
null
ct-tools/vis.py
vis.py
py
813
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.join", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 13, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 1...
328808388
"""Base GRR module class. GRR modules should extend it.""" from __future__ import print_function from __future__ import unicode_literals import abc import tempfile import time from grr_api_client import api as grr_api from grr_api_client import errors as grr_errors from dftimewolf.lib import module class GRRBaseM...
null
dftimewolf/lib/collectors/grr_base.py
grr_base.py
py
3,683
python
en
code
null
code-starcoder2
66
[ { "api_name": "dftimewolf.lib.module.BaseModule", "line_number": 16, "usage_type": "attribute" }, { "api_name": "dftimewolf.lib.module", "line_number": 16, "usage_type": "name" }, { "api_name": "grr_api_client.api.InitHttp", "line_number": 57, "usage_type": "call" }, ...
575914104
import csv import copy import os import cv2 import numpy as np #import matplotlib.pyplot as plt GEN_DIR="gendir" if os.path.exists(GEN_DIR) == False: os.mkdir(GEN_DIR) if os.path.exists(os.path.join(GEN_DIR, "IMG")) == False: os.mkdir(os.path.join(GEN_DIR, "IMG")) def read_csv_samples(samples, angles, path,...
null
gen_bak.py
gen_bak.py
py
4,274
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.exists", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.exists", "line_numbe...
589607909
# place additional imports here if needed import re from collections import Counter import csv def ex1(text, char='-'): """ Given a text of arbitrary length, divide the text on the character given and return the resulting list. E.g., ex1('hi-me') = ['hi', 'me']; ex1('hi-me', char='+') = ['hi-me']; ex1('abc...
null
material/25-10/main.py
main.py
py
3,737
python
en
code
null
code-starcoder2
66
[ { "api_name": "re.search", "line_number": 53, "usage_type": "call" }, { "api_name": "re.search", "line_number": 62, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 73, "usage_type": "call" }, { "api_name": "csv.reader", "line_number...
408721233
# coding=utf-8 #================================================================ # # File name : bitwise_not_demo.py # Author : Faye # Created date: 2021/6/22 11:14 # Description : # #================================================================ import cv2 import numpy as np # 加载图像 img1 = cv2.imread...
null
base/_06_cv2/_14_bit_operation/bitwise_not_demo.py
bitwise_not_demo.py
py
1,407
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.imread", "line_number": 14, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 15, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 19, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 21...
371421697
import pylab import numpy import matplotlib.pyplot as plt time_interval = 3.0/10.0 n_points = 1000; fig1 = plt.figure() for i in range(0, 10): data = numpy.loadtxt(open(str(i) + ".dat", "r")) u = data[:, 1] x = data[:, 0] plt.plot(x, u) plt.show() fig1.savefig("u_x1.png") plt.close() fig2 = plt.figure() f...
null
graficador.py
graficador.py
py
499
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 8, "usage_type": "name" }, { "api_name": "numpy.loadtxt", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.pyp...
38236793
import discord #nice it seems to have worked fine import random import os client = discord.Client() users = ["Nicko", "Tarbel", "Matthew", "Aamna", "Dylon"] who_answers = ["Must be ", "Obviously ", "Gotta be ", "Definitely ", "Eh, probably ", ""] king = "Couldn't be Sam" @client.event async def on_ready(): print...
null
HumbleBeginnings.py
HumbleBeginnings.py
py
1,293
python
en
code
null
code-starcoder2
66
[ { "api_name": "discord.Client", "line_number": 5, "usage_type": "call" }, { "api_name": "discord.Game", "line_number": 14, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 23, "usage_type": "call" }, { "api_name": "random.choice", "line_n...
349034318
import socket from ssl import PROTOCOL_TLSv1 from OpenSSL import SSL import pendulum import requests import json import time def get_domains(cert): san = '' ext_count = cert.get_extension_count() for i in range(0, ext_count): ext = cert.get_extension(i) if 'subjectAltNam...
null
src/valdomain.py
valdomain.py
py
11,303
python
en
code
null
code-starcoder2
66
[ { "api_name": "pendulum.parse", "line_number": 37, "usage_type": "call" }, { "api_name": "pendulum.parse", "line_number": 38, "usage_type": "call" }, { "api_name": "pendulum.now", "line_number": 39, "usage_type": "call" }, { "api_name": "socket.socket", "line_...
560805898
# encoding: utf-8 """ @author: weijian @contact: dengwj16@gmail.com """ import glob import re import os.path as osp from .bases import BaseImageDataset class personX_spgan(BaseImageDataset): """ personX (source domain): only consains training samples Dataset statistics: # identities: 700 # imag...
null
devkit/data/datasets/personX_spgan.py
personX_spgan.py
py
2,292
python
en
code
null
code-starcoder2
66
[ { "api_name": "bases.BaseImageDataset", "line_number": 14, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path", "line_number": 27, "usage_type": "name" }, { "api_name": "os.path.join", "line_...
20483939
#!/usr/bin/python3 """ This script that starts a Flask web application """ from flask import Flask, render_template from models import storage from models import * app = Flask(__name__) @app.route('/states_list', strict_slashes=False) def states_list(): """displays states in HTML page sorted alphabetically""" ...
null
web_flask/7-states_list.py
7-states_list.py
py
651
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "models.storage.all", "line_number": 15, "usage_type": "call" }, { "api_name": "models.storage", "line_number": 15, "usage_type": "name" }, { "api_name": "flask.render_template", ...
510101935
from tkinter import * from tkinter import messagebox from tkinter import scrolledtext global entqote global text import numpy as np import matplotlib.pyplot as plt global student_list global mark_list global list1 root = Tk() root.title("Student Management System") root...
null
sms.py
sms.py
py
18,241
python
en
code
null
code-starcoder2
66
[ { "api_name": "cx_Oracle.connect", "line_number": 62, "usage_type": "call" }, { "api_name": "cx_Oracle.DatabaseError", "line_number": 90, "usage_type": "attribute" }, { "api_name": "cx_Oracle.connect", "line_number": 128, "usage_type": "call" }, { "api_name": "tki...
518222516
import random import bpy class User: requirePassword = True maxUsers = 1000 #not used usersList = [] def __init__(self, name, id_num, DOB): self.name = name self.id_num = id_num self.DOB = DOB self.usersList.append(self) def showUserByPosition(posit...
null
User Management System Project in Python/testing.py
testing.py
py
1,844
python
en
code
null
code-starcoder2
66
[ { "api_name": "random.randrange", "line_number": 43, "usage_type": "call" }, { "api_name": "bpy.ops.object.select_all", "line_number": 71, "usage_type": "call" }, { "api_name": "bpy.ops", "line_number": 71, "usage_type": "attribute" }, { "api_name": "bpy.data", ...
105246974
#!/usr/bin/env python3 import argparse # import glob # import itertools import math import multiprocessing import os # import sys from pathlib import Path from typing import Iterable import numpy as np import pandas as pd from astropy import constants as const from astropy import units as u import artistools as at i...
null
artistools/lightcurve.py
lightcurve.py
py
66,215
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.get_cmap", "line_number": 29, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 29, "usage_type": "name" }, { "api_name": "numpy.linspace", "line_number": 29, "usage_type": "call" }, { "api_name": "pandas.re...
232221638
# Copyright 2019 Google LLC # # 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 agreed to in writing, ...
null
python/signature/public_key_verify_key_manager_test.py
public_key_verify_key_manager_test.py
py
3,674
python
en
code
null
code-starcoder2
66
[ { "api_name": "tink.python.tink_config.register", "line_number": 33, "usage_type": "call" }, { "api_name": "tink.python.tink_config", "line_number": 33, "usage_type": "name" }, { "api_name": "tink.proto.ecdsa_pb2.EcdsaParams", "line_number": 37, "usage_type": "call" }, ...
548936124
#!/usr/bin/env python # # Copyright (c) 2017 Amazon.com, Inc. or its affiliates. All Rights # Reserved. # # Additional copyrights may follow import BuildFiler import unittest import logging import time import os import shutil import tempfile import errno import glob logger = logging.get...
null
nightly-tarball/MockBuildFiler.py
MockBuildFiler.py
py
6,894
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 19, "usage_type": "call" }, { "api_name": "BuildFiler.BuildFiler", "line_number": 22, "usage_type": "attribute" }, { "api_name": "time.time", "line_number": 33, "usage_type": "call" }, { "api_name": "tempfile.mkdte...
226656765
import os import cv2 import numpy as np import tensorflow as tf import keras.utils from keras import backend as kbe from keras.models import Sequential from keras.layers import Dense, Dropout, Flatten, Conv2D, Conv3D, MaxPooling2D, Activation from keras.optimizers import SGD, Adadelta, Adagrad from keras.callbacks imp...
null
train_custom_detector.py
train_custom_detector.py
py
4,190
python
en
code
null
code-starcoder2
66
[ { "api_name": "keras.models.Sequential", "line_number": 42, "usage_type": "call" }, { "api_name": "keras.layers.Conv2D", "line_number": 44, "usage_type": "call" }, { "api_name": "keras.layers.Activation", "line_number": 46, "usage_type": "call" }, { "api_name": "k...
54914941
# Task 25: Task Manager # Function: Register new user - requires username and password # Confirm password and write information to the user.txt file # Only admin are allow to register new users def reg_user(): if username == "admin": print("Register New User") new_user = input("Please in...
null
Task 25 - task manager.py
Task 25 - task manager.py
py
11,539
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime.now", "line_number": 211, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 211, "usage_type": "name" }, { "api_name": "datetime.datetime.strptime", "line_number": 214, "usage_type": "call" }, { "api_name": ...
250797419
import json import os import nltk import pandas as pd import glob import argparse import sys parser = argparse.ArgumentParser(description='parse out the relevant infor from CSI and output a JSON, a txt, and a meta file') parser.add_argument('directory', help='directory with input files', type=str) parser.add_argumen...
null
scripts/CSI2json_and_texts.py
CSI2json_and_texts.py
py
3,171
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "nltk.data.load", "line_number": 16, "usage_type": "call" }, { "api_name": "nltk.data", "line_number": 16, "usage_type": "attribute" }, { "api_name": "pandas.read_csv...
643584446
import numpy as np import pandas as pd import dash_bootstrap_components as dbc from datetime import timedelta, date from dash.dependencies import Input, Output, State from dash_project.get_data import all_tickers_data from .server import app @app.callback( Output('corr_table_window_x', 'children'), [Input('s...
null
dash_project/performance.py
performance.py
py
8,845
python
en
code
null
code-starcoder2
66
[ { "api_name": "dash_project.get_data.all_tickers_data.loc", "line_number": 19, "usage_type": "attribute" }, { "api_name": "dash_project.get_data.all_tickers_data", "line_number": 19, "usage_type": "name" }, { "api_name": "dash_project.get_data.all_tickers_data.loc", "line_num...
631622700
from setuptools import setup, Extension try: from Cython.Build import cythonize except ImportError: cythonize = None ext_module = Extension( 'graphique.arrayed', sources=['graphique/arrayed' + ('.pyx' if cythonize else '.cpp')], extra_compile_args=['-std=c++11'], extra_link_args=['-std=c++11']...
null
setup.py
setup.py
py
1,946
python
en
code
null
code-starcoder2
66
[ { "api_name": "Cython.Build.cythonize", "line_number": 6, "usage_type": "name" }, { "api_name": "setuptools.Extension", "line_number": 8, "usage_type": "call" }, { "api_name": "Cython.Build.cythonize", "line_number": 10, "usage_type": "name" }, { "api_name": "setu...
35456379
from PyQt5 import QtCore, QtWidgets, uic, QtGui import os import sys import time class ThreadProgress(QtCore.QThread): mysignal = QtCore.pyqtSignal(int) def __init__(self, parent=None): QtCore.QThread.__init__(self, parent) def run(self): i = 0 while i<101: time.sleep(...
null
combine/gui/splashscreen/photobooth.py
photobooth.py
py
2,130
python
en
code
null
code-starcoder2
66
[ { "api_name": "PyQt5.QtCore.QThread", "line_number": 8, "usage_type": "attribute" }, { "api_name": "PyQt5.QtCore", "line_number": 8, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.pyqtSignal", "line_number": 9, "usage_type": "call" }, { "api_name": "PyQt5.QtC...
152571857
import redis import time import re import json import os import subprocess current_subprocess = None current_uuid = None DATA_DIR = os.path.join(os.getenv("HOME"), "musicazoo_videos") redis = redis.Redis() def sanitize(ytid): return re.sub("[^-a-zA-Z0-9_]", "?", ytid) def path_for(ytid): return os.path.join(DATA...
null
player.py
player.py
py
2,279
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.getenv", "line_number": 11, "usage_type": "call" }, { "api_name": "redis.Redis", "line_number": ...
250509620
# # Self-Driving Car Engineer Nanodegree # ## Deep Learning - Vehicle detection ## Pipeline and tracker functions that enable vehicle detection import matplotlib.image as mpimg import matplotlib.pyplot as plt import numpy as np import cv2 import glob import time from sklearn.preprocessing import StandardScaler from...
null
source/tracking_pipeline.py
tracking_pipeline.py
py
16,877
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.copy", "line_number": 23, "usage_type": "call" }, { "api_name": "cv2.rectangle", "line_number": 28, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 36, "usage_type": "call" }, { "api_name": "cv2.COLOR_RGB2YCrCb", "line...
250879407
import pandas import matplotlib # reads the csv using pandas df = pandas.read_csv('data.csv') # selects the two columns that are needed df = df[['purpose','int_rate']] # groups the dataframe by the purpose and then gets the mean df = df.groupby('purpose').mean() # change the column name df.columns = ['avg_rate'] # plot...
null
script.py
script.py
py
483
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 4, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.show", "line_number": 14, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 14, "usage_type": "attribute" } ]
448507714
from kivy.app import App from kivy.uix.image import Image from kivy.properties import ObjectProperty from kivy.uix.gridlayout import GridLayout from kivy.core.image import Image as CoreImage from kivy.uix.behaviors import ButtonBehavior from kivy.lang import Builder from mlp.serialization import ( remote_action_app...
null
mlp/widgets/action/action.py
action.py
py
5,362
python
en
code
null
code-starcoder2
66
[ { "api_name": "kivy.lang.Builder.load_file", "line_number": 16, "usage_type": "call" }, { "api_name": "kivy.lang.Builder", "line_number": 16, "usage_type": "name" }, { "api_name": "general.image_button.image_button.ImageButton", "line_number": 19, "usage_type": "name" }...
343481124
from collections import defaultdict import json import operator from django.shortcuts import render, get_object_or_404, redirect from django.db.models import Prefetch, F, Max from django.conf import settings from django.contrib.auth import login, logout from django.contrib.auth.decorators import login_required from dj...
null
core/views.py
views.py
py
12,678
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 22, "usage_type": "call" }, { "api_name": "django.shortcuts.get_object_or_404", "line_number": 28, "usage_type": "call" }, { "api_name": "maps.utils", "line_number": 29, "usage_type": "name" }, { "...
496073842
import datetime import json import logging import dateutil from django.conf import settings from django.core.urlresolvers import reverse from django.utils import html import pytz from corehq.apps.reports import util from corehq.apps.reports.standard import DatespanMixin from corehq.apps.reports.standard.deployments imp...
null
phonelog/reports.py
reports.py
py
14,169
python
en
code
null
code-starcoder2
66
[ { "api_name": "corehq.apps.reports.standard.deployments.DeploymentsReport", "line_number": 20, "usage_type": "name" }, { "api_name": "corehq.apps.reports.standard.DatespanMixin", "line_number": 20, "usage_type": "name" }, { "api_name": "corehq.apps.reports.standard.deployments.De...
87559140
from django.contrib import admin from django.urls import path,include; from blog_app import views; urlpatterns = [ # path('home/',views.home,name="blog_home"), path('',views.PostListView.as_view(),name="blog_home"), path('user/<str:username>/',views.UserPostListView.as_view(),name="user_post"), path('post/<int:pk>/',vi...
null
blog/blog_app/urls.py
urls.py
py
653
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "blog_app.views.PostListView.as_view", "line_number": 6, "usage_type": "call" }, { "api_name": "blog_app.views.PostListView", "line_number": 6, "usage_type": "attribute" }, { ...
105890977
#!/usr/bin/python3 """ 1. FIFO caching """ from datetime import datetime BaseCaching = __import__('base_caching').BaseCaching class FIFOCache(BaseCaching): """ BaseCache defines: - overwrite functions 'put' and 'get' for implement FIFO caching system """ def __init__(self): """ Initili...
null
0x03-caching/1-fifo_cache.py
1-fifo_cache.py
py
1,540
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime.now", "line_number": 30, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 30, "usage_type": "name" } ]
157500181
import matplotlib.pyplot as plt import numpy as np x = np.linspace(0.0, 5.0, 50) y1 = np.sin(x) y2 = np.cos(x) plt.subplot(2, 2, 1) line1, = plt.plot( x, y1, 'ko-', label='cos' ) # ax1.set_ylim([-1, 1]) plt.xlabel('x-axis') plt.ylabel('y-axis') plt.legend() plt.title("cos figure") plt.subplot(2, 2, 2) line2, = plt...
null
Mathplot_org.py
Mathplot_org.py
py
1,676
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.linspace", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.cos", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplot", "line...
526160755
from flask import render_template from blog import app from database import session from models import Post @app.route('/') @app.route('/page/<int:page>') def posts(page=1, paginate_by=10): # Zero-indexed page page_index = page - 1 count = session.query(Post).count() start = page_index * paginate_by end = star...
null
blog/views.py
views.py
py
3,766
python
en
code
null
code-starcoder2
66
[ { "api_name": "database.session.query", "line_number": 13, "usage_type": "call" }, { "api_name": "models.Post", "line_number": 13, "usage_type": "argument" }, { "api_name": "database.session", "line_number": 13, "usage_type": "name" }, { "api_name": "database.sess...
119790789
from performanceapi.models import Performance from performanceapi.serializers import PerformanceSerializer from rest_framework import mixins, status, generics from rest_framework.response import Response from django.db import IntegrityError from datetime import datetime from rest_framework.decorators import api_view fr...
null
openmic/performanceapi/views.py
views.py
py
8,122
python
en
code
null
code-starcoder2
66
[ { "api_name": "rest_framework.generics.ListCreateAPIView", "line_number": 17, "usage_type": "attribute" }, { "api_name": "rest_framework.generics", "line_number": 17, "usage_type": "name" }, { "api_name": "performanceapi.models.Performance.objects.all", "line_number": 18, ...
353988592
from django.urls import path from quizes_app.views import * urlpatterns = [ path('quizzes/', QuizListView.as_view(), name='quizzes'), path('quiz/<int:pk>/', QuizDetailView.as_view(), name='quiz_detail'), path('answer/<int:pk>/', AnswerView.as_view(), name='answer'), path('results/<int:pk>/', ResultsVi...
null
quizes_app/urls.py
urls.py
py
353
python
en
code
null
code-starcoder2
66
[ { "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", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", ...
301110671
from PIL import Image def is_pink(img, size, pix, row_num): for x in range(size[0]): if pix[x, row_num] == 195: # magenta return x return False def shift_row(size, pix, row_num, pix_shift): shifted_row = [pix[i, row_num] for i in \ range(pix_shift, size[0]) + range(pi...
null
level16_mozart.py
level16_mozart.py
py
822
python
en
code
null
code-starcoder2
66
[ { "api_name": "PIL.Image.open", "line_number": 15, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 15, "usage_type": "name" } ]
489797035
import unittest import config from PIL import Image import numpy as np from keras.preprocessing import image from pymongo.errors import ServerSelectionTimeoutError from mongo_datastore import MongoDatastore from keras.models import load_model from web_server import app class TestKerasModel(unittest.TestCase): def set...
null
unit_tests.py
unit_tests.py
py
2,255
python
en
code
null
code-starcoder2
66
[ { "api_name": "unittest.TestCase", "line_number": 11, "usage_type": "attribute" }, { "api_name": "keras.models.load_model", "line_number": 13, "usage_type": "call" }, { "api_name": "config.test_neural_network", "line_number": 13, "usage_type": "attribute" }, { "ap...
547400616
#coding=utf-8 import os import tensorflow as tf from PIL import Image import sys import pydicom classification={"others":0,"pneumonia":1} def creat_tfrecord(df_parsed,is_training=True): if is_training: writer = tf.python_io.TFRecordWriter("F:/Datasets/Pneunomia/train_data.tfrecords") else: wr...
null
Vision/Python/Applications/Pneumonia/create_tfrecords.py
create_tfrecords.py
py
1,018
python
en
code
null
code-starcoder2
66
[ { "api_name": "tensorflow.python_io.TFRecordWriter", "line_number": 13, "usage_type": "call" }, { "api_name": "tensorflow.python_io", "line_number": 13, "usage_type": "attribute" }, { "api_name": "tensorflow.python_io.TFRecordWriter", "line_number": 15, "usage_type": "cal...
502143068
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Aug 31 15:02:32 2019 @author: eadali """ import requests from bs4 import BeautifulSoup import pandas # CONFIGS # ============================================================================= datapath = 'pages.csv' # =================================...
null
extract_wiki_data.py
extract_wiki_data.py
py
2,952
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.DataFrame", "line_number": 36, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 44, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 44, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", ...
587419784
import os, time, unittest from appium import webdriver desired_caps = {'platformName': 'Android', 'platformVersion': '8.0.0', 'deviceName': 'a82ccd1d', # 'app': r'D:\apk\boobuz.apk', 'appPackage': 'com.erlinyou.worldlist', 'appActivity': ...
null
aut/test/test3.py
test3.py
py
1,633
python
en
code
null
code-starcoder2
66
[ { "api_name": "appium.webdriver.Remote", "line_number": 17, "usage_type": "call" }, { "api_name": "appium.webdriver", "line_number": 17, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 21, "usage_type": "call" }, { "api_name": "time.sleep", ...
370701186
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models from django import forms from django.utils.translation import ugettext_lazy as _ from wagtail.wagtailcore.models import Page from wagtail.wagtailcore.blocks import ( StreamBlock, CharBlock, RichTextBlock, Stru...
null
core/models.py
models.py
py
2,072
python
en
code
null
code-starcoder2
66
[ { "api_name": "wagtail.wagtailcore.blocks.FieldBlock", "line_number": 28, "usage_type": "name" }, { "api_name": "django.forms.ChoiceField", "line_number": 29, "usage_type": "call" }, { "api_name": "django.forms", "line_number": 29, "usage_type": "name" }, { "api_n...
143154336
import numpy as np import pickle,gzip,sys import matplotlib.gridspec as gridspec import matplotlib.pyplot as plt fig = plt.figure() gs = gridspec.GridSpec(3, 4) data = pickle.load(gzip.open('/Users/sanjaykumarp/sptXdes/SCL-sptpol_cluster_lensing/QE/QE_schem_rep.pkl.gz')) unlen = data['unlensed']*1e6 - np.mean(data['unl...
null
make_plots/get_schematic_qe.py
get_schematic_qe.py
py
1,095
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 5, "usage_type": "name" }, { "api_name": "matplotlib.gridspec.GridSpec", "line_number": 6, "usage_type": "call" }, { "api_name": "...
464666208
#!/usr/bin/python3 """Export data in JSON format""" import json import requests from sys import argv if __name__ == "__main__": api_url = 'https://jsonplaceholder.typicode.com' users_url = '{}/users'.format(api_url) r_users = requests.get(users_url).json() users_dict = {} for user in r_users: ...
null
0x15-api/3-dictionary_of_list_of_dictionaries.py
3-dictionary_of_list_of_dictionaries.py
py
910
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 11, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 16, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 27, "usage_type": "call" } ]
224696446
# (C) Datadog, Inc. 2020-present # All rights reserved # Licensed under Simplified BSD License (see LICENSE) from datadog_checks.istio import Istio from . import common from .utils import _assert_tags_excluded def test_istiod(aggregator, istiod_mixture_fixture): """ Test the istiod deployment endpoint for v1...
null
istio/tests/test_istio_1_5.py
test_istio_1_5.py
py
2,181
python
en
code
null
code-starcoder2
66
[ { "api_name": "datadog_checks.istio.Istio", "line_number": 14, "usage_type": "call" }, { "api_name": "datadog_checks.istio.Istio", "line_number": 27, "usage_type": "call" }, { "api_name": "utils._assert_tags_excluded", "line_number": 33, "usage_type": "call" }, { ...
179254239
import matplotlib.pyplot as plt import matplotlib.patches as pat import numpy as np plt.xkcd() fig = plt.figure() plt.xlim((0,2)) plt.ylim((0,2)) ax = fig.add_subplot(111) ax.set_aspect('equal') A = pat.Arc(xy = (1.75,1.25), width = 1, height = 1 , theta1 = 90 ,theta2 = 180, linewidth = 20 , edgecolor = '#ffffff') ax...
null
plot.py
plot.py
py
505
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.xkcd", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 5, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 6, "usage_type": "call" }, { "api_name": "matplo...
307907354
# -*- coding: utf-8 -*- ''' @Description: @Version: 1.0.0 @Author: louishsu @Github: https://github.com/isLouisHsu @E-mail: is.louishsu@foxmail.com @Date: 2019-09-03 09:30:51 @LastEditTime: 2019-09-03 09:45:11 @Update: ''' import torch from torch import nn from torch import cuda from torch.optim import SGD from torch...
null
src/train.py
train.py
py
3,913
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.nn.CrossEntropyLoss", "line_number": 29, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 29, "usage_type": "name" }, { "api_name": "torch.optim.SGD", "line_number": 30, "usage_type": "name" }, { "api_name": "model.LSTM", "...
279101463
"""Unit tests for the route authentication plugin.""" import logging import unittest from datetime import datetime, timezone from unittest.mock import Mock import bottle from routes.plugins import AuthPlugin, InjectionPlugin class AuthPluginTest(unittest.TestCase): """Unit tests for the route authentication an...
null
components/server/tests/routes/route_plugins/test_route_auth_plugin.py
test_route_auth_plugin.py
py
2,955
python
en
code
null
code-starcoder2
66
[ { "api_name": "unittest.TestCase", "line_number": 13, "usage_type": "attribute" }, { "api_name": "logging.disable", "line_number": 18, "usage_type": "call" }, { "api_name": "unittest.mock.Mock", "line_number": 19, "usage_type": "call" }, { "api_name": "bottle.inst...
482143341
#!/usr/bin/env python3 import argparse import os import shlex import time from mylast import lastfm_network, lastfm_username # Show my now playing song, or that of a given username # Prerequisites: mylast.py, pyLast def say(thing): cmd = "say {}".format(shlex.quote(str(thing))) os.system(cmd) if __name__ ...
null
np.py
np.py
py
1,527
python
en
code
null
code-starcoder2
66
[ { "api_name": "shlex.quote", "line_number": 14, "usage_type": "call" }, { "api_name": "os.system", "line_number": 15, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 19, "usage_type": "call" }, { "api_name": "argparse.ArgumentDefaul...
246127282
import random from flask import Flask,render_template,Response,redirect,url_for,request import time import math import multiprocessing from flask import Flask, render_template from werkzeug.datastructures import CallbackDict, ViewItems from werkzeug.wrappers import ETagRequestMixin app = Flask(__name__) c...
null
Flask/start.py
start.py
py
20,929
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.redirect", "line_number": 101, "usage_type": "call" }, { "api_name": "flask.url_for", "line_number": 101, "usage_type": "call" }, { "api_name": "flask.render_template", ...
248172290
import os import KratosMultiphysics from KratosMultiphysics import Logger import multiprocessing def CreateAndRunStageInSelectedNumberOfOpenMPThreads(my_obj, model, parameters_file_name, number_of_threads): if "OMP_NUM_THREADS" in os.environ: initial_number_of_threads = os.environ['OMP_NUM_THREADS'] ...
null
applications/DEMApplication/tests/auxiliary_functions_for_tests.py
auxiliary_functions_for_tests.py
py
1,021
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 9, "usage_type": "attribute" }, { "api_name": "KratosMultiphysics.ParallelUtilities.SetNumThreads", "line_number": 10, "usage_type": "call" }, { "...
152162073
# neural network with 5 layers # # · · · · · · · · · · (input data, flattened pixels) X [batch, 784] # 784 = 28*28 # \x/x\x/x\x/x\x/x\x/ -- fully connected layer (relu) W1 [784, 200] B1[200] # · · · · · · · · · Y1 [batch, 200] # \x/x...
null
4.0_five_layers_relu_lrdecay_batchnorm.py
4.0_five_layers_relu_lrdecay_batchnorm.py
py
5,861
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.nn.Module", "line_number": 32, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 32, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_number": 37, "usage_type": "call" }, { "api_name": "torch.nn", "line_nu...
368296730
import gensim import unicodedata import pandas as pd import sys import csv import os import nltk import io import string import re from sys import exit import codecs #Convert train and text #os.chdir('/Volumes/limoncito/NLP/NER_Spectral/') context_words = 2 train=io.open("train.txt",'r', encoding = 'utf-8') evalua...
null
03_code/Python/Depricated/HPC/02_context_average.py
02_context_average.py
py
3,625
python
en
code
null
code-starcoder2
66
[ { "api_name": "io.open", "line_number": 20, "usage_type": "call" }, { "api_name": "io.open", "line_number": 21, "usage_type": "call" }, { "api_name": "nltk.data.load", "line_number": 46, "usage_type": "call" }, { "api_name": "nltk.data", "line_number": 46, ...
245472772
import sys import time import serial ser = serial.Serial('/dev/ttyUSB0', 9600) fp = open('lutron2.csv', 'w', 32) ser.read(64) # Readout dummy values while True: try: temp = None hum = None while True: if temp != None and hum != None: break d = ser....
null
code-compare-am2301s-mm2001-lutron/lutron2.py
lutron2.py
py
751
python
en
code
null
code-starcoder2
66
[ { "api_name": "serial.Serial", "line_number": 6, "usage_type": "call" }, { "api_name": "time.time", "line_number": 27, "usage_type": "call" } ]
521336426
""" Basics of Matplotlib Scatter Plot Line Plot Pie Chart Bar Chart Histogram Box Plot """ import matplotlib.pyplot as plt x = [1,2,3,4,5,6,7,8,9,10] y = [1,2,3,4,5,6,7,8,9,10] # Setting the title plt.title("A Line Graph") # Setting the X Label plt.xlabel("X") # Setting the Y Label pl...
null
day11/Day_11_Matplotlib.py
Day_11_Matplotlib.py
py
9,858
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.title", "line_number": 20, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 20, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.xlabel", "line_number": 23, "usage_type": "call" }, { "api_name": "ma...
130981340
#!/usr/bin/env python # -*- coding: utf-8 -*- # ライブラリのインポート import boto3 import subprocess import wave # 翻訳したい文章(英語)を入力する print("日本語を入力すると、英語に翻訳して音声合成します。") input_text = raw_input("入力: > ") # AWSを使う準備 translate = boto3.client(service_name="translate") polly = boto3.client(service_name="polly") # 文章を翻訳 translate_te...
null
aws_sample/translate_speech.py
translate_speech.py
py
1,423
python
en
code
null
code-starcoder2
66
[ { "api_name": "boto3.client", "line_number": 15, "usage_type": "call" }, { "api_name": "boto3.client", "line_number": 16, "usage_type": "call" }, { "api_name": "wave.open", "line_number": 40, "usage_type": "call" }, { "api_name": "subprocess.check_call", "line...
447496552
# -*- coding: utf-8 -*- import paramiko,time ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) DIP = raw_input("Please input an IP:") ssh.connect(str(DIP), 22, "root", "root") #stdin, stdout, stderr = ssh.exec_command("lsh;configure;run show bfd session") chan = ssh.invoke_shell() ...
null
script-py/workspace/save_with_input.py
save_with_input.py
py
573
python
en
code
null
code-starcoder2
66
[ { "api_name": "paramiko.SSHClient", "line_number": 4, "usage_type": "call" }, { "api_name": "paramiko.AutoAddPolicy", "line_number": 5, "usage_type": "call" }, { "api_name": "time.strftime", "line_number": 14, "usage_type": "call" }, { "api_name": "time.localtime"...
591048115
import numpy as np import pandas as pd import yfinance as yf #reading the code that has the forecasts and then they rename the dataset as date and signal forecasts = pd.read_csv("sp500_forecasts_new.csv", header = None).rename(columns = {0: 'Date', 1: 'Signal'}) #then we want to reset the index so that it is i...
null
MaurícioCordeiro/step by step ARIMA + GARCH/arima1.py
arima1.py
py
1,706
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 6, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "line_number": 12, "usage_type": "call" }, { "api_name": "yfinance.Ticker", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.log", "li...
350253181
from django.contrib import admin from django.http import HttpResponseRedirect from django.utils.html import format_html from django.shortcuts import reverse from django.core.cache import cache from .models import (Restaurant, Product, RestaurantMenuItem, ProductCategory,Order,OrderItem) class O...
null
foodcartapp/admin.py
admin.py
py
3,328
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.contrib.admin.TabularInline", "line_number": 12, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 12, "usage_type": "name" }, { "api_name": "models.OrderItem", "line_number": 13, "usage_type": "name" }, { "api...
647169356
from django.shortcuts import render from .forms import RoundForm from .forms import FightForm from .models import Round from .models import Fight from .models import Game from users.models import CustomUser from datetime import datetime # Create your views here. def create_fight_view(request): form = FightForm(re...
null
games/views.py
views.py
py
5,825
python
en
code
null
code-starcoder2
66
[ { "api_name": "forms.FightForm", "line_number": 13, "usage_type": "call" }, { "api_name": "forms.FightForm", "line_number": 16, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 20, "usage_type": "call" }, { "api_name": "models.Fight....
498201833
import numpy as np from sklearn.feature_extraction.text import CountVectorizer import re from sklearn.decomposition import TruncatedSVD from sklearn.preprocessing import LabelEncoder import pandas as pd import seaborn as sns import matplotlib.pyplot as plt sns.set(style="ticks", color_codes=True) def readData(textfile...
null
Assignment 6/PCA.py
PCA.py
py
1,421
python
en
code
null
code-starcoder2
66
[ { "api_name": "seaborn.set", "line_number": 9, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 16, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 23, "us...
587443227
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('tinder', '0005_comment_moment'), ] operations = [ migrations.RemoveField( model_name='moment', name=...
null
flint/tinder/migrations/0006_auto_20150708_1313.py
0006_auto_20150708_1313.py
py
729
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.RemoveField", "line_number": 14, "usage_type": "call" }, ...
176932389
# Imports import numpy as np import os import argparse import tensorflow as tf from cnn_models import CNN_Model cnn_model = CNN_Model #which model to use import cv2 from data_processing.audio_to_image import convertWav #DEBUG, INFO, WARN, ERROR, or FATAL tf.logging.set_verbosity(tf.logging.WARN) #Argument parsing par...
null
predict_cnn.py
predict_cnn.py
py
1,740
python
en
code
null
code-starcoder2
66
[ { "api_name": "cnn_models.CNN_Model", "line_number": 7, "usage_type": "name" }, { "api_name": "tensorflow.logging.set_verbosity", "line_number": 12, "usage_type": "call" }, { "api_name": "tensorflow.logging", "line_number": 12, "usage_type": "attribute" }, { "api_...
571358811
import argparse def flag(N): japanese_flag = '' try: if type(N) is int and not (N % 2) and N > 0: # check is it integer (just in case), is it even, is it positive ... else: raise argparse.ArgumentError(N_args, 'Invalid argument N!\n') except argparse.Argu...
null
flag.py
flag.py
py
1,445
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentError", "line_number": 10, "usage_type": "call" }, { "api_name": "argparse.ArgumentError", "line_number": 11, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 29, "usage_type": "call" } ]
171354963
from __future__ import print_function import sys from operator import add from pyspark import SparkContext from csv import reader def formatter(line): k = line[0] v1 = str(line[1][0]) v2 = str(line[1][1]) v3 = str(line[1][2]) v4 = str(line[1][3]) return k + " " + v1 + ", " + v2 + ", " + v3 ...
null
hw2/hw2/task1.py
task1.py
py
980
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.argv", "line_number": 18, "usage_type": "attribute" }, { "api_name": "sys.stderr", "line_number": 19, "usage_type": "attribute" }, { "api_name": "pyspark.SparkContext", "line_number": 21, "usage_type": "call" }, { "api_name": "sys.argv", "li...
89226329
import pandas as pd import numpy as np import win32com.client as win32 import psutil import subprocess import os import sys import re sys.path.append(os.path.join('..', '..')) OPATH = "C:/Users/Hakucho.Nin/Documents/GitHub/CBRE/self_search/auto_match_indus" PRO = "pro_list.csv" CLIENT = "client_list.csv" ...
null
athome/athome_mail.py
athome_mail.py
py
2,371
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.path.append", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...
230760674
import requests from lxml import etree import re import time import random ''' 获取手机壁纸 ''' headers = { "User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36" } def getnum(i): global r...
null
wallpaper_downloader.py
wallpaper_downloader.py
py
1,014
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 16, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 18, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 19, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 24...
480141270
from .set_of_molecules import SetOfMolecules, SubsetOfMolecules from .control_existing import control_existing_files from .calculation import write_charges_to_file from .comparison import Comparison from .molecule import MoleculeChg from importlib import import_module from termcolor import colored from scipy.optimize i...
null
modules/parameterization.py
parameterization.py
py
12,830
python
en
code
null
code-starcoder2
66
[ { "api_name": "scipy.optimize.minimize", "line_number": 32, "usage_type": "call" }, { "api_name": "git.Repo", "line_number": 70, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 76, "usage_type": "call" }, { "api_name": "datetime.datet...
252430230
import numpy as np import matplotlib.pyplot as plt import cv2 from calibration import undistort, calibrate_camera from binarization import convert_to_binary from perspective import convert_to_birdeye from projection import final_image_projections from finding_lines import Line, from_sliding_windows, compute_offset, ble...
null
lanes-advanced/main.py
main.py
py
2,732
python
en
code
null
code-starcoder2
66
[ { "api_name": "finding_lines.Line", "line_number": 11, "usage_type": "call" }, { "api_name": "finding_lines.Line", "line_number": 12, "usage_type": "call" }, { "api_name": "calibration.undistort", "line_number": 16, "usage_type": "call" }, { "api_name": "binarizat...