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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
348483905 | #!/usr/bin/python
# -*- coding:utf-8 -*-
'''
采集lol.gameguyz.com站点图片墙所有图片信息
http://lol.gameguyz.com/pictures.html
每天差不多更新2条记录
'''
from bs4 import BeautifulSoup
import urllib,os,simplejson,json,urllib2,sys
from weibo.sinaweibopy.sinaweibo import post_weibo_sina
from weibo.qqweibopy.postqqweibo import post_qq_weib... | null | lol_pictures.py | lol_pictures.py | py | 1,582 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.setdefaultencoding",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "urllib2.urlopen",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "weibo.postweibo.post... |
36018391 | import unittest
import torch
from utils.metrics import calculate_batch_statistics, calculate_metrics
class MetricsTest(unittest.TestCase):
def test_collecting_stats(self):
original_tokens = torch.tensor([
[1, 2, 3, -1],
[1, 2, 3, -1],
[1, 0, -1, -1],
[0, -... | null | tests/test_metrics.py | test_metrics.py | py | 1,364 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "unittest.TestCase",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "torch.tensor",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torch.tensor",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "utils.metrics.calcula... |
170245798 | import discord
from discord.ext import commands
bot = commands.Bot(command_prefix='s')
bot.event
async def onready():
print("bot is online")
bot.event
async def on_member_join(member):
print(F'{member} join!')
bot.run('ODgzNzgzMjk5NzE2MjM5NDMw.YTO9Vg.YIDbL00i-D-KdLzLHEtvZGVXN2Y') | null | main.py | main.py | py | 295 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "discord.ext.commands.Bot",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands",
"line_number": 4,
"usage_type": "name"
}
] |
455140081 | from setuptools import setup
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name='lenses_python',
version='2.2',
packages=['lenses_python'],
url='https://github.com/Landoop/lenses-python',
download_url='https://github.com/Landoop/lenses-python/archive/2.2.tar.gz',
l... | null | pypi_install_script/lenses_python-2.2.tar/setup.py | setup.py | py | 689 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "setuptools.setup",
"line_number": 6,
"usage_type": "call"
}
] |
531785956 | #!/usr/bin/env python3
# @Time : 8/5/20 3:43 PM
# @Author : fangcheng.ji
# @FileName: bifpn.py
import torch
from torch import nn
from torch.nn import functional as F
import math
import fvcore.nn.weight_init as weight_init
from detectron2.modeling.backbone import Backbone
from detectron2.modeling.backbone.build i... | null | detectron2/modeling/backbone/bifpn.py | bifpn.py | py | 13,420 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.nn.Module",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
413321221 | # -*- coding:utf-8 -*-
# @time:
# @author:张新新
# @email: 1262981714@qq.com
import os
import cv2
from board.apriltagboard import AprilTagBoard
from calibration_utils.apriltag_cali_utils import apriltag_cali_utils
import numpy as np
def getImgList(root_dir):
file_list = os.listdir(root_dir)
rgb_list = []
for... | null | test/stereo_test.py | stereo_test.py | py | 4,323 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.listdir",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "cv2.FileStorage",
"line_numb... |
555763813 | import bpy
import os
#img_path = '/home/staff/barskya/work/datagen/data/images/'
#label_path = '/home/staff/barskya/work/datagen/data/labels/'
# in generality, assuming we run this from the datagen directory:
img_path = os.path.join(os.getcwd(), 'data', 'images')
label_path = os.path.join(os.getcwd(), 'data', 'labels... | null | render_saver.py | render_saver.py | py | 2,085 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.join",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 9,... |
610088775 | # A node structure
from collections import deque
class Node:
# A utility function to create a new node
def __init__(self, key):
self.val = key
self.left = None
self.right = None
@staticmethod
def same_tree(p, q):
d = deque([(p,q)])
while d:
lvl_len ... | null | _Trees/bfs/leetcode/18_100.py | 18_100.py | py | 1,513 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "collections.deque",
"line_number": 14,
"usage_type": "call"
}
] |
475819447 | from __future__ import unicode_literals
from django.test import TestCase
from ..models import Message, Recipient
from ..compat import truncate_words
class MessageModelTests(TestCase):
fixtures = ["users.json", "messages.json"]
def test_string_formatting(self):
""" Test the human representation of a... | null | discussions/tests/test_models.py | test_models.py | py | 1,332 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.test.TestCase",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "models.Message.objects.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "models.Message.objects",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_na... |
30579025 | """
Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored
in a file or memory buffer, or transmitted across a network connection link to be reconstructed later in the same or
another computer environment.
Design an algorithm to serialize and deserialize ... | null | Coding Interview Questions/serialize_deserialize_binary_tree.py | serialize_deserialize_binary_tree.py | py | 5,761 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "collections.deque",
"line_number": 158,
"usage_type": "call"
}
] |
212673817 | import re
import requests
def get_html(url):
try:
html=requests.get(url)
html.encoding=html.apparent_encoding
return html.text
except:
return ""
def get_info(html):
try:
Sales_Num=re.findall(r'\"view_sales\"\:\".*?\"',html)
plt = re.findall(r'\"view_price\"\:... | null | taobao/ta.py | ta.py | py | 1,617 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 15,... |
23748220 | import datetime
def calc_age(birth_year):
now = int(datetime.datetime.now().year)
result = now - birth_year
if result < 0:
raise Exception(f'Birth yar an not be lesser than {now}')
return result
try:
birth_year = int(input('Year of birth: '))
print(f'Your age is : {calc_age(birth_yea... | null | base/excetions/exception.py | exception.py | py | 437 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "datetime.datetime.now",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 5,
"usage_type": "attribute"
}
] |
440488903 | """
Routes and views for the flask application.
"""
from datetime import datetime
from flask import Flask, request, Response, render_template
from FlaskWebProject1 import app
import sys
import io
from bs4 import BeautifulSoup, CData
import urllib.request
import urllib.parse
import time
import re
@app.route('/')
@app.... | null | FlaskWebProject1/views.py | views.py | py | 4,295 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.render_template",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "FlaskWe... |
205438061 | import re
from io import BytesIO
from zipfile import ZipFile
from urllib.request import urlopen
import json
def tokenize(tweet):
""" Split a tweet into tokens
Args:
A single tweet
Returns:
List of tokens
"""
if not tweet:
return []
tweet = tweet.lower()
tweet = re.sub(... | null | a4/classify.py | classify.py | py | 4,579 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "re.sub",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 22,
"usage_type"... |
478691734 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
#Baseline Model (which is just taking the black and white dataset verbatim)
class Baseline(nn.Module):
def __init__(self):
super(Baseline, self).__init__()
def forward(self, x):
return x
#Defin... | null | model.py | model.py | py | 4,152 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.nn.Module",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_... |
9524667 | import pandas as pd
import numpy as np
import torch
from torchtext import data
from torchtext.data import Field, TabularDataset, BucketIterator
from torchtext.vocab import Vectors
import nltk
from nltk.tokenize import word_tokenize
import os
import re
import pickle
from config import *
# def tokenize(x):
# sp = ... | null | data_process.py | data_process.py | py | 3,174 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "re.sub",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "torchtext.data.Field",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "nltk.tokenize.word_tokenize",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "torchtext.dat... |
547482785 | import json
from django.db import IntegrityError
from django.test import TestCase
from django.utils import timezone
from django.test import TestCase
from rest_framework.test import APIRequestFactory, APITestCase
from players.models import Player
class PlayerTestCase(TestCase):
def setUp(self):
Player.... | null | players/tests.py | tests.py | py | 1,911 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.test.TestCase",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "players.models.Player.objects.create",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "players.models.Player.objects",
"line_number": 16,
"usage_type": "attribute"
... |
15598747 | from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import pandas as pd
from sqlalchemy import create_engine
class UFC:
def __init__(self, URL="http://www.ufcstats.com/st... | null | UFC_data.py | UFC_data.py | py | 12,323 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.support.ui.WebDriverWait",
"line_number": 91,
"usage_type": "call"
},
... |
336272004 | """Routes configuration
The more specific and detailed routes should be defined first so they
may take precedent over the more generic routes. For more information
refer to the routes manual at http://routes.groovie.org/docs/
"""
from pylons import config
from routes import Mapper
def make_map():
"""Create, confi... | null | wurdig/config/routing.py | routing.py | py | 2,061 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "routes.Mapper",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pylons.config",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "pylons.config",
"line_number": 13,
"usage_type": "name"
}
] |
41601381 | # (c) Copyright [2017] Hewlett Packard Enterprise Development LP
#
# 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 appli... | null | python/mxnet_benchmarks/data_iterator.py | data_iterator.py | py | 6,084 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "mxnet.io.DataIter",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "numpy.float32",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "mxnet.nd.array",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "mxnet.nd",
"l... |
628465586 | import boto3
import csv
import os
#Takes in an unsplit string with delimiter = '|' and returns a dictionary in from
# '1': 'item1', '2':'item2'....
def spliter(unsplit_data):
split_data = unsplit_data.split('|')
if split_data[0] == 'none':
new_data = 'none'
else:
new_data = {}
for i... | null | db_python_scripts/metadata/metadata_population.py | metadata_population.py | py | 3,215 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.listdir",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "boto3.resource",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 39,
"usage_type": "call"
}
] |
374740625 | import pyttsx3
engine=pyttsx3.init()
rate=engine.getProperty('rate')
engine.setProperty('rate',rate+50)
engine.say('Hello,This is Priyesh Ranjan '
'.I am from Bhagalpur College '
'of Engineering.I am a final yr student '
'insiring to leran more in my life '
... | null | changing voice module/3..changing_rate.py | 3..changing_rate.py | py | 391 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pyttsx3.init",
"line_number": 3,
"usage_type": "call"
}
] |
650619264 | from motor import motor_asyncio
from urllib.parse import quote_plus
from Bubot.Helpers.Action import async_action
class Mongo:
def __init__(self, **kwargs):
self.client = kwargs.get('client')
pass
@classmethod
def connect(cls, device, **kwargs):
user = kwargs.get('user')
if u... | null | src/Bubot/Core/DataBase/Mongo.py | Mongo.py | py | 3,985 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "urllib.parse.quote_plus",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "urllib.parse.quote_plus",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "motor.motor_asyncio.AsyncIOMotorClient",
"line_number": 27,
"usage_type": "call"
},
{... |
49643833 | import logging
logging.basicConfig(level=logging.DEBUG)
import os
from slack_bolt.app import App
from slack_bolt.context import BoltContext
from slack_bolt.oauth.oauth_settings import OAuthSettings
app = App(
signing_secret=os.environ["SLACK_SIGNING_SECRET"],
oauth_settings=OAuthSettings(
client_id=... | null | integration_tests/samples/socket_mode/bolt_oauth_websocket_client_example.py | bolt_oauth_websocket_client_example.py | py | 1,390 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.basicConfig",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "slack_bolt.app.App",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.environ",
... |
538734575 | #!/usr/bin/env python
#-*- coding: utf-8 -*-
# THOUVENIN Arthur athouvenin@outlook.fr
# 26/02/2020
########################
import joblib
import json
import numpy
import os
import re
import requests
import time
import tqdm
# from extract import *
from multiprocessing import Pool,Manager,cpu_count
#####################... | null | Interface/detect_EMBL.py | detect_EMBL.py | py | 16,122 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "joblib.load",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "joblib.load",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "joblib.load",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "joblib.load",
"line_number": ... |
211313656 | import speech_recognition as sr
from os import path
def printWAV(FILE_NAME, pos, clip):
# use the audio file as the audio source
AUDIO_FILE = path.join(path.dirname(path.realpath(__file__)), 'static/'+FILE_NAME)
r = sr.Recognizer()
text = ""
with sr.AudioFile(AUDIO_FILE) as source:
... | null | myaudio.py | myaudio.py | py | 735 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.join",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.realpath",
"line_number... |
162164210 | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
# This Python 3 environment comes with many helpful analytics libraries installed
# It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python
# For example, here's several helpful packages to load in
import numpy as np # linear algebra
i... | null | downloaded_kernels/house_sales/parsed_kernels/kernel_56.py | kernel_56.py | py | 2,262 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "subprocess.check_output",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "seaborn.pairplot",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "sklearn.cros... |
486271432 | from bs4 import BeautifulSoup
import requests
import kivy
from kivy.app import App
from kivy.uix.label import Label
from kivy.uix.gridlayout import GridLayout
from kivy.uix.textinput import TextInput
from kivy.uix.button import Button
from kivy.uix.widget import Widget
from kivy.properties import ObjectPrope... | null | Kivy_weather_app.py | Kivy_weather_app.py | py | 2,588 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "kivy.uix.screenmanager.ScreenManager",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "kivy.uix.screenmanager.Screen",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "kivy.properties.ObjectProperty",
"line_number": 31,
"usage_type": "cal... |
501112541 | import pandas as pd
import pdb
data=pd.read_table("hydrogel.soft.stiff.saha.txt",header=0,sep='\t')
header=[str(i) for i in data.columns]
b=pd.read_table("b.txt",header=0,sep='\t')
outf=open("background_subtracted.txt",'w')
outf.write('\t'.join(header)+'\n')
for i in range(data.shape[0]):
try:
expected_read... | null | diff_peaks/deseq2_custom_norm/subtract_expected_counts.py | subtract_expected_counts.py | py | 697 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.read_table",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "pandas.read_table",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pdb.set_trace",
"line_number": 15,
"usage_type": "call"
}
] |
343900079 | import numpy as np
import time
import matplotlib.pyplot as plt
def find_trig(wf):
bl=np.median(wf[:200])
top=np.median(wf[325:475])
mid=0.5*(bl+top)
return np.argmin(np.abs(wf[:400]-mid))
pmts=np.array([0,1,4,7,8,14])
chns=[2,3,6,9,10,15]
pmt=1
IDs=np.array([0, 9, 10, 11, 22, 25, 27, 32, 33 ,34, 37,... | null | AnalysisU/calib/TEMPshow.py | TEMPshow.py | py | 2,414 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.median",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.median",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.argmin",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.abs",
"line_number": 1... |
372813963 | #!/usr/bin/env python3
"""
This file is for system testing the Astronomer Helm chart.
Testinfra is used to create test fixures.
testinfra simplifies and provides syntactic sugar for doing
execs into a running pods.
"""
import json
import os
import docker
def test_prometheus_user(prometheus):
""" Ensure user is ... | null | bin/functional-tests/test_config.py | test_config.py | py | 2,648 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "json.loads",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 61,
... |
375437212 | # coding: utf-8
from datetime import datetime
from datetime import date
from datetime import timedelta
from mock import patch
import os
import unittest
import freezegun
import DBControlar
class TestDBControlar(unittest.TestCase):
def setUp(self):
self.img_url_s = 'http://www.img.filename.... | null | Test_DBControl.py | Test_DBControl.py | py | 12,154 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "unittest.TestCase",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.basename",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
... |
304777646 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
HaussdorfDistance.py: Computes the Hausdorff between the graph nodes.
* Bibliography: Fischer et al. (2015) "Approximation of graph edit distance based on Hausdorff matching."
Usage:
"""
from __future__ import print_function
import torch
import torch.nn as ... | null | GraphEditDistance/HausdorffDistance.py | HausdorffDistance.py | py | 2,294 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.nn.Module",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "torch.sqrt",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "torch.sum",
"line_number... |
360306400 | # Create a 2 wide plot and set the background of right-hand plot
# to orange. Add a cube to the left plot and a sphere to the
# right.
#
import pyvista
pl = pyvista.Plotter(shape=(1, 2))
actor = pl.add_mesh(pyvista.Cube())
pl.subplot(0, 1)
actor = pl.add_mesh(pyvista.Sphere())
pl.set_background('orange', all_renderers... | null | version/stable/api/plotting/_autosummary/pyvista-Plotter-subplot-1.py | pyvista-Plotter-subplot-1.py | py | 338 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pyvista.Plotter",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pyvista.Cube",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pyvista.Sphere",
"line_number": 9,
"usage_type": "call"
}
] |
441461810 | # coding: utf-8
import glob
import os
from ui.ui_scd_window import Ui_scd_form
from views.view_qmainwindow import ViewQMainWindow
from lib.config import ConfigIni
from PyQt5.QtWidgets import QMessageBox
from PyQt5.QtCore import Qt
class ViewSCDWindow(ViewQMainWindow):
def __init__(self, parent=None):
sup... | null | views/view_scd_window.py | view_scd_window.py | py | 9,560 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "views.view_qmainwindow.ViewQMainWindow",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "lib.config.ConfigIni",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "ui.ui_scd_window.Ui_scd_form",
"line_number": 17,
"usage_type": "call"
},
... |
441920935 | """
データマージプログラム
複数出力されたデータをsqlite3のデータベースに格納する
-- 移動データ
create table traffic_data (
shadow_id text
timestamp text
lat REAL
lng REAL
attributes text
)
-- タイムスタンプ一覧を保持
create table timestamp_list(
timestamp text
)
-- 車(shadow_id)一覧を保持
create table mobilities (
shadow_id text
)
### 仕様等
・実行時にデータベースを新規に作成... | null | data-merge.py | data-merge.py | py | 3,410 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.exists",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 77,
"usage_type": "attribute"
},
{
"api_name": "os.remove",
"line_number": 78,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_num... |
138867110 | from enum import IntFlag, unique
__all__ = (
'ExtraDataFlag',
)
@unique
class ExtraDataFlag(IntFlag):
GAME_ID = 0x01 # 1
# NOTE: Lower bits 2-4 are unused/undocumented
STEAM_ID = 0x10 # 5
KEYWORDS = 0x20 # 6
SOURCETV = 0x40 # 7
GAME_PORT = 0x80 # 8
| null | aioa2squery/enumerations/extra_data_flag.py | extra_data_flag.py | py | 285 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "enum.IntFlag",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "enum.unique",
"line_number": 8,
"usage_type": "name"
}
] |
277248355 | # %%
import os
import warnings
import pandas as pd
from tools.path_tools import normalize_path
warnings.filterwarnings("ignore")
# %%
BUILD_DIR = normalize_path([os.getcwd(), "..", "build"])
DATA_INPUT_DIR = normalize_path([BUILD_DIR, "data-ingested.csv"])
# %%
invoices = pd.read_csv(DATA_INPUT_DIR, parse_dates... | null | notebooks/feature_engineering.py | feature_engineering.py | py | 1,168 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tools.path_tools.normalize_path",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "too... |
565955358 | # Copyright 2016, 2017 California Institute of Technology
# Users must agree to abide by the restrictions listed in the
# file "LegalStuff.txt" in the PROPER library directory.
#
# PROPER developed at Jet Propulsion Laboratory/California Inst. Technology
# Original IDL version by John Krist
# Python transla... | null | proper_v3.2.1_python_3.x_12feb20/build/lib.linux-x86_64-3.7/proper/prop_fftw_wisdom.py | prop_fftw_wisdom.py | py | 2,854 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.expanduser",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "numpy.ones",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "numpy.complex128",
"li... |
573591696 | import os
import math
import numbers
import numpy as np
import networkx as nx
import pandas as pd
import matplotlib.pyplot as plt
from time import time
from colorama import Fore, Back, Style
from preproc import relational as rel
class CsvToGraph(object):
def __init__(self, config):
self.cfg = config
'''
Read ... | null | tasks/CsvToGraph.py | CsvToGraph.py | py | 1,833 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.join",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_excel",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"li... |
224840544 | #!/usr/bin/env python3
import logging
import os
from PIL import Image
from driver import epd7in5b_V2
# Setup Logging - change to logging.DEBUG if you are having issues.
logging.basicConfig(level=logging.INFO)
logging.info("Screen saver starting")
def display_image(epd, image_data):
rgb_image = image_data.conve... | null | screensaver.py | screensaver.py | py | 1,344 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.basicConfig",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "logging.info",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "PIL.Image.new",
... |
574146874 | # STD python packages
import os
from pathlib import Path
from typing import List
# Third party packages
# Local imports
excluded_files = ["CommonServerPython.py", "demistomock.py", "CommonServerUserPython.py", "conftest.py", "venv"]
def get_python_exec(py_num: float) -> str:
""" Get python executable
Args:... | null | demisto_sdk/commands/lint/commands_builder.py | commands_builder.py | py | 6,692 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "typing.List",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 48,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number"... |
476742186 | from datetime import datetime
from django.db import models
from django.middleware.csrf import _get_new_csrf_key
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from . import conf
class TokenManager(models.Manager):
"""Token manager"""
@property
def _exp... | null | session_csrf/models.py | models.py | py | 1,514 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.db.models.Manager",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "da... |
361326778 | # _*_ coding: utf-8 _*_
""" Functions for creating dataset of multi-view slices """
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
from skimage import io
import pydicom as dicom
import os
import os.path as osp
from os import listdir
import numpy as np
from utils import dcm2hu
from multiproce... | null | datasets/multiview_45degree.py | multiview_45degree.py | py | 12,280 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.use",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number":... |
338897639 | import logging
from securewei.core.expressions.expression_typed import ExpressionTyped
from securewei.core.expressions.expression import Expression
from securewei.core.solidity_types.type import Type
logger = logging.getLogger("UnaryOperation")
class UnaryOperationType:
BANG = 0 # !
TILD = ... | null | CORE/core/expressions/unary_operation.py | unary_operation.py | py | 4,391 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "securewei.core.expressions.expression_typed.ExpressionTyped",
"line_number": 80,
"usage_type": "name"
},
{
"api_name": "securewei.core.expressions.expression.Expression",
"line_number"... |
523784894 | import discord, textwrap
from PIL import Image, ImageDraw, ImageFont
formats = ['Drake', 'smudge', 'mike_blank_face', 'smart']
neededargs = [2, 2, 1, 4]
async def main(msg):
args = msg.content.split('/')
memeid = args[1]
try:
numargs = str(neededargs[int(memeid)-1])
memeformat = for... | null | updootbot/modules/meme/meme.py | meme.py | py | 4,031 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "PIL.Image.open",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "PIL.ImageDraw.Draw",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "PIL.ImageDraw",
"line... |
171130066 | from datetime import datetime
from shapely.geometry import shape, MultiPolygon, MultiPoint, MultiLineString
import json
import sys
import traceback
import geopandas as gpd
import numpy as np
import pandas as pd
import requests
import utils
class DataFrameComparison:
def __init__(self, src, new, columns_excluded=... | null | app/validate_data.py | validate_data.py | py | 19,140 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.intersect1d",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.intersect1d",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.union1d",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
... |
539701997 | from flask import render_template, redirect
from app import db
from app import app
from app.forms import MessageForm
from app.models import User, Messages
# add route '/' and also add the two methods to handle request: 'GET' and 'POST'
@app.route('/', methods=['GET','POST'])
def home():
'''
Home page
... | null | app/routes.py | routes.py | py | 2,083 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "app.forms.MessageForm",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "app.models.User.query.filter_by",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "app.models.User.query",
"line_number": 21,
"usage_type": "attribute"
},
{
"... |
567890915 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.examples.tutorials.mnist import input_data
from datetime import datetime
import os
mnist = input_data.read_data_sets('MNIST_data',one_hot=True)
import tensorflow as tf
def _bias_variable(name,s... | null | restore_pd.py | restore_pd.py | py | 3,866 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tensorflow.examples.tutorials.mnist.input_data.read_data_sets",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "tensorflow.examples.tutorials.mnist.input_data",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "tensorflow.get_variable",
"line_nu... |
72661547 | import calendar
import datetime
def first_day_and_last_day_of_current_month():
current_year = datetime.datetime.now().year
current_month = datetime.datetime.now().month
first_day, last_day = first_day_and_last_day_of_month(current_year, current_month)
return first_day, last_day
def first_day_and_las... | null | CommonModule/DateUtil.py | DateUtil.py | py | 1,033 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "datetime.datetime.now",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.now",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "datet... |
530657499 | from django import forms
from company.models import BankAccountType
class BankAccountTypeUpdateForm(forms.ModelForm):
class Meta:
model = BankAccountType
fields = [
"name",
"description",
"maximum_withdrawal_amount",
"active",
'color_cod... | null | company/forms.py | forms.py | py | 822 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "company.models.BankAccountType",
"line_number": 8,
"usage_type": "name"
}
] |
623111441 | from django.conf.urls import url
from .views import ProfileRetrieveAPIView, ProfileFollowAPIView
# from scholar.apps.annotations.views import AnnotationViewSet, ChannelViewSet
urlpatterns = [
url(r'^profiles/(?P<username>\w+)/?$', ProfileRetrieveAPIView.as_view()),
url(r'^profiles/(?P<username>\w+)/follow/?$'... | null | backend/scholar/apps/profiles/urls.py | urls.py | py | 668 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "views.ProfileRetrieveAPIView.as_view",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "views.ProfileRetrieveAPIView",
"line_number": 7,
"usage_type": "name"
},
{
... |
250851972 | from django.conf.urls import patterns, url
from pages import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^about/$', views.about, name='about'),
url(r'^mapbook/$', views.mapbook, name='mapbook'),
url(r'^contact/$', views.contact, name='contact')
]
| null | pages/urls.py | urls.py | py | 280 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pages.views.index",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pages.views",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.conf.urls... |
540530797 | from typing import List
class Solution:
def sumZero(self, n: int) -> List[int]:
res = []
if n%2 == 1:
res.append(0)
for i in range(1, n//2+1):
res.append(i)
res.append(-i)
return res
n = 5
res = Solution().sumZero(n)
print(res) | null | array/1304_find_n_unique_integers_sum_up_to_zero/1304_find_n_unique_integers_sum_up_to_zero.py | 1304_find_n_unique_integers_sum_up_to_zero.py | py | 303 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
}
] |
286196409 |
import requests
def getHtml(url):
headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36'}
cookies = dict(PageSize='96')
#s = requests.Session()
#r1 = s.get('https://www.bilbasen.dk', headers=headers)
#print(r1.sta... | null | scrapecar/otherGetter.py | otherGetter.py | py | 1,316 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 21,
"usage_type": "call"
}
] |
223014851 | from django.test import TestCase
from django.http import HttpRequest
from lists.views import home_page, view_list
from lists.models import Item, List
from lists.forms import ItemForm, EMPTY_LIST_ERROR
class ItemFormTest(TestCase):
def test_form_renders_item_text_input(self):
form=ItemForm()
self.assertIn('placeho... | null | lists/tests/test_forms.py | test_forms.py | py | 897 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.test.TestCase",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "lists.forms.ItemForm",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "lists.forms.ItemForm",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "lists.fo... |
516061684 | from flask import Blueprint, current_app, json
from HueScoreAlert import app_config
from time import sleep
import urllib.request as api
# Creates Blueprint
bp = Blueprint('hue', __name__, url_prefix='/hue')
def create_user():
conf = app_config.get()
url = "http://" + conf["bridge_ip"] + "/api"
json_da... | null | HueScoreAlert/hue.py | hue.py | py | 2,935 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Blueprint",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "HueScoreAlert.app_config.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "HueScoreAlert.app_config",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "... |
259799183 | import pygame
import os, sys
from pygame.locals import *
import math
import time
import GameVariables
# ----------------------
friction = 0.03
W, H = 1750, 1000
behind_net_margin = 60
top_border_for_players = 100
left_border_for_players = 0
right_border_for_players = W
bottom_border_for_players ... | null | Utilities.py | Utilities.py | py | 10,844 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pygame.display.set_mode",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "time.time",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
... |
183417339 | from flask import Flask
import random
app = Flask(__name__)
rnd_number = random.randint(0, 9)
@app.route('/')
def higher_lower_text():
return "<h1>Guess a number between 0 and 9</h1>" \
"<img src='https://media.giphy.com/media/3o7aCSPqXE5C6T8tBC/giphy.gif'>"
@app.route('/<int:guessed_nu... | null | Day_55_Higher_lower/server.py | server.py | py | 974 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 6,
"usage_type": "call"
}
] |
411292662 | from decimal import Decimal
from collections import defaultdict
from django.conf import settings
from .models import SparePart
class Cart:
def __init__(self, request):
self.session = request.session
cart = self.session.get(settings.SPARE_PARTS_CART_SESSION_ID)
if not cart:
car... | null | pbsite/sparepart/cart.py | cart.py | py | 2,124 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.conf.settings.SPARE_PARTS_CART_SESSION_ID",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.conf.settings.SPARE_PARTS_CART_SESSION_ID",
"line_number": ... |
103994287 | import cv2
import numpy as np
img = cv2.imread('./images/chihuahua.jpg')
cv2.imshow('original',img)
cv2.waitKey(0)
cv2.destroyAllWindows()
gray_image = cv2.cvtColor(img , cv2.COLOR_BGR2GRAY)
cv2.imshow('Gray scale',gray_image)
cv2.waitKey(0)
cv2.destroyAllWindows()
#another easier method is
img2 = cv2.imread('./i... | null | 2-grayscale.py | 2-grayscale.py | py | 418 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.imread",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.destroyAllWindows",
"line_numb... |
529544863 | # coding:utf-8
from bs4 import BeautifulSoup
import requests
import re
import csv
count =0
index =1
#
#Goal: 出前TripAdvisor HK 20页的餐厅名字,餐厅排名,点评数量,餐厅类型/标签,价格区间,
#
file = open('result.csv', 'w')
fileObject=csv.writer(file)
fileObject.writerow(['name','rank','reviews','tag','price'])
while index<=20:
if index==1:
... | null | Assignment1/spider.py | spider.py | py | 2,075 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "csv.writer",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_numb... |
546513465 | # -*- coding: utf-8 -*-
import re
import fasttext
from proto import prediction_pb2, rest_api_pb2
from common import constants
from common.experiment_framework_cfg import ExperimentFrameworkCfg
from common.util import build_dict_items
from prometheus_client import Histogram
SPAM_PREDICTION_LATENCY = Histogram('sentimen... | null | SentimentV2/Sentiment/prediction_model/junk_ads/model.py | model.py | py | 4,092 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "prometheus_client.Histogram",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "fasttext.load_model",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "common.constants.JUNK_ADS_PATH",
"line_number": 13,
"usage_type": "attribute"
},
{
... |
546361097 | import csv
import sqlite3
# MENU.dbを作成する
dbname = 'MENU.db'
conn = sqlite3.connect(dbname)
# DB上の処理対象の行を指し示すためのCursorオブジェクトを作成する
cur = conn.cursor()
# ごはんという名前のtableを作成する
cur.execute("""CREATE TABLE IF NOT EXISTS エネルギー必要量
(メニュー名 STRING,
カロリー INTEGER,
タンパク質 DOUBLE,
脂質 DOUBLE,
炭水化物 DOUBLE,
塩分 DOUBLE,
... | null | hackU/bin/sqlwrite.py | sqlwrite.py | py | 934 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sqlite3.connect",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 25,
"usage_type": "call"
}
] |
315547660 | """Example running MemN2N on a single bAbI task.
Download tasks from facebook.ai/babi """
# from __future__ import absolute_import
# from __future__ import print_function
from data_utils.tradition_data import load_task, vectorize_data
from sklearn import cross_validation, metrics
from memn2n_model import E2EMemm
from ... | null | model/memory-networks/single_task.py | single_task.py | py | 6,050 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tensorflow.flags.DEFINE_float",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "tensorflow.flags",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.flags.DEFINE_float",
"line_number": 17,
"usage_type": "call"
},
{
... |
16192981 | # -*- coding: utf-8 -*-
import os
from datetime import datetime, timedelta
from urlparse import urljoin
import iso8601
from dateutil.tz import tzlocal
from flask import (
current_app as app, request, jsonify, url_for, session, abort, redirect
)
from openprocurement.auction.event_source import (
send_event, se... | null | openprocurement/auction/texas/views.py | views.py | py | 6,828 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "datetime.timedelta",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "flask.request.args",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "flask.curren... |
111770324 | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
# In[1]:
get_ipython().system('wget "http://cb.lk/covid_19"')
# In[2]:
get_ipython().system('unzip covid_19')
# In[ ]:
TRAIN_PATH = "CovidDataset/Train"
VAL_PATH = "CovidDataset/Val"
# In[4]:
import numpy as np
import matplotlib.pyplot as plt
import ker... | null | Covid_19_Classifier.py | Covid_19_Classifier.py | py | 5,588 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "keras.preprocessing.image.ImageDataGenerator",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "keras.preprocessing.image",
"line_number": 77,
"usage_type": "name"
},
{
"api_name": "keras.preprocessing.image.ImageDataGenerator",
"line_number": 84,
... |
261232495 | #!/usr/bin/env python3
from os.path import exists, join
from time import time
from sys import exit
from subprocess import getstatusoutput
from re import search, compile
from common import DATASET_ROOT, WORKSPACE_ROOT, OUTPUT_ROOT, parse_all_metadata, get_gpu_ram
SEP_PATH = join(WORKSPACE_ROOT, "sep-graph")
SEP_BUILD_P... | null | bin/run_fig7.py | run_fig7.py | py | 2,475 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.join",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "common.WORKSPACE_ROOT",
"line_number": 9,
"usage_type": "argument"
},
{
"api_name": "os.path.join",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.join",
... |
333235002 | # coding: utf-8
"""Download metadata and SNVs from selected sequences
Author: Albert Chen - Vector Engineering Team (chena@broadinstitute.org)
"""
import pandas as pd
import psycopg2
from flask import make_response
from psycopg2 import sql
from cg_server.config import config
from cg_server.constants import constan... | null | services/server/cg_server/download/metadata.py | metadata.py | py | 5,641 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cg_server.query.selection.select_sequences",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "cg_server.constants.constants",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "psycopg2.sql.SQL",
"line_number": 34,
"usage_type": "call"
},
... |
58517896 | from django.contrib import admin
from django.utils.safestring import mark_safe
from .models import ArtistBankDetail, ArtistDesign, ArtistDetail, SocialLink, ProductArtistDesignMap, ArtistCoupon
from product.models import ProductImage
# Register your models here.
class ArtistDetailAdmin(admin.ModelAdmin):
model = ... | null | artist/admin.py | admin.py | py | 1,823 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "models.ArtistDetail",
"line_number": 9,
"usage_type": "name"
},
{
"api_na... |
507459041 | import numpy as np
import matplotlib.pyplot as plt
import operator
# 将文本导入并转化为numpy数组格式返回
def file2matrix(filename):
# 导入文件
fname = open(filename)
# 按行读取文件内容
lines = fname.readlines()
# 返回行数,即样本数
num_of_lines = len(lines)
# 构建输入的样本及其标签
x_data = np.zeros((num_of_lines, 3), dtype=np.floa... | null | chapter2_kNN/kNN_ImproveDatingSite/datingSite.py | datingSite.py | py | 3,696 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.zeros",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "matplotlib.py... |
430076547 | #!/usr/bin/env python3
# Copyright (c) 2018 EPAM Systems
#
# 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 l... | null | src/vis_client_example.py | vis_client_example.py | py | 2,913 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
... |
224214466 | import mock
import datetime
from django.db import models
from django.test import TestCase
from dateutil.relativedelta import relativedelta
from nose.tools import eq_, ok_
from ..utils import update_views_count, get_order_fields, update_vote_score
class _ModelMock(mock.MagicMock):
def _get_child_mock(self, **kwa... | null | popcorn_gallery/popcorn/tests/utils_tests.py | utils_tests.py | py | 3,841 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "mock.MagicMock",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "django.db.models.Model",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "djan... |
566055902 | import json
from django.apps import apps
from django.contrib.auth.mixins import LoginRequiredMixin
from django.shortcuts import get_object_or_404
from django.urls import reverse
from django.views.generic import (
CreateView, DetailView
)
from ..forms import VocabContextCreateForm, VocabContextAudioCreateForm
from... | null | nublado/vocab/views/views_vocab_context_auth.py | views_vocab_context_auth.py | py | 4,060 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.apps.apps.get_app_config",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "django.apps.apps",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.mixins.LoginRequiredMixin",
"line_number": 23,
"usage_type": "name"
... |
125922259 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2020 CERN.
#
# CDS-ILS is free software; you can redistribute it and/or modify it under
# the terms of the MIT License; see LICENSE file for more details.
"""Admin panel for importer tasks."""
import json
from flask import Blueprint, url_for
from flask_admin.contrib.sqla impo... | null | cds_ils/importer/admin.py | admin.py | py | 3,855 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "markupsafe.Markup",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "flask_admin.contrib.sqla.ModelView",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "cds_ils.importer.models.ImporterTaskLog.id",
"line_number": 41,
"usage_type": "attri... |
329631507 | import numpy as np
import torch
from torch.autograd import Variable
import os
import glob
import h5py
import configs
import backbone
from data.datamgr import SimpleDataManager
from methods.baselinetrain import BaselineTrain
from methods.baselinefinetune import BaselineFinetune
from methods.protonet import ProtoNet
fro... | null | fewshot/save_features.py | save_features.py | py | 5,633 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "h5py.File",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "torch.autograd.Variable",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "scipy.spatial.distance.pdist",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "pandas... |
523069875 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" Functions and utilities comparing raster and vector similarities.
Module can be used alone or as part of Snakemake workflow.
"""
import logging
import rasterio
import os
import geopandas as gpd
import pandas as pd
import numpy as np
import numpy.ma as ma
from importl... | null | src/03_post_processing/similarity.py | similarity.py | py | 15,271 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "importlib.machinery.SourceFileLoader",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.round",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "numpy.min",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "numpy.roun... |
104192373 | import requests, json
from bs4 import BeautifulSoup
class Coursera:
@staticmethod
def fromCoursePage(link):
data = {}
data['content'] = []
data['ratings'] = {}
data['skills'] = []
data['instructors'] = []
r = requests.get(link, headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) Ap... | null | multiverse/scrapers/coursera.py | coursera.py | py | 3,318 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"... |
217173757 | import boto3
import click
session = boto3.Session(profile_name = 'ec2automate')
s3 = session.resource('s3')
@click.group()
def cli():
"webtron deploys website to AWS"
pass
@cli.command('list-buck... | null | 01-webotron/webotron.py | webotron.py | py | 643 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "boto3.Session",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "click.group",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "click.argument",
"line_number": 20,
"usage_type": "call"
}
] |
441832 | import pandas as pd
import case.vip_info.login
import requests
import time
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.header import Header
import smtplib
"""读取Excel接口路由,入参。返回执行结果、发送邮件"""
token = case.vip_info.login.test_login()
def test_readMyExcel():
headers ... | null | Auto_tata/case/vip_info/ReadExcelInterface.py | ReadExcelInterface.py | py | 3,238 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "case.vip_info.login.vip_info.login.test_login",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "case.vip_info.login.vip_info",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "case.vip_info.login",
"line_number": 12,
"usage_type": "n... |
282815715 | import json, requests
game = "Counter-Strike:%20Global%20Offensive"
url = "https://api.twitch.tv/kraken/search/streams?limit=100&offset=0&q=" + game
print(url)
resp = requests.get(url=url)
data = json.loads(resp.text)
print(data)
print(data)
| null | twitch/main_script.py | main_script.py | py | 248 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 11,
"usage_type": "call"
}
] |
602310234 | #!/usr/bin/python3
# -*- coding: utf-8 -*
import RPi.GPIO as GPIO
import time
from datetime import datetime
from PIL import Image
import pygame
from pygame.locals import *
import os
GPIO.setmode(GPIO.BCM) #Attention au choix du port ; référez-vous au site https://fr.pinout.xyz/
GPIO.setup(24, GPIO.IN, pull_up_down=GPI... | null | Photomaton/photomaton.py | photomaton.py | py | 4,650 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "RPi.GPIO.setmode",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "RPi.GPIO",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "RPi.GPIO.BCM",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "RPi.GPIO.setup",
"lin... |
116635761 | #
# 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
# ... | null | murano/tests/unit/packages/versions/test_mpl_v1.py | test_mpl_v1.py | py | 1,639 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "murano.tests.unit.base.MuranoTestCase",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "murano.tests.unit.base",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "os.path.abspath",
"line_number": 23,
"usage_type": "call"
},
{
... |
455844922 | #***************************************************************************
#* *
#* Copyright (c) 2013-2015 - Juergen Riegel <FreeCAD@juergen-riegel.net> *
#* *
#* This pr... | null | SourceCode/FreeCAD_x86/src/Mod/Fem/_TaskPanelFemSolverCalculix.py | _TaskPanelFemSolverCalculix.py | py | 12,792 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "FreeCAD.GuiUp",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "FreeCADGui.PySideUic.loadUi",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "FreeCADGui.PySideUic",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name... |
329639348 | from django.shortcuts import render
from django.http import JsonResponse, HttpResponse
# Create your views here.
import json
import datetime
import requests
from dev_util import cache_util
def fetch_new_data_from_api():
response = requests.get('https://corona.lmao.ninja/v2/historical')
data = response.json()
... | null | covidstats/views.py | views.py | py | 4,046 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "dev_util.cache_util.process_api_data_for_cache",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "dev_util.cache_util",
"line_number": 12,
"usage_type": "name"
},
{
"a... |
219826709 | """
A contextual bandit problem + Thompson sampling + particle filter
"""
import numpy as np
import matplotlib.pyplot as plt
import Game
import Particle_Filter as ParFil
import Performance_Evaluation as PerfEval
np.set_printoptions(precision=4)
def run_one_simulation():
"""
Run one simulatio... | null | 0_nonmoving/main.py | main.py | py | 3,619 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.set_printoptions",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "Game.System",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "Particle_Filter.init_state",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "matplot... |
107508104 | # -*- coding: utf-8 -*-
# Copyright (c) 2018 Petter Reinholdtsen <pere@hungry.com>
# This file is covered by the GPLv2 or later, read COPYING for details.
import configparser
import simplejson
import time
import unittest
import tornado.ioloop
from decimal import Decimal
from os.path import expanduser
from tornado imp... | null | valutakrambod/service/bitstamp.py | bitstamp.py | py | 5,928 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "valutakrambod.services.Service",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "decimal.Decimal",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "decimal.Decimal",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "valuta... |
447860228 | import numpy as np
import pickle
import tensorflow as tf
import scipy
import six
from tensorflow.contrib.distributions import Normal, BernoulliWithSigmoidProbs, kl, RelaxedBernoulli, Bernoulli
from bayesdend.utils.tf_util import repeat_elements
from bayesdend.utils.model_util import *
from bayesdend.rec_model_util impo... | null | old/autoencoder_vimco.py | autoencoder_vimco.py | py | 24,616 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tensorflow.summary.histogram",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "tensorflow.summary",
"line_number": 47,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.reshape",
"line_number": 54,
"usage_type": "call"
},
{
"api_name"... |
327898701 | import matplotlib.pyplot as plt
from pymove.utils.constants import DATE, DAY, HOUR, LATITUDE, LONGITUDE, PERIOD, TRAJ_ID
def show_object_id_by_date(
move_data,
create_features=True,
kind=None,
figsize=(21, 9),
return_fig=True,
save_fig=True,
name='shot_points_by_date.png',
):
"""
... | null | pymove/visualization/matplotlib.py | matplotlib.py | py | 4,515 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 52,
"usage_type": "name"
},
{
"api_name": "pymove.utils.constants.PERIOD",
"line_number": 59,
"usage_type": "name"
},
{
"api_na... |
566304873 | from flask import Flask, render_template
app = Flask(__name__)
#@app.route("/")
#def head():
# names = ["Ummuhan", "Hasan", "Sibel", "Fatmanur", #"Edip"]
# return render_template("index.html", isimler = names)
@app.route("/")
def head():
dinleyen = "Tulay"
return render_template("index.html", listener ... | null | DevOps/TeamWork/Working_group/3_Flask_if_for_structure/app.py | app.py | py | 384 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 13,
"usage_type": "call"
}
] |
344671040 | #!/usr/bin/env python3
import multiprocessing
import os
import shutil
import signal
import subprocess
import sys
import tempfile
import time
curdir = os.path.abspath(os.path.dirname(__file__))
def read_targets():
targets = []
with open(os.path.join(curdir, 'get')) as f:
for line in f.readlines():
... | null | parallel-get.py | parallel-get.py | py | 1,904 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.abspath",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line... |
256790325 | from djitellopy import Tello
import time
from pyzbar import pyzbar
import argparse
import cv2
import matplotlib.pyplot as plt
import imutils
from imutils.video import VideoStream
import time
import numpy as np
import matplotlib.pyplot as plt
from tello_utils import polygon_area, get_x_measurement, get_z_measurement
al... | null | gatherTestData.py | gatherTestData.py | py | 6,036 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "djitellopy.Tello",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "imutils.resize",
"line_num... |
646113208 | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from models import *
from torch.autograd.gradcheck import zero_gradients
from torch.autograd import Variable
from torch import autograd
import utils
import math
from utils import softCrossEntropy
from utils import one_hot_tensor, la... | null | svhn/attack_methods_new_imt_svhn.py | attack_methods_new_imt_svhn.py | py | 14,544 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Module",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "torch.nn... |
297435114 | from curiousbot import bot
from flask import Flask, render_template, request
import os
app = Flask(__name__)
chatbot = bot.get_bot(bot_brain='char_rnn')
@app.route("/", methods=['GET', 'POST'])
def home():
global chatbot
if request.method == 'POST':
bot_brain = request.form.get('model_select')
... | null | curiousbot/app.py | app.py | py | 917 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "curiousbot.bot.get_bot",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "curiousbot.bot",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "flask.request.method",... |
509386826 | #!/usr/bin/env python
import os
import sys
import subprocess
import types
from Bio import SeqIO
INSTALLATION_DIR = os.path.dirname(os.path.realpath(__file__)) + '/'
sys.path.append(INSTALLATION_DIR)
from modules import seqio_filter
from modules import makeTrain
from modules import makeTest
from modules import classi... | null | PhiSpy.py | PhiSpy.py | py | 3,647 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.dirname",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"lin... |
71619473 | #
# Copyright (c) 2018 ISP RAS (http://www.ispras.ru)
# Ivannikov Institute for System Programming of the Russian Academy of Sciences
#
# 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
#
# h... | null | core/core/coverage.py | coverage.py | py | 23,577 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "core.components.components",
"line_number": 125,
"usage_type": "attribute"
},
{
"api_name": "core.components",
"line_number": 125,
"usage_type": "name"
},
{
"api_name": "multiprocessing.Queue",
"line_number": 135,
"usage_type": "call"
},
{
"api_name... |
17881104 | import json
import pytest
def test_get_posts_count(setup_jp):
jp = setup_jp
res = jp.get(path="/posts")
data = json.loads(res.text)
status = res.status_code
assert status == 200
assert len(data) == 100
def test_get_posts_data(setup_jp):
jp = setup_jp
res = jp.get(path="/posts")
d... | null | 3-webapi-testing/jsonplaceholder/test_all_tests.py | test_all_tests.py | py | 1,458 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "json.loads",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_n... |
586362332 | from selenium import webdriver
from os import path
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support import events
from time ... | null | backup.py | backup.py | py | 5,883 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
642709874 | import torch
import torch.nn as nn
import torchvision
def features(dataset, name=''):
feature_ext = torchvision.models.resnet50(pretrained=True).cuda()
feature_ext = nn.Sequential(*list(feature_ext.children())[:-1]).cuda()
feature_ext.eval()
train_f = []
train_act = []
num_videos = len(dataset... | null | no_RNN/functions_no_RNN.py | functions_no_RNN.py | py | 1,062 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torchvision.models.resnet50",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torchvision.models",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "... |
612209987 | import json
import os
from collections import namedtuple, defaultdict
from file_readers.read_csv_file import read_csv_file
from file_readers.read_json_file import read_json_file, write_json_file
from toolbox.toolbox import test_directory
def PolDiv_demo_creator():
infile = "../output/associate_db_with_pd/results... | null | 040_PolDiv_demo_creator/PolDiv_demo_creator.py | PolDiv_demo_creator.py | py | 7,361 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "file_readers.read_csv_file.read_csv_file",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "file_readers.read_csv_file.read_csv_file",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 40,
"usage_typ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.