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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
32903293 | import torch
import torch.nn as nn
import pandas as pd
import numpy as np
from torch.utils.data import DataLoader, Dataset, TensorDataset
from torch.optim import SGD, Adam
import torch.nn.functional as F
import argparse
from torch.autograd import Variable
import os
use_cuda = torch.cuda.is_available()
device = torch... | null | final_folder/mlp.py | mlp.py | py | 11,232 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torch.device",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.utils.data... |
298172961 | import requests, os, json
# Retrieve your API credentials from the .env file
if os.getenv("API_KEY") is None or os.getenv("API_KEY") == "":
print("ERROR! Make sure you have created your .env file with your API credentials (look for the .evn.example as an example and replace it with your own API credentials that yo... | null | src/app.py | app.py | py | 1,542 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.getenv",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 24,
... |
477390573 | from bs4 import BeautifulSoup
from bs4.element import Comment
import urllib.request
import time
import pickle
from docx import Document
from docx.enum.text import WD_LINE_SPACING
from docx.enum.style import WD_STYLE_TYPE
from docx.shared import Pt
from docx.shared import Inches
from docx.enum.text import WD_PARAGRAPH_A... | null | excel_dic.py | excel_dic.py | py | 4,172 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "docx.enum.text.WD_PARAGRAPH_ALIGNMENT.JUSTIFY",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "docx.enum.text.WD_PARAGRAPH_ALIGNMENT",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "docx.enum.text.WD_PARAGRAPH_ALIGNMENT.CENTER",
"line... |
576011203 | import os
from setuptools import find_packages, setup
with open("README.md", "r") as f:
LONG_DESCRIPTION = f.read()
with open("requirements.txt", "r") as f:
INSTALL_REQUIRES = [
r for r in f.read().split(os.linesep) if r
]
URL = "https://github.com/rugleb/surname-detection"
PACKAGES = find_pack... | null | setup.py | setup.py | py | 1,157 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.linesep",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "setuptools.find_packages",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "setuptools.setup",
"line_number": 31,
"usage_type": "call"
}
] |
275046416 | # -*- coding: utf-8 -*-
"""
Created on Mon May 28 11:16:44 2018
@author: zhcao
"""
import pandas as pd
from sklearn.preprocessing import MinMaxScaler
import tensorflow as tf
import numpy as np
from sklearn.metrics import mean_squared_error
from math import sqrt
timesteps = 10
batch_size = 30
hidden_size = 30
traini... | null | tensorflow/lstm/predict.py | predict.py | py | 4,682 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.... |
112858805 | from __future__ import division
from __future__ import print_function
import argparse
import time
import numpy as np
import scipy.sparse as sp
import torch
import torch.nn.functional as F
import torch.optim as optim
import pygcn.models as models
from pygcn.utils.data_utils import load_data, accuracy, normalize, spar... | null | pygcn/train_nc_lp.py | train_nc_lp.py | py | 5,996 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 47,
"usage_type": "attribute"
},
{
"api_name": "pygcn... |
252844545 | import random
from audiomentations import *
import h5py as h5
import librosa
import librosa.display
import numpy as np
import random
import matplotlib
import matplotlib.pyplot as plt
import torch
from spec_augment import spec_augment
import time
def visualization_spectrogram(mel_spectrogram, title):
"""visualizin... | null | utils/augment.py | augment.py | py | 9,575 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "librosa.display.specshow",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "l... |
377552979 | import os
from io import BytesIO
import fastavro as fa
import numpy as np
import pandas as pd
import pyarrow as pa
import pyarrow.orc as orc
import pytest
import cudf
from cudf.tests.utils import assert_eq
if not os.environ.get("RUN_HDFS_TESTS"):
pytestmark = pytest.mark.skip("Env not configured to run HDFS test... | null | python/cudf/cudf/tests/test_hdfs.py | test_hdfs.py | py | 6,471 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.environ.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "pytest.mark.skip",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"li... |
177949253 | """
NOTE: Python 3.6
"""
import gym
if __name__ == '__main__':
env = gym.make('InvertedDoublePendulum-v2')
env.reset()
while True:
env.render()
next_state_observation, reward, done, info = env.step(env.action_space.sample())
print ()
if done:
env.reset()
| null | MuJoCO/InvertedDoublePendulum-v2.py | InvertedDoublePendulum-v2.py | py | 315 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "gym.make",
"line_number": 9,
"usage_type": "call"
}
] |
410482434 | import torch
import torch.nn as nn
import torch.nn.functional as F
class linear:
def __init__(self):
self.w = torch.ones(5,5, requires_grad=False)
self.x_1d = torch.arange(5).type(torch.float32)
self.x_2d = torch.arange(5*5).type(torch.float32).view(5,5)
self.x_3d = torch.arange(5*5... | null | Fundamental_of_deep_learning/pytorch/tensor_analysis/linear.py | linear.py | py | 3,143 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.ones",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.arange",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.float32",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "torch.arange",
"line_numb... |
937507 | import openpyxl
workbook = openpyxl.load_workbook("D:\\Python_Selenium\\PythonSelFramework\\ExcelData\\PytestDemo.xlsx")
sheet = workbook.active
Dict = {}
cell = sheet.cell(row=1, column=2)
print(cell.value)
sheet.cell(row=4, column=2).value = "Vivaan"
print(sheet.cell(row=4, column=2).value)
print(sheet.max_row)
... | null | Testdata/excelDemo.py | excelDemo.py | py | 702 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "openpyxl.load_workbook",
"line_number": 3,
"usage_type": "call"
}
] |
2660226 | import csv
import sys
import itertools
from FreqMax import FreqMax
def flatmap(a):
return itertools.chain.from_iterable(a)
def get_jobs(input_file):
'''Get top 10 most common jobs listed in the input file,
provided that they are from certified visa applications.
Also include the frequency of those j... | null | src/h1b_counting.py | h1b_counting.py | py | 4,827 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "itertools.chain.from_iterable",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "itertools.chain",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "csv.reader",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sys.exit"... |
359513836 | from itertools import accumulate
N, M, K = map(int,input().split())
A_list = [0] + list(map(int,input().split()))
B_list = [0] + list(map(int,input().split()))
A_sums_list = list(accumulate(A_list))
B_sums_list = list(accumulate(B_list))
ans = 0
for i, A_sums in enumerate(A_sums_list):
B_min = -1
B_max = M + 1
... | null | Python_codes/p02623/s685598709.py | s685598709.py | py | 653 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "itertools.accumulate",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "itertools.accumulate",
"line_number": 6,
"usage_type": "call"
}
] |
646873567 | # uncompyle6 version 3.7.4
# Python bytecode 3.6 (3379)
# Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04)
# [GCC 8.4.0]
# Embedded file name: build/bdist.linux-x86_64/egg/jwql/jwql_monitors/generate_preview_images.py
# Compiled at: 2019-08-26 11:08:03
# Size of source mod 2**32: 25442 bytes
"""Generate ... | null | pycfiles/jwql-0.22.0-py3.6/generate_preview_images.cpython-36.py | generate_preview_images.cpython-36.py | py | 21,365 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.array",
"line_number": 112,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 115,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 116,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 1... |
266309074 | import os
import platform
import textwrap
import pytest
from mock import patch
from conan import conan_version
from conans.errors import ConanException
from conans.util.files import save, load
from conans.test.utils.tools import TestClient
@pytest.fixture
def client():
client = TestClient()
conanfile = text... | null | conans/test/integration/configuration/conf/test_conf.py | test_conf.py | py | 11,182 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "conans.test.utils.tools.TestClient",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "textwrap.dedent",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name":... |
620880187 | # -*- coding: utf-8 -*-
from django.shortcuts import render
from django.http import HttpResponseRedirect
from django.contrib import messages
from noticia.models import Noticia
from estabelecimento.models import Categoria, Plano
from evento.models import Evento
from publicidade.models import Segmento
from .forms impor... | null | projeto/projeto/views.py | views.py | py | 2,306 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "estabelecimento.models.Categoria.objects.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "estabelecimento.models.Categoria.objects",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "estabelecimento.models.Categoria",
"line_number": ... |
421593126 | # Model copied from https://github.com/abhijeet3922/Object-recognition-CIFAR-10
# https://github.com/keras-team/keras/blob/master/examples/cifar10_cnn.py
import numpy as np
from keras.preprocessing.image import ImageDataGenerator
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, ... | null | Scripts/oid_3class_scripts/oid_3class_cnn.py | oid_3class_cnn.py | py | 3,905 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.environ",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "numpy.load",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "keras.utils.to_categorical",
... |
87697131 | import uuid, fnmatch, json
from flask import request, Response
from flask_restful import Resource, reqparse, fields, marshal_with
from flask_restful.reqparse import RequestParser
from flask_cloudy import Storage
from authlib.integrations.flask_oauth2 import current_token
from covod.models.models import Timestamps, P... | null | covod/resources/lecture.py | lecture.py | py | 5,776 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask_cloudy.Storage",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask_restful.fields.Integer",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "flask_restful.fields",
"line_number": 17,
"usage_type": "name"
},
{
"api_n... |
608362361 | import json
import logging
import multiprocessing.pool
from typing import Optional
from cda_client import ApiClient, Configuration
from cda_client.api.query_api import QueryApi
from cda_client.model.query import Query
from cdapython.constantVariables import table_version, default_table,project_name
from cdapython.Resul... | null | cdapython/Q.py | Q.py | py | 6,944 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.Union",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "cda_client.model.query.Query",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "cda_client.model.query.Query",
"line_number": 29,
"usage_type": "call"
},
{
"api_name":... |
418159181 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 8 19:57:53 2021
@author: adititelang
"""
import pandas as pd
import os
import numpy as np
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
from sklearn import preprocessing
from sklearn.model_selection import trai... | null | model_codes/netflixForecastModel.py | netflixForecastModel.py | py | 1,516 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.expanduser",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
... |
547726722 | import pytest
import jobsDB
@pytest.fixture()
def my_database():
conn, cur = jobsDB.open_database("rmalmbergJobsProject1\\my_db4.sqlite")
conn.commit()
yield cur
def test_check_jobs(my_database):
location = my_database.execute("""SELECT location from jobs_api_data where id='0e921dfd-4f8c-4a4d-8adb-f... | null | test/testSprint3.py | testSprint3.py | py | 378 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "jobsDB.open_database",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 5,
"usage_type": "call"
}
] |
542476514 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.IndexView.as_view(), name='index'),
url(r'^(?P<pk>[0-9]+)/$', views.DetailView.as_view(), name='detail'),
url(r'^(?P<pk>[0-9]+)/results/$', views.ResultsView.as_view(), name='results'),
url(r'^(?P<book_id>[0-9]+)/vot... | null | books/urls.py | urls.py | py | 448 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.co... |
189700041 | from google.cloud import bigquery
client = bigquery.Client()
query_job = client.query(
"""
SELECT count(*) as counted_tables FROM banias.INFORMATION_SCHEMA.TABLES
where table_name != 'error'"""
)
results = query_job.result() # Waits for job to complete.
for row in results:
if row.coun... | null | src/test/test_e2e.py | test_e2e.py | py | 434 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "google.cloud.bigquery.Client",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "google.cloud.bigquery",
"line_number": 3,
"usage_type": "name"
}
] |
17608972 | """
tone-analyzer-api:
"""
from flask import Flask, session, redirect, url_for
from watson_developer_cloud import ToneAnalyzerV3
import json
app = Flask(__name__)
@app.route('/transcript')
def transcript():
session['id'] = '6726'
with open ('6726_1.json') as transcript_input:
transcript = json.load(tr... | null | flask_try.py | flask_try.py | py | 1,426 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.session",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "json.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.session",
"line_number":... |
386551561 | import cv2
import numpy as np
# img = cv2.imread('manga.jpg')
# #Display Image
# for i in range(100):
# for j in range (100):
# img[i,j] = [0,0,0]
#
# cv2.imshow('image',img)
# cv2.waitKey(0)
# cv2.destroyAllWindows()
from matplotlib import pyplot as plt
# img = cv2.imread('manga.jpg',0)
# # edges = cv2.c... | null | PycharmProjects/MangaCleaner/main.py | main.py | py | 1,640 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.imread",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "cv2.Canny",
"line... |
235273490 | from django.urls import path, include
from . import views
app_name = 'accounting'
urlpatterns = [
path('kassas/', views.KassaListView.as_view(), name='kassas_list'),
path('closed_kassas/', views.KassaClosedListView.as_view(), name='kassas_closed_list'),
path('charity_kassas/', views.KassaCharityListView.as_view(),... | null | accounting/urls.py | urls.py | py | 973 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
62958868 | import urllib.request as request
import re
import bs4
import time
import sys
sys.path.append('path to this repo')
from emailTradeinfo import *
page = request.urlopen('http://www.news.cn/fortune/').read()
page = page.decode(encoding='utf-8')
dt = time.strftime("%Y-%m/%d")
soup = bs4.BeautifulSoup(page,"lxml")#解析树
link ... | null | xinhua.py | xinhua.py | py | 1,657 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "urllib.request.urlopen",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "urllib.request",
... |
174545862 | #encoding:utf-8
from django.conf.urls.defaults import patterns,url
#creamos nueva rama de urls
urlpatterns = patterns('apps.acerca.views', #prefijos de la vista que queremos jalar archivo donde estamos jalando las vistas
url(r'^acerca-de-nosotros/$' , 'acerca_view' , name = 'vista_acerca') ,
... | null | apps/acerca/urls.py | urls.py | py | 567 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.urls.defaults.patterns",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.defaults.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.defaults.url",
"line_number": 9,
"usage_type": "call"
}... |
427253101 | # -*- coding: utf-8 -*-
#
desc = 'Another legend plot'
phash = '5f31c1ca34bcac72'
def plot():
from matplotlib import pyplot as pp
import numpy as np
fig = pp.figure()
t1 = np.arange(0.0, 2.0, 0.1)
t2 = np.arange(0.0, 2.0, 0.01)
# note that plot returns a list of lines. The 'l1, = plot' usage... | null | test/testfunctions/legends2.py | legends2.py | py | 876 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "numpy.arange",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
... |
390739827 | # -*- coding: utf-8 -*-
import scrapy
import re
import time
import json
from lxml import etree
from scrapy.spiders import CrawlSpider, Rule
from scrapy.linkextractors import LinkExtractor
from weibo.items import WeiboInfo
from web_driver import GetCookies
from values import FILENAME_COOKIES, URL_REGEX, FILENAME_LINKS,... | null | weibo/spiders/wbtv.py | wbtv.py | py | 8,770 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "scrapy.spiders.CrawlSpider",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "scrapy.spiders.Rule",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "scrapy.linkextractors.LinkExtractor",
"line_number": 18,
"usage_type": "call"
},
{
... |
610811533 | # -*- coding: utf-8 -*-
import scrapy
import time
import re
from scrapy.linkextractors import LinkExtractor
from scrapy.spiders import CrawlSpider, Rule
class JeansSpider(CrawlSpider):
name = 'wool'
allowed_domains = ['terrakot-yarn.ru']
start_urls = ['http://terrakot-yarn.ru/']
rules = (Rule(
... | null | crawler/wool.py | wool.py | py | 8,287 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "scrapy.spiders.CrawlSpider",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "scrapy.spiders.Rule",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "scrapy.linkextractors.LinkExtractor",
"line_number": 15,
"usage_type": "call"
},
{
... |
186365909 | # coding:utf-8
from django.conf.urls import url
from .views import user, car, carbrand
urlpatterns = [
url(r'^index/$', user.UserView.as_view(), name='user'),
url(r'^edit/(?P<id>\d+)/$', user.UserEditView.as_view(), name='user_edit'),
url(r'^detail/(?P<id>\d+)/$', user.UserDetailView.as_view(), name='user_... | null | apps/user/urls.py | urls.py | py | 1,008 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "views.user.UserView.as_view",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "views.user.UserView",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name":... |
518290531 | from behave import *
from selenium import webdriver
from tests.acceptance.page_model.blog_page import BlogPage
from tests.acceptance.page_model.home_page import HomePage
from tests.acceptance.page_model.new_post_page import NewPostPage
use_step_matcher("re") # it allows our steps to receive arguments from .feature fi... | null | tests/acceptance/steps/navigation.py | navigation.py | py | 1,547 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "tests.acceptance.page_model.home_page.HomePage",
"line_number": 14,
"usage_type": "call"
}... |
49673867 | #requires testing for CTO
import re
import PyPDF2
import requests
from bs4 import BeautifulSoup
def downloadPdf():
print('Downloading New Brunswick PDF. Please Hold.')
url = 'http://fcnb.ca/reporting-issuer-list.html'
r = requests.get(url)
soup = BeautifulSoup(r.content, 'lxml')
link = soup.find(... | null | newBrunswick.py | newBrunswick.py | py | 2,227 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_num... |
220827283 | # coding: utf-8
from __future__ import division, print_function, unicode_literals, absolute_import
"""
This module defines tasks for writing vasp input sets for various types of vasp calculations
"""
import os
from fireworks import FiretaskBase, explicit_serialize
__author__ = 'Anubhav Jain, Shyue Ping Ong, Kiran... | null | atomate/fhi_aims/firetasks/write_inputs.py | write_inputs.py | py | 3,120 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "fireworks.FiretaskBase",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "fireworks.explicit_serialize",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "fireworks.FiretaskBase",
"line_number": 67,
"usage_type": "name"
},
{
"api_na... |
37482847 | import curses, curses.ascii
import time
import traceback
import locale
import types
try:
from IPython.terminal.interactiveshell import TerminalInteractiveShell
shell = TerminalInteractiveShell()
ipython_avail = True
except:
ipython_avail = False
from datetime import date
from collections import OrderedD... | null | util/python/g3curses.py | g3curses.py | py | 22,881 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "IPython.terminal.interactiveshell.TerminalInteractiveShell",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "locale.setlocale",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "locale.LC_ALL",
"line_number": 17,
"usage_type": "attribute"
... |
159548915 | import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import argparse
import codecs
import json
import logging
import numpy as np
import os
import re
import subprocess
import inspect
import tensorflow as tf
import tensorflow.keras.backend as K
from tensorflow.keras.callbacks import TensorBoard, ModelCheckpoint
from m... | null | tf-distribution-options/code/train_hvd.py | train_hvd.py | py | 11,277 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.environ",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.python.keras.optimizer_v2.optimizer_v2.OptimizerV2",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.python.keras.optimizer_v2.optimizer_v2",
"line_n... |
123905670 | """ This file defines an environment for the Box2D PointMass simulator. """
import numpy as np
import Box2D as b2
import cv2
import matplotlib.pyplot as plt
from scipy import ndimage
from framework import Framework
from gps.agent.box2d.settings import fwSettings
from gps.proto.gps_pb2 import END_EFFECTOR_POIN... | null | python/gps/agent/box2d/point_mass_world.py | point_mass_world.py | py | 6,397 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "framework.Framework",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "Box2D.b2World",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "Box2D.b2FixtureDef",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "Box2D.b2CircleSh... |
387016233 | import time
from mpl_toolkits.mplot3d import Axes3D
from mpl_toolkits.mplot3d.art3d import Poly3DCollection
import matplotlib._color_data as mcd
import ROOT
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import modules
import printColor as pc
import math
from sklearn.datasets import load_wine
fr... | null | multiPerceptron/torchBasicCPU.py | torchBasicCPU.py | py | 6,852 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "printColor.bcolors",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "modules.momLabel",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessi... |
283426675 | import pandas as pd
import torch
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
from transformers import AdamW
from transformers import get_linear_schedule_with_warmup
from src import config
from src import dataset
from src import model as m
from src ... | null | Machine_Learning_Projects/NLP/Sentiment_Classification_with_BERT/main.py | main.py | py | 4,236 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "gc.collec... |
90748703 | import numpy as np
from sklearn import datasets
from sklearn.tree import DecisionTreeClassifier
import streamlit as st
@st.cache
def load_data():
iris_data = datasets.load_iris()
return iris_data
@st.cache
def train(features, targets):
clf = DecisionTreeClassifier(random_state=42)
clf.fit(features, ... | null | code/iris_app.py | iris_app.py | py | 1,565 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sklearn.datasets.load_iris",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "streamlit.cache",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "sklearn... |
256124364 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# @time :2021-02-19 11:00
# @Author :Merle
# @File :create_table.py
""" """
from pymysql import IntegrityError
from test.setting import connect_mysql
conn = connect_mysql('test')
# 创建游标
cur = conn.cursor()
# execute执行sql语句
cur.execute('show tables')
# 创建表
da... | null | 02Databases/test/create_table.py | create_table.py | py | 1,261 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "test.setting.connect_mysql",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pymysql.IntegrityError",
"line_number": 42,
"usage_type": "name"
}
] |
68222336 | #!/usr/bin/env python
import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import time
import fannypack
from lib import dpf, panda_models, panda_datasets, panda_training, fusion, \
fusion_pf, omnipush_datasets
import argparse
print(torch.__version... | null | train_dpf_fusion_tune.py | train_dpf_fusion_tune.py | py | 4,625 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.__version__",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "numpy.__version__",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": ... |
129378109 | # shows tracks for the given artist
import pprint
import sys
import spotipy
import spotipy.util as util
sp = spotipy.Spotify()
username = "dublado"
playlist_id = "4oxcScbIPXLC5ZQZK0vLww"
musicas="""cinema mudo Cinema Mudo Paralamas
o senhor da guerra LEGIÃO URBANA"""
splitmusica=musicas.split("\n")
scope = 'pla... | null | examples/ex.py | ex.py | py | 906 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "spotipy.Spotify",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "spotipy.util.prompt_for_user_token",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "spotipy.util",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "spoti... |
472104391 | # -*- coding: utf-8 -*-
"""
Created on Sun Apr 28 15:10:17 2019
@author: lapi7
"""
import networkx as nx
import numpy as np
import pandas as pd
import random as rdm
import matplotlib.pyplot as plt
from time import time
import datetime as dt
from scipy.stats import truncnorm
from networkx.algorithms.flow import boykov... | null | Tarea No.5/T5histoporopiedad.py | T5histoporopiedad.py | py | 1,904 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "networkx.from_pandas_adjacency",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "networ... |
326454464 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 21 14:24:25 2020
@author: mjr583
"""
import sys
sys.path.append('/users/mjr583/python_lib')
import RowPy as rp
import CVAO_tools as CV
from CVAO_dict import CVAO_dict as d
import matplotlib.pyplot as plt
import pandas as pd
import netCDF4
import num... | null | code/poly_trend_fit.py | poly_trend_fit.py | py | 2,222 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "matplotli... |
249363275 | import collections
import copy
from sklearn import utils as sk_utils
from .. import base
from .. import optim
from .. import stats
from .. import utils
class FMRegressor(base.Regressor):
"""Factorization machine for regression.
Example:
::
>>> from creme import linear_model
... | null | creme/linear_model/fm.py | fm.py | py | 4,200 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sklearn.utils.check_random_state",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "sklearn.utils",
"line_number": 52,
"usage_type": "name"
},
{
"api_name": "collections.defaultdict",
"line_number": 54,
"usage_type": "call"
},
{
"api_name":... |
240621828 | """ Plotter
Wraps matplotlib.
"""
from itertools import count
import matplotlib.patches
import matplotlib.path
import matplotlib.pyplot as plot
from config import IO, Color
axis = None
class Drawing:
_ids = count(0)
def __init__(self, name):
self.id = next(self._ids)
self.active = 0
... | null | experiments/plotter.py | plotter.py | py | 1,623 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "itertools.count",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "matplotlib... |
324019992 | from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.shortcuts import render, redirect, get_object_or_404
from django.views.generic import ListView
import json
import datetime
from .models import Facility, CheckR... | null | oasis/facilities/views.py | views.py | py | 6,746 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "forlease.models.User.objects.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "forlease.models.User.objects",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "forlease.models.User",
"line_number": 18,
"usage_type": "name"
},
... |
565603384 | from starlette.applications import Starlette
from starlette.responses import HTMLResponse, JSONResponse
from starlette.staticfiles import StaticFiles
from starlette.middleware.cors import CORSMiddleware
import uvicorn, aiohttp, asyncio
from io import BytesIO
import requests
from fastai import *
from fastai.vision impo... | null | app/server.py | server.py | py | 4,805 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "starlette.applications.Starlette",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "starlette.middleware.cors.CORSMiddleware",
"line_number": 32,
"usage_type": "argument"
},
{
"api_name": "starlette.staticfiles.StaticFiles",
"line_number": 33,
"usa... |
609037129 | from typing import List
from dataclasses import dataclass
from tekore.model.base import Identifiable
from tekore.model.track import FullTrack
from tekore.serialise import SerialisableDataclass, SerialisableEnum
class RecommendationAttribute(SerialisableEnum):
acousticness = 'acousticness'
danceability = 'dan... | null | tekore/model/recommendations.py | recommendations.py | py | 1,123 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tekore.serialise.SerialisableEnum",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "tekore.model.base.Identifiable",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 26,
"usage_type": "call"
},
{
... |
400025996 | """passbook pretend GitHub Views"""
from django.http import JsonResponse
from django.shortcuts import get_object_or_404
from django.views import View
from oauth2_provider.models import AccessToken
class GitHubUserView(View):
"""Emulate GitHub's /user API Endpoint"""
def verify_access_token(self):
"""... | null | passbook/providers/oauth/views/github.py | github.py | py | 2,245 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.views.View",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.shortcuts.get_object_or_404",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "oauth2_provider.models.AccessToken",
"line_number": 14,
"usage_type": "argument"
},... |
188248726 | import pika, sys, os
from commons import *
from random import randint
#Getting random name
supplier_name = NAMES[randint(0,len(NAMES))].strip(' ')
#Handling message and order from client
def handle_delivery(channel, method, header, body):
global supplier_name
print(f"{supplier_name} | Processing order from {b... | null | lab2/zadDomowe/Maciej_Sikora_2/dostawca.py | dostawca.py | py | 1,396 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "random.randint",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pika.ConnectionParameters",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pika.BlockingConnection",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sys.a... |
78127968 | # -*- coding: utf-8 -*-
import time
import numpy as np
import pandas as pd
import urllib.request
import requests
import json
from bs4 import BeautifulSoup
class Crawler:
def __init__(self):
self.name = "I am a good robot"
def load_past_data(self, url):
with open(url,'r') as f:
dat... | null | crawling bot ver3.0/crawler.py | crawler.py | py | 1,984 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "json.load",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_num... |
324240584 | #
# [711] Number of Distinct Islands II
#
# https://leetcode.com/problems/number-of-distinct-islands-ii/description/
#
# algorithms
# Hard (42.55%)
# Total Accepted: 2.2K
# Total Submissions: 5.3K
# Testcase Example: '[[1,1,0,0,0],[1,0,0,0,0],[0,0,0,0,1],[0,0,0,1,1]]'
#
# Given a non-empty 2D array grid of 0's and ... | null | 711.number-of-distinct-islands-ii.python3.py | 711.number-of-distinct-islands-ii.python3.py | py | 3,204 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.deque",
"line_number": 99,
"usage_type": "call"
}
] |
325684812 | from selenium import webdriver
import time, traceback, os
log = open('LogFile/SignUp_Log.txt', 'w')
error = open('LogFile/SignUp_Error.txt', 'w')
var = False
try:
options = webdriver.ChromeOptions()
options.add_argument('--headless')
options.add_argument('window-size=1200,1000')
cdrive = 'chromedrive... | null | UpdateAutoTest/SignUp.py | SignUp.py | py | 2,267 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "selenium.webdriver.ChromeOptions",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 15,
"usage_type": "call"
},
{
"api... |
491024498 | # https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sqs.html
import boto3
import list_queues as lq
sqs = boto3.resource('sqs')
def read_messages(qname) :
q = sqs.get_queue_by_name(QueueName=qname)
wts = 20 # 0 - 20
print("Reading queue", qname, "with a WaitTimeSeconds of", wts, "...")... | null | AWSTrials/Python/snstest1/queues/read_messages_from_queue.py | read_messages_from_queue.py | py | 1,061 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "boto3.resource",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "list_queues.queue_exists",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "list_queues.list_queues",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "list_q... |
240858909 | import os
import shutil
import time
from collections import OrderedDict
from datetime import datetime
from tempfile import mkdtemp
from conf_tools.utils import locate_files
from system_cmd import CmdException
from .constants import DSwarmConstants
from .dcache_wire import create_propose_message
from .ipfs_utils impor... | null | src/duckietown_swarm/directory_watcher_imp.py | directory_watcher_imp.py | py | 2,582 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "ipfs_utils.IPFSInterface",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "tempfile.mkdtemp",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
268827843 | import pymongo
from .session import Session
from .metadata import Field, Index, collection
from .declarative import Document
from .base import Cursor
from .version import __version__, __version_info__
# Re-export direction keys
ASCENDING = pymongo.ASCENDING
DESCENDING = pymongo.DESCENDING
def configure(**kwargs):
... | null | ming/__init__.py | __init__.py | py | 1,764 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pymongo.ASCENDING",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pymongo.DESCENDING",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "formencode.schema.Schema",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_... |
530766953 | #!/usr/bin/env python
# -*- coding: UTF8 -*-
from dbus.mainloop.glib import DBusGMainLoop
import dbus
import gobject
import re
import time
import random
#from pprint import pprint as pp
class YoloBot(object):
def __init__(self, dbus_session):
self._bus = dbus_session
self.purple = None
se... | null | yolo_bot.py | yolo_bot.py | py | 2,857 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "dbus.Interface",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "re.I",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_name": "time.time",
"line_number": 54,... |
264843439 | import random
from itertools import chain
import operator
import decimal
class EquationBuilderException(Exception): pass
class Equation:
def __init__(self, body):
self.body = body
self.to_representation = body
self.result = EquationSolver.solve(self)
def __eq__(self, other):
r... | null | hfycc/equations.py | equations.py | py | 923 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "itertools.chain",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "decimal.Decimal",
"line_number": 34,
"usage_type": "call"
}
] |
469125206 | from edward.models import Normal
import tensorflow as tf
import numpy as np
import edward as ed
import matplotlib.pyplot as plt
import seaborn as sns
# def build_toy_dataset(N=40, noise_std=0.1):
# D = 1
# X = np.concatenate([np.linspace(0, 2, num=N / 2),
# np.linspace(6, 8, num=N / 2)])
# ... | null | bayesian_nn_example.py | bayesian_nn_example.py | py | 5,854 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.linspace",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.random.normal",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line... |
236141160 | from __future__ import absolute_import
import numpy as np
import math
import fractions
from scipy.signal import correlate
import obspy
from obspy import Stream, Inventory, Trace
from obspy.core.event.event import Event
from obspy.core.inventory.network import Network
from obspy.core import AttribDict
from obspy.geode... | null | frospy/util/array_util.py | array_util.py | py | 54,651 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "frospy.util.base.stream2array",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "obspy.core.event.event.Event",
"line_number": 96,
"usage_type": "argument"
},
{
"api_na... |
452087527 |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.mlab import griddata
import scipy.optimize as opt
import seaborn as sns; sns.set(color_codes=True)
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.model... | null | AmplifyBad - Copy.py | AmplifyBad - Copy.py | py | 4,334 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "seaborn.set",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.LabelEncoder",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "sklearn... |
394154061 | from keras.utils import Sequence
import numpy as np
class N2V_DataWrapper(Sequence):
"""
The N2V_DataWrapper extracts random sub-patches from the given data and manipulates 'num_pix' pixels in the
input.
Parameters
----------
X : array(floats)
The noisy input data. ... | null | n2v/internals/N2V_DataWrapper.py | N2V_DataWrapper.py | py | 6,319 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "keras.utils.Sequence",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "numpy.random.permutation",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "numpy.... |
496413128 | # -*- coding: utf-8 -*-
"""
The output files have the following structure
nw-name_run_seed_input-freq_input-scale_bc-decay_hc-decay_bc-delay_hc-delay_gc-weight_bc-weight_hc-weight
@author: DanielM
"""
from neuron import h, gui # gui necessary for some parameters to h namespace
import numpy as np
import net_tunedreve... | null | deprecated_paradigms/paradigm_large_scale_robustness_enhanced_ff.py | paradigm_large_scale_robustness_enhanced_ff.py | py | 12,831 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "analysis_main.time_stamps_to_signal",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": ... |
350143991 | import gym
import matplotlib.pyplot as plt
import torch
import torch.optim as optim
from memory import ReplayMemory
from DQN import DQN
from preprocessing import get_screen
from utils import select_action, plot_scores
from training import optimize_model
# based on https://pytorch.org/tutorials/intermediate/reinforce... | null | main.py | main.py | py | 2,710 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "gym.make",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.ion",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "torch.device",
"... |
626170335 | '''
script to simulate compounding annualized returns of financial assets
this is not meant as financial advice/stock tips/etc.
Copyright (C) <2019> <zweilinkehaende>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as ... | null | assetSimulation.py | assetSimulation.py | py | 5,579 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.zeros",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.random.normal",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "numpy.ones",
"l... |
7271837 | from __future__ import annotations
from abc import ABC, abstractmethod
import click
import os
import config
import logging
import sys
import shutil
import csv
if config.COMMANDS_CONFIG['log_type'] == "log":
log_path = '/Main/myapp.log'
else:
log_path = '/Main/myapp.csv'
logger = logging.getLogg... | null | command.py | command.py | py | 11,164 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "config.COMMANDS_CONFIG",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "log... |
154976421 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import fields_bundle.fields.html
class Migration(migrations.Migration):
dependencies = [
('flatpage', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name=... | null | Lib/site-packages/django_extended/contrib/flatpages/migrations/0002_auto_20151110_0615.py | 0002_auto_20151110_0615.py | py | 468 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AlterField",
"line_number": 15,
"usage_type": "call"
},
{... |
74513311 | #!/usr/bin/env python3
from elasticsearch import Elasticsearch, exceptions
from datetime import datetime
import argparse
def main():
parser_desc = "Server-side utility for creating and restoring elastic snapshots. \
NOTE: Be sure to set path.repo in elasticsearch.yml before attempting to use this tool."
... | null | natlas-server/elastic-snapshot.py | elastic-snapshot.py | py | 4,577 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "elasticsearch.Elasticsearch",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.utcnow",
"line_number": 74,
"usage_type": "call"
},
{
"api_... |
268769340 | # -*- coding: utf-8 -*-
"""
Created on Wed Sep 16 21:20:58 2020
@author: qtckp
"""
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
val = np.array([23,78,22,19,45,33,20])
res = np.random.normal(3,0.5, (val.size,))
df = pd.DataFrame({
'name':['john','mary','peter','jeff','bill','lisa','jo... | null | old_data/plotting.py | plotting.py | py | 631 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.array",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.random.normal",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "pandas.DataFrame",
... |
524993182 | import os
import numpy as np
from PIL import Image
from torch.utils.data import Dataset
import torchvision.transforms as transforms
''' The standard transforms for training'''
def get_transforms(size, mean, std):
return transforms.Compose([
transforms.Resize((size, size)),
transform... | null | dataset.py | dataset.py | py | 1,574 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torchvision.transforms.Compose",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.Resize",
"line_number": 10,
"usage_type": "call"
},
{
... |
378642618 | import os
import sys
import inspect
import re
import pymysql
import memcache
from datetime import datetime
from .dict_sql import make_sql_dict
from app import pagination, username, password, mysql_host, db_name
connection = pymysql.connect(host=mysql_host,
user=username,
... | null | app/models.py | models.py | py | 3,498 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pymysql.connect",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "app.mysql_host",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "app.username",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "app.password",
"line_... |
260668483 | import sys
import pydot
import os
import traceback
import src.internals.analyser as analyser
class Translator:
__slots__= '__fts', 'output', '_mts'
def __init__(self):
self.output = ''
def load_model(self, path):
try:
self.__fts = analyser.load_dot(open(path,"r"))
exce... | null | src/internals/translator.py | translator.py | py | 5,337 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "src.internals.analyser.load_dot",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "src.internals.analyser",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "pydot.Dot",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "pydo... |
331797665 | import pandas as pd
from statistics import mean, median
import sys
import json
from scipy import stats, optimize
from datetime import datetime, timedelta
file = pd.read_csv(sys.argv[1])
columns = list(file.head(0))
def aggregateStuff(file):
aggPoints = []
numberOfStudent = (len(file[columns[0]]))
for colu... | null | 08/student.py | student.py | py | 3,404 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pandas.Series",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime"... |
16710620 | #! /usr/bin/env python3.7
from tqdm import tqdm
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import matplotlib.patches as patches
import numpy as np
import os
"""
- Load the tempo track
- And marquee defintions:
* The composition
* The starti... | null | tabla-editing-v3/02.make_lyrics_video.py | 02.make_lyrics_video.py | py | 5,957 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.use",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "matplotlib.patches.Rectangle",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "matplotlib.patches",
"line_number": 73,
"usage_type": "name"
},
{
"api_name": "argpars... |
390613429 | import numpy as np
import matplotlib.pyplot as plt
def toy_data():
number_data = 1000
distance = 10
width = 2
p1 = np.random.normal(-distance/2, width, (number_data//2, 2))
p2 = np.random.normal(distance/2, width, (number_data//2, 2))
# p1 = np.random.normal(0, width, (number_data//2, 2))
... | null | Uebung3/Aufgabe1.py | Aufgabe1.py | py | 3,529 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.random.normal",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.normal",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.random"... |
596513525 | import numpy as np
from matplotlib import pyplot
from math import *
import config
from expfit import expfit
import pandas as pd
EPSILON = 0.1
dataset = "wichert.dta"
if dataset == "wei.dat":
df= np.loadtxt("wei.dat")
data_ = zip(df[:,0]/max(df[:,0]), df[:,1].astype(int))
elif dataset=="wichert.dta":
df = ... | null | ps6/plot_tip.py | plot_tip.py | py | 3,157 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.loadtxt",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.read_stata",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.read_stata",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.factorize",
... |
454417918 | import datetime
from django.views import generic
from .models import Tadameshi
# Create your views here.
class IndexView(generic.ListView):
'''ホーム画面のビュー
今回はこのビューしか使いませんが、何か要望があれば追加するかも?
'''
model = Tadameshi
template_name = "hontai/index.html"
def get_context_data(self, **kwargs):
... | null | hontai/views.py | views.py | py | 1,053 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.views.generic.ListView",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.views.generic",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "models.Tadameshi",
"line_number": 14,
"usage_type": "name"
},
{
"api_name":... |
194828922 | from classes import *
import csv
from selenium import webdriver
from urllib.request import urlopen as uReq
from bs4 import BeautifulSoup as soup
import time
def useTXT(str, filename, argument):
if argument == 'w':
file_object = open(filename, 'w')
file_object.write(str)
file_object.close()... | null | functions.py | functions.py | py | 5,529 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "csv.writer",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "csv.QUOTE_MINIMAL",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "csv.writer",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "csv.QUOTE_MINIMAL",
... |
452341395 | import PyPDF2
def ReadingFromPDF(filename, f, l):
pdfFile = open(filename, "rb")
pdfReader = PyPDF2.PdfFileReader(pdfFile)
numOfPages = pdfReader.numPages
pdf = ""
for i in range(f - 1, l):
page = pdfReader.getPage(i)
pdf += page.extractText()
pdfFile.close()
return pdf | null | ReadDocument.py | ReadDocument.py | py | 319 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PyPDF2.PdfFileReader",
"line_number": 6,
"usage_type": "call"
}
] |
138056180 | #BROADCAST via http://eligius.st/~wizkid057/newstats/pushtxn.php
#electrum output looks like:
#{"id": 1, "result": [{"tx_hash": "6570000fb785a26757d3296c71d2130348460c48c2d1b6d14951840f95290695", "tx_pos": 1, "value": 90000, "height": 287604}, {"tx_hash": "b98aeda21891001f359402af0ca59347b5c111faac88c20dcd17f89d5e50da... | null | multisig.py | multisig.py | py | 25,695 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.dirname",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"... |
593250992 | # sean whalen
# reads in a pickled blob (a dictionary of game config info)
# creates a class representing the game
# applies dp to it
import sys
import numpy as np
import copy
import pickle
import random
import operator
import itertools as it
from state_gen import print_board, getkey
def sample(probs):
s = random... | null | pinwheel.py | pinwheel.py | py | 6,192 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "random.random",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "itertools.product",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"li... |
517397834 | #!/bin/env python
import argparse
import os
import uhal
if 'XDAQ_ROOT' not in os.environ:
os.environ['XDAQ_ROOT'] = '/opt/xdaq'
desc = '''
Hacky script to apply a bunch mask range to the LPM
'''
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter,description=desc)
parser.add_... | null | cactusupgrades/boards/mp7/software/mp7/tests/scripts/toolbox/lpmEnablePeriodicResyncs.py | lpmEnablePeriodicResyncs.py | py | 717 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.environ",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "argparse.Argume... |
605730325 | # -*- coding:utf-8 -*-
from django.conf.urls import url
from . import views
#from . import forms
from django.contrib.auth.views import login, logout
from django.conf import settings
from django.conf.urls.static import static
from . import models
urlpatterns = [
# Site
url(r'^(?:index.+)?$', views.index, name='... | null | woodstock/urls.py | urls.py | py | 1,519 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.urls.url",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django... |
155337948 | from pyspark import SparkContext
import sys
import csv
def createIndex(shapefile):
'''
This function takes in a shapefile path, and return:
(1) index: an R-Tree based on the geometry data in the file
(2) zones: the original data of the shapefile
Note that the ID used in the R-tree 'index' is ... | null | Extra Credit/Task1_v1.py | Task1_v1.py | py | 2,890 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "geopandas.read_file",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "fiona.crs.crs.from_epsg",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "fiona.crs.crs",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "fiona.... |
131407417 | #!/usr/bin/env python
"""Word frequency and median for unique words calculation"""
from collections import Counter
from collections import OrderedDict
import sys
from glob import glob
import os
import codecs
import numpy as np
__author__ = "Jigdel"
__copyright__ = "See license"
__credits__ = ["Python for Data Analys... | null | code_challenge_Jul2015/src/words_tweeted_median_unique.py | words_tweeted_median_unique.py | py | 2,669 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "codecs.open",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "codecs.open",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.median",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number":... |
630172635 | import os
import json
from flask import Flask, request, make_response, jsonify
import googleapiclient.discovery
from google.oauth2 import service_account
app = Flask(__name__)
def respond(fullfilment):
return make_response(jsonify({"fulfillmentText": fullfilment}))
def get_credentials():
scop... | null | Incognitos/Incognitos CARE (Prototype)/app.py | app.py | py | 4,668 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.make_response",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_n... |
1246900 | import json
from pprint import pprint
import requests
import os
import shutil
import re
import argparse, sys
BASE_DIR = "./playlist"
VIDEOS_FOLDER = "chapter"
#os.makedirs(BASE_DIR, exist_ok=True)
parser = argparse.ArgumentParser()
parser.add_argument('playlist', help = 'The playlist ID you wish to convert the video... | null | _src/py/youtube_playlists_converter/convert_youtube_playlists_to_webpages.py | convert_youtube_playlists_to_webpages.py | py | 5,050 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 100,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"li... |
217458786 | """
Django settings for qed splash page.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import os
import socket
import logging
from temp_config.set_environment im... | null | settings_kube.py | settings_kube.py | py | 11,067 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.getenv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "temp_config.set_environment.DeployEnv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.getenv",... |
264263254 | import json
import psycopg2
from datetime import datetime
data_file = '19.json'
brute_force_sql = 'INSERT INTO "{}"("type", "region", "volume_str", "volume", "orderCount", "orderCount_str", "highPrice", "lowPrice", "date", "avgPrice") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)'
mogrify_sql = 'INSERT INTO "{}" VA... | null | db_test.py | db_test.py | py | 6,694 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 31,
"usage_type": "call"
},
{
"api_name"... |
72250810 | import json
import argparse
import os
# import gensim
import utils
from six.moves import cPickle
import numpy as np
from sklearn.metrics.pairwise import cosine_similarity
import re
#import faiss_index
import collections
np.random.seed(123)
def clean_up_data(path, output_path):
start = False
endline = False
to_write... | null | server/python/kialo_light.py | kialo_light.py | py | 8,173 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.random.seed",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "re.search",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_n... |
301267503 | import dogpile.cache
import requests
import urllib
from datetime import datetime
from requests_kerberos import HTTPKerberosAuth, OPTIONAL
from packaging import version
from freshmaker import log, conf
from freshmaker.utils import get_ocp_release_date
class PyxisRequestError(Exception):
"""
Error return as a ... | null | freshmaker/pyxis.py | pyxis.py | py | 14,698 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "dogpile.cache.cache.make_region",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "dogpile.cache.cache",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "dogpile.cache",
"line_number": 40,
"usage_type": "name"
},
{
"api_name":... |
256884761 | import datetime
import ast
from collections import defaultdict, namedtuple
import itertools
import functools
import json
import random
from constraint import Problem
from dateutil.relativedelta import relativedelta
from django.db import models, transaction
from django.utils import timezone
from people.models import C... | null | main/models.py | models.py | py | 39,660 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.models.Manager",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "main.utilities.dates_in_range",
"line_number": 62,
"usage_type": "call"
},
{
"api_... |
401372795 | import pygame
WIDTH = 1280
HEIGHT = 620
SPEED = 5
pygame.init()
screen = pygame.display.set_mode((WIDTH, HEIGHT))
clock = pygame.time.Clock()
bird = pygame.image.load('Dubecz Dávid/img/bird1.png').convert_alpha()
bird_x = WIDTH / 2
bird_y = HEIGHT / 2
running = True
while running:
for event in pygame.ev... | null | Dubecz Dávid/mozgasbillel.py | mozgasbillel.py | py | 1,122 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pygame.init",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pygame.time.Cloc... |
265094913 |
from keras.models import Sequential
from keras.layers import Convolution2D
from keras.layers import MaxPooling2D
from keras.layers import Flatten
from keras.layers import Dense
classifier = Sequential()
#building the model
classifier.add(Convolution2D(32,3,3,input_shape = (64,64,3),activation = 'relu... | null | BFC.py | BFC.py | py | 1,945 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "keras.models.Sequential",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "keras.layers.Convolution2D",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "keras.layers.Convolution2D",
"line_number": 14,
"usage_type": "call"
},
{
"api... |
439663731 | import cv2 as cv
import numpy as np
from matplotlib import pyplot as plt
# img = cv.imread('DSC_3430.jpg')
# img = cv.imread('/home/kyaking/downloads/pic/rose/DSC_3430.jpg')
# img = cv.imread('/home/kyaking/downloads/pic/narzissien5/IMG_6752.jpg')
img = cv.imread('/home/kyaking/downloads/pic/papri_rota/IMG_6796.JPG')
... | null | venv/threshold.py | threshold.py | py | 1,311 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.imread",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_RGB2HSV",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line... |
245739381 | """
Ajilon spider created on the top of ATSSpider
scrapy crawl ajilon -a mining_job_id=9999 -a iteration=1 -a extract=1 -a url="http://www.ajilon.com/JobSeekers/JobSearch/Pages/SearchResults.aspx?kws=&cty=&zip=&rds=50&submenuid="
Sample URL:
http://www.ajilon.com/JobSeekers/JobSearch/Pages/SearchResults.aspx?kws=... | null | brightcorp/brightcorp/spiders/ajilon.py | ajilon.py | py | 3,610 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.compile",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "brightcorp.base.atsspiders.ATSSpider",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "scrapy.selector.Selector",
"line_number": 30,
"usage_type": "call"
},
{
"api_name... |
8325073 | from rest_framework import serializers
from . import models
class ProductImageSerializer(serializers.ModelSerializer):
file = serializers.ImageField(use_url=True)
class Meta:
model = models.ProductImage
fields = ('id', 'file')
class ProductSerializer(serializers.ModelSerializer):
cate... | null | shop/serializers.py | serializers.py | py | 779 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.ImageField",
"line_number": 7,
"usage... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.