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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
258535719 | import pyautogui as pa
from time import sleep
while True:
i = int(input(" :"))
while True:
if i == 0 :
fice = list(pa.center(pa.locateOnScreen("1.PNG")))
pa.click(fice)
sleep(3)
i += 1
continue
j = 140
while j >0:
... | null | Macro/q12345.py | q12345.py | py | 1,007 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pyautogui.center",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pyautogui.locateOnScreen",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pyautogui.click",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "time.sleep",
... |
314521674 |
from nintendo.common import websocket, http
import pytest
HOST = "127.0.0.1"
@pytest.mark.anyio
async def test_websocket():
async def handler(client):
assert await client.recv() == b"binary"
assert await client.recv_text() == "text"
await client.send(b"test1")
await client.send_text("tes... | null | tests/common/test_websocket.py | test_websocket.py | py | 1,024 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "nintendo.common.websocket.serve",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "nintendo.common.websocket",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "nintendo.common.websocket.connect",
"line_number": 19,
"usage_type": "call"
}... |
336491002 | # -*- coding: utf-8 -*-
"""
Created on Wed Dec 2 11:22:08 2015
@author: FinArb
"""
import os
import sys
import numpy as np
from fnmatch import fnmatch
import pandas as pd
import openpyxl as op
import warnings
from joblib import Parallel, delayed
#folder for csv and xlsx files
root = str(sys.argv[1])
#starting charac... | null | scripts/data_process/etl_excel/save_all_ddf_xlsx_as_csv_multithreaded.py | save_all_ddf_xlsx_as_csv_multithreaded.py | py | 6,267 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.argv",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "sys.setdefaultencoding",
... |
245251501 | import numpy as np
import pandas as pd
from pathlib import Path
from src import ROOT
def _rev_lin_id(unique_ids, type):
""" Get dict to find actual id """
lin_id = dict()
for i, id in enumerate(np.sort(unique_ids)):
lin_id[i] = get_class_name(id, type)
return lin_id
def get_class_name(id, typ... | null | old_stuff/code/mlcv-exp_01/src/utils/ek.py | ek.py | py | 1,259 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.sort",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "src.ROOT",
"line_number": 15,
"usage_type": "argument"
},
{
"api_name": "pandas.read_csv",
"line_numb... |
593232068 | from django.urls import path
from .views import NewsCreateView, NewsListView, NewsDetailView
app_name = 'news'
urlpatterns = [
path('create/', NewsCreateView.as_view()),
path('all/', NewsListView.as_view()),
path('detail/<str:part_link>', NewsDetailView.as_view())
]
| null | news/urls.py | urls.py | py | 281 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "views.NewsCreateView.as_view",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "views.NewsCreateView",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "djang... |
258184986 | # -*- coding: utf-8 -*-
"""
Created on Fri Oct 28 16:18:47 2016
@author: congbria
"""
from collections import defaultdict
import csv, plotting
def open_file():
#open file with catches
while True:
try:
fp = input("Select a decade. ")
if fp.isalpha():
... | null | CSE231/proj07/proj07a.py | proj07a.py | py | 2,456 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "csv.reader",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 75,
"usage_type": "call"
}
] |
396804782 | from prediction.admin import PredictionConfig
import numpy as np
from tensorflow.keras.preprocessing.sequence import pad_sequences
from .pre_politics import extract_hashtag, preprocess
from Stream.extract_tweets import extract_tweets
from collections import Counter as Counter
import re
from nltk.corpus import stopwords... | null | backend/django_app/prediction/ML_politics.py | ML_politics.py | py | 1,687 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "Stream.extract_tweets.extract_tweets",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pre_politics.preprocess",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pre_politics.extract_hashtag",
"line_number": 14,
"usage_type": "call"
},
... |
511429073 | from django.template.loader import get_template
from django.template.response import TemplateResponse
from django.http import JsonResponse
import importlib
from django.utils.translation import gettext as _
import games
import os
from .models import Games, Players
from project_couch import status
# Pages
# Main menu ... | null | main_menu/views.py | views.py | py | 4,222 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.listdir",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "games.__file__",
"line_nu... |
238302635 | import math
import BinomialTree as bt
import matplotlib.pyplot as plt
u = 1.000000000000001
d = 1/u
T = 0.00000000000000001
division = 3
t = T / division
r = 0.05
p = (math.exp(r*t)-d) / (u-d)
q = 1-p
df = math.exp(-r*t)
record = []
iterator = list(range(2, 20))
for i in iterator:
print(i)
seed = bt.Binomi... | null | main2.py | main2.py | py | 487 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "math.exp",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "math.exp",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "BinomialTree.BinomialNode",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "BinomialTree.BinomialTree... |
434286935 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
import numpy as np
from sklearn.naive_bayes import MultinomialNB
from sklearn.linear_model import RidgeClassifier
def softmax(X):
return np.exp(X) / np.sum(np.exp(X), axis=1).reshape(X.shape[0], 1)
def logsumexp(X):
return np.log(np.sum... | null | projects/resources/python/other/train_ensemble.py | train_ensemble.py | py | 3,150 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.exp",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.log",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 15,
... |
396842840 | from maya import cmds
import sys
import maya.OpenMayaUI as mui
from PyQt4 import QtCore, QtGui
import sip
import imp
imp.load_source("mn_randomColors", "/net/homedirs/mneubig/maya/scripts/mn_scripts/mn_randomColors.py")
imp.load_source("mn_tubesOnCurves", "/net/homedirs/mneubig/maya/scripts/mn_scripts/mn_tubesOnCurves... | null | mn_utilsUI.py | mn_utilsUI.py | py | 9,463 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "imp.load_source",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "imp.load_source",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "imp.load_source",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "imp.load_source",
"... |
343537441 | from typing import Union, List
def has_parameter(parameter: Union[str, List[str]], kwargs: dict):
if isinstance(parameter, str):
if parameter in kwargs:
return True
else:
return False
elif isinstance(parameter, list):
for param in parameter:
if not h... | null | Eranox/Core/utils.py | utils.py | py | 461 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.Union",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 4,
"usage_type": "name"
}
] |
562845839 | import json
from enum import Enum
from operator import itemgetter
from typing import List, T, Dict
# from models.util.db_util import DatabaseHandle
class ConceptType(Enum):
CND = 'Condition'
OBS = 'Observation'
TRT = 'Treatment'
OBSIID = 'Labs'
def get_int(self) -> int:
int_dict = {
... | null | archive/models/util/concept_util.py | concept_util.py | py | 2,911 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "enum.Enum",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.T",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 46,
"usage_type": "name"
}
] |
458912978 | # importing the library
#import pyperclip as pc
#import clipboard as pc
# text1 = "GeeksforGeeks"
from google.cloud import texttospeech
# copying text to clipboard
# pc.copy(text1)
# set GOOGLE_APPLICATION_CREDENTIALS=C:\Users\micha\Projects\google_speech\speech-test-300122-d4f7f5f35fc7.json
# impor... | null | engl.py | engl.py | py | 2,658 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.argv",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "google.cloud.texttospeech.TextToSpeechClient",
"line_number": 31,
"usage_type": "call"
},
{
"api_name... |
551993937 | # -*- coding: utf-8 -*-
"""
Created on Thu Apr 19 11:28:01 2018
@author: pnola
def kevrekidis(t,Y, eps=0.01):
return np.array([-Y[0]-Y[1]+2, 1/eps*(Y[0]**3-Y[1])])
def ex11(t,Y):
return -np.array([np.tanh(Y[0]**2/4)+Y[0],Y[0]+2*Y[1]])
def rotHoop(t,Y, eps=0.1, gamma=2.3):
return np.array([Y[1], 1/eps*(np.sin(Y... | null | second_order_terms_oldWRONG.py | second_order_terms_oldWRONG.py | py | 5,787 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.pyplot.close",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "numpy.ceil",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",... |
166818715 | import datetime
import hashlib
import urllib.parse
from dataclasses import dataclass
from typing import Any, Dict, List, Optional
import requests
from storeclient.client import Client
from storeclient.dateutils import parse_datetime
from storeclient.snap import Snap
def parse_url_query(url: str) -> Dict[str, str]:
... | null | storeclient/store.py | store.py | py | 5,631 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "urllib.parse.parse.urlparse",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "urllib.parse.parse",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "urllib.parse",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "urll... |
567047018 | import re
import requests
import boto3
import click
from geopy.geocoders import Nominatim
from elasticsearch import Elasticsearch, RequestsHttpConnection
from requests_aws4auth import AWS4Auth
geolocator = Nominatim()
# Connecting to AWS Elasticsearch Service
host = 'search-elastic-wifi2-tj7nwqymkpo4rxoe3mpdvpxjqi.u... | null | search_wifi/populate_es.py | populate_es.py | py | 3,267 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "geopy.geocoders.Nominatim",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "boto3.Session",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "requests_aws4auth.AWS4Auth",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "el... |
212712716 | from __future__ import unicode_literals
from six.moves import urllib_parse as urlparse
import os
import collections
import requests
import six
import json
import yaml
from flex.context_managers import ErrorCollection
from flex.exceptions import ValidationError
from flex.serializers.core import (
SwaggerSerialize... | null | flex/core.py | core.py | py | 4,443 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.Mapping",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "os.path.expandus... |
249006779 | from datetime import datetime
from .const import _LOGGER, WEEKDAYS, WEEKENDS, SPECIALDAYS
def convert_from_wiser_schedule(scheduleData: dict, scheduleName=""):
"""
Description: Converts from wiser format to human readable format
Param: scheduleData
Param: mode
"""
# Remove Id key from sch... | null | custom_components/wiser/util.py | util.py | py | 3,844 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "const.WEEKDAYS",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "const.WEEKENDS",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "const.SPECIALDAYS",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.str... |
44070082 | import os
import numpy as np
import pypinyin
import tensorflow as tf
import logging
from augmentations.augments import Augmentation
from utils.speech_featurizers import SpeechFeaturizer
from utils.text_featurizers import TextFeaturizer
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s -... | null | dataloaders/am_dataloader.py | am_dataloader.py | py | 17,279 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.basicConfig",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "utils.speech_featurizers.SpeechFeaturizer",
"line_number": 23,
"usage_type": "call"
},
{
"a... |
501811947 | import tensorflow as tf
from tensorflow.keras import datasets, layers, models
import numpy as np
#from mpl_toolkits.mplot3d import Axes3D
#import matplotlib.pyplot as plt
import random
import pickle
import signal
import sys
import time
import math
import csv
import os
import argparse
from datetime import datetime
... | null | energylossestimate/EnergyLossEstimate.py | EnergyLossEstimate.py | py | 13,539 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 106,
"usage_type": "call"
},
{
"api_name": "signal.signal",
"line_... |
404756144 | import json
import os
import random
import base64
import binascii
import requests
from Crypto.Cipher import AES
from bs4 import BeautifulSoup
import ptvsd
ptvsd.settrace('my_secret', ('0.0.0.0', 3000))
# headers = {
# 'Host': 'music.163.com',
# 'Connection': 'keep-alive',
# 'Content-Length': '486',
#... | null | requestser.py | requestser.py | py | 7,252 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "ptvsd.settrace",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "Crypto.Cipher.AES.new",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "Crypto.Cipher.AES",
... |
155387878 | from selenium import webdriver #le driver qui te permet d'aller sur un explorateur internet
from selenium.webdriver.common.keys import Keys #ce qui te permet de rentrer des touches du clavier
from re import sub
from decimal import Decimal
driver = webdriver.Firefox() #ouvre Firefox
driver.get("https://www.kickstarte... | null | kick-final.py | kick-final.py | py | 1,836 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "selenium.webdriver.Firefox",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "decimal.Decimal",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "re.sub",
... |
250543887 | # coding: utf-8
__author__ = 'windy'
import datetime
from rest_framework.decorators import api_view
from rest_framework.response import Response
from mis import models
from tools import utils
from tools.utils import Row
from mis.dao.methods_user import get_user_by
@api_view(['GET'])
def get_class_notes(request):
... | null | mis/mis/apis/api_class_notes.py | api_class_notes.py | py | 6,065 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "rest_framework.response.Response",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "tools.utils.Row",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "tools.utils.Row",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "mis.... |
381679856 | from config import *
import numpy as np
from sklearn.model_selection import StratifiedKFold
import pandas as pd
def Messidor_Process(dirname):
bases = [11, 12, 14, 21, 22, 23, 24, 31, 32, 33]
df_messidor = pd.DataFrame()
for i in bases:
train_dir_messidor = os.path.join(dirname,'Base '+str(i))
... | null | data_processor.py | data_processor.py | py | 3,176 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.DataFrame",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
... |
167081432 | # Copyright (c) 2018 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | null | yardstick/tests/unit/benchmark/runner/test_iteration_ipc.py | test_iteration_ipc.py | py | 5,323 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "yardstick.tests.unit.base.BaseUnitTestCase",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "yardstick.tests.unit.base",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "uuid.uuid1",
"line_number": 31,
"usage_type": "call"
},
{
... |
323679079 | import random
import threading
from queue import Queue
import requests
import constants
from login import CookiesHelper
from page_parser import MovieParser
from proxy import proxy
from storage import DbHelper
from utils import Loggers
from utils import Utils
class DouBanMovieSpider(object):
def __init__(self, ... | null | core/spider.py | spider.py | py | 5,340 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "queue.Queue",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "utils.Loggers.get_logger",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "utils.Loggers",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "storage.DbHelper.D... |
285236051 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
##############################################
#
# Name: U7.5_Read_xlsx.py
#
# Author: Peter Christen
#
# Version: 1.0
#
# Date: 05.11.2015
#
# Purpose: Liest ein xlsx-File ein und schreibt Daten auf Bildschirm
#
###########################... | null | Version2/U7.5_Read_xlsx.py | U7.5_Read_xlsx.py | py | 991 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.argv",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "openpyxl.load_workbook",
"line_number": 32,
"usage_type": "call"
}
] |
502487308 | """
Functionality for working with a video tiling
This is a class that's used with the multi-object tracking scenario.
"""
import cv2
import json
import numpy as np
import matplotlib.pyplot as plt
import sys
class MOT_Tiling:
"""
Represents a tiling in a MOT scenario.
"""
def __init__(self, data_p... | null | src/scenario/mot_tiling.py | mot_tiling.py | py | 3,832 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "json.load",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "numpy.array",
... |
236379008 | from django.db import models
from django.db.models import Model
from django.contrib.sitemaps import Sitemap
from camps.models import Camp
from django.contrib.auth.models import User
import markdown
from tagging.fields import TagField
from tagging.models import Tag
# Create your models here.
class Entry(models.Model)... | null | simpleshout/models.py | models.py | py | 2,104 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.models.Model",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "django.db.models.ForeignKey",
"line_number": 14,
"usage_type": "call"
},
{
"api_name... |
254165883 | """This code creates bar plots for the categorical variables and box plots for numeric variables in the data set with the following steps:
Create bar plots for each categorical column in the data frame. A subplot is created for each level of the label, readmi_class.
Create box plots for each categorical column in t... | null | code/VisClassification.py | VisClassification.py | py | 2,123 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.use",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.int64",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "numpy.int32",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "numpy.float64",
"... |
461755131 | #!/usr/bin/env python3
import random
import gym
from gym_minigrid.register import envSet
print('%d environments registered' % len(envSet))
for envName in sorted(envSet):
print('testing "%s"' % envName)
# Load the gym environment
env = gym.make(envName)
env.reset()
env.render('rgb_array')
en... | null | run_tests.py | run_tests.py | py | 559 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "gym_minigrid.register.envSet",
"line_number": 7,
"usage_type": "argument"
},
{
"api_name": "gym_minigrid.register.envSet",
"line_number": 9,
"usage_type": "argument"
},
{
"api_name": "gym.make",
"line_number": 13,
"usage_type": "call"
},
{
"api_name... |
511792497 | # -*- coding:utf-8 -*-
'''
#=====================================================
# FileName: tweet163_crawler.py
# Desc: download html pages from 163 tweet and save to local files
# Author: DianaCody
# Version: 1.0
# Since: 2014-09-27 15:20:21
#===========================================... | null | Python/week1_basic/Crawler.py | Crawler.py | py | 2,005 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "urllib.request",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "chardet.detect",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "re.compile"... |
154141134 | #!/usr/bin/python3
import ast
import socket
import signal
import requests
import argparse
import base64
from base64 import b64decode, b64encode
from Crypto.Cipher import AES
from contextlib import contextmanager
@contextmanager
def ignored(*exceptions):
try:
yield
except exceptions:
pass
def... | null | zabivaka/fix_cleaned/12/Replay/1136_break95(U)/mitm.py | mitm.py | py | 2,356 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "contextlib.contextmanager",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "requests.post",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "socket.SHUT_RDWR",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "socket.... |
541466778 | from django.shortcuts import render, redirect
from .models import Work, Task, Employee
from .forms import AddForm
from django.contrib import messages
# Create your views here.
def work_view(request):
if not request.user.is_authenticated():
return redirect('home')
task_list = Task.objects.all()
em... | null | work/views.py | views.py | py | 1,195 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.shortcuts.redirect",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "models.Task.objects.all",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "models.Task.objects",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_na... |
249150554 | # -*- coding: utf-8 -*-
# USAGE: spark-submit --master yarn-client --num-executors 10 sentiment_analysis_cluster.py /user/llbui/a2 /user/llbui/a2-test
# First argument is a directory containing train dataset
# Second argument is a directory containing test dataset
from pyspark import SparkConf, SparkContext
from pyspa... | null | Assignment_2/sentiment_analysis_cluster.py | sentiment_analysis_cluster.py | py | 8,051 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pyspark.ml.Estimator",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "pyspark.ml.param.shared.HasInputCol",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "pyspark.ml.param.shared.HasPredictionCol",
"line_number": 22,
"usage_type": "nam... |
494585214 | #!/usr/bin/env python
# -*- encoding: utf-8
import os
import click
import tqdm
from sinkingship import find_all_metadata_files, save_post_media_files
@click.command(
help="Save all the media files for your Tumblr posts/likes."
)
@click.option(
"--metadata", default="tumblr",
help="Directory where your ... | null | save_media_files.py | save_media_files.py | py | 591 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sinkingship.find_all_metadata_files",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sinkingship.save_post_media_files",
"line_number": 22,
"usage_type": "call"
},
{
"a... |
224923609 | import pytest
from helpers.computer import Computer, ParameterMode, build_dictionary, parse_opcode
from helpers.input import intcode_file
from collections import deque
from typing import List, Tuple
MEMORY_TEST_DATA = [
([1,9,10,3,2,3,11,0,99,30,40,50], [3500,9,10,70,2,3,11,0,99,30,40,50]),
([1,0,0,0,99], [2... | null | 2019/tests/test_computer.py | test_computer.py | py | 3,271 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "helpers.computer.ParameterMode.POSITION",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "helpers.computer.ParameterMode",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "helpers.computer.ParameterMode.IMMEDIATE",
"line_number": 33,
... |
189286759 | from PyQt5.QtCore import QThreadPool, QThread
from PyQt5.QtGui import QColor
from PyQt5.QtWidgets import QMessageBox
from PyQt5 import QtWidgets
from scrapegui import Ui_MainWindow
from worker import Worker
class MainWindowUI(QtWidgets.QMainWindow):
def __init__(self):
super(MainWindowUI, self).__init__()... | null | src/main/python/WebScrapy_DOC/appinit.py | appinit.py | py | 5,716 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "scrapegui.Ui_MainWindow",
"line_number": 12,
"usage_type": "call"
},
{
"api_name":... |
581397248 | # -*- coding: utf-8 -*-
"""
Created on: 11-09-2018
@author: jason
A collection of utility functions for use in data science projects
"""
import os
import requests
import errno
import csv
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import datetime as dt
from sklearn.m... | null | src/utils/utilities.py | utilities.py | py | 28,585 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.exists",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
"line_n... |
438686981 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""simulator.py - main driver program of cpu-cache-simulator.
See README.md or https://github.com/nicholasadamou/cpu-cache-simulator
for more information.
Copyright (C) Nicholas Adamou 2019
cpu-cache-simulator is released under the Apache 2.0 license. See
LICENSE for the f... | null | simulator.py | simulator.py | py | 10,285 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "memory.Memory",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "cache.Cache",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "util.hex_str",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "util.bin_str",
"line_numbe... |
347081100 | import cv2
import numpy as np
img = cv2.imread('Lane.jpg',1)
gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
gray=cv2.GaussianBlur(gray,(3,3),3)
edges = cv2.Canny(gray,150,150*3,apertureSize = 3)
cv2.imshow('Lane Edges', edges)
minLineLength = 0
maxLineGap = 0
lines = cv2.HoughLinesP(edges,1,np.pi/90,40,minLineLength,... | null | Lab4/Ex5/Ex5.py | Ex5.py | py | 495 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.imread",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "cv2.GaussianBlur",
"... |
259364227 | #! /usr/bin/python
# -*- coding: utf-8 -*-
import os
import sys
import argparse
import re
def get_args():
parser = argparse.ArgumentParser(description="Split DBG2OLC_Consensus_info.txt into N files or N seq. per file")
parser.add_argument('-i', '-query', '--input_file', metavar='INPUT',
... | null | DBG2OLC/splitDBG2OLC_consensusID.py | splitDBG2OLC_consensusID.py | py | 5,864 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.stderr.write",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "sys.stderr",
"line_number": 83,
"usage_type": "attribute"
},
{
"api_name": "sys.stdout.w... |
544202420 | import spotipy
import spotipy.util as util
from sklearn.externals import joblib
import pandas as pd
import os, sys
import config
from ast import literal_eval
scope = 'playlist-modify-private playlist-read-private user-library-read'
song_info = pd.read_csv(os.getcwd() + '/song_info_saved2.csv') # all saved songs
all_g... | null | analyze_songs.py | analyze_songs.py | py | 5,465 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_numbe... |
153683271 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('branch_change', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='userpost',
name... | null | branch_change_webapp/branch_change/migrations/0002_auto_20151024_1744.py | 0002_auto_20151024_1744.py | py | 471 | 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.AlterField",
"line_number": 14,
"usage_type": "call"
},
{... |
103874475 | import os
import textwrap
from binascii import hexlify
from django.http import JsonResponse, HttpResponse
from dotenv import read_dotenv as rd
def read_dotenv(path=None):
if not os.environ.get('DOCKER') == "yes":
rd(path)
class PrettyJsonResponse(JsonResponse):
def __init__(self, data, rate_limit... | null | backend/uclapi/common/helpers.py | helpers.py | py | 1,711 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.environ.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "dotenv.read_dotenv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.http.JsonRes... |
651942922 | import re
import os
import numpy
import urllib
from pyon.util.log import log
from coverage_model.coverage import SimplexCoverage
from pydap.model import DatasetType,BaseType, GridType, StructureType
from pydap.handlers.lib import BaseHandler
class Handler(BaseHandler):
#extensions = re.compile(r"^.*\.cov", re.IG... | null | ion/util/pydap/handlers/coverage/coverage_handler.py | coverage_handler.py | py | 3,795 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pydap.handlers.lib.BaseHandler",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "re.compile",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "re.IGNORECASE",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.... |
166826161 | import importlib
import sys
import textwrap
from functools import wraps
import boto3
import moto.s3.models as s3model
import pytest
from moto import mock_s3
from dvc.fs.s3 import S3FileSystem
from dvc.objects.db.base import ObjectDB
from tests.remotes import S3
# from https://github.com/spulec/moto/blob/v1.3.5/tests... | null | tests/func/test_s3.py | test_s3.py | py | 6,006 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "moto.s3.models.UPLOAD_PART_MIN_SIZE",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "moto.s3.models",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "moto.s3.models.UPLOAD_PART_MIN_SIZE",
"line_number": 28,
"usage_type": "attribute... |
179128651 | import torch
import torch.nn as nn
import sklearn.datasets
k = 4
epoch = 500
size = 150
class Net(nn.Module):
def __init__(self):
super(Net, self).__init__()
self.f = nn.Linear(k, k, bias=True)
self.f2 = nn.Linear(k, k, bias=True)
self.f3 = nn.Linear(k, k, bias=True)
self.... | null | Practice.py | Practice.py | py | 2,060 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.nn.Module",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
51405923 | from __future__ import print_function
import sublime, sublime_plugin, re
from collections import defaultdict
bases = {'binary' : 2,'octal' : 8,'decimal' : 10, 'hexadecimal' : 16}
#Thanks to Ned Batchelder for this function
#http://nedbatchelder.com/blog/200712/human_sorting.html
def sort_naturel(liste):
convertio... | null | sortby.py | sortby.py | py | 5,402 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.split",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sublime.version",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sublime.Region",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "sublime_plugin.TextCommand",
... |
141410751 | if __name__ == '__main__':
import sys
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
parser = ArgumentParser(prog='PyBROCT.viewer', description='PyBROCT Viewer', formatter_class=ArgumentDefaultsHelpFormatter)
parser.add_argument('path', help='path to BROCT file')
args = ... | null | PyBROCT/viewer/__main__.py | __main__.py | py | 1,247 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentDefaultsHelpFormatter",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"ap... |
69446551 | from PySide2.QtWidgets import QTableWidget, QTableWidgetItem, QAbstractItemView, QMenu, QHeaderView
from PySide2.QtCore import Qt, QItemSelectionModel
from typing import Dict
from binsync.data import Struct
from ...controller import BinsyncController
class QUserItem:
def __init__(self, struct_name, size, user, la... | null | plugins/binja_binsync/ui/info_tables/struct_info_table.py | struct_info_table.py | py | 4,060 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PySide2.QtWidgets.QTableWidgetItem",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "PySide2.QtWidgets.QTableWidgetItem",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "PySide2.QtWidgets.QTableWidgetItem",
"line_number": 20,
"usage_type... |
337469906 | #!/usr/bin/env python3
import datetime
import json
import os
import pymongo
from logger import Logger
conn = pymongo.MongoClient("127.0.0.1", 27017)
db = conn.weather # 连接库
l = Logger('savejson.log')
trace = l.trace
ll = l.getlog()
def main():
with open(os.path.join(os.path.dirname(os.path.abspath(__file__))... | null | savejson.py | savejson.py | py | 896 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logger.Logger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_nu... |
641424765 | import os
import argparse
import glob
import itertools
import numpy as np
import cv2
def take(n, iterable):
"Return first n items of the iterable as a list"
return list(itertools.islice(iterable, n))
def main():
parser = argparse.ArgumentParser()
parser.add_argument("indir")
parser.add_argument("outdir... | null | scripts/convert_to_bgr.py | convert_to_bgr.py | py | 1,054 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "itertools.islice",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
602534780 | # -*- coding: utf-8 -*-
"""
Created on Wed Jul 26 14:36:16 2017
@author: claire
"""
import mne
import numpy as np
import os
from sklearn.preprocessing import LabelEncoder
from braindecode.datautil.signal_target import SignalAndTarget
exclude = [7]
all_epochs=list()
# We start by exploring the frequence content of... | null | Old/braindecode_amplitude_perturbation_viz.py | braindecode_amplitude_perturbation_viz.py | py | 6,491 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 2... |
636078746 | # -*- comding:utf-8 -*-
## 定时查看日志,然后计算日志中的数据
import random,time,datetime
def source(seconds = 1):
while True:
yield {'datetime':datetime.datetime.now(datetime.timezone(datetime.timedelta(hours=8))),
'value':random.randint(1,100)}
time.sleep(seconds)
s = source()
# items = [next(s) for ... | null | mag363/Completed/200829_windowstime.py | 200829_windowstime.py | py | 2,023 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.datetime.now",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "datetime.timezone",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "datetime.... |
421421448 | import pygame
from pygame.color import THECOLORS
import pdb
import pymunk
from pymunk.vec2d import Vec2d
from pymunk.pygame_util import from_pygame, to_pygame
from pymunk.pygame_util import DrawOptions as draw
import pymunk.util as u
import random
import math
import numpy as np
from MakeItLearn import *
width = 600 # ... | null | robot_learning_v01-class01/exercise1/NN-Based-Collision-Avoidance_Incomplete/code1/ExploreAndCollect.py | ExploreAndCollect.py | py | 11,612 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pygame.init",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "pygame.time.C... |
13954352 | import asyncio
async def process():
print('first')
await asyncio.sleep(1)
print('second')
return 'first to second process result'
async def main():
task_1 = asyncio.create_task(process(), name='task_1')
task_2 = asyncio.ensure_future(process())
result = await asyncio.gat... | null | asyncio/05_1_task_basics.py | 05_1_task_basics.py | py | 558 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "asyncio.sleep",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "asyncio.create_task",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "asyncio.ensure_future",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "asyncio.gather... |
254609901 | # Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# 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 applica... | null | tensorflow/python/data/experimental/ops/data_service_ops.py | data_service_ops.py | py | 11,138 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tensorflow.python.data.ops.dataset_ops.DatasetSource",
"line_number": 47,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.python.data.ops.dataset_ops",
"line_number": 47,
"usage_type": "name"
},
{
"api_name": "tensorflow.python.data.ops.dataset_ops.AUTOTUNE"... |
59317178 | import logging
import math
import gcsfs
import zarr
from smgdatatools.collector.lib import Collector
from smgdatatools.model.model import Store, Variable, Attribute, Dimension, ChunkShape, Scale, Chunk, \
GlobalAttribute, Compressor, CompressorProperty
class ZarrCollector(Collector):
def __init__(self, drs=... | null | smgdatatools/collector/zarr.py | zarr.py | py | 4,074 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "smgdatatools.collector.lib.Collector",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "logging.warning",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "gcsfs.GCSFileSystem",
"line_number": 19,
"usage_type": "call"
},
{
"api_name... |
544264833 | import requests
from bs4 import BeautifulSoup
def get_zum_realtime_keywords():
url = "https://zum.com/"
res = requests.get(url)
html = res.text
soup = BeautifulSoup(html, "html.parser")
tag_list = soup.select(".rank_list .keyword")
keyword_list = []
for tag in tag_list:
if tag.tex... | null | blog/tasks.py | tasks.py | py | 409 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 9,
"usage_type": "call"
}
] |
67093034 | # GCD number
# 31 program
# write a program that returns GCD
import pytest
def gcd(x,y):
i = 0
res = 1
if x < y:
i = x
else:
i = y
while res != 0:
if x%i == 0 and y%i == 0:
res = 0
break
else:
i-=1
return i
def main():
x = int(raw_input("Enter input for x to find the GCD : "))
y = int(ra... | null | puzzels/31GCD.py | 31GCD.py | py | 772 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pytest.mark.parametrize",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 31,
"usage_type": "attribute"
}
] |
273506325 | import torch
def save_snapshot(path, critic, target_critic, critic_optim):
# print('adding checkpoints...')
checkpoint_path = path + 'model.pth.tar'
torch.save(
{
'critic': critic.state_dict(),
'target_critic': target_critic.state_dict(),
'critic_optimizer': critic_optim... | null | day2/dqn/utils.py | utils.py | py | 970 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.save",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.load",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.device",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.load",
"line_number": 29,... |
89073887 | from django.shortcuts import render, get_object_or_404
from django.http import HttpResponseRedirect, HttpResponse
from django.contrib.auth.decorators import login_required
from django.urls import reverse
from .models import Problem
from accounts.models import SubmittedHistory
from datetime import datetime
#@login_req... | null | web/ctfplt/problems/views.py | views.py | py | 3,047 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.shortcuts.render",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "models.Problem.objects.all",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "models.Problem.objects",
"line_number": 12,
"usage_type": "attribute"
},
{
"ap... |
396308235 | # encoding: utf-8
import os
import autopep8
import subprocess
import multiprocessing
from collections import OrderedDict
errors = OrderedDict([
("E101", "Reindent all lines."),
("E11", "Fix indentation."),
("E121", "Fix indentation to be a multiple of four."),
("E122", "Add absent indentation for han... | null | autocommitautopep8.py | autocommitautopep8.py | py | 6,541 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.OrderedDict",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 97,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numb... |
347872992 | from sqlalchemy import Column, Integer, String, Float
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class AirplaneSpec(Base):
__tablename__ = 'airplane_spec'
target_type_id = Column(Integer, comment='Идентификатор типа цели',primary_key=True)
airplane_type = Column(In... | null | airplane_spec.py | airplane_spec.py | py | 6,551 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sqlalchemy.ext.declarative.declarative_base",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integer",
"line_number": 10,
"usage_type": "argument"
},
{
... |
406970259 | import tkinter as tk
import serial
import time
from numpy import *
from matplotlib.backends.backend_tkagg import (
FigureCanvasTkAgg, NavigationToolbar2Tk)
from matplotlib.figure import Figure
serialcomm = serial.Serial('Replace with PORT # (i.e. COM6)', 115200)
serialcomm.bytesize = serial.EIGHTBITS
serialcomm.pa... | null | 6RRobotArm/PublicInterface.py | PublicInterface.py | py | 43,061 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "serial.Serial",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "serial.EIGHTBITS",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "serial.PARITY_NONE",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "serial.STO... |
561062848 | #
# Ghost_evade w/ standard DQN at work.
#
#
import gym
import numpy as np
import time as time
import tensorflow as tf
import tf_util_rob as U
import models as models
import build_graph_rob3 as build_graph
from replay_buffer import ReplayBuffer, PrioritizedReplayBuffer
from schedules import LinearSchedule
import matplo... | null | ghost_evade3.py | ghost_evade3.py | py | 6,375 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "envs.testrob3_standalone.TestRob3Env",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "envs.testrob3_standalone",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "schedules.LinearSchedule",
"line_number": 49,
"usage_type": "call"
},
{... |
356528538 | # https://programmers.co.kr/learn/courses/30/lessons/49189
# 처음 다익스트라 사용했는데 뭐때문인지 채점에서 틀림; 그래서 일반 BFS 를 사용함
# (아마 graph initialize 하는 곳에서 틀린게 아닌가 싶다)
# cost 계산하는거 조금 주의 할 필요있음
from collections import deque
def solution(n, edge):
answer = 0
INF = int(1e9)
graph = [[] for i in range(n+1)]
distance = [IN... | null | Programmers/farthest_node.py | farthest_node.py | py | 1,065 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.deque",
"line_number": 20,
"usage_type": "call"
}
] |
292309466 | import logging
from absl import flags
import json
from perfkitbenchmarker import configs
from perfkitbenchmarker.linux_packages.jmeter import run_jmeter
from perfkitbenchmarker import errors
flags.DEFINE_integer('jmeter_concurrent_users_2', 2,
'number of concurrent users to generate traffic')
f... | null | perfkitbenchmarker/linux_benchmarks/jmeter_benchmark.py | jmeter_benchmark.py | py | 1,949 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "absl.flags.DEFINE_integer",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "absl.flags",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "absl.flags.DEFINE_string",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "absl.fl... |
206357861 | import cv2
import numpy as np
from getdirs import onlydirs, getimgs, iscoll,timeprinter,loopcounter
from textspliter import splitted
from PIL import ImageFont, ImageDraw, Image
def boxkr(text,size, box, color=(255,0,255) ,center=False):
#fontpath = "ridibatang.ttf"
fontpath = 'NotoSerifKR-Medium.otf'
mul... | null | blendalpha.py | blendalpha.py | py | 6,914 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.ones",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image.fromarray",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line... |
358625241 | import pygame
import sys
import math
from button import Button
pygame.init()
class Tony(pygame.sprite.Sprite):
def __init__(self):
super().__init__()
self.x = 1095
self.y = 460
self.image = pygame.image.load('resources/tony.png')
self.rect = pygame.Rect(self.x, self.y, 30,... | null | tony.py | tony.py | py | 1,837 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pygame.init",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.sprite",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"li... |
332182082 | from django.db import models
from imagekit.models import ProcessedImageField
# Create your models here.
class Post(models.Model):
title = models.TextField(blank=True, null=True)
image = ProcessedImageField(
upload_to='static/images/posts',
format='JPEG',
options={'quality': 100},
... | null | Gallery/models.py | models.py | py | 455 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.models.Model",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.db.models.TextField",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "... |
377921280 | from sikuli import *
import logging
import myTools
import names_Init
import backup_Data
#---------------------------------------------------#
def Open_SlipList():
#---------------------------------------------------#
# open slip list and verify it's open
myTools.getFocus()
type("m",KeyModifier.CTRL)
t... | null | slips_Create.sikuli/slips_Create.py | slips_Create.py | py | 10,287 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "myTools.getFocus",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.debug",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "myTools.sectionEndTimeStamp",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "myTools.pr... |
281328906 | import argparse
import json
parser = argparse.ArgumentParser(prefix_chars='-')
parser.add_argument('--file',required=True,type=argparse.FileType(mode='r', bufsize=-1, encoding=None),help='Path to cpptools file')
parser.add_argument('-D',action='append',help='Preprocessor defines', default=[])
parser.add_argument('-i',a... | null | cmake/utils/gen-cpptools_file.py | gen-cpptools_file.py | py | 2,007 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "argparse.FileType",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "json.loads",
"... |
456759624 | """ Serializer for Call Record """
from django.utils.translation import ugettext as _
from rest_framework import serializers
from app.call import models
from app.call.models import choices
# pylint: disable=too-few-public-methods
class CallRecordSerializer(serializers.ModelSerializer):
""" Serializer for Call Re... | null | olist/app/call/api/v1/call_record/serializer.py | serializer.py | py | 1,472 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.ChoiceField",
"line_number": 12,
"u... |
216833121 | """
prep_headers.py
Changes the headers of a contact note input csv to Salesforce-ready
field names. Saves the changes back out as 'prepped_<input filename>' in the
working directory.
Converts the relevant headers (see salesforce_fields.contact_note).
"""
import argparse
import csv
from os import path
from header_m... | null | prep_headers.py | prep_headers.py | py | 1,644 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.split",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "csv.DictReader",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "header_mappings.HEADER_MAPPINGS.... |
250654972 | #!python
import os.path
from time import time
from subprocess import run, PIPE
from sys import stdout
import logging
_here = os.path.dirname(os.path.abspath(__file__))
_logger = logging.getLogger(__name__)
def main():
logging.basicConfig(level=logging.INFO, format='%(message)s')
venv_path = os.path.join(_he... | null | scripts/build_virtual_environment.py | build_virtual_environment.py | py | 1,485 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.path.dirname",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "os.path.path.abspath",
... |
318343724 | import os
from flask import Flask
from jinja2 import FileSystemLoader
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.login import LoginManager
from flask.ext.mail import Mail
from flask.ext.assets import Environment, Bundle
from config import ADMINS, MAIL_SERVER, MAIL_PORT, MAIL_USERNAME, \
MAIL_PASSWOR... | null | app/__init__.py | __init__.py | py | 3,550 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line... |
517195608 | import requests
from MxForum.apps.users.urls import SMS_URI, REGISTER_URI
import json
web_url = "http://127.0.0.1:8888"
def test_sms():
url = web_url + SMS_URI
data = {
"mobile": "18565607772"
}
res = requests.post(url, json=data)
print(json.loads(res.text))
def test_register():
url... | null | tornado_overview/MxForum/apps/users/test.py | test.py | py | 592 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "MxForum.apps.users.urls.SMS_URI",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "requests.post",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "MxForum.apps.... |
230998890 | from typing import List
'''
https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/
Input: numbers = [2,7,11,15], target = 9
Output: [1,2]
Explanation: The sum of 2 and 7 is 9. Therefore index1 = 1, index2 = 2.
앞 문제와의 차이점은 정렬이 되어있냐? 안되어있냐?
'''
class Solution:
def twoSum(self, numbers: List[int], target... | null | archive-len/leetcode/ch18-binary-search/p68-two-sum-ii-input-array-is-sorted.py | p68-two-sum-ii-input-array-is-sorted.py | py | 923 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.List",
"line_number": 15,
"usage_type": "name"
}
] |
196797480 | import os
import os.path
from datetime import datetime
from unittest import TestCase
import cate.core.ds as io
from cate.conf import get_data_stores_path
from cate.core.ds import DATA_STORE_REGISTRY
from cate.ds.esa_cci_ftp import FileSetDataStore, set_default_data_store
class EsaCciFtpTest(TestCase):
def test_s... | null | tests/ds/test_esa_cci_ftp.py | test_esa_cci_ftp.py | py | 7,827 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "unittest.TestCase",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "cate.ds.esa_cci_ftp.set_default_data_store",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cate.conf.get_data_stores_path",
"line_number": 15,
"usage_type": "call"
}... |
505830637 | from pathlib import Path
from otree.models_concrete import RoomToSession
from otree.common import add_params_to_url, make_hash, validate_alphanumeric
from otree import settings
from otree.database import db, NoResultFound
from collections import defaultdict
from typing import Dict
class BaseRoom:
use_secure_urls ... | null | otree/room.py | room.py | py | 3,624 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "otree.common.validate_alphanumeric",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "otree.models_concrete.RoomToSession.objects_get",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "otree.models_concrete.RoomToSession",
"line_number": 32,
... |
357025661 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('clients', '0006_auto_20150612_1933'),
]
operations = [
migrations.AddF... | null | clients/migrations/0007_auto_20150612_2337.py | 0007_auto_20150612_2337.py | py | 833 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AddField",
"line_number": 16,
"usage_type": "call"
},
{
... |
448275370 | import requests
from django.shortcuts import render, redirect
from yandex_checkout import Payment, Configuration, WebhookNotification
import json
json1 = {
"type": "notification",
"event": "payment.succeeded",
"object": {
"id": "26115c13-000f-5000-9000-1ad291d11fb8",
"status": "succeeded",
"paid": ... | null | payment/tests.py | tests.py | py | 1,728 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.post",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 63,
"usage_type": "call"
}
] |
633521016 | """
Translates items from the testplan into the actual programming language.
"""
import logging
from dataclasses import dataclass
from pathlib import Path
from typing import List, Union, Tuple, Optional, Set, Callable
from mako import exceptions
from .config import TemplateType
from .templates import find_and_write_t... | null | judge/src/tested/languages/generator.py | generator.py | py | 19,848 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "serialisation.Statement",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "typing.Call... |
224405723 | #!/usr/bin/env python
"""
Make a png/pdf of a single frame.
"""
import matplotlib
matplotlib.use('Agg') #for batch jobs!!!
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import matplotlib.colors as colors
#from matplotlib import cm
import matplotlib.ticker as ticker
impo... | null | make_image.py | make_image.py | py | 3,168 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.use",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.rc",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "colloid_plot_lib... |
212477964 | """
Utility used by the Network class to actually train.
Based on:
https://github.com/fchollet/keras/blob/master/examples/mnist_mlp.py
"""
from keras.datasets import mnist, cifar10
from keras.models import Sequential
from keras.layers import Dense, Dropout
from keras.utils.np_utils import to_categorical
from kera... | null | GA/train.py | train.py | py | 5,846 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "keras.callbacks.EarlyStopping",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "keras.datasets.cifar10.load_data",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "keras.datasets.cifar10",
"line_number": 29,
"usage_type": "name"
},
{
... |
413623398 | from base import Base
from globals import HouseModes, PEOPLE
import globals
import datetime
from datetime import timedelta, date
import json
class Todoist(Base):
def initialize(self) -> None:
"""Initialize."""
super().initialize()
self.project = self.args['project']
... | null | appdaemon/apps/todoist/todoist.py | todoist.py | py | 1,623 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "base.Base",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "datetime.date.today",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "datetime.timedelta",
"... |
82903043 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import cgi
import json
import urllib
import datetime
from services.exceptions import *
from google.appengine.ext import db
from services.models.coordinatorFormModel import *
from services.querys.query import *
#---------------------------------------------------... | null | services/querys/coordinatorFormQuery.py | coordinatorFormQuery.py | py | 3,232 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "google.appengine.ext.db.GqlQuery",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "google.appengine.ext.db",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "google.appengine.ext.db.GqlQuery",
"line_number": 30,
"usage_type": "call"
},
... |
121483751 | import argparse
def test_model(clean_data, fit_model):
import numpy as np
import pandas as pd
import joblib
from tensorflow import keras
from keras.models import load_model
model = load_model(fit_model)
data = joblib.load(clean_data)
X_train = data['X_train']
X_test = data['X_test']
X_pred_train = m... | null | Condition Monitoring/pipeline components/test/test.py | test.py | py | 1,464 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "keras.models.load_model",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "joblib.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
... |
496100761 | # -*- coding: utf-8 -*-
"""
Model that optimizes the revenues of a generic electricity storage at
a given power market by purchasing and selling energy
Excercises:
1. Run the model and see what's happening by looking at the plotted results
2. Write down the mathematical description of the model ... | null | 03_Pyomo_Intro/storage_dispatch/storage_dispatch.py | storage_dispatch.py | py | 5,330 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.style.use",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "matplotlib.style",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_na... |
567324439 | """feature based tracking by using ORB(Oriented FAST and Rotated BRIEF) for detectors and compute keypoints, discriptors
and FLANN(Fast Library Approximate Nearest Neighbour) for matchers give the template iamge of the object to find at line 19
and run the script to track the object here we are tracking fish """
... | null | Featurebased-tracking/Realtime-tracking/Realtime-tracking-FLANN-ORB/realtime_orb_flann.py | realtime_orb_flann.py | py | 4,218 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.ORB_create",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.FlannBasedMatcher",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
... |
444893729 | #!/usr/bin/python
import os, sys
from scripts.flownet import FlowNet
my_dir = os.path.dirname(os.path.realpath(__file__))
os.chdir(my_dir + '/..')
if len(sys.argv)-1 != 1:
print("Use this tool to train FlowNet using the train.prototxt\n"
"Usage for FlowNetS or FlowNetC:\n"
" ./train_flowne... | null | flownet-release/models/flownet/train_flownet.py | train_flownet.py | py | 647 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.dirname",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_numbe... |
307591223 | """
models for membership database
"""
from django.conf import settings
from django.db import models
class Member(models.Model):
member_id = models.CharField(
max_length=255,
unique=True,
help_text="Membership ID")
nickname = models.CharField(
max_length=255,
blank=T... | null | hackbureau/models.py | models.py | py | 2,869 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.models.Model",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": ... |
394910465 | import pygame, threading,math, random
from pygame.locals import *
from OpenGL.GL import *
from OpenGL.GLU import *
pygame.init()
dimensions=(640,480)
window=pygame.display.set_mode(dimensions,DOUBLEBUF|OPENGL)
running=True
size =3
buttonfontsize=1
buttontext=pygame.font.SysFont('arial',buttonfontsize)
turnangle=0
rubi... | null | rubikscubeopengl.py | rubikscubeopengl.py | py | 14,812 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pygame.init",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pygame.font.SysF... |
88928533 | import os
import pytest
from sqlalchemy.ext.asyncio import AsyncEngine, AsyncSession
from virtool.config import get_config_from_app
import virtool.utils
from virtool.uploads.models import SQLUpload, UploadType
from virtool_core.models.enums import Permission
@pytest.fixture
def files(test_files_path):
return {"... | null | tests/uploads/test_api.py | test_api.py | py | 8,703 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pytest.fixture",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sqlalchemy.ext.asyncio.AsyncEngine",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "virtool_core.models.enums.Permission.upload_file",
"line_number": 35,
"usage_type"... |
504118587 | from sklearn.preprocessing import StandardScaler
from sklearn import ensemble
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_squared_error
from sklearn.model_selection import learning_curve
from sklearn.model_selection import validation_curve
from sklearn.metrics import mean_squar... | null | tree.py | tree.py | py | 5,398 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.StandardScaler",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sklearn.decomposition.PCA",
"line_number": 19,
"usage_type": "call"
},
{... |
516590660 | import pytest
import arcade
from arcade.gl import geometry
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600
@pytest.fixture(scope="module")
def ctx():
window = arcade.Window(SCREEN_WIDTH, SCREEN_HEIGHT, "Test OpenGL")
yield window.ctx
window.close()
def test_create(ctx):
program = ctx.program(
vertex... | null | tests/unit2/test_opengl_query.py | test_opengl_query.py | py | 896 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "arcade.Window",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "arcade.gl.geometry.quad_2d_fs",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "arcade.gl.g... |
372023054 | from typing import Tuple
import torch
import torch.utils.data
from torchvision import transforms, datasets
from tqdm import tqdm
from utils.constants import DATA_DIR
from utils.normalize import NormalizeFromDataset
class DataSubset(torch.utils.data.TensorDataset):
def __init__(self, dataset_cls, labels_keep: T... | null | utils/datasubset.py | datasubset.py | py | 2,400 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.utils",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "typing.Tuple",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.Compose",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torchvis... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.