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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
467525212 | from rest_framework import viewsets, mixins
from opal.core.views import _get_request_data, _build_json_response
from pathways import Pathway
from rest_framework.permissions import IsAuthenticated
class PathwayApi(viewsets.ViewSet):
permission_classes = (IsAuthenticated,)
def dispatch(self, *args, **kwargs):
... | null | pathway/api.py | api.py | py | 1,479 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rest_framework.viewsets.ViewSet",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.viewsets",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "rest_framework.permissions.IsAuthenticated",
"line_number": 8,
"usage_type": "... |
345582379 | import json
import boto3
import os
import time
import base64
import zlib
import os
from boto3.dynamodb.conditions import Key, Attr
import logging
import smtoolkit as vcsm
import base64
# # Set logging
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
def lambda_handler(event, context):
try:
re... | null | workflow-lambda/responsemanager.py | responsemanager.py | py | 10,521 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "json.dumps",
... |
169555248 | # This is to write to logic for the game flow
# Version 2, simplify the game to fixed board 6 * 7, and to connect 4 as the classic
from connect_n_logic_classic import *
import itertools
# python3 -i connect_n_game.py
def start_game():
# Game Header
print("\nWelcome to play Connect N!!!\n")
print("Player... | null | QuickProjects/ConnectN/Classic/connect_n_game_classic.py | connect_n_game_classic.py | py | 2,225 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "itertools.cycle",
"line_number": 24,
"usage_type": "call"
}
] |
385801756 | #!/usr/bin/env python
import sys
from PyQt5 import QtWidgets
def arayuz():
object = QtWidgets.QApplication(sys.argv)
window = QtWidgets.QWidget()
window.setWindowTitle("Arayüz") # Arayüzü isimlendirme.
window.setGeometry(300,300,600,480) # Arayüzün konumu ve çözünürlüğünü belirleme.
label = Qt... | null | QLabel.py | QLabel.py | py | 552 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "PyQt5.QtWidgets.QApplication",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "sys.argv",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidge... |
307793006 | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch_geometric.nn as pyg_nn
import torch_geometric.utils as pyg_utils
from rlkit.torch.networks import Mlp
from network_utils import get_activation, build_conv_model
class GNNLSTMNet(torch.nn.Module):
def __init__(self... | null | tests/Traffic/gnn_lstm_net.py | gnn_lstm_net.py | py | 3,876 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.nn",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "torch.sum",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "torch.abs",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "torch.cat",
"line_number": 40,
... |
173938012 | from django.urls import path
from .views import RegisterView, GetEmailCodeView, LoginView, LogoutView, ForgetPwdView, UserCenterIndexView,ModifyPwdView
from .views import ModifyEmailView,AddressListView,AddAddressView,DeleteAddressView,WalletView,CartView,ChangeCartView
from .views import DeteleCartView,UnpaidOrderVie... | null | apps/users/urls.py | urls.py | py | 2,209 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.urls.path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "views.RegisterView.as_view",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "views.RegisterView",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django... |
619993764 | import os
import time
import tensorflow as tf
import pandas as pd
import matplotlib.pyplot as plt
from tensorflow.keras.models import save_model
from nets.conv_net import ConvModel
from utils.data_generator import train_val_generator
from utils.image_plot import plot_images
os.environ["CUDA_DEVICE_ORDER"] = ... | null | src/train.py | train.py | py | 3,934 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "utils.data_generator.train_val_generator",
"line_number": 14,
"usage_type": "call"
},
{
"api_name... |
652930074 | import os
import json
import argparse
import numpy as np
import tensorflow as tf
import midi_encoder as me
from train_generative import build_generative_model
from train_classifier import preprocess_sentence, get_states_from_layers
GENERATED_DIR = './generated'
def update_states_for_layers(model, layer_idxs, h_stat... | null | midi_generator.py | midi_generator.py | py | 5,465 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tensorflow.Variable",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "tensorflow.Variable",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "train_classifier.get_states_from_layers",
"line_number": 23,
"usage_type": "call"
},
{
"a... |
243478637 | from django.shortcuts import render, get_object_or_404, redirect
from .cart import Cart
from shop.models import Product
from .forms import CartAddForm
from django.views.decorators.http import require_POST
from django.contrib import messages
def detail(request):
cart = Cart(request)
return render(request, 'car... | null | cart/views.py | views.py | py | 986 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cart.Cart",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cart.Cart",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.get_obje... |
227308379 | # INSERT COPYRIGHT HERE
# python modules
import matplotlib.pyplot as plt
import tensorflow as tf
from ta.utils import dropna
import pyfinancialdata
from datetime import datetime as dt
# local modules
from market import EquityData
from models.lstm import split, split_multivariate, show_plot
from utils import plot_tra... | null | multivariate_single_forecast.py | multivariate_single_forecast.py | py | 3,599 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tensorflow.random.set_seed",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tensorflow.random",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.keras.models.Sequential",
"line_number": 27,
"usage_type": "call"
},
{
... |
263438665 |
"""
Sample Python/Pygame Programs
Simpson College Computer Science
http://programarcadegames.com/
http://simpson.edu/computer-science/
"""
import pygame
from Player import *
from Level import *
import random
# Global constants
# Colors
# BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
GREEN = (0, 255, 0)
RED = (255... | null | Project/Rebecca/PlatformerDriver.py | PlatformerDriver.py | py | 4,735 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pygame.init",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "pygame.displa... |
565813661 | from nonebot import CommandSession, on_command
from nonebot import on_natural_language, NLPSession, IntentCommand
from jieba import posseg
import re
from .team_homework_spider import TeamHomework
from data import init_database
from pcr.plugins.priconne.chara import Chara, gen_team_pic
from hoshino.util import pic2b64... | null | pcr/plugins/bigfun_info/__init__.py | __init__.py | py | 6,808 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "nonebot.CommandSession",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "re.search",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "data.init_database.get_connection",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "da... |
362859222 | from pathlib import Path
from random import randint
from typing import Union
from io import BytesIO
from base64 import b64encode
from functools import partial
from PIL import Image
from imghdr import what
class Image_Handler:
"""把图像内容进行反和谐处理,并且支持存为base64编码或直接存入磁盘
"""
def __init__(self, content: Union[s... | null | src/utils/antiShielding.py | antiShielding.py | py | 3,513 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "typing.Union",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "io.BytesIO",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "io.BytesIO",
"line_number": ... |
546131843 | import pdbfixer
import tempfile
from io import StringIO
from simtk.openmm import app, LangevinIntegrator, CustomExternalForce
from simtk import unit
ENERGY = unit.kilocalories_per_mole
LENGTH = unit.angstroms
spring_unit = ENERGY / (LENGTH ** 2)
def openmm_refine(pdb_txt, CDR_definitions, spring_constant=10):
w... | null | ABlooper/openmm_refine.py | openmm_refine.py | py | 2,319 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "simtk.unit.kilocalories_per_mole",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "simtk.unit",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "simtk.unit.angstroms",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name"... |
188538471 | import logging
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s - %(levelname)s: %(message)s',
filename='data/logging.log',
filemode='a')
# 配置logger并设置等级为DEBUG
logger = logging.getLogger('logging_write')
logger.debug('Here has a bug')
... | null | PyhtonDataScienceHandbook/logging_write.py | logging_write.py | py | 341 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.basicConfig",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
}
] |
166554413 | import sys
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from openpyxl import *
import os
from openpyxl.styles import *
from openpyxl.utils import get_column_letter
app_name = "Price-list creator"
# variables for widgets
file_name_pl = "Nazwa tworzonego pliku:"
amt_of_valid_files_pl = "Ilość plików do prz... | null | Main_program.py | Main_program.py | py | 14,624 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.listdir",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "openpyxl.load_workbook",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "openpyxl.load_workbook",
"line_number": 127,
"usage_type": "call"
},
{
"api_name": "openpyxl.ut... |
81406217 | from __future__ import absolute_import
import unittest, pytest
from datetime import datetime, date, time, timedelta
import sys
from pyq import _k
if sys.maxsize == 2147483647: # 32-bit platform
K_INT_CODE, K_LONG_CODE = "lq"
else:
K_INT_CODE, K_LONG_CODE = "il"
PY3K = sys.hexversion >= 0x3000000
# extract ... | null | src/pyq/tests/test_k.py | test_k.py | py | 21,001 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.maxsize",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "sys.hexversion",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "pyq._k.K",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "pyq._k",
"line_... |
241375366 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on May, 2020
@author: Nathan de Lara <ndelara@enst.fr>
"""
from abc import ABC
from typing import Union, Iterable, Tuple
import numpy as np
from sknetwork.utils.base import Algorithm
class BaseLinkPred(Algorithm, ABC):
"""Base class for link prediction ... | null | sknetwork/linkpred/base.py | base.py | py | 2,709 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sknetwork.utils.base.Algorithm",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "abc.ABC",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.Iterable",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "numpy.ndarray"... |
335786420 | '''
Take one or more aggregated NetCDF file names as input.
Move that file to the directory where it will get automatically published,
and move the input grib files for that month and RFC to a safe place.
@author: rhayes
'''
from datetime import date
import glob
import os
import argparse
import logging
import sys
imp... | null | Python/ncETL/publish.py | publish.py | py | 4,101 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "re.match",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "os.path.basename",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "datetime.date",
"line_numb... |
225032497 | # Standard libraries
import os
import uuid
import string
import datetime
import bibtexparser
from DataModelDict import DataModelDict as DM
def build_record(bib_databases, elements, key=None, othername=None, fictional=False, modelname=None, description_notes=None):
model = DM()
model['interatomic-potenti... | null | iprbuild/potential_record_gen.py | potential_record_gen.py | py | 9,720 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "DataModelDict.DataModelDict",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "DataModelDict.DataModelDict",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "uuid.uuid4",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "da... |
316116208 | """ my loop implementatin """
from timeit import default_timer
from time import sleep as _sleep
from heapq import heappush, heappop
from collections import defaultdict
clock = default_timer
from types import coroutine
@coroutine
def sleep(seconds):
yield 'sleep', seconds
@coroutine
def join(task):
yield '... | null | asyncdemistified/tuts.py | tuts.py | py | 2,211 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "timeit.default_timer",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "types.coroutine",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "types.coroutine",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "types.coroutine",... |
395882580 | import json
import os
import requests
import pymongo
# Gets the file's current directory so we can easily grab the config file
__location__ = os.path.realpath(
os.path.join(os.getcwd(), os.path.dirname(__file__)))
class RealmNameImport(object):
def __init__(self):
self.config = json.loads(
... | null | install/RealmNameImport.py | RealmNameImport.py | py | 1,129 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.realpath",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": ... |
228186391 | import tensorflow as tf
import random
import os
import numpy as np
from PIL import Image
import random
import time
import matplotlib.pyplot as plt
import cv2
def load_data(folder_name, label): # 데이터 불러오는 함수
pic_names = os.listdir("./data/" + folder_name)
temp = []
for p in pic_names:
... | null | train labeling.py | train labeling.py | py | 2,102 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.listdir",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "numpy.min",
"line_number": 23... |
67030048 | """
TASK 2: Which telephone number spent the longest time on the phone
during the period? Don't forget that time spent answering a call is
also time spent on the phone.
Print a message:
"<telephone number> spent the longest time, <total time> seconds, on the phone
during September 2016.".
Read file into texts and calls... | null | task02.py | task02.py | py | 1,037 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "csv.reader",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 22,
"usage_type": "call"
}
] |
77479699 | import sys
sys.path.insert(0, './')
from rlf import DDPG
from rlf import run_policy
from tests.test_run_settings import TestRunSettings
from rlf import RegActorCritic
from rlf.rl.model import MLPBase, TwoLayerMlpWithAction
import torch.nn as nn
import torch.nn.functional as F
def reg_init(m):
return m
def get_act... | null | examples/test_cmds/ddpg/def.py | def.py | py | 1,406 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.insert",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_... |
45357835 | import json
from flask import request, Response, render_template, Flask
#from wsgiref import simple_server
from train_validate import train_validate
from train_model import train_model
from pred_validate import pred_validate
from predict_from_model import predict_from_model
from create_log_directories import cre... | null | main.py | main.py | py | 3,293 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.request.json",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "flask.reque... |
471819244 | from mpl_toolkits.mplot3d import Axes3D
from scipy.stats import norm
import matplotlib.pyplot as plt
import numpy as np
mean = [0, 0, 0]
cov = [[1, -0.5, 1], [-0.5, 1, 1], [1, 1, 1]]
x, y, z = np.random.multivariate_normal(mean, cov, 10).T
x_mean = np.mean(x)
y_mean = np.mean(y)
corr = np.corrcoef(x,y)[0, 1]
#print("x_... | null | src/data_generate.py | data_generate.py | py | 1,331 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.random.multivariate_normal",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "numpy.mean",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.mean... |
589127338 | import pandas as pd
from typing import Callable
from psycopg2.extensions import connection
from pathlib import Path
from jinja2 import Template
from threading import Thread
from queue import Queue
from pandabox.tools import Panda, PandaBox
class DbQueries:
"""
A class used to group database queries together a... | null | pandabox/db/queries.py | queries.py | py | 3,528 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pathlib.Path",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "psycopg2.extensions.connection",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "jinja2.Template",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "pandas.re... |
26208651 | import json
import csv
fileNames = ['universities','universities-pretty','universities_with_mua']
jsonKeys = ('university','thCode','enCode')
for fileName in fileNames:
with open(fileName+'.json', 'r') as jsonFilePtr:
universityData = json.load(jsonFilePtr)
with open(fileName+'.csv', 'w') as csvFile... | null | dist/jsonToCSV.py | jsonToCSV.py | py | 486 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "json.load",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "csv.DictWriter",
"line_number": 9,
"usage_type": "call"
}
] |
228031116 | from maya import cmds
top_groups = [x for x in cmds.ls("|*", type="transform") if x not in ["front", "persp", "side", "top"]]
snap_dict = {}
for top_group in top_groups:
category_dict = snap_dict[top_group] = {}
category_dict["snap_points"] = {}
transforms = cmds.listRelatives(top_group, c=True, f=True)... | null | generator_tools/snapping_generator.py | snapping_generator.py | py | 1,878 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "maya.cmds.ls",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "maya.cmds",
"line_number": 2,
"usage_type": "name"
},
{
"api_name": "maya.cmds.listRelatives",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "maya.cmds",
"line_nu... |
145069683 | # -*- coding: utf-8 -*-
from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage
from django.shortcuts import render
from django.views.decorators.cache import cache_page
from models import News, Notification, EnrollStudent
@cache_page(60 * 15)
def articles_news(request):
news = News.objects.all()... | null | ccms/apps/articles/views.py | views.py | py | 1,735 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "models.News.objects.all",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "models.News.objects",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "models.News",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.c... |
334062416 | # header_footer.py
from fpdf import FPDF
from getSNMP import consultaSNMP
class CustomPDF(FPDF):
def header(self):
# Set up a logo
self.image('linux11.png', 10, 8, 33)
self.set_font('Arial', 'B', 15)
# Add an address
self.cell(100)
self.cell(0, 5, 'Reporte de age... | null | creaPDF.py | creaPDF.py | py | 1,080 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "fpdf.FPDF",
"line_number": 6,
"usage_type": "name"
}
] |
248170653 | import tensorflow as tf
keras = tf.keras
import os
import pathlib
import matplotlib.pyplot as plt
import numpy as np
from src.utils import _get_data_info
# Set precision
DATA_PATH = 'data/'
AUTOTUNE = tf.data.experimental.AUTOTUNE
CLASS_NAMES, image_count = _get_data_info(DATA_PATH)
IMG_WIDTH, IMG_HEIGHT = 224,... | null | src/read_data.py | read_data.py | py | 2,055 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tensorflow.keras",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.data",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "src.utils._get_data_info",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pa... |
149895881 | import copy
import qgrid
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from IPython.display import display, Markdown as md, clear_output
from ipywidgets import Output, fixed
from .wordclouder import WordClouder
from metrics.token import TokensManager
from metrics.conflict import ConflictManag... | null | visualization/tokens_listener.py | tokens_listener.py | py | 4,057 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.nan",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "qgrid.show_grid",
"line_number": 81,
"usage_type": "call"
},
{
"api_name": "IPython.display.display",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "ipywidgets.Out... |
575550299 | #!/usr/bin/env python
#_*_ coding: utf8 _*_
import json
import urllib
from core.colors import colors
co = colors()
def geolocation(ip):
list_keys = []
urljson = urllib.urlopen("http://ipinfo.io/{}/json".format(ip))
datos = json.loads(urljson.read())
for n in datos:
list_keys.append(n)
for l in list_keys:
pri... | null | modules/ip_geolocation.py | ip_geolocation.py | py | 389 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "core.colors.colors",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "urllib.urlopen",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 11,
"usage_type": "call"
}
] |
568978975 | #!/usr/bin/env python3
# coding=utf-8
import json
import os
from shared import domain_list, config_file
# certbot tries to write to /var/log/letsencrypt by default; because of this, running as root is required.
# certbot Error Message:
# Either run as root, or set --config-dir, --work-dir, and --logs-dir to writeable... | null | verlaengern.py | verlaengern.py | py | 1,520 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.geteuid",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.expanduser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.expanduser",
"... |
592975859 | #!/usr/bin/python3
'''Flask module to return status of API'''
from flask import Flask, Blueprint, jsonify, session
from models import storage
from api.v1.views import app_views
from os import getenv, environ
from flask_cors import CORS
app = Flask(__name__)
app.config['JSONIFY_PRETTYPRINT_REGULAR'] = True
app.registe... | null | api/v1/app.py | app.py | py | 898 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "api.v1.views.app_views",
"line_number": 12,
"usage_type": "argument"
},
{
"api_name": "flask_cors.CORS",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "models.storage... |
12070823 | from panda3d.core import TextProperties, TextPropertiesManager
from direct.fsm import FSM
from otp.otpbase import OTPGlobals
import sys
from direct.directnotify import DirectNotifyGlobal
from direct.gui.DirectGui import *
from direct.gui import DirectGuiGlobals
from otp.otpbase import OTPLocalizer
from direct.task impo... | null | otp/chat/ChatInputWhiteList.py | ChatInputWhiteList.py | py | 6,034 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "direct.fsm.FSM.FSM",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "direct.fsm.FSM",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "direct.directnotify.DirectNotifyGlobal.directNotify.newCategory",
"line_number": 13,
"usage_type":... |
139124231 | from io import BytesIO
from PIL import Image
import requests
import subprocess
import platform
from os import path, getcwd, mkdir
def run_lolcat_factory():
cats_path = getcwd() + '/cats'
print_header()
create_cats_directory(cats_path)
download_cats(cats_path)
open_cats_directory(cats_path)
def ... | null | exercise_6/exercise_6.py | exercise_6.py | py | 1,682 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.getcwd",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "os.mkdir",
"line_number": 26,
... |
248958234 | import datetime
import numpy as np
import os
import pkg_resources
from . import IOutils as io
class MainOutput:
"""
Functionality to write to the main output (*.out) file.
"""
def __init__(self, STS):
self.ipfile = STS.ipfile
self.outfile = STS.outfile
self.verbosity = STS.verb... | null | boss/io/main_output.py | main_output.py | py | 12,370 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.isfile",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "pkg_resources.require",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.n... |
232860233 | # Object representing a single ion species
import matplotlib.pyplot as plt
import numpy as np
from .IonState import IonState
from .OutputException import OutputException
class IonSpecies:
def __init__(self, name, Z, data, grid, output, attr=list()):
"""
Constructor.
name: Name of i... | null | py/DREAM/Output/IonSpecies.py | IonSpecies.py | py | 3,709 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "OutputException.OutputException",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "IonState.IonState",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.axes",
"line_number": 111,
"usage_type": "call"
},
{
"api_nam... |
152787066 | import json
import time
import os
import solariat_bottle
from solariat_bottle.tests.base import RestCase
from solariat_bottle.db.channel.base import Channel
from solariat_bottle.db.faq import FAQ, DbBasedSE1, FAQDocumentInfo
from solariat_bottle.db.channel.faq import FAQChannel
from solariat_bottle.db.post.faq_query ... | null | tests/test_faq_data.py | test_faq_data.py | py | 18,121 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "solariat_bottle.tests.base.RestCase",
"line_number": 67,
"usage_type": "name"
},
{
"api_name": "solariat_bottle.db.faq.FAQDocumentInfo.objects.get",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "solariat_bottle.db.faq.FAQDocumentInfo.objects",
"line... |
266901045 | """
time_loadall
"""
from __future__ import absolute_import, division, print_function
import logging
import timeit
from mceditlib.test import templevel
log = logging.getLogger(__name__)
def loadall():
ents = 0
for cPos in dim.chunkPositions():
chunk = dim.getChunk(*cPos)
ents += len(chunk.... | null | src/mceditlib/test/time_loadsave.py | time_loadsave.py | py | 786 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "mceditlib.test.templevel.TempLevel",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "mceditlib.test.templevel",
"line_number": 23,
"usage_type": "name"
},
{
"api_... |
614078028 | from django.db import models
# Create your models here.
from django.db import models
from user_auth.models import User
# Create your models here.
class Tag(models.Model):
pass
class Community(models.Model):
name = models.CharField('コミュニティ名', max_length=30)
description = models.TextField('コミュニティの説明')
... | null | core/models.py | models.py | py | 2,233 | python | en | code | null | code-starcoder2 | 66 | [
{
"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.Model",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name":... |
649976123 | from django.conf.urls import url
from . import views
app_name = 'show'
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^entry/(?P<entry_id>[0-9]+)/$', views.entrydetail, name='entrydetail'),
url(r'^class/(?P<ShowClass_number>[0-9]+)/$', views.classdetail, name='classdetail'),
url(r'^entry... | null | myproject/show/urls.py | urls.py | py | 440 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.co... |
35099401 | # An example on MNIST to introduce how to train and test under GCPL
from nets import mnist_net
import functions as func
import numpy as np
import tensorflow as tf
import argparse
import time
import os
import pickle
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import input_data
mnist = input_data.read_data_sets... | null | mnist_gcpl.py | mnist_gcpl.py | py | 6,449 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "input_data.read_data_sets",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.argmax",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "numpy.argmax",... |
592101824 | import urllib
from xml.etree import ElementTree
QUICKLOOK_URL = 'http://api.eve-central.com/api/quicklook'
def quicklook(typeid, sethours=None, regionlimit=None, usesystem=None,
setminQ=None):
args = [('typeid', typeid)]
if sethours is not None:
args.append(('sethours', sethours))
if... | null | lib/mrintel/eve/evecentral.py | evecentral.py | py | 1,030 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "urllib.urlopen",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "urllib.urlencode",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree.parse",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "xml.etree... |
605820306 | from typing import cast
import unittest
from fnmatch import fnmatchcase
from unittest.mock import Mock
from modelark.filterer import FunctionParser
from modelark.filterer.types import QueryDomain
from modelark.filterer.safe_eval import SafeEval
class TestFunctionParser(unittest.TestCase):
def setUp(self):
... | null | tests/filterer/test_function_parser.py | test_function_parser.py | py | 7,900 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "unittest.TestCase",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "modelark.filterer.FunctionParser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "modelark.filterer.FunctionParser",
"line_number": 16,
"usage_type": "argument"
... |
82868818 | import torch
import matplotlib.pyplot as plt
import numpy as np
import torch.optim
from scipy import linalg
batch = 1
N = 100
T = 10.0
dt = T/N
NVars = 4
NControls = 1
def getNewState():
#we 're going to also pack f into here
x = torch.zeros(batch,N,NVars+NControls, requires_grad=True)
#f = torch.zeros(batch, N-1,... | null | old/newton_traj3_prof.py | newton_traj3_prof.py | py | 4,811 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.zeros",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.zeros",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.sum",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "torch.zeros",
"line_number": 32... |
187299606 | import cv2
import numpy as np
cap = cv2.VideoCapture(0)
circles = np.zeros((100,100,100), np.uint16)
import RPi.GPIO as IO #calling header file which helps us use GPIO’s of PI
import time #calling time to provide delays in program
k=0
IO.setwarnings(False) #do not show any warnings
IO... | null | Codes/[IMAGE-MOTOR][red_ball_detection_with_motor_control][ver.1.00][22.02.2018][Necati].py | [IMAGE-MOTOR][red_ball_detection_with_motor_control][ver.1.00][22.02.2018][Necati].py | py | 7,557 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.uint16",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "RPi.GPIO.setwarnings",
... |
63135509 | import cv2
import numpy as np
import copy
import math
import time
def dir():
cap_region_x_begin=0.6
cap_region_y_end=0.6
threshold = 30
blurValue = 41
bgSubThreshold = 50
learningRate = 0
isBgCaptured = 0
triggerSwitch = False
counter = 0
q = []
out = []
... | null | main.py | main.py | py | 4,121 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.ones",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "cv2.erode",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "cv2.bitwise_and",
"line_num... |
312592727 | import re
from pathlib import Path
from setuptools import setup
def get_version(package):
"Return package version as listed in `__version__` in `init.py`"
initfile = Path(package, "__init__.py").read_text() # Python >= 3.5
return re.search("__version__ = ['\"]([^'\"]+)['\"]", initfile)[1]
def get_long_... | null | setup.py | setup.py | py | 2,318 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pathlib.Path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "setuptools.setup",
"line_number": 22,
"usage_type": "call"
}
] |
247870338 | import random
import json
import time
from prettytable import PrettyTable as pt
import pymysql
import requests
import pymongo
from get_xiciip import get_IP
from lxml import etree
MONGO_URI = 'localhost'
MONGO_DB = 'test' # 定义数据库
MONGO_COLLECTION = 'ganji' # 定义数据库表
class ganji_spider(object):
def __init__(self,mongo... | null | ganji_sipder.py | ganji_sipder.py | py | 7,002 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "json.loads",
"lin... |
212937486 | from datetime import datetime, timedelta
from laika.lib import coordinates
import logging
import math
from matplotlib import animation, cm, pyplot as plt
from mpl_toolkits.basemap import Basemap
import numpy
import os
from pytid.gnss import get_data
from pytid.utils.configuration import Configuration
config = Config... | null | pytid/gnss/plot.py | plot.py | py | 4,885 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pytid.utils.configuration.Configuration",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 25,
"usage_type": "name"
},
{
"api_n... |
387704405 | # -*- coding: utf-8 -*-
"""
Created on Wed Jan 23 07:59:24 2019
Simulation of the market based on Ising model. Each step agents place buy or sell order.
Agents are placed on a chosen type of network and their relationships evolve during the simulation.
The results are presented in the form of the price, return and... | null | market.py | market.py | py | 11,131 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "network_generation.generate_graph",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "csv.DictWriter",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "pathlib... |
317745242 | # Copyright 2017 Bracket Computing, Inc. 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.
# A copy of the License is located at
#
# https://github.com/brkt/brkt-cli/blob/master/LICENSE
#
# or in the "license" file... | null | brkt_cli/esx/encrypt_vmdk.py | encrypt_vmdk.py | py | 12,025 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "brkt_cli.encryptor_service.ENCRYPTOR_STATUS_PORT",
"line_number": 51,
"usage_type": "name"
},
{
"api_name": "brkt_cli.util.CRYPTO_XTS",
"line_number": 64,
"usage_type": "name"
}... |
637601692 | #!/usr/bin/python3
""" sends a POST"""
import requests
import sys
if __name__ == "__main__":
url = 'https://swapi.co/api/people'
listargs = sys.argv
values = {'search': listargs[1]}
req = requests.get(url, params=values)
data1 = req.json()
print("Number of results: {}".format(data1.get('count')... | null | 0x11-python-network_1/101-starwars.py | 101-starwars.py | py | 554 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.argv",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 17,
"usage_type": "call"
}
] |
283997123 | '''
政治/经济 新闻的主题随时间变化
1.分年份,划分每一句
2.训练分类器 (训练的过程是怎样的,需要分词吗)
3.找出政治/经济的句子
4.对他们进行主题分析
5.使用时间标签,分开
判别:1(Politics); 2 (Econ); 0 (Neither);
data structure
dict id->title
dict title->id 用以方面从title找id的过程
pickle id -> content #news 原文
pickle id -> sentences of content #已经分句的
sentence, time, id [{},{}...] #处理的单元... | null | analysisTopicOfEcoPol.py | analysisTopicOfEcoPol.py | py | 4,895 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "newstool.readTXT",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "jieba.cut",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "newstool.readStopWord",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "newstool.readTXTLine... |
322401092 | # Author- Aishwarya Budhkar
from __future__ import print_function
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
from torch.autograd import Variable
# Import for plotting graphs
import matplotlib
... | null | German Traffic Signs Recognition Benchmark/main.py | main.py | py | 6,431 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.use",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "torch.manual_seed",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "data.initial... |
40912932 | from __future__ import absolute_import, division, print_function
import numpy as np
from sklearn.base import BaseEstimator
from SparseGroupLasso.linalg import vec_norm, dot
from .utils import S, norm_non0
__author__ = 'Romain Tavenard romain.tavenard[at]univ-rennes2.fr'
class SSGL(BaseEstimator):
"""A Semi-Spa... | null | SparseGroupLasso/blockwise_descent_semisparse.py | blockwise_descent_semisparse.py | py | 13,568 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sklearn.base.BaseEstimator",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "numpy.max",
"l... |
481362649 | import unittest
from mock import Mock
from pcp_mpstat import TotalInterruptUsageReporter
class TestTotalInterruptUsageReporter(unittest.TestCase):
def test_print_report(self):
timestamp = "2016-19-07 IST"
total_interrupt_usage = Mock()
total_interrupt_usage.total_interrupt_per_delta_time =... | null | test/total_interrupt_usage_reporter_test.py | total_interrupt_usage_reporter_test.py | py | 639 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "unittest.TestCase",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "mock.Mock",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "mock.Mock",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "mock.Mock",
"line_number... |
408728862 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# setup.py - Avahi/mDNS name publisher module.
#
# Copyright (c) 2018, Carlos Rodrigues
#
import os
from setuptools import setup
manifest = {
"name": "mdns-publisher",
"version": "0.9.2",
"description": "Publish CNAMEs pointing to the local host over Avah... | null | setup.py | setup.py | py | 1,330 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.join",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "setuptools.setup",
"lin... |
553257134 | import tempfile
import os
import requests
from bs4 import BeautifulSoup
import sys
def uprint(x):
if x:
print(x.encode('cp65001',errors='backslashreplace').decode('cp1252',errors='ignore'))
def dec(x):
if x:x.decompose()
def wiki(wiki):
r=requests.get('https://en.wikipedia.org/w/index.php?title={}&printable=yes... | null | wiki.py | wiki.py | py | 1,122 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "tempfile.mkstemp",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.write",
"line_... |
58754932 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('trygame', '0062_sitepartner'),
]
operations = [
migrations.AddField(
model_name='sitepartner',
name=... | null | trygame/migrations/0063_sitepartner_created.py | 0063_sitepartner_created.py | py | 507 | python | en | code | null | code-starcoder2 | 66 | [
{
"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.AddField",
"line_number": 14,
"usage_type": "call"
},
{
... |
308548987 | import configparser
import os
from dotenv import load_dotenv
CWD_PATH = os.path.dirname(__file__)
load_dotenv(os.path.join(CWD_PATH, ".aws"))
config = configparser.ConfigParser()
config.read(os.path.join(CWD_PATH, "dwh.cfg"))
config.add_section("AWS")
config.set("AWS", "KEY", os.environ.get("KEY"))
config.set("AWS",... | null | config.py | config.py | py | 356 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.dirname",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "dotenv.load_dotenv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line... |
472510853 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
# pylint: skip-file
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('portal', '0006_assign... | null | portal/migrations/0007_course_owners.py | 0007_course_owners.py | py | 581 | python | en | code | null | code-starcoder2 | 66 | [
{
"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.swappable_dependency",
"line_number": 12,
"usage_type": "call... |
100942822 | from django.template.response import TemplateResponse
from django.contrib.auth.decorators import login_required
from hivetrader.symbols.models import Exchange, Institution, Symbol
@login_required
def overview(request, template_name='dashboard/overview.html'):
symbols = Symbol.objects.order_by('?')[:5]
institut... | null | hivetrader/dashboard/views.py | views.py | py | 649 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "hivetrader.symbols.models.Symbol.objects.order_by",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "hivetrader.symbols.models.Symbol.objects",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "hivetrader.symbols.models.Symbol",
"line_number... |
652848930 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('orders', '0006_auto_20170419_0809'),
]
operations = [
migrations.AlterField(
model_name='order',
nam... | null | orders/migrations/0007_auto_20170519_1657.py | 0007_auto_20170519_1657.py | py | 685 | python | en | code | null | code-starcoder2 | 66 | [
{
"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"
},
{... |
198248459 | import yaml
from concreate.descriptor import Descriptor
packages_schema = [yaml.safe_load("""
map:
repositories:
seq:
- {type: str}
install:
seq:
- {type: str}""")]
class Packages(Descriptor):
"""Object representing Pakcages
Args:
descriptor - yaml containing Packages section... | null | concreate/descriptor/packages.py | packages.py | py | 455 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "yaml.safe_load",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "concreate.descriptor.Descriptor",
"line_number": 16,
"usage_type": "name"
}
] |
183161051 | from collections import OrderedDict
from functools import wraps
def fib(n):
if n <= 1: # 0 or 1
return n
return f(n - 1) + f(n - 2) # 由于涉及到重复计算,这个递归函数在 n 大了以后会非常慢。 O(2^n)
"""
下边就来写一个缓存装饰器来优化它。传统方法是用个数组记录之前计算过的值,但是这种方式不够 Pythonic
"""
def cache(func):
"""先引入一个简单的装饰器缓存,其实原理很简单,就... | null | 链表/lru_cache.py | lru_cache.py | py | 4,699 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "functools.wraps",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 104,
"usage_type": "call"
},
{
"api_name": "time.time",
"l... |
307846378 | import glob
import os
import sys
import librosa
def setfiles():
res = glob.glob('/home/tree/data/SongData/*/*')
for f in res:
print(f)
name = f.split('/')
os.system('cp ' + f + ' /home/tree/data/dataset/' + name[-2] +'_' + name[-1])
def sep():
res = glob.glob('/home/... | null | prepare_data/separate.py | separate.py | py | 1,927 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "glob.glob",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 20,
"... |
542052525 | import sqlite3
import itertools
import random
from operator import itemgetter, attrgetter
from random import *
basket = {}
current_id = -11
def login(login_type):
global c, conn,current_id
if login_type == "c":
sign = input("Sign in(i)/Sign up(u): ")
if sign == "i":
# complete... | null | test.py | test.py | py | 25,448 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "operator.itemgetter",
"line_number": 232,
"usage_type": "call"
},
{
"api_name": "operator.itemgetter",
"line_number": 276,
"usage_type": "call"
},
{
"api_name": "operator.itemgetter",
"line_number": 277,
"usage_type": "call"
},
{
"api_name": "sqlite... |
167808330 | from typing import List
from ortools.sat.python.cp_model import CpSolverSolutionCallback # type: ignore
from ortools.sat.python.cp_model import IntVar
class NQueensPrinter(CpSolverSolutionCallback):
def __init__(self,
board: List[List[IntVar]],
printer: bool):
CpSolverS... | null | proj/printer.py | printer.py | py | 2,212 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "ortools.sat.python.cp_model.CpSolverSolutionCallback",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "ortools.sat.python.cp_model.IntVar",
"line_number": 9,
"usage_type": "name... |
338535222 | #!/bin/env python
import os
import xml.etree.ElementTree as ET
PFCFILE='PoolFileCatalog.xml'
fout = open('pfc.txt','w')
if os.path.exists(PFCFILE):
doc = ET.parse(PFCFILE)
for File in doc.getroot():
logicalname = ''
physicalname = ''
for item in File:
if item.tag == 'logic... | null | python/pfc2txt.py | pfc2txt.py | py | 918 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.exists",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "xml.etree.ElementTree.parse",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "xml.etree.Eleme... |
580443897 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Tweet',
fields=[
('id', models.AutoField(verbos... | null | tweetbort/migrations/0001_initial.py | 0001_initial.py | py | 963 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.CreateModel",
"line_number": 13,
"usage_type": "call"
},
... |
103546194 |
import pygame
from entity import MazeRunner
from constants import *
from vector import Vector2
from random import *
from nodes import Node
from stack import Stack
class Ghost(MazeRunner):
def __init__(self, nodes):
MazeRunner.__init__(self, nodes)
self.name = "ghost"
self.goal = Vector2(0... | null | PacMan/ghosts.py | ghosts.py | py | 3,356 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "entity.MazeRunner",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "entity.MazeRunner.__init__",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "entity.MazeRunner",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "vector... |
213880803 | from django.db.models.aggregates import Max
from django.shortcuts import render, redirect
from .models import SanPham, SimTheoLoai, SimNamSinh, NhaMang, SimTheoGia
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from hoadon.models import HoaDon
from itertools import chain
from django.db.models ... | null | PythonWeb/sanpham/views.py | views.py | py | 5,687 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "models.SanPham.objects.filter",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "models.SanPham.objects",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "models.SanPham",
"line_number": 12,
"usage_type": "name"
},
{
"api_name... |
36519385 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | null | azure-cognitiveservices-vision-computervision/azure/cognitiveservices/vision/computervision/models/read_operation_result_py3.py | read_operation_result_py3.py | py | 1,477 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "msrest.serialization.Model",
"line_number": 15,
"usage_type": "name"
}
] |
394077962 | #! /usr/bin/env python
# python programa to comunicate with an MCP3008
# Import our SpiDe wrapper and our sleep function
import spidev
from time import sleep
# Establish SPI device on Bus 0,Device 0
spi = spidev.SpiDev()
spi.open(0,0)
#check valid channel
def getAdc (channel):
if((channel>7)or(c... | null | Rpi/mcp3008.py | mcp3008.py | py | 731 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "spidev.SpiDev",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 25,
"usage_type": "call"
}
] |
139168516 | import sys
import maya.api.OpenMaya as OpenMaya
import maya.api.OpenMayaUI as OpenMayaUI
import maya.api.OpenMayaAnim as OpenMayaAnim
import maya.api.OpenMayaRender as OpenMayaRender
#Node implementation with standard viewport draw
class PivotNode(OpenMayaUI.MPxLocatorNode):
id = OpenMaya.MTypeId( 0x82307 )
dr... | null | Scripts/PivotNode.py | PivotNode.py | py | 4,334 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "maya.api.OpenMayaUI.MPxLocatorNode",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "maya.api.OpenMayaUI",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "maya.api.OpenMaya.MTypeId",
"line_number": 9,
"usage_type": "call"
},
{
... |
245060262 | import torch
import torch.nn as nn
from torch.nn import functional as F
class BasicBlock(nn.Module):
expansion=1
def __init__(self, inplanes, planes, kernel_size=3, stride=1, padding=1, downsample=None):
super(BasicBlock, self).__init__()
self.conv1 = nn.Conv2d(inplanes, planes, kernel_size=ke... | null | lib/networks/invcnn_pytorch/invnet/inv_cnn.py | inv_cnn.py | py | 6,000 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.nn.Module",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numb... |
260110155 | import time, random, datetime
from Houdini.Handlers import Handlers, XT
from Houdini.Data.Postcard import Postcard
from Houdini.Data.Penguin import Penguin, IgnoreList
from Houdini.Data import retryableTransaction
@Handlers.Handle(XT.StartMailEngine)
@Handlers.Throttle(-1)
def handleStartMailEngine(self, data):
if... | null | Houdini/Handlers/Play/Mail.py | Mail.py | py | 5,575 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "random.random",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "Houdini.Data.Postcard.Postcard",
"line_number": 11,
"usage_type": "argument"
},
{
"api_name": "Houdini.Data.Postcard.Postcard.RecipientID",
"line_number": 11,
"usage_type": "attribute... |
10829172 | from struct import unpack
from datetime import datetime
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
import uuid
import ftplib
import sys
import os
p_dir = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
sys.path.append(r'%s' % str(p_dir))
from config import config
# 初始化数... | null | crontab/unpack_certificate.py | unpack_certificate.py | py | 4,879 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.abspath",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"l... |
1407814 | # requires
# pip install airtable
# pip install airtable-python-wrapper
import json
import airtable
from airtable import Airtable
BASE_ID = "app38cZA2uPDxdTL8" # found in url of API documentation for base
SERVICES_TABLE = "Services"
ICONS_TABLE = "Icons"
def create_services_object():
return Airtable(BASE_ID, SER... | null | modules/airtable_call.py | airtable_call.py | py | 3,285 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "airtable.Airtable",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "airtable.Airtable",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_n... |
310508789 | from __future__ import division
import re
from random import random
import numpy as np
import pandas as pd
import os
import uuid
import pyinotify
# from treys import Card as treys_card
import Hand
import Player as p
import low_level_functions as llf
import subprocess
import matplotlib
from gym import Env, error, spaces... | null | main_files/cpp_casino_implementation/main.py | main.py | py | 12,453 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "low_level_functions.create_cards_for_game",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "Player.Player",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "Player.CardHolding",
"line_number": 35,
"usage_type": "call"
},
{
"api_na... |
601427537 | # :coding: utf-8
# :copyright: Copyright (c) 2014 ftrack
import os
import tempfile
import ftrack_api
import ftrack_api.accessor.disk
import ftrack_api.entity.location
import ftrack_api.structure.standard
def configure_locations(event):
session = event['data']['session']
location = session.ensure(
'... | null | example_location/studio_default.py | studio_default.py | py | 1,263 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "ftrack_api.structure.standard.StandardStructure",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "ftrack_api.structure",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "ftrack_api.accessor.disk.DiskAccessor",
"line_number": 27,
"usa... |
576240624 | # uncompyle6 version 3.7.4
# Python bytecode 3.4 (3310)
# Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04)
# [GCC 8.4.0]
# Embedded file name: build/bdist.linux-x86_64/egg/mediagoblin/tests/test_sql_migrations.py
# Compiled at: 2016-02-04 13:34:40
# Size of source mod 2**32: 32611 bytes
import six, pytes... | null | pycfiles/mediagoblin-0.9.0-py3.4/test_sql_migrations.cpython-34.py | test_sql_migrations.cpython-34.py | py | 20,941 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pytest.mark.skipif",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "six.PY3",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "six.PY2",
"line_num... |
352090161 | import json
import os
import time
from moto import mock_sqs
from six.moves import range
import pytest
import taskqueue
from taskqueue import RegisteredTask, TaskQueue, MockTask, PrintTask, LocalTaskQueue
from taskqueue.paths import ExtractedPath, mkpath
@pytest.fixture(scope='function')
def aws_credentials():
""... | null | test/test_taskqueue.py | test_taskqueue.py | py | 4,135 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"lin... |
395259231 | #!/usr/bin/python
"""
This is the code to accompany the Lesson 2 (SVM) mini-project.
Use a SVM to identify emails from the Enron corpus by their authors:
Sara has label 0
Chris has label 1
"""
import sys
from time import time
sys.path.append("../tools/")
from email_preprocess import preprocess
### ... | null | svm/svm_author_id.py | svm_author_id.py | py | 1,375 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.append",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "email_preprocess.preprocess",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sklearn.svm... |
541382983 | import requests
import sys
import pprint
from bs4 import BeautifulSoup
team = ''
for arg in sys.argv[1:]:
team+=str(arg)+'+'
team = team.rstrip('+')
URL = 'https://www.google.com/search?q=' + team +'+score&oq='+team +'+score'
# print(URL)
# URL='https://www.google.com/search?q=arsenal+score&oq=arsenal+score'
USER_... | null | imageToSticker/utils/score_scraper.py | score_scraper.py | py | 2,555 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.argv",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 16,
"usage_type": "call"
}
] |
505228718 | # coding: utf-8
from django.shortcuts import render, get_object_or_404
from .models import Noticia
def listagem(request):
return render(
request,
'index.html',
{'noticias': Noticia.objects.order_by('-data')[:5]}
)
def detalhe(request, id):
noticia = get_object_or_404(Noticia, p... | null | apps/noticias/views.py | views.py | py | 400 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.shortcuts.render",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "models.Noticia.objects.order_by",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "models.Noticia.objects",
"line_number": 12,
"usage_type": "attribute"
},
{
... |
44622672 | from ScopeFoundry.base_app import BaseMicroscopeApp
import logging
logging.basicConfig(level=logging.DEBUG)
logging.getLogger('PyQt5').setLevel(logging.WARN)
logging.getLogger('ipykernel').setLevel(logging.WARN)
logging.getLogger('traitlets').setLevel(logging.WARN)
logging.getLogger('LoggedQuantity').setLevel(logging.... | null | ScopeFoundryHW/attocube_ecc100/attocube_test_app.py | attocube_test_app.py | py | 1,597 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.basicConfig",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "logging.WARN",
... |
40532536 | from math import pi
import gi
import logging
from graph_tool import Graph, PropertyMap
from graph_tool.draw import GraphWidget, sfdp_layout
from common.model.gamemodel import GameModel
from common.model.phase import Phase
from common.model.rules.changephase import ChangePhase
from common.model.rules.ifrule import If... | null | editor/windows/phaseflowwindow.py | phaseflowwindow.py | py | 5,872 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "gi.require_version",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "gi.repository.Gtk.ApplicationWindow",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "gi.repository.Gtk",
"line_number": 21,
"usage_type": "name"
},
{
"api... |
199783566 | import nltk
from nltk.stem.lancaster import LancasterStemmer
import numpy as np
import tflearn
import tensorflow as tf
import random
import json
import pickle
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--sentence", default="halo kak", help="input kalimat untuk di prediksi dan di klasifika... | null | predict_and_clasify.py | predict_and_clasify.py | py | 2,257 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "nltk.stem.lancaster.LancasterStemmer",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 17,
"usage_type": "call"
},
{
"api_name... |
138329329 | from aiohttp import web
from pymongo import MongoClient
import datetime
import os.path
from create_files import create_file
def graph(data):
"""connecting with MongoDB and getting data for graphics"""
city = data["city"]
business_type = data["business_type"]
dt_today = datetime.datetime.today()
... | null | backend/app/views.py | views.py | py | 4,167 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.datetime.today",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "datetime.timedelta",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "dat... |
633885602 | from lxml import etree
from lxml.builder import E
import os
#location = "eads"
location = "testeads"
print("Parsing EAD folder")
#now replacing the tags with our new information
for filename in os.listdir(location):
#getting the information from the original files to put into the new eads
ead = os.path.join... | null | BentleyBlitz/eadtransform.py | eadtransform.py | py | 3,222 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.listdir",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "lxml.etree.parse",
"line_num... |
459992679 | import torch
import utils
import data
import json
from model_baseline import run
def get_answer_map():
res = {}
with open("vizwiz/Annotations_all/val.json") as f:
junk = json.loads(f.read())
# print(junk)
for dictionary in junk:
image_name = dictionary["image"].split(".")[-2... | null | eval_binary.py | eval_binary.py | py | 1,438 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "json.loads",
"line_number": 10,
"usage_type": "call"
},
{
"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.load",
"... |
474581807 | from random import random
import requests
import json
from bs4 import BeautifulSoup
from fake_useragent import UserAgent
# 得到所有地方航班及链接
flights = {} # {'安庆航班': 'https://flights.ctrip.com/schedule/aqg..html', ...}
url = 'https://flights.ctrip.com/schedule'
headers = {
'User-Agent': 'Mozilla/5.0 (Windows... | null | xiecheng.py | xiecheng.py | py | 1,002 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 19,
"usage_type": "call"
}
] |
576472827 | def find_ini_brian(modelname, workdir, bifpar, automodelname):
import pylab, brian2, brianutils, os, json, sympy, scipy, sys, \
datetime, shelve, autoutils, contextlib
from sympy import S
units= dict(brian2.units.__dict__.items()
+ brian2.units.allunits.__dict__.items()
... | null | model2/inibrian.py | inibrian.py | py | 4,442 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "brian2.units.__dict__.items",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "brian2.units",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "brian2.units.allunits.__dict__.items",
"line_number": 8,
"usage_type": "call"
},
{
"a... |
39537786 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Entry',
fields=[
('id', models.AutoField(verbos... | null | karthago/migrations/0001_initial.py | 0001_initial.py | py | 7,814 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.CreateModel",
"line_number": 13,
"usage_type": "call"
},
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.