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
97913648
from zeit.content.image.interfaces import IVariants import zeit.cms.testing import zeit.content.image.testing import zope.interface.verify class VariantTraversal(zeit.cms.testing.FunctionalTestCase): layer = zeit.content.image.testing.ZCML_LAYER def setUp(self): super(VariantTraversal, self).setUp()...
null
src/zeit/content/image/tests/test_variant.py
test_variant.py
py
2,146
python
en
code
null
code-starcoder2
76
[ { "api_name": "zeit.content.image.interfaces.cms", "line_number": 7, "usage_type": "attribute" }, { "api_name": "zeit.content.image.interfaces", "line_number": 7, "usage_type": "name" }, { "api_name": "zeit.content.image.interfaces.content", "line_number": 9, "usage_type"...
268264786
import time from bs4 import BeautifulSoup from selenium import webdriver from selenium.webdriver.common.keys import Keys # for necessary browser action from selenium.webdriver.common.by import By # For selecting html code import lxml from userAgents import user_agents, randomUserAgents start = time.time() url ...
null
googPlay.py
googPlay.py
py
1,161
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.time", "line_number": 11, "usage_type": "call" }, { "api_name": "userAgents.randomUserAgents", "line_number": 14, "usage_type": "call" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 16, "usage_type": "call" }, { "api_name": "selen...
482821317
import json import uuid import os def load(path): with open(path, "r", encoding="utf-8") as f: s = f.read() return json.loads(s) def save(path, data): s = json.dumps(data, ensure_ascii=False, indent=2) with open(path, "w", encoding="utf-8") as f: f.write(s) class Model(object): @classmethod def getid(cls...
null
model/__init__.py
__init__.py
py
1,944
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.loads", "line_number": 8, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 12, "usage_type": "call" }, { "api_name": "uuid.uuid1", "line_number": 19, "usage_type": "call" }, { "api_name": "os.sep", "line_number": 24, "...
86128023
import dask.array as da import dask import numpy as np from optimization.dask_version.optimization import MultiAgent from optimization.dask_version import objectif_function as of import time class GA(MultiAgent): def __init__(self, chunks, objf, population_size, dim, lb, ub, max_i, mutat_p=0.5, k_way=150, ind_nb=5...
null
dask_version/myswarmpy/ga.py
ga.py
py
3,552
python
en
code
null
code-starcoder2
76
[ { "api_name": "optimization.dask_version.optimization.MultiAgent", "line_number": 8, "usage_type": "name" }, { "api_name": "numpy.asarray", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.random.choice", "line_number": 20, "usage_type": "call" }, { ...
191660471
#!/usr/bin/python # -*- coding: utf-8 -*- """ __title__ = '' __author__ = 'mi' __mtime__ = '2018/12/6' # code is far away from bugs with the god animal protecting I love animals. They taste delicious. ┏┓ ┏┓ ┏┛┻━━━┛┻┓ ┃ ☃ ┃ ┃ ┳┛ ┗┳ ┃ ┃ ...
null
多进程,线程方式/thread.py
thread.py
py
4,841
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.sleep", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.random.random", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 36, "usage_type": "name" }, { "api_name": "multiprocessing.JoinableQ...
190036260
from flask import jsonify from model.model_db import Base from model.connect_db import initialize class Controller: # Constructor def __init__(self, request_data: dict, auth=""): self.auth = auth self.engine, self.session = initialize(Base) if request_data: print(request_da...
null
src-meblanja/controller/controller.py
controller.py
py
789
python
en
code
null
code-starcoder2
76
[ { "api_name": "model.connect_db.initialize", "line_number": 10, "usage_type": "call" }, { "api_name": "model.model_db.Base", "line_number": 10, "usage_type": "argument" }, { "api_name": "flask.jsonify", "line_number": 21, "usage_type": "call" }, { "api_name": "fla...
469227487
# -*- coding:utf-8 -*- from __future__ import absolute_import from __future__ import unicode_literals from __future__ import print_function import json import uuid import time import gevent import logging import random, string from gevent import GreenletExit from gevent.subprocess import Popen, PIPE logger = logging....
null
platform/x/loadcluster/roles/locust/files/gamex/dismbots.py
dismbots.py
py
2,960
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "gevent.subprocess.Popen", "line_number": 26, "usage_type": "call" }, { "api_name": "gevent.subprocess.PIPE", "line_number": 26, "usage_type": "name" }, { "api_name": "geve...
406649695
import os import requests import time from bs4 import BeautifulSoup from openpyxl import load_workbook def get_detail_info_byid(job_id, outputfolder): """分析每个职位页面详情""" headers = { 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'Accept-Encoding': 'gzip...
null
spider/jobdetailspider.py
jobdetailspider.py
py
2,479
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.exists", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_number": 20, "usage_type": "call" }, { "api_name": "requests.get", "line_number"...
181925804
""" * Copyright 2020-2021 Xilinx, Inc. * * 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 agr...
null
plugin/tigergraph/recomengine/tests/regression/python/main.py
main.py
py
11,922
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.dirname", "line_number": 37, "usage_type": "call" }, { "api_name": "os.path", "line_number": 37, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 37, "usage_type": "call" }, { "api_name": "os.path.dirname", "...
227270781
import pandas as pd import requests import time class GettingData: def __init__(self, ticker): """ :param ticker: тикер компании """ self.ticker = ticker def get_data(self): """ Запросы к Alpha Vantage :return: нужные данные в формате csv """ ...
null
reader.py
reader.py
py
3,485
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 23, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 55, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 70, "usage_type": "call" }, { "api_name": "time.sleep", "line_number...
425733815
import BruteForce, Dictionary, Hash, Load, Speed import sys, os import numpy as np from PySide2 import QtCore, QtGui, QtWidgets import time #THREAD HANDLING BOTH THE CRACKING AND THE COMPUTATION SPEED PROCESS class Woker(QtCore.QObject): finished = QtCore.Signal() finished2 = QtCore.Signal() ...
null
Password_Strength_Tester.py
Password_Strength_Tester.py
py
13,418
python
en
code
null
code-starcoder2
76
[ { "api_name": "PySide2.QtCore.QObject", "line_number": 9, "usage_type": "attribute" }, { "api_name": "PySide2.QtCore", "line_number": 9, "usage_type": "name" }, { "api_name": "PySide2.QtCore.Signal", "line_number": 10, "usage_type": "call" }, { "api_name": "PySide...
198452661
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 ################################################# # Database Setup ###########...
null
SurfsUp/app.py
app.py
py
4,362
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlalchemy.create_engine", "line_number": 16, "usage_type": "call" }, { "api_name": "sqlalchemy.ext.automap.automap_base", "line_number": 19, "usage_type": "call" }, { "api_name": "sqlalchemy.orm.Session", "line_number": 28, "usage_type": "call" }, { ...
239668381
import bpy import math import bmesh from .... preferences import get_preferences class HOPS_OT_ADD_plane(bpy.types.Operator): bl_idname = "hops.add_plane" bl_label = "Add smart plane" bl_options = {"REGISTER", "UNDO", "GRAB_CURSOR", "BLOCKING"} bl_description = """Create Smart plane""" ...
null
addon/operator/add/plane.py
plane.py
py
2,682
python
en
code
null
code-starcoder2
76
[ { "api_name": "bpy.types", "line_number": 7, "usage_type": "attribute" }, { "api_name": "bpy.data.objects.new", "line_number": 16, "usage_type": "call" }, { "api_name": "bpy.data", "line_number": 16, "usage_type": "attribute" }, { "api_name": "bpy.data.meshes.new"...
456838951
from bs4 import BeautifulSoup import pandas as pd import gspread from oauth2client.service_account import ServiceAccountCredentials from datetime import date episodeList = pd.read_csv('sg1-eps.csv', sep=',', header=None) print(episodeList.head()) def get_filters(): # use creds to create a client to interact wi...
null
sitepages/generate_nav_v2.py
generate_nav_v2.py
py
6,877
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "oauth2client.service_account.ServiceAccountCredentials.from_json_keyfile_name", "line_number": 16, "usage_type": "call" }, { "api_name": "oauth2client.service_account.ServiceAccountCredentia...
405357505
#coding=utf-8 ''' 警告框处理 text 返回 alert/confirm/prompt 中的文字信息。 accept 点击确认按钮。 dismiss 点击取消按钮,如果有的话。 send_keys 输入值,这个 alert\confirm 没有对话框就不能用了,不然会报错。 在 WebDriver 中处理 JavaScript 所生成的 alert、confirm 以及 prompt 是很简单的。具体做法是使用 switch_to_alert()方法定位到 alert/confirm/prompt。然后使用 text/accept/dismiss/send_keys 按需进行操做。 ''' from seleni...
null
Webdriver Api/警告框处理.py
警告框处理.py
py
1,310
python
en
code
null
code-starcoder2
76
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 17, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 17, "usage_type": "name" }, { "api_name": "selenium.webdriver.common.action_chains.ActionChains", "line_number": 22, "usage_type": "cal...
436563366
import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import numpy as np np.random.seed( 19680645 ) def randrange(n, min, max): return (max - min)*np.random.rand(n) + min kolory=['yellow','blue','red','green','cyan'] markers=['.','o','v','*','p'] fig = plt.figure() ax = fig.add_su...
null
Tomasz_Maćkiewicz_155299_11/zadanie 2.py
zadanie 2.py
py
626
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.seed", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 5, "usage_type": "attribute" }, { "api_name": "numpy.random.rand", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.random", ...
405904650
from ftw.builder import Builder from ftw.builder import create from ftw.testbrowser import browsing from ftw.testbrowser.pages import factoriesmenu from ftw.testbrowser.pages.statusmessages import assert_no_error_messages from opengever.base.interfaces import ISequenceNumber from opengever.testing import IntegrationTes...
null
opengever/workspace/tests/test_todolist.py
test_todolist.py
py
9,274
python
en
code
null
code-starcoder2
76
[ { "api_name": "opengever.testing.SolrIntegrationTestCase", "line_number": 14, "usage_type": "name" }, { "api_name": "ftw.testbrowser.pages.factoriesmenu.add", "line_number": 20, "usage_type": "call" }, { "api_name": "ftw.testbrowser.pages.factoriesmenu", "line_number": 20, ...
337554374
import math import torch from torch.autograd import Function from .. import masked_conv2d_cuda class MaskedConv2dFunction(Function): @staticmethod def forward(ctx, features, mask, weight, bias, padding=0): assert mask.dim() == 3 and mask.size(0) == 1 assert features.dim() == 4 and features.si...
null
mmdet/ops/masked_conv/functions/masked_conv.py
masked_conv.py
py
2,374
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.autograd.Function", "line_number": 7, "usage_type": "name" }, { "api_name": "math.floor", "line_number": 35, "usage_type": "call" }, { "api_name": "math.floor", "line_number": 38, "usage_type": "call" }, { "api_name": "torch.nonzero", "lin...
626654454
import os from cv2 import cv2 from mtcnn import MTCNN from global_config import PROCESSED_IMAGE_DIR_SUFFIX def crop_and_save(raw_path, name): images = [] dem = 0 current_path = str(os.path.abspath(os.getcwd())) # .../pbl5-api newpath = current_path + PROCESSED_IMAGE_DIR_SUFFIX + "/" + name if no...
null
src/recognize_module/utils.py
utils.py
py
1,174
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.abspath", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 11, "usage_type": "call" }, { "api_name": "global_config.PROCESSED_IMAGE_...
73751333
from warnings import warn from torch import einsum from torch.nn import LayerNorm from backpack.core.derivatives.basederivatives import BaseParameterDerivatives class LayerNormDerivatives(BaseParameterDerivatives): def get_module(self): return LayerNorm def hessian_is_zero(self): return Fal...
null
backpack/core/derivatives/layernorm.py
layernorm.py
py
2,291
python
en
code
null
code-starcoder2
76
[ { "api_name": "backpack.core.derivatives.basederivatives.BaseParameterDerivatives", "line_number": 9, "usage_type": "name" }, { "api_name": "torch.nn.LayerNorm", "line_number": 11, "usage_type": "name" }, { "api_name": "warnings.warn", "line_number": 35, "usage_type": "ca...
85280861
from odoo import api, fields, models, _ from datetime import date, datetime, timedelta from dateutil import relativedelta from odoo.exceptions import UserError import logging _logger = logging.getLogger(__name__) from io import StringIO, BytesIO import io import pdb try: import xlwt except ImportError: _logg...
null
hr_ext/reports/salary_report.py
salary_report.py
py
16,709
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "odoo.models.TransientModel", "line_number": 28, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 28, "usage_type": "name" }, { "api_name": "odoo.fie...
237040694
# 2 of 10 application - Winter Holidays Challenge 2021 # Napisz program, który po uruchomieniu wyświetla w czytelnej formie aktualną datę, godzinę, dzień tygodnia # i pogodę/temperaturę/ciśnienie w zadanym mieście # (wykorzystaj np. https://rapidapi.com/commu.../api/open-weather-map/endpoints - # pamiętaj o poprawn...
null
page-from-callendar.py
page-from-callendar.py
py
2,437
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.request", "line_number": 32, "usage_type": "call" }, { "api_name": "datetime.datetime.today", "line_number": 45, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 45, "usage_type": "attribute" }, { "api_name": "rando...
156284489
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## solution found at (2019-05-28) ## https://incognitjoe.github.io/adding-certs-to-requests.html import certifi import requests def _import_certs(cert_path): try: remote_address = 'https://api.slack.com' test = requests.get(...
null
mlflow_tracking_server/test/check_certs.py
check_certs.py
py
698
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 11, "usage_type": "call" }, { "api_name": "requests.exceptions", "line_number": 12, "usage_type": "attribute" }, { "api_name": "certifi.where", "line_number": 14, "usage_type": "call" } ]
580747337
from django.db import models from django.db.models import Max class QuestionManager(models.Manager): # gets all available questions for a user for a specifc category and specific belt level # returns a dictionary def one_level_questions(self, category, level): result = super().get_queryset().filter(category=cat...
null
backend/content/manager.py
manager.py
py
521
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.models.Manager", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 5, "usage_type": "name" } ]
290227906
import requests import json import csv lista = [] def url_format(): _url = 'https://www.sportsline.com/sportsline-web/service/v1/odds?league=nba&auth=1' result = requests.get(_url) content = result.content content = content.decode('utf8').replace("'",'"') data = json.loads(content) return da...
null
lines/lines_nba.py
lines_nba.py
py
1,462
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 13, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 36, "usage_type": "call" }, { "api_name": "csv.QUOTE_MINIMAL", "line_numb...
422933286
import numpy as np import matplotlib.pyplot as plt import function_list as fl EFIX = 0 MOVIE = 0 N = 1001 L = 10. #domain_length CFL = 0.6 #Courant-Fredrichs-Lewy condition dx = L / (N-1) #spatial resolution dt = CFL*dx #time step T_begin = 1 #step number [important in determining xi = x/t ----> (in this case) --> xc...
null
oldEulerANDSW/eulerEqs.py
eulerEqs.py
py
3,901
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.linspace", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.empty", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.empty", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.empty", "line_number...
537782122
# -*- coding: utf-8 -*- """ https://docs.python.org/2/howto/logging-cookbook.html """ import logging # create logger with 'spam_application' logger2 = logging.getLogger('logging_test.log2') logger = logging.getLogger('logging_test') logger.setLevel(logging.DEBUG) # create file handler which logs even debug messages f...
null
logging_test.py
logging_test.py
py
1,237
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 11, "usage_type": "attribute" }, { "api_name": "logging.FileHan...
375794121
import os import logging import re import asyncio from typing import List, Tuple, Any from .magdeck import MagDeck from .tempdeck import TempDeck from opentrons import HERE as package_root, config log = logging.getLogger(__name__) PORT_SEARCH_TIMEOUT = 5.5 SUPPORTED_MODULES = { 'magdeck': MagDeck, 'magnetic m...
null
api/src/opentrons/legacy_api/modules/__init__.py
__init__.py
py
8,090
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "magdeck.MagDeck", "line_number": 14, "usage_type": "name" }, { "api_name": "magdeck.MagDeck", "line_number": 15, "usage_type": "name" }, { "api_name": "tempdeck.TempDeck",...
386556361
import traceback from flask import render_template, request, redirect, url_for import logging.config #from app.models import UserInput from flask import Flask from src.add_movies import UserInput, _truncate_userinput from flask_sqlalchemy import SQLAlchemy import os import sqlalchemy as sql import sys sys.path.append(o...
null
app/app.py
app.py
py
4,189
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_num...
156286427
"""Cone searches. Inspired by Corrfunc. Matthew Alger <matthew.alger@anu.edu.au> Research School of Astronomy and Astrophysics The Australian National University 2018 """ import astropy.units as u import numpy from sklearn.neighbors import DistanceMetric from sklearn.utils.extmath import cartesian haversine = Dista...
null
second/neighbours.py
neighbours.py
py
5,685
python
en
code
null
code-starcoder2
76
[ { "api_name": "sklearn.neighbors.DistanceMetric.get_metric", "line_number": 16, "usage_type": "call" }, { "api_name": "sklearn.neighbors.DistanceMetric", "line_number": 16, "usage_type": "name" }, { "api_name": "astropy.units.deg", "line_number": 23, "usage_type": "attrib...
558700747
# -*-coding:utf-8 -*- #coding:utf8 import glob from PIL import Image import win32api,win32con,win32gui import re,os import urllib,re,sys,os,time import sys from PyQt4 import QtGui,QtCore import urllib.request from requests import request import json #判断是否有photos这个文件夹,有就直接下载当天图片 #没有就全部下载 i=0 class Example(QtGui.QWidg...
null
Bing5.0_python3.py
Bing5.0_python3.py
py
3,736
python
en
code
null
code-starcoder2
76
[ { "api_name": "PyQt4.QtGui.QWidget", "line_number": 19, "usage_type": "attribute" }, { "api_name": "PyQt4.QtGui", "line_number": 19, "usage_type": "name" }, { "api_name": "os.path.exists", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "li...
389176298
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import pycurl import sys import pprint pp = pprint.PrettyPrinter(indent=4) pprint = pp.pprint #import datetime as dt from io import BytesIO from bs4 import BeautifulSoup def main(argv): stuff = {} urls = [ 'http://envoy-00071.local/production?locale=en', 'http:...
null
parse.py
parse.py
py
1,646
python
en
code
null
code-starcoder2
76
[ { "api_name": "pprint.PrettyPrinter", "line_number": 7, "usage_type": "call" }, { "api_name": "io.BytesIO", "line_number": 21, "usage_type": "call" }, { "api_name": "pycurl.Curl", "line_number": 22, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "l...
451167138
import matplotlib.pyplot as plt import os import numpy as np def dis_plot(q, c): if q == 2: upper = 0.4 else: upper = 0.11 with open(f"./results_{q}_{c}.txt", 'r') as f: data = f.readlines()[0].replace("[", "").replace("]", "").replace(",", " ").split() y = list(map(lambda x...
null
problem_sheet4/julia/res2/plot.py
plot.py
py
698
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.linspace", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.title", "line_number": 14, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 14, "usage_type": "name" }, { "api_name": "matplotlib.p...
121494503
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2018/2/7 11:52 # @Author : QiWei.Ren import unittest,time,xlrd from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.common.action_chains import ActionChains from selenium.common.exceptions import NoSuch...
null
case/basic_data_case/Spec_code_export.py
Spec_code_export.py
py
5,264
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 18, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 22, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 22, "usage_type": "name" }, { "api_name": "s...
28955849
import numpy as np import cv2 import time import os import json import argparse from scipy.ndimage.filters import median_filter, sobel parser = argparse.ArgumentParser() parser.add_argument('-s', '--sigma_s', default=0) parser.add_argument('-r', '--sigma_r', default=0) parser.add_argument('-v', '--verbose', action='st...
null
hw4/main.py
main.py
py
32,807
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "os.mkdir", "li...
552397877
import datetime import json import csv from settings import FIELDS fields = FIELDS def get_table_elements(**kwargs): # get data elements title = kwargs.get('title') description = kwargs.get('description') or None created_date = datetime.datetime.now() return title, description, created...
null
utils/utils.py
utils.py
py
1,241
python
en
code
null
code-starcoder2
76
[ { "api_name": "settings.FIELDS", "line_number": 5, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 13, "usage_type": "attribute" }, { "api_name": "json.load...
204734561
import numpy as np import matplotlib.pyplot as plt from gaussian_fit import gaussian_get_params from TSTR_fit_new import BRIDF_plotter import seaborn as sns # takes a single run, list of runs, or list of lists of runs. For a list of lists, it gives each inner list the same color and label. def plot_runs(runs, title=Fa...
null
plotting.py
plotting.py
py
7,103
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 18, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 18, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.cm.plasma", "line_number": 25, "usage_type": "call" }, { "api_name":...
232597783
# -*- coding: utf-8 -*- """ Created on Wed Jul 17 13:10:30 2013 @author: dashamstyr """ import MPLtools as mtools import os import numpy as np import pandas as pan import matplotlib.pyplot as plt #from plot_fields import loadvars import fasthist as fh from binit import fastbin from matplotlib.colors import Normaliz...
null
2d-histplot.py
2d-histplot.py
py
2,124
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.chdir", "line_number": 21, "usage_type": "call" }, { "api_name": "MPLtools.get_files", "line_number": 23, "usage_type": "call" }, { "api_name": "MPLtools.MPL", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.arange", "line_num...
116671130
#!/usr/bin/python import pyfits import matplotlib.pyplot as pyplot import matplotlib.ticker as ticker class label_hider(ticker.Formatter): def __init__( self, to_hide, format ): self.hide = to_hide self.format = format def __call__( self, a, pos=None ): return '' if a == self.hide else self.format % a pyplot...
null
docs/paper/jun14/figs/NEW_plot_proximity_sim.py
NEW_plot_proximity_sim.py
py
1,658
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.ticker.Formatter", "line_number": 7, "usage_type": "attribute" }, { "api_name": "matplotlib.ticker", "line_number": 7, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.rcParams.update", "line_number": 14, "usage_type": "call" }, { ...
566011770
"""create custom role chart table Revision ID: 85ffec7736c0 Revises: 7baf663f0bb2 Create Date: 2019-09-28 20:55:36.711830 """ # revision identifiers, used by Alembic. revision = '85ffec7736c0' down_revision = '7baf663f0bb2' branch_labels = None depends_on = None from alembic import op import sqlalchemy as sa def ...
null
alembic/versions/85ffec7736c0_create_custom_role_chart_table.py
85ffec7736c0_create_custom_role_chart_table.py
py
947
python
en
code
null
code-starcoder2
76
[ { "api_name": "alembic.op.create_table", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 22, "usage_type": "call" }, { "api_name": "sqlalchemy.BigIn...
526520041
from django.test import TestCase, override_settings from django.contrib.auth.models import User from django.core.files.uploadedfile import SimpleUploadedFile from django.urls import reverse from unittest.mock import patch from tom_observations.tests.utils import FakeFacility from tom_observations.tests.factories impor...
null
tom_dataproducts/tests.py
tests.py
py
2,445
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.test.TestCase", "line_number": 14, "usage_type": "name" }, { "api_name": "tom_observations.tests.factories.TargetFactory.create", "line_number": 16, "usage_type": "call" }, { "api_name": "tom_observations.tests.factories.TargetFactory", "line_number": 16...
347931155
import logging from rhobot.components.commands.base_command import BaseCommand from move_bot.components.configuration_enums import IDENTIFIER_KEY, CLIENT_SECRET_KEY from move_bot.components.events import OAUTH_DETAILS_UPDATED logger = logging.getLogger(__name__) class ConfigureClientDetails(BaseCommand): """ ...
null
move_bot/components/commands/configure_client_details.py
configure_client_details.py
py
2,584
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "rhobot.components.commands.base_command.BaseCommand", "line_number": 10, "usage_type": "name" }, { "api_name": "rhobot.components.commands.base_command.BaseCommand.default_dependencies.uni...
413364738
import random import sqlite3 class Account: all_accounts = [] def __init__(self, card_number, pin): self.card_number = card_number self.pin = pin self.balance = 0 def output(self, transfer): self.balance = self.balance - transfer def income(self, transfer): ...
null
Functions.py
Functions.py
py
3,271
python
en
code
null
code-starcoder2
76
[ { "api_name": "random.randint", "line_number": 41, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 63, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 111, "usage_type": "call" } ]
37883327
from collections import deque def chunkSplit(l, n): def chunker(): for i in range(0, len(l), n): yield l[i:i + n] return [' '.join(chunk) for chunk in chunker()] def deblockComment(code): lines = code.split('\n') output = [] for line in lines: output.appen...
null
block comment.py
block comment.py
py
4,463
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.deque", "line_number": 42, "usage_type": "call" } ]
388690358
import pytest import time import sys from os.path import dirname, abspath sys.path.insert(0, dirname(dirname(abspath(__file__)))) from page_obj.scg.scg_def_physical_interface import * from page_obj.scg.scg_def_vlan_interface import * from page_obj.scg.scg_def_bridge import * from page_obj.common.rail import * ...
null
pyautoTest-master(ICF-7.5.0)/test_case/scg/scg_Bridge-Interface/test_c140474.py
test_c140474.py
py
2,012
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.insert", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path.abspath", "lin...
52839631
#!/usr/bin/python2 from math import sqrt from interactive_markers.interactive_marker_server import ( InteractiveMarkerServer) from visualization_msgs.msg import InteractiveMarker, InteractiveMarkerControl from urdf_parser_py.urdf import URDF from tf.transformations import (quaternion_multiply, quaternion_conjuga...
null
schpin_user/src/schpin_user/joint_markers.py
joint_markers.py
py
5,306
python
en
code
null
code-starcoder2
76
[ { "api_name": "rospy.Publisher", "line_number": 29, "usage_type": "call" }, { "api_name": "std_msgs.msg.Float64", "line_number": 30, "usage_type": "attribute" }, { "api_name": "std_msgs.msg", "line_number": 30, "usage_type": "name" }, { "api_name": "visualization_...
107357294
import typing from vang.fields import Field, Integer, Float, String, Boolean, List, Dict, Raw from vang.exceptions import InitError TYPES_MAPPING = { int: Integer(), float: Float(), str: String(), bool: Boolean(), list: List(Raw()), tuple: List(Raw()), dict: Dict(), } def _type_to_field...
null
vang/typing_mapping.py
typing_mapping.py
py
1,071
python
en
code
null
code-starcoder2
76
[ { "api_name": "vang.fields.Integer", "line_number": 8, "usage_type": "call" }, { "api_name": "vang.fields.Float", "line_number": 9, "usage_type": "call" }, { "api_name": "vang.fields.String", "line_number": 10, "usage_type": "call" }, { "api_name": "vang.fields.Bo...
256413972
from collections import defaultdict from runcommands import DEFAULT_ENV, command, configure from runcommands.util import confirm, printer from arctasks.commands import * from arctasks.aws import * from arctasks.django import call_command, manage, setup configure(default_env='dev') @command(env='dev', timed=True) ...
null
commands.py
commands.py
py
5,196
python
en
code
null
code-starcoder2
76
[ { "api_name": "runcommands.configure", "line_number": 11, "usage_type": "call" }, { "api_name": "runcommands.command", "line_number": 14, "usage_type": "call" }, { "api_name": "arctasks.django.manage", "line_number": 28, "usage_type": "call" }, { "api_name": "runc...
240574924
from selenium import webdriver import os protocol = 'https' if ('SCREENER_USE_SSL' in os.environ and os.environ['SCREENER_USE_SSL'] == 'true') else 'http' hub_url = os.environ['SCREENER_HUB_HOST'] if 'SCREENER_HUB_HOST' in os.environ else 'hub.screener.io' url = "{}://{}/wd/hub".format(protocol, hub_url) screener = {...
null
python/test.py
test.py
py
713
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ", "line_number": 4, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.environ", "line_...
502696810
from src.Base.Evaluation.Evaluator import EvaluatorHoldout from src.GraphBased.RP3betaRecommender import RP3betaRecommender from src.Utils.load_ICM import load_ICM from src.Utils.load_URM import load_URM URM_all = load_URM("../../in/data_train.csv") ICM_all = load_ICM("../../in/data_ICM_title_abstract.csv") from src.D...
null
parameter_tuning/GraphBased/RP3beta_tuning.py
RP3beta_tuning.py
py
1,794
python
en
code
null
code-starcoder2
76
[ { "api_name": "src.Utils.load_URM.load_URM", "line_number": 6, "usage_type": "call" }, { "api_name": "src.Utils.load_ICM.load_ICM", "line_number": 7, "usage_type": "call" }, { "api_name": "src.Data_manager.split_functions.split_train_validation_random_holdout.split_train_in_two_p...
103831096
# # LSST Data Management System # Copyright 2018 AURA/LSST. # # This product includes software developed by the # LSST Project (http://www.lsst.org/). # # 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 Found...
null
tests/test_pipeTools.py
test_pipeTools.py
py
10,569
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.namedtuple", "line_number": 35, "usage_type": "call" }, { "api_name": "lsst.pipe.supertask.SuperTaskConfig", "line_number": 45, "usage_type": "attribute" }, { "api_name": "lsst.pipe.supertask", "line_number": 45, "usage_type": "name" }, { ...
202197177
bl_info = { 'name': 'KeyCollectionTreadmill', 'author': 'bay raitt', 'version': (0, 1), 'blender': (2, 92, 0), 'category': 'Animation', 'location': '3D Comic > Utilities > Key Collection Treadmill', 'wiki_url': ''} import bpy class KeyCollectionTreadmillSettin...
null
KeyCollectionTreadmill.py
KeyCollectionTreadmill.py
py
3,737
python
en
code
null
code-starcoder2
76
[ { "api_name": "bpy.types", "line_number": 14, "usage_type": "attribute" }, { "api_name": "bpy.props.PointerProperty", "line_number": 15, "usage_type": "call" }, { "api_name": "bpy.props", "line_number": 15, "usage_type": "attribute" }, { "api_name": "bpy.types", ...
54266835
from django.shortcuts import render, redirect from django.http import HttpResponse from django.contrib.auth.decorators import login_required from django.contrib.auth import authenticate, login, logout from blog.forms import PostForm from blog.models import Categoria, Post def home(request): name = "Álef" #...
null
blog/views.py
views.py
py
2,498
python
en
code
null
code-starcoder2
76
[ { "api_name": "blog.models.Categoria.objects.all", "line_number": 17, "usage_type": "call" }, { "api_name": "blog.models.Categoria.objects", "line_number": 17, "usage_type": "attribute" }, { "api_name": "blog.models.Categoria", "line_number": 17, "usage_type": "name" },...
445615807
#!/usr/bin/env python import unittest # Simple manipulation to use ``unittest2`` if current Python version is # less than 2.7 if not hasattr(unittest.TestCase, 'assertIn'): import unittest2 as unittest from flask import url_for from flask.ext.redis import Redis from redis.exceptions import ConnectionError from ...
null
testapp/tests.py
tests.py
py
4,105
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 7, "usage_type": "attribute" }, { "api_name": "unittest2.TestCase", "line_number": 17, "usage_type": "attribute" }, { "api_name": "app.app.config", "line_number": 20, "usage_type": "attribute" }, { "api_name": "app...
391403801
import json import pandas as pd import numpy as np from datetime import datetime, timedelta from utils import load_binance_api_key API_Key, Secret_Key = load_binance_api_key('account') from utils import * import mac_say from binance_f import RequestClient request_client = RequestClient(api_key=API_Key, secret_key=Sec...
null
futureReporter.py
futureReporter.py
py
2,514
python
en
code
null
code-starcoder2
76
[ { "api_name": "utils.load_binance_api_key", "line_number": 6, "usage_type": "call" }, { "api_name": "binance_f.RequestClient", "line_number": 12, "usage_type": "call" }, { "api_name": "mac_say.say", "line_number": 82, "usage_type": "call" } ]
380874152
import requests import json import semver from snapstore import Microk8sSnap def upstream_release(release): """Return the latest stable k8s in the release series""" if release == "latest": release_url = "https://dl.k8s.io/release/stable.txt" else: release_url = "https://dl.k8s.io/release/s...
null
jobs/microk8s/utils.py
utils.py
py
2,065
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 14, "usage_type": "call" }, { "api_name": "semver.compare", "line_number": 37, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 46, "usage_type": "call" }, { "api_name": "json.loads", "line_numbe...
508033280
# -*- coding: utf-8 -*- """ Created on Tue Jun 18 09:04:49 2019 @author: Pedro """ import serial import pandas as pd import numpy as np import time from openpyxl import Workbook import xlsxwriter import winsound import statistics import matplotlib.pyplot as plt ##########################################...
null
Current code/Code/calibrating stability times.py
calibrating stability times.py
py
17,752
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.amax", "line_number": 169, "usage_type": "call" }, { "api_name": "numpy.amin", "line_number": 170, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 187, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": ...
525556929
import numpy as np import matplotlib.pyplot as plt file = open('istherecorrelation.csv','r') readings = file.readlines() readings.pop(0) W0 = [] liters = [] years = [] for reading in readings: y, W, hl = reading.strip('\r\n').split(';') W0.append(W) liters.append(hl) years.append(y) for i in range(0, ...
null
plot.py
plot.py
py
572
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.plot", "line_number": 22, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 22, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 23, "usage_type": "call" }, { "api_name": "matpl...
590225489
''' remove_noise.py Given an audio file, remove the noise from the first 100 milliseconds of audio. This is good at removing things such as air conditioning noise from the raw audio. ''' import soundfile as sf import os def remove_noise(filename): #now use sox to denoise using the noise profile data, sampler...
null
chapter_2_collection/remove_noise.py
remove_noise.py
py
1,156
python
en
code
null
code-starcoder2
76
[ { "api_name": "soundfile.read", "line_number": 14, "usage_type": "call" }, { "api_name": "soundfile.write", "line_number": 21, "usage_type": "call" }, { "api_name": "os.system", "line_number": 22, "usage_type": "call" }, { "api_name": "os.system", "line_number...
154149442
from datetime import datetime from openerp.osv.fields import datetime as datetime_field from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT from openerp.report import report_sxw from openerp.tools.translate import _ from openerp.osv import orm from openerp.osv import fields, osv import logging _logger = logging.ge...
null
dym_report_distribusi/report/dym_report.py
dym_report.py
py
10,658
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "openerp.report.report_sxw.rml_parse", "line_number": 11, "usage_type": "attribute" }, { "api_name": "openerp.report.report_sxw", "line_number": 11, "usage_type": "name" }, { ...
483142188
from django.urls import path from burger import views urlpatterns = [ path('', views.index, name='index'), path('findRestaurant', views.findRestaurant, name='findRestaurant'), path('midtownMenu', views.midtownMenu, name='midtownMenu'), path('southlandMenu', views.southlandMenu, name='southlandMenu'), ...
null
code/burger/urls.py
urls.py
py
613
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "burger.views.index", "line_number": 6, "usage_type": "attribute" }, { "api_name": "burger.views", "line_number": 6, "usage_type": "name" }, { "api_name": "django.urls.path",...
119496529
import time import asyncio import configparser from azure.eventhub import EventData from azure.eventhub.aio import EventHubProducerClient # config config = configparser.ConfigParser() config.read('../app_config/EVENTHUB_CONFIG.INI') EVENTHUB_NAME = config['EVENTHUB_ACCOUNT']['EVENTHUB_NAME'] EVENTHUB_CONN_STR = co...
null
sender_app/create_event.py
create_event.py
py
1,147
python
en
code
null
code-starcoder2
76
[ { "api_name": "configparser.ConfigParser", "line_number": 8, "usage_type": "call" }, { "api_name": "time.time", "line_number": 19, "usage_type": "call" }, { "api_name": "time.time", "line_number": 20, "usage_type": "call" }, { "api_name": "azure.eventhub.aio.Event...
583125642
# -*- coding: utf-8 -*- # possible kwargs: # buttons = ['add', 'addfolder', 'copy', 'edit', 'delete'] # parentcode = '' (code of current parent folder) from __future__ import unicode_literals import logging import uuid from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.decorators impor...
null
utils/Jdatatable/views.py
views.py
py
6,413
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 18, "usage_type": "call" }, { "api_name": "uuid.uuid4", "line_number": 38, "usage_type": "call" }, { "api_name": "django.utils.module_loading.import_module", "line_number": 120, "usage_type": "call" }, { "api_name"...
123926430
from serial import Serial from multiprocessing import Process, Queue from collections import namedtuple import math import json Servo_Calibration = namedtuple('Servo_Calibration', ['pwm_min', 'pwm_max', 'angle_min', 'angle_max']) def linear_map(value, in_min, in_max, out_min, out_max): return (value - in_min) * ...
null
ArmConnector.py
ArmConnector.py
py
4,392
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.namedtuple", "line_number": 7, "usage_type": "call" }, { "api_name": "json.load", "line_number": 33, "usage_type": "call" }, { "api_name": "math.degrees", "line_number": 43, "usage_type": "call" }, { "api_name": "math.atan2", "line_n...
100713543
# type: ignore import inspect from types import CodeType, FunctionType import torch from .graph import Graph from .graph_module import GraphModule HAS_VARSTUFF = inspect.CO_VARARGS | inspect.CO_VARKEYWORDS def _find_module(root, m): for n, p in root.named_modules(): if m is p: return n ra...
null
torch/fx/symbolic_trace.py
symbolic_trace.py
py
3,125
python
en
code
null
code-starcoder2
76
[ { "api_name": "inspect.CO_VARARGS", "line_number": 9, "usage_type": "attribute" }, { "api_name": "inspect.CO_VARKEYWORDS", "line_number": 9, "usage_type": "attribute" }, { "api_name": "types.CodeType", "line_number": 36, "usage_type": "call" }, { "api_name": "type...
429937650
import socket import random import hashlib import logging import time import datetime import tqdm import threading def main(): filesize = 104865944 host = '34.205.154.39' puerto = 55555 print('Hola, Cliente') fecha = datetime.datetime.today().strftime('%Y-%m-%d_%H-%M-%S') logging.basicConfig(...
null
clienteCarga.py
clienteCarga.py
py
4,991
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.today", "line_number": 17, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 17, "usage_type": "attribute" }, { "api_name": "logging.basicConfig", "line_number": 18, "usage_type": "call" }, { "api_name": "lo...
115771391
#!/usr/bin/env python # coding: utf-8 # @File Name: scanner.py # @Author: Joshua Liu # @Email: liuchaozhenyu@gmail.com # @Create Date: 2018-04-20 11:04:51 # @Last Modified: 2018-04-20 18:04:02 # @Description: import socket import os import struct import threading from netaddr import IPAddress, IPNetwork from ctypes imp...
null
python/black_hat/chapter_3/scanner.py
scanner.py
py
4,464
python
en
code
null
code-starcoder2
76
[ { "api_name": "socket.socket", "line_number": 27, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 27, "usage_type": "attribute" }, { "api_name": "socket.SOCK_DGRAM", "line_number": 27, "usage_type": "attribute" }, { "api_name": "netaddr.IPNe...
641007522
# This source code is part of the Biotite package and is distributed # under the 3-Clause BSD License. Please see 'LICENSE.rst' for further # information. import biotite.sequence as seq from biotite.sequence import Location, Feature, Annotation, AnnotatedSequence import biotite.sequence.io.genbank as gb import numpy a...
null
tests/sequence/test_annotation.py
test_annotation.py
py
3,024
python
en
code
null
code-starcoder2
76
[ { "api_name": "biotite.sequence.Feature", "line_number": 15, "usage_type": "call" }, { "api_name": "biotite.sequence.Feature", "line_number": 16, "usage_type": "call" }, { "api_name": "biotite.sequence.Annotation", "line_number": 18, "usage_type": "call" }, { "api...
289456756
# embedding에서 저장한 lena_w.bmp에 포함된 copyright 이미지 추출하기 import numpy as np from scipy import signal, misc import matplotlib.pyplot as plt from scipy import ndimage bin8 = lambda x : ''.join(reversed( [str((x >> i) & 1) for i in range(8)] ) ) def BitPlane_Slice(value): c = np.zeros(8) n = 7 bits = bin8(value) ...
null
chapter3/extracting.py
extracting.py
py
986
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.zeros", "line_number": 9, "usage_type": "call" }, { "api_name": "scipy.misc.imread", "line_number": 17, "usage_type": "call" }, { "api_name": "scipy.misc", "line_number": 17, "usage_type": "name" }, { "api_name": "numpy.ndarray", "line_num...
215151735
import itertools, random from dateutil.relativedelta import relativedelta from django.utils import timezone from django.db import transaction from django.db.utils import IntegrityError from people.models import User, Child, Classroom from main.models import WorktimeCommitment, Period, Shift, CareDay, ShiftPreference,...
null
people/generate_samples.py
generate_samples.py
py
5,183
python
en
code
null
code-starcoder2
76
[ { "api_name": "dateutil.relativedelta.relativedelta", "line_number": 24, "usage_type": "call" }, { "api_name": "django.utils.timezone.now", "line_number": 25, "usage_type": "call" }, { "api_name": "django.utils.timezone", "line_number": 25, "usage_type": "name" }, { ...
168958735
import logging logging.basicConfig(level=logging.DEBUG) logger = logging.getLogger(__name__) def speech2text(recognizer, source): # recognize speech using Google Speech Recognition audio = recognizer.listen(source) heard = recognizer.recognize_google(audio) logger.debug(f"Heard {heard}") return h...
null
src/s2t.py
s2t.py
py
326
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 3, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 3, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 4, "usage_type": "call" } ]
368966901
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('archive', '0027_auto_20150911_1923'), ] operations = [ migrations.CreateModel( name='Alias', fields=...
null
archive/migrations/0028_alias.py
0028_alias.py
py
665
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.CreateModel", "line_number": 14, "usage_type": "call" }, ...
401961034
"""Classes representing defects.""" from __future__ import annotations import collections import logging from abc import ABCMeta, abstractmethod, abstractproperty from enum import Enum from typing import Dict import numpy as np from monty.json import MSONable from pymatgen.analysis.structure_matcher import ElementCom...
null
pymatgen/analysis/defects/core.py
core.py
py
32,952
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 33, "usage_type": "call" }, { "api_name": "enum.Enum", "line_number": 36, "usage_type": "name" }, { "api_name": "monty.json.MSONable", "line_number": 45, "usage_type": "name" }, { "api_name": "abc.ABCMeta", "li...
29692889
# Imports from typing import Union import numpy as np from random import choice import cv2 SEED = 1 POSSIBLE_DIRECTIONS = ["N", "NE", "E", "SE", "S", "SW", "W", "NW"] # Set seed for reproducibility np.random.seed(SEED) # Main function performs some testing def main(): """ blob_env = BlobEnv( size=10...
null
automower/mark_07/env.py
env.py
py
14,780
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.seed", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 11, "usage_type": "attribute" }, { "api_name": "numpy.random.choice", "line_number": 41, "usage_type": "call" }, { "api_name": "numpy.random"...
618603508
# -*- coding: utf-8 -* # Copyright (c) 2019 BuildGroup Data Services Inc. # All rights reserved. from collections import OrderedDict from caravaggio_rest_api.haystack.indexes import TextField from caravaggio_rest_api.utils import get_primary_keys_values from drf_haystack.fields import HaystackCharField from drf_haysta...
null
src/caravaggio_rest_api/drf_haystack/serializers.py
serializers.py
py
11,608
python
en
code
null
code-starcoder2
76
[ { "api_name": "caravaggio_rest_api.utils.get_primary_keys_values", "line_number": 134, "usage_type": "call" }, { "api_name": "rest_framework_cache.settings.api_settings.SERIALIZER_CACHE_KEY_FORMAT.format", "line_number": 146, "usage_type": "call" }, { "api_name": "rest_framework_...
53774961
import click import os from spotidnldr.spot import * import spotidnldr.env_setup as e from spotidnldr.cover_download import * from spotidnldr.youtube_search import * from spotidnldr.downloader import * from spotidnldr.tag_embedder import * from spotidnldr.converter import * @click.command() @click.option('-v','--verbo...
null
spotidnldr/clifi.py
clifi.py
py
2,580
python
en
code
null
code-starcoder2
76
[ { "api_name": "spotidnldr.env_setup.SPOTIPY_CLIENT_ID", "line_number": 16, "usage_type": "attribute" }, { "api_name": "spotidnldr.env_setup", "line_number": 16, "usage_type": "name" }, { "api_name": "spotidnldr.env_setup.SPOTIPY_CLIENT_SECRET", "line_number": 17, "usage_t...
295055014
""" Building and evaluating machine learning model using k nearest neighbors classification algorithm. """ from sklearn.datasets import load_iris from sklearn.model_selection import train_test_split from sklearn.neighbors import KNeighborsClassifier iris = load_iris() # Building training set and test set X_train, X_t...
null
knn_classification.py
knn_classification.py
py
695
python
en
code
null
code-starcoder2
76
[ { "api_name": "sklearn.datasets.load_iris", "line_number": 10, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 12, "usage_type": "call" }, { "api_name": "sklearn.neighbors.KNeighborsClassifier", "line_number": 15, "usage_ty...
611858257
import ast import builtins import sys import types import importlib.util import importlib.machinery import importlib.abc from importlib import machinery # Module ############################################################# class TemplateModule(types.ModuleType): def __init__(self, name): super().__init...
null
htmlmash/_importer.py
_importer.py
py
15,443
python
en
code
null
code-starcoder2
76
[ { "api_name": "types.ModuleType", "line_number": 14, "usage_type": "attribute" }, { "api_name": "htmlmash.Element", "line_number": 19, "usage_type": "name" }, { "api_name": "htmlmash.Element", "line_number": 20, "usage_type": "call" }, { "api_name": "importlib.uti...
125316873
from http import HTTPStatus class CiscoIseRequest: def __init__(self, path, method, ok_status_code=HTTPStatus.OK, body=None): self.path = path self.method = method self.ok_status_code = ok_status_code self._body = body if body else {} @property def body(self): ret...
null
rest_requests/base.py
base.py
py
344
python
en
code
null
code-starcoder2
76
[ { "api_name": "http.HTTPStatus.OK", "line_number": 6, "usage_type": "attribute" }, { "api_name": "http.HTTPStatus", "line_number": 6, "usage_type": "name" } ]
415067724
from django.forms import ModelForm from django import forms from sports.models import Athlete, Sport from .models import Guesses, Comments, Responses class GuessForm(ModelForm): class Meta: model = Guesses fields = ('gold','silver','bronze',) def __init__(self, *args, **kwargs): sport ...
null
user_participation/forms.py
forms.py
py
1,004
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.forms.ModelForm", "line_number": 6, "usage_type": "name" }, { "api_name": "models.Guesses", "line_number": 9, "usage_type": "name" }, { "api_name": "sports.models.Sport.objects.get", "line_number": 13, "usage_type": "call" }, { "api_name": "s...
207608956
import pygame import sys import random from pygame.locals import * # constants/ variables FPS = 30 WINDOW_WIDTH = 800 WINDOW_HEIGHT = 400 BOX_SIZE = 20 GAP_SIZE = 1 WHITE = (255, 255, 255) BLACK = (0, 0, 0) PINK = (200, 0, 50) GRAY = (200, 200, 200) def main(): global FPS_CLOCK, DISPLAY_SURF, WIDTH, HEIGHT, MIN...
null
Minesweeper.py
Minesweeper.py
py
5,771
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.init", "line_number": 21, "usage_type": "call" }, { "api_name": "pygame.time.Clock", "line_number": 22, "usage_type": "call" }, { "api_name": "pygame.time", "line_number": 22, "usage_type": "attribute" }, { "api_name": "pygame.display.set_mod...
646114262
import yaml import utils_nb from sklearn.linear_model import LogisticRegression from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer from sklearn.model_selection import GridSearchCV, StratifiedKFold from sklearn.metrics import accuracy_score from sklearn.ensemble import ExtraTreesClassifier impo...
null
nb_ml/logreg.py
logreg.py
py
10,847
python
en
code
null
code-starcoder2
76
[ { "api_name": "evaluator.evaluator", "line_number": 15, "usage_type": "name" }, { "api_name": "yaml.load", "line_number": 31, "usage_type": "call" }, { "api_name": "sklearn.feature_extraction.text.TfidfVectorizer", "line_number": 48, "usage_type": "call" }, { "api...
243452566
#!/home/dev/pyenvs/ocl/bin/python import h5py import matplotlib.pyplot as plt import argparse def visitFunction(name, obj, plotp, match): print(name) for key, val in obj.attrs.items(): print(' ' + str(key) + ': ' + str(val)) matching = True if(isinstance(match, str) and name.find(mat...
null
listH5.py
listH5.py
py
2,170
python
en
code
null
code-starcoder2
76
[ { "api_name": "h5py._hl", "line_number": 15, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.matshow", "line_number": 20, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 20, "usage_type": "name" }, { "api_name": "matplotlib....
351217593
from sympy import Indexed from devito.dimension import LoweredDimension from devito.dle import retrieve_iteration_tree from devito.dle.backends import BasicRewriter, dle_pass from devito.logger import dle_warning from devito.visitors import FindSymbols try: import yask_compiler as yask # Factories to interact...
null
devito/dle/backends/yask.py
yask.py
py
4,288
python
en
code
null
code-starcoder2
76
[ { "api_name": "yask_compiler.yask_compiler_factory", "line_number": 12, "usage_type": "call" }, { "api_name": "yask_compiler.node_factory", "line_number": 13, "usage_type": "call" }, { "api_name": "devito.dle.backends.BasicRewriter", "line_number": 18, "usage_type": "name...
548047051
import boto3 import botocore import base64 import math import numpy import json from multiprocessing.pool import ThreadPool config = botocore.config.Config(connect_timeout=900, read_timeout=900, retries={'max_attempts': 0}) client = boto3.client('lambda', config=config) function_name = 'pipe-alpr-p' time_out = 900 tot...
null
charmseeker/examples/inner_bo_s3/stage_3.py
stage_3.py
py
2,535
python
en
code
null
code-starcoder2
76
[ { "api_name": "botocore.config.Config", "line_number": 9, "usage_type": "call" }, { "api_name": "botocore.config", "line_number": 9, "usage_type": "attribute" }, { "api_name": "boto3.client", "line_number": 10, "usage_type": "call" }, { "api_name": "base64.b64deco...
561734259
from matplotlib import pyplot as plt from node import Node import numpy as np import math root_n_leaves = 0 def radial_layout(root): """ This algorithm is used to create the coordinates to draw the tree. After it's executed, each node has an attribute caled coords, which has the x and y coordenates to...
null
src/layout.py
layout.py
py
3,314
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 23, "usage_type": "call" }, { "api_name": "math.pi", "line_number": 24, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 49, "usage_type": "call" }, { "api_name": "math.cos", "line_number": 49...
320027406
import six from abc import ABCMeta, abstractmethod from inputs.inputs import Inputs import tensorflow as tf @six.add_metaclass(ABCMeta) class TFRecordsInputs(Inputs): def __init__(self, config, batch_size, fake=False, **kwargs): super(TFRecordsInputs, self).__init__(config, batch_size, fake, **kwargs) ...
null
inputs/tfrecordinputs.py
tfrecordinputs.py
py
1,392
python
en
code
null
code-starcoder2
76
[ { "api_name": "inputs.inputs.Inputs", "line_number": 8, "usage_type": "name" }, { "api_name": "abc.abstractmethod", "line_number": 13, "usage_type": "name" }, { "api_name": "tensorflow.data.Dataset.list_files", "line_number": 18, "usage_type": "call" }, { "api_nam...
330216035
# https://api.github.com/search/repositories?q=opendaylight # https://api.github.com/search/repositories?q=topic:opendaylight # get_names -- check_repos import requests def get_names(): print('Separate each name with Space:') names = input() return names.split() def check_repos(names): repo_api = '...
null
Python coding/LearningAPI/2.py
2.py
py
974
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 18, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 22, "usage_type": "call" } ]
612172005
#!/usr/env python import sys import argparse import os from pprint import pprint import shutil from pydub import AudioSegment from pytube import YouTube import urllib.request import urllib try: import simplejson as json except ImportError: import json from io import StringIO from PIL import Image import requests impo...
null
song_importer.py
song_importer.py
py
7,901
python
en
code
null
code-starcoder2
76
[ { "api_name": "fuzzywuzzy.process.extract", "line_number": 39, "usage_type": "call" }, { "api_name": "fuzzywuzzy.process", "line_number": 39, "usage_type": "name" }, { "api_name": "pydub.AudioSegment.from_file", "line_number": 48, "usage_type": "call" }, { "api_na...
205154768
from django.http import JsonResponse from django.shortcuts import render, render_to_response from django.views import View from Common.Utils.queue_manager import queue_manager from Endpoint.models import EndPoint, Registry class QueueOutputView(View): def get(self, request, queue_id): return render_to_re...
null
Endpoint/views.py
views.py
py
3,129
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.views.View", "line_number": 9, "usage_type": "name" }, { "api_name": "django.shortcuts.render_to_response", "line_number": 11, "usage_type": "call" }, { "api_name": "django.views.View", "line_number": 14, "usage_type": "name" }, { "api_name":...
118793972
import requests from me.configs import param class HttP(): def httppost(self,url,data): res = requests.post(url, data) return res def httpget(self,url,params): res=requests.get(url,params) return res def http(self,method,url,data): if method==param.method =="POST": ...
null
me/apis/httpsME.py
httpsME.py
py
701
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.post", "line_number": 7, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "me.configs.param.method", "line_number": 13, "usage_type": "attribute" }, { "api_name": "me.configs.par...
379713132
import argparse import logging import os import re import shutil import sys # prevent asap other modules from defining the root logger using basicConfig import amlb.logger import amlb from amlb.utils import Namespace as ns, config_load, datetime_iso, str2bool, str_sanitize, zip_path from amlb import log, AutoMLError ...
null
automlbenchmark/runbenchmark.py
runbenchmark.py
py
9,260
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 16, "usage_type": "call" }, { "api_name": "amlb.utils.str2bool", "line_number": 48, "usage_type": "name" }, { "api_name": "argparse.SUPPRESS", "line_number": 50, "usage_type": "attribute" }, { "api_name": "ar...
614627035
from rest_framework import filters, viewsets from .serializers import CitySerializer from .models import City class CityViewSet(viewsets.ModelViewSet): model = City serializer_class = CitySerializer queryset = City.objects.all() filter_backends = (filters.SearchFilter, filters.OrderingFilter, filters...
null
citiesprj/apps/cities/views.py
views.py
py
458
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.viewsets.ModelViewSet", "line_number": 7, "usage_type": "attribute" }, { "api_name": "rest_framework.viewsets", "line_number": 7, "usage_type": "name" }, { "api_name": "models.City", "line_number": 8, "usage_type": "name" }, { "api_na...
423953095
#!/usr/bin/python3 # import os import math from optparse import OptionParser import numpy as np import matplotlib.pyplot as plt # import matplotlib.collections as mc from scan import scan # from bathtubs import scan import time # parser def main(): parser = OptionParser() parser.add_option( "-s", ...
null
analysis/main.py
main.py
py
3,631
python
en
code
null
code-starcoder2
76
[ { "api_name": "optparse.OptionParser", "line_number": 19, "usage_type": "call" }, { "api_name": "scan.scan", "line_number": 57, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 60, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots"...
443757602
#!/usr/bin/env python3 from __future__ import print_function import argparse import collections import struct import sys Elf_Hdr = collections.namedtuple( 'Elf_Hdr', 'ei_class ei_data ei_version ei_osabi e_type e_machine e_version ' 'e_entry e_phoff e_shoff e_flags e_ehsize e_phentsize e_phn...
null
app/src/main/java/com/syd/source/aosp/development/vndk/tools/definition-tool/tools/remove_dt_needed.py
remove_dt_needed.py
py
6,896
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.namedtuple", "line_number": 11, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 18, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 24, "usage_type": "call" }, { "api_name": "...
25738522
from rllab.envs.normalized_env import normalize from rllab.misc.instrument import stub, run_experiment_lite from sandbox.rocky.tf.envs.base import TfEnv from rllab.envs.gym_env import GymEnv from railrl.predictors.dynamics_model import FullyConnectedEncoder import numpy as np import tensorflow as tf import itertools ...
null
scripts/eval_inverse_model/test_one_layer_regress_on_arm.py
test_one_layer_regress_on_arm.py
py
2,528
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 55, "usage_type": "call" }, { "api_name": "tensorflow.Session", "line_number": 61, "usage_type": "call" }, { "api_name": "joblib.load", "line_number": 62, "usage_type": "call" }, { "api_name": "tensorflow.pla...
240587591
# Copyright (c) Intangible Realities Lab, University Of Bristol. All rights reserved. # Licensed under the GPL. See License.txt in the project root for license information. # This file launches and executes DFTB+ import numpy as np from Input_Generator import * from DFTB_calculator import * import time from ase impor...
null
graphene/Launcher.py
Launcher.py
py
1,411
python
en
code
null
code-starcoder2
76
[ { "api_name": "ase.io.formats.read", "line_number": 28, "usage_type": "call" }, { "api_name": "ase.io.formats", "line_number": 28, "usage_type": "attribute" }, { "api_name": "ase.io", "line_number": 28, "usage_type": "name" }, { "api_name": "time.time", "line_...
406365319
import asyncio import functools from aiter import join_aiters, map_aiter from aiter.server import start_server_aiter async def handle_event(server_line_sw_tuple): server, line, sw = server_line_sw_tuple await sw.drain() if line == b"\n": sw.close() sw.write(line) if line == b"quit\n": ...
null
examples/4-total-pipeline.py
4-total-pipeline.py
py
1,158
python
en
code
null
code-starcoder2
76
[ { "api_name": "asyncio.sleep", "line_number": 17, "usage_type": "call" }, { "api_name": "aiter.server.start_server_aiter", "line_number": 31, "usage_type": "call" }, { "api_name": "aiter.map_aiter", "line_number": 33, "usage_type": "call" }, { "api_name": "functoo...
581574346
# -*- coding: utf-8 -*- import scrapy, re, os, json, datetime from urllib import parse from scrapy.loader import ItemLoader from ArticleSpider.items import ZhihuAnswerItem, ZhihuQuestionItem class ZhihuSpider(scrapy.Spider): name = 'zhihu' allowed_domains = ['www.zhihu.com'] start_urls = ['https://www.zhi...
null
ArticleSpider/ArticleSpider/spiders/zhihu.py
zhihu.py
py
4,928
python
en
code
null
code-starcoder2
76
[ { "api_name": "scrapy.Spider", "line_number": 8, "usage_type": "attribute" }, { "api_name": "urllib.parse.urljoin", "line_number": 30, "usage_type": "call" }, { "api_name": "urllib.parse", "line_number": 30, "usage_type": "name" }, { "api_name": "re.search", "...
148013716
import argparse import configparser import logging import time from enum import Enum from typing import List from TM1py import TM1Service from results import OptimusResult APP_NAME = "optimuspy" TIME_STAMP = time.strftime("%Y-%m-%d_%H-%M-%S", time.localtime()) LOGFILE = APP_NAME + ".log" RESULT_CSV = "results\\{}_{}...
null
optimuspy.py
optimuspy.py
py
6,740
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.strftime", "line_number": 13, "usage_type": "call" }, { "api_name": "time.localtime", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 18, "usage_type": "call" }, { "api_name": "logging.INFO", "...