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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
306178802 | #
# Copyright (c) 2016 Intel Corporation
#
# 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 i... | null | project/tests/test_functional/data_science/test_arcadia.py | test_arcadia.py | py | 3,839 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "modules.constants.TapComponent.dataset_publisher",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "modules.constants.TapComponent",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "modules.constants.TapComponent.das",
"line_number": 30,
... |
81698119 | r"""Language model with residual LSTM blocks.
Usage:
import lmp
model = lmp.model.ResLSTMModel(...)
logits = model(...)
pred = model.predict(...)
"""
# built-in modules
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import... | null | lmp/model/_res_lstm_model.py | _res_lstm_model.py | py | 3,202 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "lmp.model._base_res_rnn_model.BaseResRNNModel",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "lmp.model._res_lstm_block.ResLSTMBlock",
"line_number": 102,
"usage_type": "call"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 103,
"usage_ty... |
511623987 | import sys
try:
from pypyodbc import connect as sqlCNX
import json
import boto3
from numpy import array,ndarray
from datetime import datetime as dtm
from copy import *
import yaml
from collections import OrderedDict as odict
from time import sleep as ziz,time
from pandas import DataFrame as pdf, read_sql
exc... | null | concepts/dataLake/pourData.py | pourData.py | py | 2,008 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.exit",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "yaml.load",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pandas.read_sql",
"line_number": 38,
... |
604812397 | # -*- coding: utf-8 -*-
# @Time:2018.12.12 10:24
# @Author:Zhang
# @Desc :
import pandas
import numpy as np
from matplotlib import pyplot
#显示所有列
pandas.set_option('display.max_columns',None)
#显示所有行
pandas.set_option('display.max_rows',None)
#设置长度
pandas.set_option('max_colwidth',100)
move_data = pandas.re... | null | myClass/myT_class/dataanalyze/d1.py | d1.py | py | 1,144 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.set_option",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv"... |
64715682 | import numpy as np
from sklearn.decomposition import LatentDirichletAllocation as lda
import time
from sklearn.feature_extraction.text import CountVectorizer
from hott import sparse_ot
import progressbar
import nltk
from sklearn.metrics.pairwise import euclidean_distances
from nltk.corpus import stopwords
from nltk.s... | null | archives/data03.py | data03.py | py | 11,284 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.unique",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.choice"... |
420731720 | from cell import Bacilli
import optimization
from typing import List
from global_optimization.Modules import CellNodeM, LineageM
import pandas as pd
from colony import LineageFrames, CellNode
import csv
import numpy as np
def build_initial_lineage(imagefiles, realimages, lineagefile, continue_from, simulation_config)... | null | src/lineage_funcs.py | lineage_funcs.py | py | 3,531 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.read_csv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "global_optimization.Modules.LineageM",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cell.Bacilli",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "opt... |
234313695 | # https://secweb.rbi.org.in/orfsxbrl
# java -jar selenium-server-standalone-3.141.59.jar -port 4545
# -Dwebdriver.chrome.driver=./chromedriver
from selenium import webdriver
import time
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait # available since 2.4.0
fr... | null | src/ib_pd.py | ib_pd.py | py | 4,712 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "time.time",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 29,
... |
468076857 | from dataclasses import dataclass
from typing import List
import jiant.utils.python.io as py_io
from jiant.tasks.core import (
Task,
TaskTypes,
BaseExample,
)
from jiant.tasks.utils import ExclusiveSpan
from .templates import mlm_premasked as mlm_premasked_template
@dataclass
class Example(BaseExample):
... | null | jiant/tasks/lib/mlm_pretokenized.py | mlm_pretokenized.py | py | 2,880 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "jiant.tasks.core.BaseExample",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "jiant.tasks.util... |
360580960 | # -*- coding: utf-8 -*-
"""
Created on Thu Oct 3 11:40:12 2019
@author: Vladimir
"""
import numpy as np
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
import mglearn
from sklearn.datasets import make_regression
X, y = make_regression(n_samples=100, n_features=1, noise=0.0)
# X, y... | null | X. Python) Мюллер А., Гвидо С. W/Mueller-Guido_lr_wave.py | Mueller-Guido_lr_wave.py | py | 1,334 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sklearn.datasets.make_regression",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 17,
"usage_type": "name"
},
{
"api_nam... |
281420963 | # 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, software
# d... | null | karbor-1.3.0/karbor/tests/unit/operationengine/test_karbor_client.py | test_karbor_client.py | py | 1,583 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "karbor.tests.base.TestCase",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "karbor.tests.base",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "karbor.context.get_admin_context",
"line_number": 28,
"usage_type": "call"
},
{
... |
503294998 | # -*- coding: utf-8 -*-
# @Author: 曾辉
from flask import Flask,request
from flask_sqlalchemy import SQLAlchemy
#实例化SQLAlchemy对象
db = SQLAlchemy()
#导入所有的类,从而在数据库中生成表
from love_house.models import *
#导入蓝图
from love_house.views.account.login import al
from love_house.views.account.register import ar
from love_house.... | null | 基于vue-flask搭建爱家租房项目/flask_后端/love_house/love_house/__init__.py | __init__.py | py | 1,199 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "love_house.views.account.login.al",
"line_number": 31,
"usage_type": "argument"
},
{
"api... |
366009823 | # -*- coding: utf-8 -*-
#get the comments of a book in douban.com and save it in a text file
#I learn it in the answer made by 'DataCastle' in the question: 'ÈçºÎÈëÃÅ Python ÅÀ³æ£¿''https://www.zhihu.com/question/20899988'
"""
Created on Sat May 5 15:31:31 2018
@author: MaChao
"""
import requests
from lxml i... | null | crawler_01_douban_comments_of_book.py | crawler_01_douban_comments_of_book.py | py | 1,315 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "lxml.etree.HTML",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "pandas.DataFrame",
"line_... |
234450890 | # -*- coding: utf-8 -*-
import logging
import pdb
from openerp import api, fields, models
_logger = logging.getLogger(__name__)
class ContratosVentas(models.Model):
_inherit = 'account.analytic.account'
tipo = fields.Selection((('client', 'Cliente'), ('provider', 'Proveedor')), 'Tipo', default='client')
... | null | addons-obs/contrato_ventas_ext/models.py | models.py | py | 739 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "openerp.models.Model",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "openerp.models",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "openerp.fie... |
211216956 | from math import sqrt
import matplotlib.pyplot as plt
import numpy
#update.message.text
#update.message.reply_text
diction = {
"^": "**",
"√": "sqrt",
}
def graph(bot, update):
user_range = []
user_func = update.message.text.split('/graph ')[1]
for j in diction:
if j in user_func:
... | null | plugins/graph.py | graph.py | py | 909 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.linspace",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "matplotlib.pypl... |
205104405 | """Switch platform for Enphase Envoy solar energy monitor."""
from __future__ import annotations
from collections.abc import Callable, Coroutine
from dataclasses import dataclass
import logging
from typing import Any
from pyenphase import Envoy, EnvoyEnpower
from homeassistant.components.switch import SwitchEntity, ... | null | homeassistant/components/enphase_envoy/switch.py | switch.py | py | 3,829 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "collections.abc.Callable",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "pyenphase.EnvoyEnpower",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "col... |
371085389 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
class Migration(migrations.Migration):
dependencies = [
('LogTool', '0010_auto_20150504_2354'),
]
operations = [
migrations.RemoveField(
model_name='logco... | null | DayLog/LogTool/migrations/0011_auto_20150505_0008.py | 0011_auto_20150505_0008.py | py | 637 | python | en | code | null | code-starcoder2 | 83 | [
{
"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.RemoveField",
"line_number": 15,
"usage_type": "call"
},
... |
30027037 | import cv2
import numpy as np
import base64
from detector import ComponentsDetector
cap = cv2.VideoCapture(1)
width = 640
height = 480
cap.set(cv2.CAP_PROP_FRAME_WIDTH,width)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT,height)
cd = ComponentsDetector() # Instancia el detector de componentes
while True:
_, frame = cap... | null | misc_code/a_more_programs/square_angle2.py | square_angle2.py | py | 814 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.CAP_PROP_FRAME_WIDTH",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "cv2.CAP_PROP_FRAME_HEIGHT",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_... |
62583260 | from bs4 import BeautifulSoup
import re
import requests
import csv
import urllib.request as ur
#years = ['2004']
years = ['2002', '2004', '2006', '2008', '2009', '2011', '2013', '2014', '2015', '2017', '2018']
url = []
for year in years:
url.append('http://www.piano-e-competition.com/midi_'+year+'.asp')
... | null | yamaha-excel-scrap.py | yamaha-excel-scrap.py | py | 1,564 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "re.compile",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_numb... |
294306178 | #!/usr/bin/env python3.6
import socket
import select
import json
import ssl
import sys
from NetProtocol import NetProtocol
class ExampleClient(NetProtocol):
def __init__(self):
super().__init__()
self.token = 'INSERT YOUR TOKEN HERE'
if self.token == 'INSERT YOUR TOKEN HERE':
print("You must insert your to... | null | exampleClient.py | exampleClient.py | py | 2,210 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "NetProtocol.NetProtocol",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "sys.exit",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "socket.socket",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"... |
250938057 | import numpy as np
import matplotlib.pyplot as plt
from matplotlib.widgets import Slider
import time
import seaborn as sns
start = time.time()
##################### IMPORT DATA ########################
JobID = int(input('JobID: '))
print('Loading Data...')
Weightmatrix = np.load('../../RetinotopicMapsData/%s/Weightm... | null | Plots/ProjectionPlot.py | ProjectionPlot.py | py | 2,291 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "time.time",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 15,
... |
576587386 | from tkinter import *
import tkinter.filedialog
from PIL import Image, ImageTk, ImageOps, ImageFilter
import numpy as np
import matplotlib.pyplot as plt
import cv2
import math
from scipy.ndimage import filters
master = Tk()
master.title('Final project')
master.geometry('1280x960')
global load, img_gray, ... | null | final/final2.py | final2.py | py | 4,129 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tkinter.filedialog.askopenfilename",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "tkinter.filedialog",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image.open",
"line_number": 19,
"usage_type": "call"
},
{
"api_nam... |
588764139 | import pygame
from chess_game_project import Pawn_piece, Rook_piece, Knight_piece, King_piece, Bishop_piece, Queen_piece
# constant values
gap = 75
BLACK = (139, 69, 45)
WHITE = (250, 235, 215)
pawn_list = []
bishop_list = []
rook_list = []
knight_list = []
king_list = []
queen_list = []
black_piece = []
white_piece ... | null | Objects.py | Objects.py | py | 7,625 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pygame.image.load",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.load",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pygame.image",
... |
192818764 | # Owner(s): ["oncall: distributed"]
import torch
import torch.distributed as dist
import torch.distributed.checkpoint as dist_cp
import torch.distributed.distributed_c10d as distributed_c10d
import torch.nn.functional as F
from torch.distributed._tensor import DeviceMesh, DTensor
from torch.distributed.checkpoint.def... | null | test/distributed/checkpoint/test_2d_fsdp_dt_checkpoint.py | test_2d_fsdp_dt_checkpoint.py | py | 7,219 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.nn",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Linear",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.ReLU",
"line... |
284841345 | import os
import logging
import datetime
from google.appengine.ext import db
from google.appengine.ext import webapp
from google.appengine.ext.webapp import util
from google.appengine.api.labs.taskqueue import Task
from google.appengine.api.urlfetch import DownloadError
from google.appengine.api import urlfetch
from ... | null | feeds/scan.py | scan.py | py | 2,362 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "google.appengine.ext.webapp.RequestHandler",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "google.appengine.ext.webapp",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "google.appengine.ext.db.GqlQuery",
"line_number": 25,
"usage_... |
394447657 | # -*- coding: utf-8 -*-
"""
Created on 2014-05-21
@author: momo
"""
import sys
from suning.util.StringUtils import StringUtils
try:
import httplib
except ImportError:
import http.client as httplib
import os
import hashlib
import base64
import json
import suning
from datetime import datetime
VERSION = "v1.2"... | null | suning/api/abstract.py | abstract.py | py | 6,261 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "base64.b64encode",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "hashlib.md5",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "os.linesep",
"line_number": 84,
"usage_type": "attribute"
},
{
"api_name": "suning.getDefaultAppInfo... |
469651531 | # Emulacija micro:bit-ovog "radio" modula prema MicroPython API specifikaciji.
# --> https://microbit-micropython.readthedocs.io/en/latest/radio.html
# Koristeći python-zeromq modul za interprocesnu komunikaciju.
# --> https://zeromq.org/
# Jakov Schramadei, 2.F, V.Gimnazija, Zagreb
# Pogledajte license.md za l... | null | src/radio.py | radio.py | py | 9,158 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "time.time",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 95,
"usage_type": "call"
},
{
"api_name": "zmq.Context",
"line_number": 101,
"usage_type": "call"
},
{
"api_name": "zmq.PAIR",
"line_n... |
462907932 | import dbmanager as db
import time
from iexfinance import Stock
from psycopg2.extensions import AsIs
from pprint import pprint
import pandas as pd
import tools
cur = db.get_cursor()
def get_intraday():
symbols_list = db.get_symbols_list()
columns = db.get_column('column_name', 'information_schema.columns', "t... | null | utils/fetch_intraday.py | fetch_intraday.py | py | 1,673 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "dbmanager.get_cursor",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "dbmanager.get_symbols_list",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "dbmanager.get_column",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "i... |
587392128 | from ftw.builder import Builder
from ftw.builder import create
from ftw.testbrowser import browsing
from opengever.mail.mail import IOGMail
from opengever.testing import IntegrationTestCase
from opengever.testing.assets import load
from plone.app.uuid.utils import uuidToObject
from plone.namedfile.file import NamedBlob... | null | opengever/api/tests/test_mail.py | test_mail.py | py | 15,859 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "opengever.testing.IntegrationTestCase",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "ftw.testbrowser.browsing",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "opengever.mail.mail.IOGMail",
"line_number": 38,
"usage_type": "call"
},... |
107082419 | from collections import namedtuple
import json
__author__ = 'sdementen'
def run_yql(yql, scalar=False):
# run a yql query and return results as list or scalar
import requests
DATATABLES_URL = 'store://datatables.org/alltableswithkeys'
PUBLIC_API_URL = 'http://query.yahooapis.com/v1/public/yql'
t... | null | piecash/core/_commodity_helper.py | _commodity_helper.py | py | 1,498 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "requests.get",
"li... |
286869709 | """
HOWTO:
api = Api(api_key)
video_ids = api.get_video_by_channel_id(channel_id)
video_ids = api.get_video_by_user_name(user_name)
"""
API_URL = 'https://www.googleapis.com/youtube/v3/%s?%s'
class Api:
def __init__(self, api_key):
self.key = api_key
def do(self, method, params):
... | null | youtube.py | youtube.py | py | 2,748 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "urllib.parse.urlencode",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "urllib.request.urlopen",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 33,
"usage_type": "call"
}
] |
335810381 | import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
from sklearn.preprocessing import PolynomialFeatures
import matplotlib.pyplot as plt
f=pd.read_csv('atmosphere_data.csv')
x=f.iloc[:,:-1]
y=f.iloc[:,-1]
x_train,x_test,y_train,y_test=train_test_... | null | Lab_Assignmnets_solutions/lab 8/bla.py | bla.py | py | 1,873 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.read_csv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": ... |
48066632 | import os
import sys
import torch
import argparse
import torchvision
import numpy as np
import torch.nn as nn
import scipy.io as sio
from PIL import Image
from tqdm import tqdm
from datetime import datetime
from collections import defaultdict
from torch.optim import lr_scheduler
from torch.utils.data import DataLoader
... | null | hed.py | hed.py | py | 19,286 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tensorboardX.SummaryWriter",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "torch.device",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "os.pa... |
128702735 | import json
import petname
import random
dict_animals = {}
arms = []
for i in range(2,11,2):
arms.append(i)
legs = []
for i in range(3,13,3):
legs.append(i)
dict_animals['animals'] = []
for i in range(1,21,1):
heads = ['snake', 'bull', 'lion', 'raven', 'bunny']
ran_head = random.choice(heads)
ani = pe... | null | homework01/generate_animals.py | generate_animals.py | py | 682 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "random.choice",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "petname.name",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "petname.name",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_num... |
85181707 | import numpy as np
import scipy.io.wavfile
from scipy.fftpack import dct
import matplotlib.pyplot as plt
from matplotlib.ticker import MultipleLocator, FormatStrFormatter
plt.rcParams['font.sans-serif']=['SimHei'] #用来正常显示中文标签
plt.rcParams['axes.unicode_minus']=False #用来正常显示负号
sample_rate, signal = scipy.io.wavfile.rea... | null | BiRNN_wav_OCR/test001.py | test001.py | py | 2,141 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 7,
"usage_type": "attribute"
},
{
"ap... |
241832700 | # -*- coding: UTF-8 -*-
import sys
reload(sys)
sys.setdefaultencoding( "utf-8" )
from pyspark import SparkContext
from pyspark.streaming import StreamingContext
# Create a local StreamingContext with two working thread and batch interval of 1 second
sc = SparkContext("local[2]", "NetworkWordCount")
ssc = StreamingCon... | null | python/cai_test/py_stream2.py | py_stream2.py | py | 618 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.setdefaultencoding",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pyspark.SparkContext",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pyspark.streaming.StreamingContext",
"line_number": 11,
"usage_type": "call"
}
] |
104745630 | from django.utils.html import format_html_join, format_html
from django.conf import settings
from wagtail.wagtailcore import hooks
@hooks.register('insert_editor_js')
def editor_js():
js_files = [
'base/js/kana_admin.js'
]
js_includes = format_html_join('\n', '<script src="{0}{1}"></script>',
... | null | base/wagtail_hooks.py | wagtail_hooks.py | py | 509 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.utils.html.format_html_join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.STATIC_URL",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 13,
"usage_type": "name"
... |
226232870 | """
Some utility functions which can operate over the OAG record object, to help
plugins and other parts of the application ensure that when they add/modify
it, they do so in the correct way.
Basically this is the stem of a future class based around the record, rather
than passing around a python data structure - but ... | null | openarticlegauge/recordmanager.py | recordmanager.py | py | 4,785 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "openarticlegauge.config.agent",
"line_number": 77,
"usage_type": "attribute"
},
{
"api_name": "openarticlegauge.config",
"line_number": 77,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.strftime",
"line_number": 79,
"usage_type": "call"
},
{
... |
152327593 | from json import loads
from os import remove
from os.path import isfile, basename
from base64 import b64decode
from FileEncryption_RSA import MyRSADecrypt
from constants import ENCODING, READ
"""
Decryption method. Input the filename of the json that needs to be decrypted,
as well as the filepath for the Private Key.... | null | src/FileEncryption_UnCollection.py | FileEncryption_UnCollection.py | py | 3,045 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.isfile",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "constants.READ",
"line_number": 18,
"usage_type": "argument"
},
{
"api_name": "json.loads",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.remove",
"line_nu... |
334853432 | ## Import libraries
import cv2
## Extract templates features for each template,
## putting them in a list of tuples:
## (template_keypoints, template_descriptors)
def extract_templates_features(template_images):
## Create the empty list of features
templates_features = []
## Create sift_detector det... | null | 1. Triangle scores test/1_synthetic_images_creation/functions/extract_templates_features.py | extract_templates_features.py | py | 738 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.xfeatures2d.SIFT_create",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.xfeatures2d",
"line_number": 12,
"usage_type": "attribute"
}
] |
612937094 | import pygame
import Board
def mouse_in_bounds(index, loc, mouse):
return loc[index] < mouse[index] < loc[index] + 160
pygame.init()
oImg = pygame.image.load('o.png')
xImg = pygame.image.load('x.png')
imageLocations = [[(75, 75), (260, 75), (440, 75)],
[(75, 260), (260, 260), (440, 260)],
... | null | src/Game.py | Game.py | py | 998 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pygame.init",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pygame.image.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.load",
... |
228725407 | # _ _ __ _______ ___
# /\ \ /\_ \ /'_ `\ /\_____ \ / ___ \
# \ \ \ __ ____\//\ \ __ __ __/\ \_\ \ \/___// / /\_\ /\ \
# \ \ \ __ / __ \ / __\ \ \ \ / __ \/\ \/\ \ \___, \ / / \/_/// /... | null | Réseaux/Pcap.py | Pcap.py | py | 5,167 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.system",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 66,
... |
413840021 | from rauth import OAuth1Service, OAuth2Service
from flask import url_for, request, redirect, session
from . import app
class OAuthSignIn(object):
providers = None
def __init__(self, provider_name):
self.provider_name = provider_name
credentials = app.config['OAUTH_CREDENTIALS'][provider_name]... | null | app/oauth.py | oauth.py | py | 4,000 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.url_for",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "rauth.OAuth2Service",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "flask.redirect",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "flask.request.args",... |
600301439 | #
# Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope ... | null | mysql-utilities-1.6.0/mysql/fabric/services/health.py | health.py | py | 4,003 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "mysql.fabric.command.Command",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "mysql.fabric.server.Group.fetch",
"line_number": 55,
"usage_type": "call"
},
{
"ap... |
392699709 | #! /usr/bin/python3
import os
import glob
import pandas as pd
import xml.etree.ElementTree as ET
import json
import sys
PATH2CSV = "../"
# check if settings.json exists
if "settings.json" not in os.listdir("../../"):
print("CANNOT FIND SETTING FILE: 'settings.json'")
sys.exit(0)
# load settings.json
with ... | null | dataset/xmls/xml2csv.py | xml2csv.py | py | 1,978 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.listdir",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 29,
... |
407645647 | from db import db_handler
from interface import bank_interface
def shop_pay_interface(username,shopping_car,cost):
user_dic=db_handler.select(username)
flag,msg=bank_interface.pay_interface(username,cost)
if flag:
user_dic['shop_car']={}
db_handler.save(user_dic)
return True,msg
... | null | interface/shop_interface.py | shop_interface.py | py | 639 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "db.db_handler.select",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "db.db_handler",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "interface.bank_interface.pay_interface",
"line_number": 5,
"usage_type": "call"
},
{
"api_name":... |
212102342 | from main.forms import CursoForm
import main
from django.http import request
from django.shortcuts import render, redirect
from django.contrib.auth.forms import AuthenticationForm, UserCreationForm
from django.contrib.auth import login, logout, authenticate
from django.contrib import messages
from django.db.models imp... | null | mysite/main/views.py | views.py | py | 3,939 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.shortcuts.render",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.http.request",
"line_number": 15,
"usage_type": "argument"
},
{
"api_name": "models.Curso.objects",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_nam... |
626633970 | import gc
import os
import numpy as np
from etc import settings
from utils import get_character_set, get_distinct_words, empty_directory, get_longest_word_length
from utils import load_pickle_data, file_exists, generate_pickle_file, get_files
from .transcript_encoding import generate_decoder_input_target
def _get_t... | null | data/data_preprocessing/prepare_dataset.py | prepare_dataset.py | py | 12,803 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "utils.load_pickle_data",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "gc.collect",
"line_number": 96,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 98,
"usage_type": "call"
},
{
"api_name": "etc.settings.AUDIO_WORD... |
421100765 | import config
import os
class Subtitle():
def __init__(self, path):
self.path = path
def convert(self):
for f in os.listdir(self.path):
with open(self.path + f, 'w', encoding='utf8') as saving:
saving.write('Nova legenda')
legenda = Subtitle(config.directory)
l... | null | Python/srt-txt-converter/converter-oo.py | converter-oo.py | py | 337 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.listdir",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "config.directory",
"line_number": 13,
"usage_type": "attribute"
}
] |
372953056 | import datetime as dt
import numpy as np
import pandas as pd
import sqlalchemy
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, func
from flask import Flask, jsonify
from datetime import datetime
#################################################
#... | null | app.py | app.py | py | 4,876 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.ext.automap.automap_base",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 29,
"usage_type": "call"
},
{
"api_name... |
472392015 | # This dockerfile is intended to be used by students
import sys
import subprocess
import pathlib
import argparse
from pathlib import Path
import os
assert sys.version_info >= (3, 4)
parser = argparse.ArgumentParser(
description='Activate homework environment for compiler-s20')
parser.add_argument( '-u','--usernam... | null | activate_docker.py | activate_docker.py | py | 1,848 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.version_info",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path"... |
629548713 | #!/usr/bin/env python
# Copyright (c) 2017 Intel corp. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
The set of hitogram-json tags
containing all histogram-json tags and maintain values and id
"""
import codecs
import json
import csv
i... | null | AutoTest/perf/histograms.py | histograms.py | py | 11,872 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "HTMLParser.HTMLParser",
"line_number": 47,
"usage_type": "name"
},
{
"api_name": "HTMLParser.HTMLParser.__init__",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "HTMLParser.HTMLParser",
"line_number": 49,
"usage_type": "name"
},
{
"api_na... |
168714660 | #!/usr/bin/env python
import os
import json
import platform
import argparse
import sys
import traceback
# for readability
from subprocess import call
from subprocess import check_output
from subprocess import check_call
from subprocess import CalledProcessError
from os import path
from os import makedirs
from os.pa... | null | tools/dotnet-bootstrap/dotnet.bootstrap.py | dotnet.bootstrap.py | py | 25,934 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.stdout.isatty",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "traceback.print_tb",
"line_number": 99,
"usage_type": "call"
},
{
"api_name": "os._exit",
"... |
393035696 | #!/usr/bin/python3
"""
This sample demonstrate the continuously image capturing of the build-in Appropho camera.
"""
import logging
import os
import sys
import cv2
logging.basicConfig(format="[ %(levelname)s ] %(message)s", level=logging.INFO, stream=sys.stdout)
log = logging.getLogger()
def main():
log.info... | null | Neon-20xA/Python/Capture/Capture-appropho.py | Capture-appropho.py | py | 1,365 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.basicConfig",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "sys.stdout",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogg... |
529080620 | import json
import numpy as np
from keras.models import Sequential
from keras.layers.core import Dense
from keras.optimizers import sgd
import random
class Gravity:
def __init__(self, size):
self.size = size
block_y = 0
block_x = random.randint(0, self.size - 1)
basket_x = random.r... | null | lesson-1/demo.py | demo.py | py | 2,679 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "random.randint",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "keras.models.Sequential",
... |
241830854 | from mbpls.mbpls import MBPLS
import time
import rpy2
# define Parameters
rand_seed = 25
import numpy as np
import pickle
import pandas as pd
np.seterr(all='raise')
def mbpls_ade4(data, num_comp=20):
from rpy2 import robjects
from rpy2.robjects import pandas2ri
import time
x1, x2, y = data
pa... | null | paper/benchmark/runtime_analysis_symmetric.py | runtime_analysis_symmetric.py | py | 10,512 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.seterr",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "rpy2.robjects.pandas2ri.activate",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "rpy2.robjects.pandas2ri",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": ... |
8905242 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logbook
from redis import StrictRedis
from twitter import Api
from auth import access_token_key, access_token_secret
from auth import consumer_key, consumer_secret
redis = StrictRedis(db=13)
api = Api(
consumer_key, consumer_secret,
access_token_key, acce... | null | utils/get_media_url.py | get_media_url.py | py | 744 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "redis.StrictRedis",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "twitter.Api",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "auth.consumer_key",
"line_number": 14,
"usage_type": "argument"
},
{
"api_name": "auth.consumer_sec... |
92132311 | import unittest
import logging
from ..common.operation_excel import OperationExcel
from ..common.assert_results import AssertResult
from ..common.myrequests import MyRequests
from ..base.base import *
import requests
import json
import ddt
#unittest.TestCase的子类,添加了方法
class SubUnittest(unittest.TestCase):
#初始化档位模板
... | null | test_framework/testcases/subunittest.py | subunittest.py | py | 2,791 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "unittest.TestCase",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "common.myrequests.MyRequests",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "common.myrequests.MyRequests",
"line_number": 28,
"usage_type": "call"
},
{
"... |
639996862 | import pandas as pd
import datetime, timedelta, time
from NSEDownload.static_data import values, arr, valuesTRI, arrTRI
from NSEDownload.check import check_name
from NSEDownload.scraper import scrape_givendate, scrape_fulldata
def get_data(indexName, full_data = None, start_date = None, end_date = None, indextype = N... | null | NSEDownload/indices.py | indices.py | py | 1,349 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "NSEDownload.static_data.arr",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "NSEDownload.static_data.values",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "NSEDownload.static_data.valuesTRI",
"line_number": 17,
"usage_type": "name"
... |
72897074 | from sqlalchemy.orm import relationship
from sqlalchemy import Column, Integer, String, \
Date, Time, DateTime, Interval, \
Boolean, ForeignKey, CheckConstraint, Enum
from sqlalchemy.ext.declarative import declarative_base
import enum
Base = declarative_base()
class Direction(enum.Enum):
inbound = 0
... | null | mbtaalerts/database/models.py | models.py | py | 4,013 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sqlalchemy.ext.declarative.declarative_base",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "enum.Enum",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "enum.Enum",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name... |
447924515 | # coding: utf-8
from bs4 import BeautifulSoup as BS
from svm_notifications import get_url, load_settings, session
import aiomysql
import asyncio
import logging
import sys
import ujson
def set_or_add(d, k, v):
try:
if k not in d:
d[k] = v
else:
d[k] += v
except Exception... | null | kortlista.py | kortlista.py | py | 4,373 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.error",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "aiomysql.create_pool",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "logging.error",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "aiomysql.create_pool... |
92121290 | # https://github.com/openai/gym/wiki/MountainCar-v0
import gym
import torch
from torch import nn
from torch import optim
import numpy as np
from torch.nn import functional as F
import random
from matplotlib import pylab as plt
from collections import deque
class DQNet(nn.Module): # B
def __init__(self):
... | null | pythonML/notebooks/Pytorch/sandbox/reinforcement_learning/q_learning/CartPoleDQNBatch.py | CartPoleDQNBatch.py | py | 3,905 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.nn.Module",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
210788517 | from collections import Counter
f = open('.\\data\\dataset_3363_3.txt', 'r')
str1 = f.read().replace('\n', ' ').lower().split()
f.close()
dictonary = Counter(str1)
max_value = list(sorted(dictonary.values()))
for key, value in dictonary.items():
if value == max_value[-1]:
print(key, value, end=" ") | null | CountRepeatWordFile.py | CountRepeatWordFile.py | py | 315 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "collections.Counter",
"line_number": 7,
"usage_type": "call"
}
] |
30264202 | import json
uniqueCluster = []
uniqueText = []
links = []
file1 = 'kmeans.txt'
file2 = 'pca.txt'
file3 = 'x.txt'
file4 = 'y.txt'
file5 = 'z.txt'
nodes = []
output = {}
linkTable = []
def getUnique(filename):
with open(filename, 'r') as f:
data = f.readlines()
#count = 0
for cluster in data:
cluster = j... | null | s3/Processing/cluster_new.py | cluster_new.py | py | 1,597 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "json.loads",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 71,
"usage_type": "call"
}
] |
423497074 | import unittest
import urllib2
import xmlrpclib
import json
from testconfig import config
import DsaWebServiceTestCase
class ICT8107isSimultaneous(DsaWebServiceTestCase.DsaWebServiceTestCase):
def test_checkColumnPresent(self):
'''
ICT-8107: Check is a response from the server for a ru... | null | FeatureTests/SCHEDULING/DSACore/test/src/ICT-8107-isSimultaneous.py | ICT-8107-isSimultaneous.py | py | 1,468 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "DsaWebServiceTestCase.DsaWebServiceTestCase",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "unittest.main",
"line_number": 39,
"usage_type": "call"
}
] |
40581418 | import cv2
def upside_down(img):
img_ud = img.copy()
h, w = img.shape[:2]
for i in range(int(h/2)):
index = h - i - 1
tmp = img_ud[i].copy()
img_ud[i] = img_ud[index]
img_ud[index] = tmp
return img_ud
def right_side_left(img):
img_rsl = img.copy()
h, w = i... | null | Classes/Computer_Vision/HW_1/problem_1.py | problem_1.py | py | 1,221 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.imread",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "cv2.imwrite",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "cv2.imwrite",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "cv2.imwrite",
"line_number": 5... |
565994612 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Created on Jan 9, 2018
.. codeauthor: svitlana vakulenko
<svitlana.vakulenko@gmail.com>
Basic setup for KBQA experiments
'''
# connect to entity catalog indexed with Lucene
from elasticsearch import Elasticsearch
from urllib.parse import quote
import string
cl... | null | api/setup.py | setup.py | py | 6,218 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "elasticsearch.Elasticsearch",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "urllib.parse.quote",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "string.punctuation",
"line_number": 67,
"usage_type": "attribute"
},
{
"api_name":... |
559332415 | from __future__ import print_function
import logging
import math
import socket
from timeit import default_timer as timer
from compas.datastructures import Mesh
from compas.geometry import Frame
from compas.geometry import matrix_from_frame
from compas_fab.backends.exceptions import BackendError
from compas_fab.backe... | null | src/compas_fab/backends/vrep/client.py | client.py | py | 29,921 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "compas_fab.backends.vrep.remote_api.vrep.simx_opmode_blocking",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "compas_fab.backends.vrep.remote_api.vrep",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "compas_fab.backends.vrep.remote_api.v... |
129082979 | import logging
logging.basicConfig(level=logging.INFO, format="%(message)s")
#logging.disable(logging.CRITICAL)
def combination(n, r, mod = 10 ** 9 + 7):
r = min(r, n-r)
up, down = 1, 1
for i in range(r):
up = up * (n - i) % mod
down = down * (i + 1) % mod
return up * pow(down, mod ... | null | BeginnerContest_145/D/solver2.py | solver2.py | py | 595 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.basicConfig",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 3,
"usage_type": "attribute"
}
] |
585247083 | from __future__ import print_function
from __future__ import unicode_literals
from __future__ import nested_scopes
from __future__ import division
from __future__ import generators
from flask import Flask
from flask import render_template
from flask import abort
from reverseproxied import ReverseProxied
from griddata... | null | sensugrid.py | sensugrid.py | py | 4,407 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "reverseproxied.ReverseProxied",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "multiprocessing.dummy.Pool",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "... |
331016616 | import numpy as np
import torch
import torch.nn as nn
from torch.nn import init
from torchvision import models
from torch.autograd import Variable
from .base_model import ClassBlock
class PCB_Effi_LSTM(nn.Module):
def __init__(self, model, train_backbone=False):
super(PCB_Effi_LSTM, self).__init__()
... | null | logs/Old-Runs/train_PCB_LSTM-full_loss-batch=8/lstm_model.py | lstm_model.py | py | 6,667 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.nn.Module",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "torch.nn.Dropout",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_n... |
71036404 | import settings as s
import random
from pathlib import Path
from pygame import image
from pygame.font import Font
class ImageWrapper():
image_object = None
x = None
y = None
def __init__(self,display,x,y):
self.x = x
self.y = y
self.display = display
def draw(self):
... | null | bin/classes.py | classes.py | py | 8,333 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pygame.image.load",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "settings.image_directory"... |
192464062 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from src.autofill import Dochazka
from src.parser import config_parser
from src.parser import schedule_parser
import datetime
__author__ = 'Dmytro Soloviov'
__email__ = 'dmytro.soloviov@gmail.com'
__version__ = '1.0'
def main(_file, _config):
def fix_int(... | null | dochazka.py | dochazka.py | py | 2,884 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "src.parser.config_parser",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "src.autofill.Dochazka",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "src.parser.schedule_parser",
"line_number": 29,
"usage_type": "call"
},
{
"api_nam... |
351233980 | from django.core.management.base import BaseCommand
from django.contrib.contenttypes.models import ContentType
class Command(BaseCommand):
args = ''
help = 'Prints all project models and the their object count'
def handle(self, *args, **options):
for conttype in ContentType.objects.all():
... | null | apps/hello/management/commands/enummodel.py | enummodel.py | py | 643 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.contrib.contenttypes.models.ContentType.objects.all",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.contrib.contenttypes.models.ContentType.... |
459438258 | import sys
import requests
import tempfile
def get_wall(resolution="1920x1080"):
"""
This method downloads a random wallpaper to use from unsplash. The file is
saved to a temporary file so it can be taken care of by the operating
syst... | null | venus/venus.py | venus.py | py | 1,401 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "tempfile.mkstemp",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sys.platform",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "venus.os_tools.linux.... |
314389252 | import itertools
any_value = lambda: None
# forbidden_queries 書式例
# forbidden_queries = {
# 'returned': False,
# 'approved': perm_method.any_value,
# 'price': [
# {
# 'to': perm_method.any_value,
# 'when' :{
# 'approved': True
# }
# }
# ... | null | api/utils/perm_method.py | perm_method.py | py | 1,364 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "itertools.repeat",
"line_number": 35,
"usage_type": "call"
}
] |
645344568 | # -*- coding: utf-8 -*-
import utils, os, itertools
if __name__ == '__main__':
version = '3.4'
system_model = 'Allocation, cut-off'
properties = ['carbon content, total']
system_model_folder = utils.version_system_model_path(version, system_model)
undefined_folder = utils.version_system_model_path(... | null | modules/release/balance_allocation_distortion.py | balance_allocation_distortion.py | py | 2,488 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "utils.version_system_model_path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "utils.version_system_model_path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "utils.read_excel",
"line_number": 13,
"usage_type": "call"
},
{
"ap... |
573271126 | """
SiEPIC Analysis Package
Author: Mustafa Hammood
Mustafa@siepic.com
Example: Application of SiEPIC_AP analysis functions
Process data of various contra-directional couplers (CDCs)
Extract the period and bandwidth from a set of devices
"""
#%%
import siepic_analysis_packa... | null | examples/ex_Bragg_analysis/SOI_SiO2_oband/Bragg_period_oband_sio2.py | Bragg_period_oband_sio2.py | py | 5,251 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.walk",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "os.path.basename",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number... |
325147044 | import os
from concurrent.futures.thread import ThreadPoolExecutor
from typing import Any, Dict, List
from cognite.client._api_client import APIClient
from cognite.client.data_classes.model_hosting.versions import (
ModelArtifactList,
ModelVersion,
ModelVersionList,
ModelVersionLog,
)
class EmptyArti... | null | cognite/client/_api/model_hosting/versions.py | versions.py | py | 11,629 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cognite.client._api_client.APIClient",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "cognite.client.data_classes.model_hosting.versions.ModelVersion._load",
"line_number": 45,
... |
398347035 | import json,requests
class fenci():
def __init__(self,servant):
self.name = 'fenci'
self.servant = servant
#获取分词结果
def get_result(self,text):
data = json.dumps({'text':text})
headers = {'Content-Type':'application/json'}
url = self.servant.yuyan_url+'?charaset=UT... | null | fenci.py | fenci.py | py | 1,411 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "json.dumps",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number"... |
172893513 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon May 29 15:14:44 2017
@author: lab309
"""
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon May 29 14:19:36 2017
@author: lab309
"""
# CNN
#from readData import *
import numpy as np
#from readData import *
#model = gensim.models.Word... | null | history/solution11.py | solution11.py | py | 1,686 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "keras.layers.Input",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "keras.layers.Input",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "keras.layers.Conv2D",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "keras.layer... |
294383509 | import os
import numpy as np
import time
import datetime
import torchvision
from pathlib import Path
from torch import optim
from torch.autograd import Variable
import torch.nn.functional as F
from torch.backends import cudnn
from .myevaluation import *
from .utils.metrics import DiceLoss
from .arch.netwo... | null | Classification/solver.py | solver.py | py | 18,103 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.nn.BCELoss",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "utils.metrics.DiceLoss",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "torch.nn.CrossE... |
414458908 | import numpy as np
import pickle
from checkers.game import Game, Board
import copy
from ANN import ANN
from tqdm import tqdm
class CheckersGame:
def __init__(self, path_rede_branca, path_rede_preta):
self.rede_branca = pickle.load(open( path_rede_branca, "rb"))
self.rede_preta = pickle.load(open( p... | null | CheckersGame.py | CheckersGame.py | py | 6,490 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pickle.load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "checkers.game.Game",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_n... |
197244215 | """
Custome logger for PyPPL
"""
import re
import logging
from collections import OrderedDict
from copy import copy
from functools import partial
import colorama
# Fore/Back: BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, RESET.
# Style: DIM, NORMAL, BRIGHT, RESET_ALL
from .utils import config
colorama.init(a... | null | pyppl/logger.py | logger.py | py | 13,831 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "colorama.init",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "collect... |
351391803 | import cv2
import lmdb
import random
import numpy as np
from tqdm import tqdm
#data_list_fns = ['data_list/train.csv', 'data_list/val.csv']
data_list_fns = ['crop_imgs/img_list.csv']
keys = []
for data_list_fn in data_list_fns:
with open(data_list_fn, 'r') as f:
lines = f.readlines()
... | null | week6/class_code_homework/lane_segmentation/make_lmdb.py | make_lmdb.py | py | 1,439 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "lmdb.open",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "lmdb.open",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "random.shuffle",
"line_number": 31,... |
226443912 | from threading import Thread
import serial
class readTest(Thread):
def __init__(self):
Thread.__init__(self)
self.serial_port = serial.Serial(
port='COM28', \
baudrate=115200, \
parity=serial.PARITY_NONE, \
stopbits=serial.STOPBITS_ONE, \
... | null | RPi/old/told/test546/serreadtest.py | serreadtest.py | py | 651 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "threading.Thread",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "threading.Thread.__init__",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "serial.Seria... |
95143935 | from django.contrib.auth import get_user_model
from django.test import TestCase
from .models import Tweet
User = get_user_model()
class TweetModelTestCase(TestCase):
def setUp(self):
test_user = User.objects.create(username='test-user')
def test_tweet_content(self):
object = Tweet.objects.... | null | src/tweets/tests.py | tests.py | py | 471 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.test.TestCase",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "models.Tweet.objects.create",
"line_number": 15,
"usage_type": "call"
},
{
... |
314582789 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from misc import torchutils
import torch.utils.model_zoo as model_zoo
from net import resnest269
class FixedBatchNorm(nn.BatchNorm2d):
def forward(self, x):
return F.batch_norm(x, self.running_mean, self.running_var, self.weigh... | null | net/resnest269_cam.py | resnest269_cam.py | py | 2,314 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.nn.BatchNorm2d",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "torch.nn.functional.batch_norm",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "tor... |
201761398 | # encoding: utf-8
"""
Sampling methods using the Random Walk Metropolis algorithm.
"""
from functools import partial
from typing import Callable, Generator
import jax
from tqdm import trange
from mcx.inference.kernels import HMCState
KernelState = HMCState
@partial(jax.jit, static_argnums=(1, 2, 3))
def single_cha... | null | mcx/inference/samplers.py | samplers.py | py | 3,249 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "mcx.inference.kernels.HMCState",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "jax.random",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "typing.Callable",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "jax.ra... |
219377482 | import json
from django.test import TestCase, Client
from viewingsites.models import *
from alerts.models import *
from facilities.models import *
from animals.models import *
from photos.models import *
# Create your tests here.
class TestViewSite(TestCase):
def setUp(self):
self.site = ViewSite.objects.... | null | viewingsites/tests.py | tests.py | py | 2,627 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.test.TestCase",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.test.Client",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "django.test.Client... |
192313930 | # Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# Author: Federico Ceratto <federico.ceratto@hpe.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.o... | null | designate/tests/unit/mdns/test_service.py | test_service.py | py | 3,060 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "oslo_config.cfg.CONF",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "oslo_config.cfg",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "oslotest.base.base",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "osl... |
403864233 | import numpy as np
import pandas as pd
from joblib import Parallel, delayed
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.pipeline import FeatureUnion, _fit_transform_one, _transform_one
class DataFrameUnion(FeatureUnion):
def fit_transform(self, X, y=None, **fit_params):
self._val... | null | taxi_tips_model/processing/pipeline_helper.py | pipeline_helper.py | py | 2,669 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sklearn.pipeline.FeatureUnion",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "joblib.Parallel",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "joblib.delayed",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sklearn.p... |
608987191 | from __future__ import absolute_import
import importlib
class NotSupportedError(Exception):
pass
class ForceDensity(object):
"""Force-density algorithm with different backends.
Parameters
----------
backend : {'alglib', 'numpy', 'cpp'}, optional
The backend to use for the algorithm.
... | null | src/compas/numerical/fd/__init__.py | __init__.py | py | 1,387 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "importlib.import_module",
"line_number": 45,
"usage_type": "call"
}
] |
371913069 | import os
import json, csv
import pandas as pd
from pathlib import Path
from etl.utils.error_handlers import handle_errors
@handle_errors
def read_file(filepath, reader=None,
header=None):
"""
Read Extension specific files
:param filepath: string
:return: list
"""
if reader:
... | null | container_folder/newyorker_task/etl/utils/commons.py | commons.py | py | 2,988 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.read_csv",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "etl.utils.error_handlers.handle_errors",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "csv.D... |
485090036 | """
pghoard - pg_basebackup handler
Copyright (c) 2015 Ohmu Ltd
See LICENSE for details
"""
import datetime
import json
import logging
import os
import select
import subprocess
import time
from . common import set_subprocess_stdout_and_stderr_nonblocking
from tarfile import TarFile
from threading import Thread
cl... | null | pghoard/basebackup.py | basebackup.py | py | 2,933 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "threading.Thread",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "threading.Thread.__init__",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "logging.g... |
591153635 | from flask import Flask, request
import requests
from flask_restful import Resource, Api, reqparse
app = Flask(__name__)
app.secret_key = 'proseth123'
api = Api(app)
class SmsGateWay(Resource):
parser = reqparse.RequestParser()
parser.add_argument('email',
type=str,
... | null | app.py | app.py | py | 2,123 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask_restful.Api",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask_restful.Resource",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "flask_restful.reqpa... |
458260278 | import pygame
import random # Q: Why can't you take an atom seriously?
from PlayerClass import PlayerClass # A: Because they make up everything!
from view_Player import view_Player
from Zombie import Zombie
fro... | null | controller.py | controller.py | py | 8,356 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pygame.display.set_mode",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.set_caption",
"line_number": 16,
"usage_type": "call"
},
{
"api_name":... |
493484742 | import numpy as np
from keras.datasets import cifar10
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten, Conv2D, MaxPooling2D
from keras.utils import np_utils
import matplotlib.pyplot as plt
from keras import backend as K
K.set_image_dim_ordering('th')
# fix random seed for reproduc... | null | Lab Manual/Lab_7/CNN-cifar10.py | CNN-cifar10.py | py | 2,057 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "keras.backend.set_image_dim_ordering",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "keras.backend",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "numpy.random.seed",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "nu... |
35765072 | import json
import requests
class GraphQLClient:
def __init__(self, endpoint, key):
self.endpoint = endpoint
self.key = key
def execute(self, query, variables=None):
return self._send(query, variables)
def _send(self, query, variables):
# Encode the variables if needed
... | null | graphqlclient/client.py | client.py | py | 752 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "json.dumps",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 31,
"usage_type": "call"
}
] |
509096800 | import tensorflow as tf
from src.datasets import Celeb
from src.model_res import Model
from src.model_classic import ModelClassic
from src.estimator import Estimator
import time
import click
dataset_path = "/home/chrabasp/Download/img_align_celeba/"
attributes_path = "/home/chrabasp/Download/list_attr_celeba.txt"
@c... | null | main.py | main.py | py | 1,109 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tensorflow.logging.set_verbosity",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "tensorflow.logging",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "click.group",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "... |
296260710 | import sys
import requests
from bs4 import BeautifulSoup
import urllib.request
import os
import time
from tqdm import tqdm
def input_request():
if len(sys.argv) == 3:
query_word = sys.argv[1]
all_num = int(sys.argv[2])
pages_num = -(-(all_num) // 20)
else:
while Tr... | null | imgs_sc_2-1.py | imgs_sc_2-1.py | py | 2,175 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.argv",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.