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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
396137075 | from django.urls import path
from . import views
# SET THE NAMESPACE!
app_name = 'core'
# Be careful setting the name to just /login use userlogin instead!
urlpatterns=[
path('register/',views.register,name='register'),
path('home/', views.home, name='home'),
path('home/tweet/', views.post_tweet, name='po... | null | core/urls.py | urls.py | py | 906 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
14670858 | from os import listdir
import cv2
import numpy as np
from matplotlib import pyplot as plt
filenames = []
dir = "./barcodes/"
for element in listdir(dir):
filenames.append(element)
# names contains of all photos in filenames
# you can change the number for changing the photo
name = dir + filenames[3]
# Linux
# na... | null | Tarea 2/barcode_detection_recognition.py | barcode_detection_recognition.py | py | 13,734 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.listdir",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "cv2.IMREAD_COLOR",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "cv2.imshow",
"line_num... |
147607367 | from flask import Flask, redirect
from flaskext.babel import Babel
from flaskext.uploads import configure_uploads, patch_request_class
from flask.ext import admin
import locale
# for number formatting
try:
locale.setlocale(locale.LC_ALL, 'en_US.utf8')
except:
locale.setlocale(locale.LC_ALL, 'en_US')
#from swis... | null | sonic_art/application.py | application.py | py | 2,666 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "locale.setlocale",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "locale.LC_ALL",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "locale.setlocale",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "locale.LC_ALL",
... |
356068185 | import falcon
import json
from datetime import datetime
from sqlalchemy.exc import SQLAlchemyError
import traceback
from db import session
import model
import util
class RunCode(object):
def on_post(self, req, resp, id):
try:
user = req.context['user']
if not user.is_logged_in():... | null | endpoint/runcode.py | runcode.py | py | 2,527 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "falcon.HTTP_401",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "db.session.query",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "db.session",
"li... |
1381464 | from die import Die
import pygal
#create a die
die=Die()
#roll the die several times and save the result in a list
results=[]
for roll_num in range(1000):
result=die.roll()
results.append(result)
#analysis result
frequencies=[]
for value in range(1,die.num_sides+1):
frequency=results.count(value)
frequencies.appe... | null | dataVisualization/die_visual.py | die_visual.py | py | 579 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "die.Die",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "die.roll",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "die.num_sides",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "pygal.Bar",
"line_number": 18,
... |
51672942 | import socket
import json
import requests
host = '' # Symbolic name meaning all available interfaces
port = 60301 # Arbitrary non-privileged port
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((host, port))
s.listen(1)
conn, addr = s.accept()
querystring = {'uid': 'u64teelak1113','ukey': 'f97... | null | .history/serverWeather_20210211004534.py | serverWeather_20210211004534.py | py | 5,500 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "socket.socket",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_STREAM",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "json.load",
... |
238135485 | # Copyright 2015 Intel Corporation
# 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 require... | null | searchlight-2.0.0/searchlight/elasticsearch/plugins/base.py | base.py | py | 32,889 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "oslo_config.cfg.Opt",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "oslo_config.cfg",
... |
117538988 | from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import GridSearchCV
from sklearn.metrics import classification_report
import argparse
import numpy as np
import pickle
import h5py
# construct the argument parse and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument("-d",... | null | TransferLearning/Duy/train_model.py | train_model.py | py | 1,252 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "h5py.File",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.GridSearchCV",
"line_number": 21,
"usage_type": "call"
},
{
"api_name":... |
255868105 | # -*- coding: utf-8 -*-
"""
Created on Sat Sep 17 00:39:03 2016
@author: jhansen
"""
from astropy.table import Table
import numpy as np
import numpy.core.defchararray as npstr
import math
#Read in table
t = Table.read('gdoc_best.csv', format = 'ascii.csv')
#Sort table according to RA and DE
t.sort(['RAdeg', 'DEdeg']... | null | playground/junkpile/duplicate_binary.py | duplicate_binary.py | py | 3,016 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "astropy.table.Table.read",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "astropy.table.Table",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "numpy.zeros",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.empty"... |
17050090 |
from django.shortcuts import render
import json
from .models import Search, Products
from django.views import generic
BASE_CRAIGSLIST_URL = 'https://losangeles.craigslist.org/search/?query={}'
BASE_IMAGE_URL = 'https://images.craigslist.org/{}_300x300.jpg'
'https://images.craigslist.org/00F0F_8FJ6PlvN7vX_300x300.... | null | my_app/views.py | views.py | py | 6,186 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.views.generic.ListView",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "django.views.generic",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "models.Products",
"line_number": 29,
"usage_type": "name"
},
{
"api_name"... |
549785031 | import pygame
class Viewer:
def __init__(self, update_func, display_size):
self.update_func = update_func
self.display_size = display_size
pygame.init()
self.display = pygame.display.set_mode(display_size, 0, 32)
def set_title(self, title):
pygame.display.s... | null | Viewer.py | Viewer.py | py | 1,386 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pygame.init",
"line_number": 7,
"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.display.s... |
112414551 | from flask import render_template
from app import app
import requests
from bs4 import BeautifulSoup
@app.route('/')
@app.route('/index')
def index():
return render_template('index.html',go='here')
@app.route('/hindu')
def hindu():
r = requests.get('http://www.thehindu.com/opinion/editorial/')
soup =... | null | app/views.py | views.py | py | 1,570 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.render_template",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "app.app.route",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "app.app",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "app.app.route",
"line_n... |
508616184 | """
Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to ... | null | src/cfnlint/rules/resources/properties/Required.py | Required.py | py | 5,952 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cfnlint.CloudFormationLintRule",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "cfnlint.helpers.load_resources",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "cfnlint.helpers",
"line_number": 31,
"usage_type": "attribute"
},
{
... |
623041255 | import os
import numpy as np
from matplotlib import pyplot as plt
from CMAES_evolStrat import getQuarantined
if __name__ == "__main__":
ablnFile = os.path.join(os.getcwd(), "quarTest", "abln_10.txt")
print(ablnFile)
if(os.path.exists(ablnFile)):
cells = np.loadtxt(ablnFile, dtype=int, delimiter=","... | null | quarTest/tst10.py | tst10.py | py | 554 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.join",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": ... |
549517224 | import torch
import torch.nn.functional as F
import torch.optim as optim
import torch.utils.data.distributed
from torch.utils.tensorboard import SummaryWriter
from torch.utils.data import Dataset, DataLoader
import horovod.torch as hvd
import os
import math
from tqdm import tqdm
from torchvision import models
epochs =... | null | distributed/train.py | train.py | py | 6,222 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tqdm.tqdm",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "torch.nn.functional.cross_entropy",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "torch.nn.functional",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "math.... |
630568300 | """
Siem de Jong
Plot summary of k_d accompanying the mean radius cubed.
Fitting using fit_data.py has to be performed first.
"""
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from glob import glob
from tkinter import filedialog
from tkinter import *
import os
plt.style.use(['science'])
plt.r... | null | plot_k.py | plot_k.py | py | 4,915 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.pyplot.style.use",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 15,
"usage_type": "name"
},
{
"api_na... |
433151120 | from django.conf import settings
from django.db import models
from django.core.urlresolvers import reverse
from django.template.defaultfilters import escape
from django.db.models import Q
from django.contrib.auth.models import AbstractUser
from django.core.exceptions import ValidationError
FOLLOWING_BITS = {
'lef... | null | imagr_images/models.py | models.py | py | 8,936 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.db.models.Model",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "django.db.models.ForeignKey",
"line_number": 31,
"usage_type": "call"
},
{
"api_name... |
398373370 | # -*- coding: utf-8 -*-
import logging
import os
import time
import unittest
from six import string_types
import pybel
from pybel2ndex import to_ndex, from_ndex
log = logging.getLogger(__name__)
TEST_BEL_URL = 'https://raw.githubusercontent.com/pybel/pybel/develop/tests/bel/thorough.bel'
TEST_ID = '014e5957-3d96-1... | null | tests/test_io.py | test_io.py | py | 1,505 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "pybel.from_path",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path.join",
... |
633492061 | import torch
import torch.nn as nn
import torch.nn.functional as F
class ResBlock(nn.Module): # not paper original
def __init__(self):
super(ResBlock, self).__init__()
self.conv1 = nn.Conv2d(64, 16, kernel_size=1, stride=1, padding=0)
self.conv2 = nn.Conv2d(16, 16, kernel_size=5, stride=1... | null | models/bottle.py | bottle.py | py | 3,622 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.nn.Module",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numbe... |
65431834 | import numpy as np
import pandas as pd
from os import getcwd, listdir
import matplotlib.pyplot as plt
import seaborn as sns
from jupyterthemes import jtplot
sns.set()
jtplot.style(theme="monokai")
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split
from sklearn.metrics... | null | fahrenheit_celsius/fc_ml.py | fc_ml.py | py | 1,110 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "seaborn.set",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "jupyterthemes.jtplot.style",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "jupyterthemes.jtplot",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "os.getcwd",
... |
263907915 | import numpy as np
import cv2
def lowe_filter(matches, k=0.8):
filtered = []
for m, n in matches:
if m.distance < k * n.distance:
filtered.append(m)
return filtered
def keypoints_based_similarity(matches, min_matches=6, max_dist=800):
if len(matches) > 35:
return len(match... | null | week4/kp_matching.py | kp_matching.py | py | 1,796 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.mean",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.inf",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "cv2.BFMatcher",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "cv2.FlannBasedMatcher",
"... |
537661648 | import numpy as np # si pas encore fait
import matplotlib.pyplot as plt
from sklearn.model_selection import LeaveOneOut
from matplotlib import cm as colormap
from scipy.stats import randint as sp_randint
from scipy.stats import alpha as sp_alpha
# definir matrices de rotation et de dilatation
rot = np.array([[0.94, ... | null | rcp209/2017-02-23-tp2/ex2_bis.py | ex2_bis.py | py | 2,872 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.array",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_numb... |
632525645 | # from docx_init import combine_word_documents
import docx
from docx import Document
from zip_De import zip_de
from rename_copy_image import coverFiles
from document_xml import read_xml, find_nodes, write_xml
from xml.etree.ElementTree import ElementTree,Element
# import zip_En
import zipfile
import shutil
import os
i... | null | main.py | main.py | py | 6,141 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.getcwd",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 32,
"us... |
444420871 | import logging
from yammp.email import EMailProcessor
from yammp.models import Message, MessageRecipients, Membership, Recipient, MessageSentLog
from django.utils import timezone
__author__ = 'cristiroma'
from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
args = ''
... | null | yammp/management/commands/yammp_send.py | yammp_send.py | py | 1,527 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "yammp.models.Message.objects.filter",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "yammp.models.Message.objects",
"line_number": 16,
"usage_type... |
583328308 | from scrapy.exceptions import IgnoreRequest
ACCEPTED_CONTENT_TYPES = (
'text/html',
'application/xhtml+xml',
)
class FilterNonHTMLResponses(object):
"""Limit the response types to HTML and robots.txt"""
def process_response(self, request, response, spider):
if response.url.endswith('robots.... | null | source/crawler/middlewares.py | middlewares.py | py | 662 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "scrapy.exceptions.IgnoreRequest",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "scrapy.exceptions.IgnoreRequest",
"line_number": 21,
"usage_type": "call"
}
] |
188454020 | from typing import List, Dict, Set
from stv.models.asynchronous.local_transition import LocalTransition
class LocalModel:
"""
Represents local model of the agent.
:ivar _agent_id: Agent identifier.
:ivar _agent_name: Agent name.
:ivar _states: Dictionary of states, assigns unique identifier to ea... | null | stv/models/asynchronous/local_model.py | local_model.py | py | 3,596 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "typing.Dict",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "stv.models.asynchronous.local_transition.LocalTransition",
"line_number": 17,
"usage_type": "name"
},
{
"... |
102479946 | import math
from itertools import zip_longest
import operator
class PlayerDay:
def __init__(self, player, day):
self.day = day
self.name = None
self.player = player
self.is_first_day = False
self.won_games = []
self.lost_games = []
self.won_game_terms_var = N... | null | lib/whole_history_rating/player_day.py | player_day.py | py | 4,521 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "math.exp",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "math.log",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "math.log",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "math.log",
"line_number": 30,
"usa... |
138941937 | """Functions for replicating estimates.
"""
import concurrent.futures
import numpy as np
import progressbar
from sklearn import metrics
from . import utils
__all__ = []
def replicate_coefficient(fit_model, extract_coefficients, X, y, **kwargs):
# Fit estimator with the training set
estimator = fit_model(X,... | null | Python/easyml/replicate.py | replicate.py | py | 11,054 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "progressbar.ProgressBar",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "concurrent.futures.futures.ProcessPoolExecutor",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "concurrent.futures.futures",
"line_number": 64,
"usage_type": "att... |
465168007 | #!/usr/bin/python3
"""
Author: cg
Date: 2020/6/5 10:38
"""
import os
from common import const
from util import com_util
from sanic.log import logger
from sanic.log import error_logger
class CfgData:
# 基本配置
_base = dict()
# mongo配置
_mongo = dict()
# server配置
_server = dict()
def __init... | null | util/cfg_util.py | cfg_util.py | py | 2,942 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "common.const.baseCfgFileName",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "common.const",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "common.const.baseMongoFileKey",
"line_number": 28,
"usage_type": "attribute"
},
{
... |
25744148 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... | null | google/maps/fleetengine/v1/maps-fleetengine-v1-py/maps/fleetengine_v1/types/trips.py | trips.py | py | 15,238 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "proto.module",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "proto.Enum",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "proto.Enum",
"line_number": 50,
"usage_type": "attribute"
},
{
"api_name": "proto.Enum",
"line_n... |
108168319 | # -*- coding: utf-8 -*-
"""
Created on Wed Sep 23 11:17:07 2020
@author: rundo
"""
import numpy as np
import scipy as sp
from matplotlib import pyplot as plt
from Lab2_Q2a_function import *
from time import time
############# a i ############################################################
print('----------Q2a i----... | null | Lab2/Submission/Lab2_Q2a.py | Lab2_Q2a.py | py | 3,484 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.arange",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "matplotlib.py... |
335036297 | """FoodFinder URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-ba... | null | FoodFinder/urls.py | urls.py | py | 1,512 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.urls.path",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "... |
194670650 | # %% Define some methods
from numba import jit
import numpy as np
from hotspot.local_stats_pairs import local_cov_pair, conditional_eg2
@jit(nopython=True)
def _compute_hs_pairs_inner_centered_cond_sym_shuff(
rowpair, counts, neighbors, weights, eg2s
):
"""
This version assumes that the counts have alrea... | null | pipelineScripts/hotspot/runHotspotPairs_shuffled.py | runHotspotPairs_shuffled.py | py | 4,766 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.random.permutation",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "hotspot.local_stats_pairs.local_cov_pair",
"line_number": 23,
"usage_type": "call"
},
{
... |
444460348 | import re
import sys
import json
import spacy
import string
import argparse
import numpy as np
from pingouin import mwu
from nltk.corpus import stopwords
def _process_strings(line,
lang_nlp,
get_lemmas,
get_pos,
remove_stopwords,
... | null | evaluation/test_attractor_correlations.py | test_attractor_correlations.py | py | 20,309 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "re.sub",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 58,
"usage_type"... |
541665482 | from django.db.models import F
from wagtail.core.models import PageRevision
def get_old_revisions_for_all_pages():
revisions = (
PageRevision.objects.filter(submitted_for_moderation=False)
.filter(approved_go_live_at__isnull=True)
.exclude(page__live_revision_id=F("id"))
.filter(pa... | null | src/xr_wagtail/services.py | services.py | py | 502 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "wagtail.core.models.PageRevision.objects.filter",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "wagtail.core.models.PageRevision.objects",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "wagtail.core.models.PageRevision",
"line_number":... |
506691696 | """add users' email
Revision ID: 3606ef604a9c
Revises: None
Create Date: 2016-06-03 20:14:53.265000
"""
# revision identifiers, used by Alembic.
revision = '3606ef604a9c'
down_revision = None
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
def upgrade():
### commands auto g... | null | migrations/versions/3606ef604a9c_add_users_email.py | 3606ef604a9c_add_users_email.py | py | 2,078 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "alembic.op.create_table",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integ... |
392192049 | import facebook
import time
import requests
import argparse
import sys
import json
from dateutil import parser as date_parser
from confluent_kafka import Producer
def check_int(val):
try:
ival = int(val)
except ValueError:
raise argparse.ArgumentParser("Value {} from input has to be an integer... | null | facebook-downloader/dk/itu/facebook/bulk/MainBulk.py | MainBulk.py | py | 3,161 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "confluent_kafka.Producer",
"line_number": 38,
"usage_type": "call"
},
{
"api_name... |
624096932 | '''
Created on Jun 18, 2014
@author: INAOE_Vital
'''
import matplotlib.pyplot as plt
import numpy as np
import numpy.ma as ma
x1 = x2 = np.arange(5)
y1 = np.array([1,5,20,2,4])
y2 = np.array([4,2,3,32,6])
NumberOfMasks = 2
Y_DataVector = [y1,y2]
X_DataVector = [x1,x2]
ColorVector = ['r','b']
PairingVector = []
for... | null | X_Bin/Tutorials2/MasksAndHistograms.py | MasksAndHistograms.py | py | 1,620 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.arange",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.ma.where",
"line_numbe... |
392009916 | import numpy as np
from qutip import *
import qutip.control.pulseoptim as cpo
np.random.seed(3)
# Setup
N = 1
H_d = sigmaz()
H_c = [sigmax()]
qc = QubitCircuit(N)
qc.add_gate("SNOT", 0)
hadamard = qc.propagators()[0]
U_targ = hadamard
U_0 = identity(U_targ.dims[0])
n_ts = 10
evo_time = 10
# Calculate amps with puls... | null | optpulse.py | optpulse.py | py | 1,286 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.random.seed",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "qutip.control.pulseoptim.optimize_pulse_unitary",
"line_number": 21,
"usage_type": "call"
},
{
... |
432929902 | """
- Provision a results table.
- Preprocessing
- Identify highest-degree node in motif, M1
- Identify second-highest degree node in motif, M2, connected to M1 by
a single edge.
- Identify all nodes with degree of M1 or greater in the host graph,
which also have all required attributes of t... | null | grandiso/__init__.py | __init__.py | py | 17,583 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "networkx.Graph",
"line_number": 60,
"usage_type": "attribute"
},
{
"api_name": "networkx.Graph",
"line_number": 86,
"usage_type": "attribute"
},
{
"api_name": "networkx.Graph",
"line_number": 109,
"usage_type": "attribute"
},
{
"api_name": "networkx... |
107378299 | import torch
import torch.nn as nn
from torch.distributions.normal import Normal
class FastSpeech2VCwGMMLoss(nn.Module):
""" FastSpeech2 Loss """
def __init__(self, beta, g_beta):
super(FastSpeech2VCwGMMLoss, self).__init__()
self.mse_loss = nn.MSELoss()
self.mae_loss = nn.L1Loss()
... | null | vc_tts_template/fastspeech2VCwGMM/loss.py | loss.py | py | 5,336 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.nn.Module",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.nn.MSELoss",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_num... |
423322304 | import urllib.request
import bs4 as bs
def call_back(myurl):
toremove = dict.fromkeys((ord(c) for c in u'\xa0\n\t'))
# Fetch the html file
response = urllib.request.urlopen(myurl)
html_doc = response.read()
# Parse the html file
soup = bs.BeautifulSoup(html_doc, 'lxml')
# Get question ans... | null | backend/downloadData.py | downloadData.py | py | 1,107 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "urllib.request.request.urlopen",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "urllib.request",
"line_number": 7,
"usage_type": "name"
},
{
"api_name":... |
437902491 | __author__ = "Aditya Singh"
__version__ = "0.1"
import yaml
import glob
import torch
import argparse
from datetime import datetime
import os
import torchvision.transforms as transforms
from torch.utils.data import DataLoader
from torchvision.datasets import CIFAR100, STL10, FashionMNIST, MNIST
from utils import load_c... | null | evaluation.py | evaluation.py | py | 6,603 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.datetime.now",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "torch... |
96211656 | # -*- coding: utf-8 -*-
"""
Created on Thu Sep 24 13:39:41 2020
@author: DELL
"""
from flask import Flask, render_template, request# Flask-It is our framework which we are going to use to run/serve our application.
#request-for accessing file which was uploaded by the user on our application.
import numpy as np #use... | null | app.py | app.py | py | 1,619 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pickle.load",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "flask.request.form",
... |
49725559 | from django.conf.urls import include, url, patterns
from views import *
urlpatterns = patterns('',
url(r'^$', home),
url(r'^login/$', login ,{'template_name':'users/login.html'}, name="login"),
url(r'^logout/$', 'django.contrib.auth.views.logout',{'template_name':'users/logout.html'}),
url(r'^home/$', ... | null | users/urls.py | urls.py | py | 462 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.conf.urls.patterns",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "djan... |
490142257 | import pandas as pd
import os, sys, string
from utils import save_text
import ast
DATA_DIR = 'training_data'
#for file in os.listdir(DATA_DIR):
# print(file)
#datas.append(pd.read_csv(DATA_DIR+'/thing.txt'))
#print('thing.txt')
datas = open(DATA_DIR+'/thing.txt')
clean_comments = datas.readlines()
comments = '\n'... | null | YeLyricsProject/collect_text.py | collect_text.py | py | 1,398 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "string.punctuation",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "utils.save_text",
"line_number": 52,
"usage_type": "call"
}
] |
415573215 | import numpy as np
import matplotlib.pyplot as plt
from sklearn import datasets,manifold
def load_data():
iris = datasets.load_iris()
return iris.data, iris.target
def test_LocallyLinearEmbedding(*data):
"""
测试局部线性嵌入的效果
"""
x,y = data
for n in [4, 3, 2, 1]:
lle = manifold.LocallyLi... | null | All_Contents/PCA_Dim_Reduction/0005-LLE.py | 0005-LLE.py | py | 2,721 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sklearn.datasets.load_iris",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "sklearn.manifold.LocallyLinearEmbedding",
"line_number": 15,
"usage_type": "call"
},
{
... |
619445356 | # -*- coding: utf-8 -*-
"""
Created on Sat Dec 22 19:39:18 2018
@author: 14561
"""
import pandas as pd
import numpy as np
#划分训练集和测试集
from sklearn.model_selection import train_test_split
from sklearn.feature_extraction import DictVectorizer
# from sklearn.preprocessing import StandardScaler
from sklearn.linear_model i... | null | 00_MyPro/toy/Perceptron.py | Perceptron.py | py | 4,934 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.array",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "numpy.nan",
"line_num... |
529425506 | import gzip
import json
import os
from tqdm import tqdm
from allennlp.data.dataset_readers.semantic_parsing.wikitables import util
DPD_PATH = "/wikitables/dpd_output/"
def process_file(file_path: str, out_path: str):
examples = []
with open(file_path, "r") as data_file:
for line in tqdm(data_file.... | null | scripts/preprocess_for_latent_alignment.py | preprocess_for_latent_alignment.py | py | 1,185 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tqdm.tqdm",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "allennlp.data.dataset_readers.semantic_parsing.wikitables.util.parse_example_line",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "allennlp.data.dataset_readers.semantic_parsing.wikita... |
457562077 | """
Take labelled data and aggregates to create predictors for a model.
Usage:
predictor_construction (-h|--help)
predictor_construction <input> <output>
[--debug]
[--verbose]
Options:
-h, --help This help message is printed
<input> Path to ... | null | python_analysis_scripts/edit_analyses/predictor_construction.py | predictor_construction.py | py | 12,786 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "re.I",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "re.compile",
"line_number"... |
418905096 | #!coding=utf-8
import tensorflow as tf
import numpy as np
DEBUG = True
class TextCNN(object):
"""
A CNN for text classification.
Uses an embedding layer, followed by a convolutional, max-pooling and softmax layer.
"""
def __init__(
self, sequence_length, num_classes, vocab_size,
embe... | null | shandong_crim_classify/text_cnn.py | text_cnn.py | py | 7,619 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tensorflow.placeholder",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "tensorflow.int32",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.placeholder",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "t... |
520985266 | # -*- coding: utf-8 -*-
# author:lyh
# datetime:2020/8/3 10:17
"""
64. 最小路径和
给定一个包含非负整数的 m x n 网格,请找出一条从左上角到右下角的路径,使得路径上的数字总和为最小。
说明:每次只能向下或者向右移动一步。
示例:
输入:
[
[1,3,1],
[1,5,1],
[4,2,1]
]
输出: 7
解释: 因为路径 1→3→1→1→1 的总和最小。
"""
from typing import List
class Solution:
def minPathSum(self, grid: List[List[int]... | null | Solutions/0064.minPathSum.normal.py | 0064.minPathSum.normal.py | py | 1,127 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "typing.List",
"line_number": 26,
"usage_type": "name"
}
] |
15591546 | import torch
import numpy as np
import matplotlib.pyplot as plt
import torch.nn.functional as F
import torch.nn as nn
import torch.optim as optim
import networkx as nx
from controller import GRNNController
class GRNN(nn.Module):
""" A simplified version of the Graph Recurrent Neural Network
"""
def __init_... | null | grnn.py | grnn.py | py | 4,238 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.nn.Module",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "torch.rand",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "torch.double",
"line_num... |
176422430 | import nltk
from nltk.stem import PorterStemmer
from nltk.tokenize import sent_tokenize, word_tokenize
ps = PorterStemmer()
a = open('reviews.dat','r')
b = a.read()
def removeNonAscii(s): return "".join(i for i in s if ord(i)<128)
b = removeNonAscii(b)
f = open('stemreview.dat','w')
for i in b.split('\n'):
words = w... | null | Crawler/stem.py | stem.py | py | 429 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "nltk.stem.PorterStemmer",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "nltk.tokenize.word_tokenize",
"line_number": 13,
"usage_type": "call"
}
] |
457260322 | """Helper functions for displaying types of data."""
import operator
import IPython.display
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
def get_values(data, idxs):
"""
Helper function to index numpy arrays and pandas objects similarly.
Parameters
----------
data ... | null | superintendent/display.py | display.py | py | 2,899 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.ndarray",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "pandas.Series",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "pandas.DataFrame",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "operator.... |
347136590 | from typing import List
class Solution:
def countNegatives(self, grid: List[List[int]]) -> int:
if not grid:
return 0
n_length = len(grid[0])
result = 0
for item in grid:
for i in range(n_length):
if item[i] < 0:
result +=... | null | 1351.py | 1351.py | py | 382 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
}
] |
287346755 | from pages.courses.register_courses_page import RegisterCoursesPage
from pages.home.navigation_page import NavigationPage
from utilities.executestatus import ExecuteStatus
import unittest, pytest
from ddt import ddt, data, unpack
from utilities.read_data import getCSVData
@pytest.mark.usefixtures("oneTimeSetUp", "setU... | null | tests/courses/register_courses_csv_data.py | register_courses_csv_data.py | py | 1,201 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "unittest.TestCase",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pages.courses.register_courses_page.RegisterCoursesPage",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "utilities.executestatus.ExecuteStatus",
"line_number": 15,
... |
79267929 | __author__ = 'admin'
from sklearn.datasets import fetch_20newsgroups
from sklearn.feature_extraction.text import TfidVectorizer
from math import fabs
i = 2
j = 1
dataset = fetch_20newsgroups(categories = ['alt.atheism', 'talk.religion.misc', 'sci.space'])
vector = TfidVectorizer()
X = vector.fit_transform(dataset.data... | null | Zaplatkina_Irina/semantic_distance.py | semantic_distance.py | py | 458 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sklearn.datasets.fetch_20newsgroups",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sklearn.feature_extraction.text.TfidVectorizer",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "math.fabs",
"line_number": 13,
"usage_type": "call"
}
... |
536832956 | from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import InputLayer,LeakyReLU, ReLU, Conv2D, MaxPool2D, Dense, Flatten, BatchNormalization, Activation, Dropout, Input, LeakyReLU, ZeroPadding2D, UpSampling2D
from tensorflow.keras import callbacks
from time import time
from tensorflow.keras.util... | null | model.py | model.py | py | 5,617 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "h5py.File",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.models.model_from_json",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "json.dump... |
582496478 | from selenium.webdriver.firefox.options import Options as FirefoxOptions
from seleniumwire.webdriver import Firefox, FirefoxProfile
from webdriver.firefox_preferences import preferences
from os import path, name
import traceback
import sys
import pickle
from pathlib import Path
import json
directory = path.dirname(__... | null | google/driver.py | driver.py | py | 4,908 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.dirname",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "os.name",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 14,... |
306547021 | from random import choice
from typing import List
from typing import Tuple
from django_countries import countries
from mock_api_gateway.company.models import Company
def create_company(
name: str,
description: str,
industry: str,
exchange: str,
country: str,
) -> Tuple[Compan... | null | mock_api_gateway/common/management/commands/_company.py | _company.py | py | 3,109 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "mock_api_gateway.company.models.Company.objects.get_or_create",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "mock_api_gateway.company.models.Company.objects",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "mock_api_gateway.company.model... |
335870146 | #!/usr/bin/env python
"""
API bootstrap file
"""
from flask import Flask, jsonify
import sys
import os
import argparse
import logging
from couchbase import Couchbase
from couchbase.exceptions import ConnectError
sys.path.insert(0, os.path.dirname(
os.path.realpath(__file__)) + '/../../../../lib')
sys.path.insert(0... | null | lib/hmac_sandbox/v1/api/main.py | main.py | py | 2,685 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.insert",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
590420474 | from pathlib import Path
from rdflib import Graph, Namespace
from rdflib.namespace import TIME
import sys
sys.path.append(str(Path(__file__).parent.parent))
from timefuncs import has_during
TFUN = Namespace("https://w3id.org/timefuncs/")
HD = Namespace("https://w3id.org/timefuncs/testdata/hasduring/")
tests_dir = Pa... | null | tests/functions/test_has_during.py | test_has_during.py | py | 1,149 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.append",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "rdflib.Namespace",
"line_... |
143478034 | from sqlalchemy import create_engine
import pandas as pd
class SQLManager:
_instance = None
@staticmethod
def get_istance():
""" Static access method. """
if SQLManager._instance == None:
SQLManager()
return SQLManager._instance
def __init__(self):
""" Vir... | null | utils/SQLManager.py | SQLManager.py | py | 796 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pandas.read_sql",
"line_number": 26,
"usage_type": "call"
}
] |
559367314 | import io
from google.cloud import vision
client = vision.ImageAnnotatorClient()
path = "/l/disk0/vdeorios/Documentos/garrafas.jpg"
with io.open(path, 'rb') as image_file:
content = image_file.read()
image = vision.types.Image(content=content)
response = client.label_detection(image=image)
labels = response.lab... | null | imageDetector.py | imageDetector.py | py | 507 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "google.cloud.vision.ImageAnnotatorClient",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "google.cloud.vision",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "io.open",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "goo... |
597333342 | import PIL
from keras_image_to_image.library.dcgan_vgg16 import DCGanWithVGG16
from keras_image_to_image.library.utility.img_directory_loader import load_image_path_pairs
import numpy as np
from random import shuffle
from PIL import Image
def main():
seed = 42
np.random.seed(seed)
img_dir_path = './dat... | null | demo/dcgan_vgg16_generate.py | dcgan_vgg16_generate.py | py | 1,262 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.random.seed",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "keras_image_to_image.library.utility.img_directory_loader.load_image_path_pairs",
"line_number": 22,
... |
106949131 | from conans import ConanFile, CMake, tools
import os
class ProtobufConan(ConanFile):
name = "protobufcpp"
version = "3.6.1"
author = "Ralph-Gordon Paul (g.paul@appcom-interactive.de)"
settings = "os", "compiler", "build_type", "arch"
options = {"shared": [True, False], "android_ndk": "ANY", "androi... | null | conanfile.py | conanfile.py | py | 4,025 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "conans.ConanFile",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "conans.tools.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "conans.tools",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "conans.tools.replace_in... |
232943260 | import sqlalchemy
from sqlalchemy.orm import sessionmaker
from models import Topics
import config
from app import celery
def connect():
"""Connects to the database and return a session"""
uri = config.SQLALCHEMY_DATABASE_URI
# The return value of create_engine() is our connection object
con = sqlalc... | null | src/tasks.py | tasks.py | py | 654 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "config.SQLALCHEMY_DATABASE_URI",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "sqlalchemy.create_engine",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.sessionmaker",
"line_number": 17,
"usage_type": "call"
},
... |
445026185 | # recent: sort=recent
# mostviewed: sort=viewed
# toprated: sort: rating
import sys
import urllib
from BeautifulSoup import SoupStrainer
from BeautifulSoup import BeautifulSoup
import http_request
import control
import utils
class Main:
def __init__(self):
# Parse parameters...
params = dict(par... | null | resources/lib/all_content.py | all_content.py | py | 2,543 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.argv",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "urllib.unquote_plus",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "utils.set_no_sort",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "control.lang",
... |
356925110 | """
Main module of the package. Defines classes and methods for working with phylogenetic trees and networks.
"""
import networkx as nx
import numpy
from networkx import DiGraph
import pyparsing
from .eNewick import eNewickParser
from .exceptions import *
from itertools import combinations
from cached_property import... | null | phylonetwork/__init__.py | __init__.py | py | 18,917 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "networkx.DiGraph",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "cached_property.cached_property",
"line_number": 69,
"usage_type": "name"
},
{
"api_name": "ca... |
117411710 | # -*- coding: utf-8 -*-
import pygame
from pygame.locals import *
import socket
import json
#SOCKET
HOST = '192.168.1.100'
PORT = 50007
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
print("xogo conectandose ao servidor",[HOST,PORT])
CONT_CONEXION = 0
#CONSTANTES
ANCHO_CADRO = 85
... | null | 3EnRaia/01/xogo.py | xogo.py | py | 3,993 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "socket.socket",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_STREAM",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "pygame.init... |
643883348 | import os
import sys
from textual.reactive import Reactive
from textual.app import App
from textual.widgets import ScrollView
from . import config
from .tree import JenkinsTree
from .views import JenkinsScrollView, JenkinsHomeView
from .widgets import JenkinsHeader, JenkinsFooter, JenkinsScrollBar
from .containers i... | null | src/jenkins_tui/app.py | app.py | py | 2,356 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "textual.app.App",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "textual.reactive.Reactive",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "widgets.JenkinsHeader",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "widge... |
525791009 | import torch
import numpy as np
import random
import time
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.utils.rnn as rnnutils
from torch.distributions.normal import Normal
from torch.distributions.kl import kl_divergence
from torch.optim import Adam
import matplotlib.pyplot as plt
device = tor... | null | src/notimp/rnnpp.py | rnnpp.py | py | 14,292 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.device",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torch.LongTensor... |
160423372 | from django.contrib import admin
from django.urls import path, re_path
from .views import *
urlpatterns = [
path('', login, name='login'),
path('cadastrar_adquirente/', cadastrar_adquirente, name='cadastrar_adquirente'),
path('cadastrar_colaborador/', cadastrar_colaborador, name='cadastrar_colaborador'),
... | null | SaoRoque/Equipamentos/urls.py | urls.py | py | 2,362 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
472018385 | import numpy as np
import scipy.ndimage.filters as filters
def median_smooth(data,size=3):
'''
data: m*n np.array
'''
return(filters.median_filter(data, size=size))
def local_maximum(data_smooth, size=3,threshold=1):
'''
data_smooth: m*n np.array
threshold: return as local_max only if loca... | null | Automark_4D/local_maxima.py | local_maxima.py | py | 631 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "scipy.ndimage.filters.median_filter",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "scipy.ndimage.filters",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "scipy.ndimage.filters.maximum_filter",
"line_number": 16,
"usage_type": "call"
... |
582457419 | #Boa:Frame:Frame2
import wx
import wx.html
import Frame1
page = ""
hola = open(u'paginasAyuda/ayuda.html','r')
page = hola.read()
hola.close()
def create(parent):
return Frame2(parent)
[wxID_FRAME2, wxID_FRAME2BITMAPBUTTON1, wxID_FRAME2PAGINA,
wxID_FRAME2STATICBITMAP1,
] = [wx.NewId() for _init_c... | null | frAyuda.py | frAyuda.py | py | 1,936 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "wx.NewId",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "wx.Frame",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "wx.Frame.__init__",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "wx.Frame",
"line_number"... |
651628749 | from flask import jsonify
from flask import Blueprint
from flask import g
from flask import request
from flask import url_for
from flask import redirect
from flask import render_template
from flask import flash
import functools
from idor.vuln_app.db import get_db
bp = Blueprint("payments", __name__)
def login_requ... | null | courses/python/idor/vuln_app/patched_payments.py | patched_payments.py | py | 1,958 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Blueprint",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.g.user",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "flask.g",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "flask.redirect",
"line_... |
196909058 | import os
import visdom
from tqdm import tqdm
from utils.loss import *
from torch.utils import data
from torch.autograd import Variable
from data import get_loader, get_data_path
from config import trainConfig
from utils.metrics import runningScore
from models import get_model
def train():
hparam = trainConfig()
... | null | semseg-pytorch/train.py | train.py | py | 7,939 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "config.trainConfig",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "data.get_loader",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "data.get_data_path",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "torch.utils.dat... |
539480121 | """
===========
Serializers
===========
"""
from rest_framework import serializers as rf_serializers
from django.db.models import ForeignKey
class ExSerializer(rf_serializers.Serializer):
"""
Base serializer that adds a feature of dynamically allow selection fields in response.
"""
def __init__(self... | null | core/serializers.py | serializers.py | py | 3,575 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rest_framework.serializers.Serializer",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 34,
"us... |
546525359 | from django.core.urlresolvers import reverse
from rest_framework import status
from rest_framework.test import APITestCase, APITransactionTestCase
from .factories import SurveyFactory, QuestionFactory, QuestionnaireFactory
from ..models import *
class SurveyRetrieveTestCase(APITestCase):
def setUp(self):
... | null | unite/surveys/tests/test_views.py | test_views.py | py | 5,138 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rest_framework.test.APITestCase",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "factories.QuestionFactory.create",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "factories.QuestionFactory",
"line_number": 16,
"usage_type": "name"
},
... |
179828588 | '''
函数说明:
Author: hongqing
Date: 2021-07-13 15:40:23
LastEditTime: 2021-07-30 17:45:18
'''
import numpy as np
import pygame
from pygame.locals import *
import random
agentWidth = 150
class Generator:
def __init__(self) -> None:
self.speed = 1 #速度
self.width = 100 #宽度
self.limit = 500 - se... | null | testfile/env/env.py | env.py | py | 3,394 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "random.randint",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pygame.init",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "pygame.display",
... |
201684734 | import traci
import time
import traci.constants as tc
import pytz
import datetime
from random import randrange
import pandas as pd
def getdatetime():
utc_now = pytz.utc.localize(datetime.datetime.utcnow())
currentDT = utc_now.astimezone(pytz.timezone("Asia/Singapore"))
DATIME = currentDT.strft... | null | 2021-05-01-22-25-37/Client2Sumo.py | Client2Sumo.py | py | 9,474 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pytz.utc.localize",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pytz.utc",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.utcnow",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.dat... |
20053901 | import os
import pwd
import stat
import yaml
import logging
from jadi import interface, component, service
import aj
from aj.util import public
class BaseConfig():
"""
A base class for config implementations. Your implementation must be able to save
arbitrary mixture of ``dict``, ``list``, and scalar valu... | null | ajenti-core/aj/config.py | config.py | py | 5,792 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.warning",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 64,
"usage_type": "attribute"
},
{
"api_name": "logging.info",
"line_... |
431792258 | """
Interpolation methods
"""
import numpy as np
from scipy import interpolate
def interp(xdat, ydat, xnew, deriv_true=None):
"""Spline interpolation
A cubic spline (scipy) is used to perform the interpolation. A (rough)
estimate of the error can be obtained by comparing linear extrapolations of
the ... | null | psets/final_exam/review/interpolation.py | interpolation.py | py | 2,330 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.array",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": ... |
45757567 | from keras.models import Model, Sequential
from keras.layers import Dense, Activation, Dropout, Flatten, Input
from keras.layers.convolutional import ZeroPadding2D, Convolution2D
from keras.layers.pooling import (MaxPooling2D, AveragePooling2D,
GlobalAveragePooling2D)
from keras.l... | null | rme/models/cifar10.py | cifar10.py | py | 8,786 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "keras.models.Sequential",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "blocks.add_nin_block",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "keras.layers.pooling.MaxPooling2D",
"line_number": 24,
"usage_type": "call"
},
{
"ap... |
561836082 | from ..websocket import WebSocket
from ..types import Pair
import requests
import traceback
import datetime
from pytz import reference
import math
from numpy import linspace
import json
from pandas import DataFrame, to_numeric
from urllib.parse import urlencode
import hmac
from ..paperwallet import PaperWallet
from ..u... | null | package/exchanges/binance.py | binance.py | py | 5,685 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "types.Pair",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "traceback.print_exc",
"line_... |
441441776 | import pandas as pd
import numpy as np
import sys
from random import randint, uniform
# Maybe import just mean
# sys.path.append(".")
from .utils import Generator, dmini, dmaxi, dmean, percentages2B
from .algorithms import findOptimumDataByProbsAndByIndex
from .constants import *
import matplotlib.pyplot as plt
"""
... | null | generator/typo/gexp.py | gexp.py | py | 4,786 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "utils.Generator",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "utils.dmaxi",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "utils.dmini",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "utils.dmean",
"line_numbe... |
34573755 | import json
import os
import pytest
from afs import config_handler
# def test_config_handler_catalog(mocker, config_handler_resource, data_dir, capsys):
# config_handler_resource.set_param('myinteger', type='integer', required=True, default=2)
# config_handler_resource.set_param('myfloat', type='float', requ... | null | tests/v1/test_config_handler.py | test_config_handler.py | py | 9,319 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ",
"line_number": 102,
"usage_type": "attribute"
},
{
"api_name": "os.environ.update",
"line_number": 104,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 104,
"usage_type": "attribute"
},
{
"api_name": "pytest.fixture",... |
582776920 | import numpy as np
import matplotlib.pyplot as plt
import time
import excel_reader
DATA_FROM = 0
DATA_TO = 300
DATA_LENGTH = DATA_TO - DATA_FROM
INF_DAYS = 50
#LOGNORMAL_MU = -2
#LOGNORMAL_STD = 0.5
#mean = 0.22
LOGNORMAL_MU = -5
LOGNORMAL_STD = 0.01
C = 0.999
LEARNING_RATE = 0.1
STEPS = 10
def comp_index_matrix(p):
... | null | data_lable_analysys.py | data_lable_analysys.py | py | 4,307 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.dot",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.log",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.log",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 52,
... |
24276549 | import requests
import bs4
import lxml
from robobrowser import RoboBrowser
br = RoboBrowser(parser="lxml")
br.open("https://strava.com/login")
s = requests.session()
print(s)
form = br.get_form(action='/session')
print(form)
form['email'].value = 'strava2@byom.de'
form['password'].value = '123456789'
print(form... | null | strava.py | strava.py | py | 1,076 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "robobrowser.RoboBrowser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "requests.session",
"line_number": 10,
"usage_type": "call"
}
] |
209890389 | #!/usr/bin/python3
"""
Module to query the Reddit API and returs the number of subscribers of a
given subreddit.
"""
import requests
def number_of_subscribers(subreddit):
"""Returns the number of subscribers of a given subreddit.
Parameters:
subreddit (string): subreddit to search for.
"""
url ... | null | 0x16-api_advanced/0-subs.py | 0-subs.py | py | 640 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 21,
"usage_type": "call"
}
] |
62624698 | import numpy as np
import itertools as it
import os
from PIL import Image
from random import random
from helpers import *
from mobject import Mobject
from point_cloud_mobject import PMobject
class ImageMobject(PMobject):
"""
Automatically filters out black pixels
"""
CONFIG = {
"filter_color" ... | null | mobject/image_mobject.py | image_mobject.py | py | 4,009 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "point_cloud_mobject.PMobject",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "mobject.Mobject.__init__",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "mobject.Mobject",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": ... |
180510581 | from __future__ import absolute_import
import os
import numpy as np
import mxnet as mx
from mtcnn.mtcnn import MTCNN
import cv2
from sklearn.preprocessing import normalize
import insightface.face_preprocess as face_preprocess
from insightface.helper import resize_by_height
# from insightface.mtcnn_detector import Mtcn... | null | insightface/face_model.py | face_model.py | py | 5,268 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "mxnet.model.load_checkpoint",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "mxnet.model",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "mxnet.mod.Module",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "mxnet.m... |
164193300 | from Acquisition import aq_inner
from Acquisition import aq_parent
from opengever.base.interfaces import IReferenceNumber
from opengever.base.oguid import Oguid
from opengever.core.upgrade import SQLUpgradeStep
from sqlalchemy import and_
from sqlalchemy.sql.expression import column
from sqlalchemy.sql.expression impor... | null | opengever/meeting/upgrades/to4603.py | to4603.py | py | 1,533 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sqlalchemy.sql.expression.table",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.sql.expression.column",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.sql.expression.column",
"line_number": 14,
"usage_type": "cal... |
68533982 | #definindo
import math
import numpy as np
import matplotlib.pyplot as plt
flag = False
alpha = 0
alpha_v = 0
u = 1
K = 1
delta_c = 0.5
delta_t = 0.05
Q_ponto = 80
tempo_desp = 2
tempo = 5
a = 15
b = 15
Lx = 30
Ly = 30
q = Q_ponto/(delta_c**2)
tempos = np.arange(0, tempo+delta_t, delta_t)
tamanho_x = int(1+Lx/delta_c)... | null | testesoftaps4.py | testesoftaps4.py | py | 1,608 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.arange",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number"... |
399455285 | import colorama
colorama.init()
BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(8)
NORMAL = "\x1b[0m"
def colorize(text, color = WHITE):
"""Return colorized string"""
return "\x1b[1;{0}m".format(str(30 + color)) + text + "\x1b[1;{0}m".format(str(30 + WHITE))
| null | Modules/color.py | color.py | py | 294 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "colorama.init",
"line_number": 3,
"usage_type": "call"
}
] |
344648968 | """
In order to run this file, it is necessary to install PeakUtils.
Instructions are located in the link below.
https://pypi.python.org/pypi/PeakUtils
-Tyler
"""
import matplotlib.pyplot as plt
import SPEFile
from ROI_Maker import ROI_Maker
import numpy as np
def plot_spectrum(spectrum, title=None, energy_range=None... | null | Spectrum_Peak_Visualization.py | Spectrum_Peak_Visualization.py | py | 7,362 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.pyplot.semilogy",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.xlabel",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": ... |
463272921 | from product.models import Product, Dimension
from order.models import Order
from rest_framework import serializers
from taggit_serializer.serializers import TagListSerializerField
class DimensionSerializer(serializers.ModelSerializer):
class Meta:
model = Dimension
fields = (
'identi... | null | product/serializers.py | serializers.py | py | 1,471 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "product.models.Dimension",
"line_number": 10,
"usage_type": "nam... |
461695604 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('price', '0003_auto_20150430_0059'),
]
operations = [
migrations.CreateModel(
name='Item',
fields=[
... | null | server/se/price/migrations/0004_auto_20150501_1536.py | 0004_auto_20150501_1536.py | py | 1,503 | 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": 14,
"usage_type": "call"
},
... |
379041463 | from flask import request, current_app, jsonify
from functools import wraps
import jwt
import datetime
authorization_header_prefix = 'Bearer '
authorization_header_prefix_len = len(authorization_header_prefix)
www_auth_header = {
'WWW-Authenticate': 'Token realm="Backend", charset="UTF-8"'}
def get_token_data(to... | null | react-router-app/backend/src/endpoints/security_utils.py | security_utils.py | py | 2,756 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "jwt.decode",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.current_app.config",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "flask.current_app",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "flask.requ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.