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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
254769106 | import socket
import time
import datetime
import numpy as np
import plotly.plotly as py
import plotly.graph_objs as go
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import tkinter
packetNum = 200
host = '127.0.0.1'
timeList = []
port = 12000
loss = 0
Min = 100000
Max = 0
total = 0
clientSocket = soc... | null | assignment/LiuClientUDPpingV1.py | LiuClientUDPpingV1.py | py | 2,078 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "socket.socket",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_DGRAM",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "time.time",
... |
106398269 | import facebook # pip install facebook-sdk
# Call this from your POST request handler.
def handle_facebook_login(access_token):
graph = facebook.GraphAPI(access_token)
profile = graph.get_object('me')
if not profile:
raise Exception('Could not log into Facebook.')
# Look up user by Facebook ... | null | fb.py | fb.py | py | 1,911 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "facebook.GraphAPI",
"line_number": 6,
"usage_type": "call"
}
] |
28410455 | # -*- coding:utf-8 -*-
#
# Copyright @ 2017 OPS Inc.
#
# Author: Jinlong Yang
#
import pika
from oslo_config import cfg
from oslo_log import log as logging
LOG = logging.getLogger(__name__)
rabbitmq_opts =[
cfg.StrOpt('mq_host', default='', help='rabbitmq host.'),
cfg.IntOpt('mq_port', default=None, help='ra... | null | cindy/util/rmq.py | rmq.py | py | 3,405 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "oslo_log.log.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "oslo_log.log",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "oslo_config.cfg.StrOpt",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "oslo_confi... |
250680515 | #!/opt/anaconda3/bin/python
import tensorflow as tf
from tensorflow.contrib.tensorboard.plugins import projector
import math
import numpy
from PIL import Image
CLASS_NUM=10
def variable_summaries(var):
mean = tf.reduce_mean(var)
stddev = tf.sqrt(tf.reduce_mean(tf.square(var - mean)))
tf.summary.scalar('... | null | model.py | model.py | py | 5,326 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tensorflow.reduce_mean",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tensorflow.sqrt",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tensorflow.reduce_mean",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tensorf... |
590813538 | from __future__ import print_function
import pickle as pickle
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
# If modifying these scopes, delete the file token.pickle.
SCOPES = ['https://www.googleapis.com/auth/spr... | null | build/lib/gserializer/Tools/Reader.py | Reader.py | py | 2,587 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.exists",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "pickle.load",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "google.auth.transport.requests.Req... |
41054106 | import numpy as np
from scipy import misc
from sklearn.cluster import KMeans
from scipy.spatial import distance
threshold = 0.0001
# Perform E-Step
def expectation(pixel, num_segments, mu, pij):
bottom = np.zeros((pixel.shape[0]))
weight = np.zeros((pixel.shape[0], num_segments)) # initialize the weights
... | null | homework7/problem2.py | problem2.py | py | 5,147 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.zeros",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "scipy.spatial.distance.cdist",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "scipy.spatial.di... |
143548600 | import plotly.graph_objects as go
def plot(df, x, y, tooltip, size, color):
traces = []
if size is not None:
df = _norm(df, size)
if color is not None:
color_vals = df[color].unique().tolist()
else:
df["color"] = "color"
color = "color"
color_vals = ["color"]
... | null | utils/scatter.py | scatter.py | py | 1,601 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "plotly.graph_objects.Scatter",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "plotly.graph_objects",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "plotly.graph_objects.Layout",
"line_number": 42,
"usage_type": "call"
},
{
"api... |
119068280 | from csv import Sniffer
from io import StringIO, BytesIO
from typing import Union
from urllib.request import urlopen
import pandas as pd
from datetime import datetime
from azure.storage.blob import ContainerClient
from data_catalog.assets import Location
from data_catalog.client.asset import AssetResponse
class Ass... | null | data_catalog/assets/asset.py | asset.py | py | 5,816 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "data_catalog.client.asset.AssetResponse",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "data_catalog.assets.Location",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "data_catalog.client.asset.AssetResponse",
"line_number": 45,
"usage_... |
21477953 | """Mendel's First Law"""
from scipy.special import comb
k = 2
m = 2
n = 2
# Total number of organisms in the population
totalPop = k + m + n
# Number of combos that could be made
totalCombos = comb(totalPop, 2)
# Number of combos that have a dominant allele
validCombos = comb(k, 2) + k*m + k*n + .5*m*n + .75*comb(m... | null | rosalind/IPRB.py | IPRB.py | py | 392 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "scipy.special.comb",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "scipy.special.comb",
"line_number": 15,
"usage_type": "call"
}
] |
286084885 | import cv2
import numpy as np
img = cv2.imread("C:\\Users\\tuzuk\\Desktop\\tmp_result.JPG")
#img1= cv2.imread("C:\\Users\\tuzuk\\Desktop\\tmp_th2.JPG")
#塗りつぶし
height, width, channels = img.shape[:3]
print("width: " + str(width))
print("height: " + str(height))
cv2.rectangle(img, (1, height), (width, 1),... | null | 輪郭関係/直線フィッティング.py | 直線フィッティング.py | py | 1,669 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.imread",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.rectangle",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.LINE_4",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "cv2.GaussianBlur",
"line_... |
105442432 | from typing import Union, Sequence, List
from PyQt5 import QtWidgets, QtGui
from PyQt5.QtCore import QSettings
from appGUI.GUIElements import RadioSet, FCCheckBox, FCButton, FCComboBox, FCEntry, FCSpinner, FCColorEntry, \
FCSliderWithSpinner, FCDoubleSpinner, FloatEntry, FCTextArea
import gettext
import appTrans... | null | HSRWLaserTool_APP/FlatCAM_beta_8.994_sources/appGUI/preferences/OptionUI.py | OptionUI.py | py | 11,328 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "appTranslation.apply_language",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "builtins.__dict__",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "gettext.gettext",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_nam... |
392864105 | """
**********************************************************************************
© 2019 Arizona Board of Regents on behalf of the University of Arizona with rights
granted for USDOT OSADP distribution with the Apache 2.0 open source license.
***************************************************************... | null | src/common/BasicVehicle.py | BasicVehicle.py | py | 5,399 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "json.dumps",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "src.common.Position3D.Position3D",
"line_number": 81,
"usage_type": "call"
},
{
"api_name": "src.common.Pos... |
131822056 | from flask import Flask, jsonify, request
import os
import networkx
#os.chdir("C:\\Users\\Wenxin\\Documents\\School\\University\\Utek\\pyshp-1.2.3")
os.chdir(r"C:\Users\Wenxin\Documents\School\University\Utek\pyshp-1.2.3")
import shapefile
#cwd = os.getcwd() # Get the current working directory (cwd)
#files = os.li... | null | FrontEnd/flaskr/app.py | app.py | py | 7,640 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.chdir",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "shapefile.Reader",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "shapefile.Reader",
"line_num... |
451513320 | from flask import Blueprint, g
from sqlalchemy import desc
from ..models import Post
blueprint = Blueprint('main', __name__, static_folder='../static')
@blueprint.before_app_request
def recent_posts():
# Causes error if there are no posts
try:
g.post_list = (
Post.query
.orde... | null | src/views/main.py | main.py | py | 431 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Blueprint",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.g.post_list",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "flask.g",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "models.Post.query.order... |
411489659 | import bs4
import logging
import json
import requests
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger('wb')
main_url = 'https://www.wildberries.ru'
class Client:
def __init__(self):
self.session = requests.Session()
self.session.headers = {
'user-agent': 'Mozilla/5.0 (Window... | null | parser.py | parser.py | py | 2,226 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.basicConfig",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "requests.Sessio... |
623720240 | # -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
from goodtables.checks.blank_header import blank_header
# Check
def test_check_blank_header(log):
errors = []
cells = [
{'numbe... | null | tests/checks/test_blank_header.py | test_blank_header.py | py | 751 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "goodtables.checks.blank_header.blank_header",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "goodtables.checks.blank_header.blank_header",
"line_number": 31,
"usage_type": "call"
}
] |
348656314 | import numpy as np
from scipy.interpolate import griddata
import matplotlib.pyplot as plt
from numpy.random import uniform, seed
from matplotlib import mlab
#plt.figure()
def plot_new_observation(x,y):
plt.plot(x, y, 'bx')
def plot_contour(x_range,y_range, mus, sigmas):
x = np.arange(x_range[0], x_range[1], 0.1)
... | null | kalman_analysis/plot_tool.py | plot_tool.py | py | 1,417 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "numpy.arange",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
... |
138638534 | from pyfaidx import Fasta
from os.path import splitext,basename,join,dirname
import unicodedata
def extract_fasta_seq(fasta_file,genome_range):
whole_seq=Fasta(fasta_file)
chr_name=genome_range.split(":")[0]
start=((genome_range.split(":")[1])).split("-")[0]
end=((genome_range.split(":")[1])).split("-"... | null | report/fasta.py | fasta.py | py | 955 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pyfaidx.Fasta",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.splitext",
"lin... |
497595093 | import torch
class ConfusionMatrix(object):
def __init__(self, num_classes):
self.num_classes = num_classes
self.mat = None
def update(self, a, b):
n = self.num_classes
if self.mat is None:
# 创建混淆矩阵
self.mat = torch.zeros((n, n), dtype=torch.int64, devi... | null | Image_segmentation/DeepLabV3/utils/confusion_matrix.py | confusion_matrix.py | py | 1,988 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.zeros",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.int64",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "torch.no_grad",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.int64",
"line_nu... |
141711170 | #%%
from typing import Iterable
from functools import partial
import sys,os
import numpy as np
from sklearn.metrics import (
accuracy_score,
matthews_corrcoef,
roc_auc_score,
balanced_accuracy_score,
log_loss,
)
from tensorflow.keras.callbacks import ModelCheckpoint, EarlyStopping
from tensorflow.... | null | eval_cv.py | eval_cv.py | py | 4,963 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.environ",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "generator.generator",
"line_number": 47,
"usage_type": "name"
},
{
"api_name": "numpy.moveaxis",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "data.ma_batch",
... |
354365280 | import requests
import json
import random
import sys
import datetime
import time
import csv
from multiprocessing.dummy import Pool as ThreadPool
head = {
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36',
'X-Requested-With':... | null | requests/bilibili/index.py | index.py | py | 5,563 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "random.shuffle",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_num... |
418628686 | # coding=utf-8
import urllib2
import re
import urllib
import requests
import urlparse
import HTMLParser
from config import *
def get_url(domain, timeout):
url_list = []
try:
res = urllib2.urlopen('http://' + domain, timeout=timeout)
except Exception as e:
return []
html = res.read()
... | null | scanner/util/script/poc_xss.py | poc_xss.py | py | 2,217 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "urllib2.urlopen",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "re.I",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "urlparse.urlparse",
"line_nu... |
60939516 | from flask_wtf import FlaskForm
from wtforms import SelectField, IntegerField, FieldList, StringField
from flask_app.models import PartyInformationLogic
class PartyInformationForm(FlaskForm):
number_of_characters = SelectField('Number of Characters: ',
choices=PartyInformat... | null | flask_app/forms.py | forms.py | py | 1,261 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask_wtf.FlaskForm",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "wtforms.SelectField",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask_app.models.PartyInformationLogic.get_num_character_choices",
"line_number": 9,
"usage_type": ... |
162352621 | from django.contrib.auth import get_user_model
from rest_framework import viewsets
from rest_framework.decorators import action
from rest_framework.permissions import BasePermission, IsAdminUser, IsAuthenticated
from rest_framework.response import Response
from .forms import ReferralForm
from . import models, seriali... | null | src/backend/partaj/core/api.py | api.py | py | 9,646 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "rest_framework.permissions.BasePermission",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "rest_framework.permissions.BasePermission",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "rest_framework.permissions.BasePermission",
"line_number"... |
248675962 | import torch
import torch.autograd as autograd
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.nn.parameter import Parameter
import numpy as np
import datetime
from Encoder import Encoder
from Decoder import Decoder
from Hyperparameter... | null | senLSTM(todo).py | senLSTM(todo).py | py | 3,301 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.nn.Module",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "Hyperparameters.args",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "torch.nn.NLLLoss",... |
101877558 | # Copyright 2014-2017 PUNCH Cyber Analytics Group
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | null | stoq/tests/core_tests.py | core_tests.py | py | 10,407 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "urllib3.disable_warnings",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "urllib3.exceptions",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "unittest.TestCase",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name"... |
544678452 | from bs4 import BeautifulSoup
import requests
m=str(input("file name:"))
file1=open(r"/home/puneeth/Desktop/fossentry/"+m,"r")
a=file1.readline()
r=requests.get("http://www.google.com/search?btnG=1&q="+a)
data=r.text
soup=BeautifulSoup(data,"html.parser")
k=soup.select("h3")
for i in k:
name=i.get_text()
print(name)
... | null | plagiarism.py | plagiarism.py | py | 324 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 8,
"usage_type": "call"
}
] |
506502792 |
import os
import argparse
import itertools
from ete3 import Tree
from string import ascii_uppercase
usage = """
python /srv/scratch/z5039045/Scripts/add_bin_group_id_to_tree.py -t species_tree.newick -g grouping.txt -o species_tree_with_grouping.newick
"""
def get_id2name_dict(grouping_file):
id2name_dict... | null | MetaCHIP_Temp/add_bin_group_id_to_tree.py | add_bin_group_id_to_tree.py | py | 1,815 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.splitext",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "ete3.Tree",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
... |
136689605 | import cv2
import tensorflow as tf
from random import shuffle
import pandas as pd
import numpy as np
import os
import tflearn
import sys
from tflearn.layers.conv import conv_2d, max_pool_2d
from tflearn.layers.core import input_data, dropout, fully_connected
from tflearn.layers.estimator import regression
##import imag... | null | project tt/prep.py | prep.py | py | 3,709 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.dirname",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "pandas.Series",
"line_... |
402005282 | # -*- coding: utf-8 -*-
import hashlib
import os
import uuid
from datetime import datetime, timedelta
import django.utils.timezone
import qrcode
from django.db import transaction
from django.http import HttpResponse, HttpResponseBadRequest, JsonResponse
from django.shortcuts import render
from django.views.generic imp... | null | stars/apps/customer/finance/weixin/views.py | views.py | py | 34,770 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "qrcode.QRCode",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "qrcode.constants",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "hashlib.md5",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "uuid.uuid4",
"lin... |
85539238 | import uuid
from alipay import AliPay
from django.core.cache import cache
from rest_framework import status
from rest_framework.generics import CreateAPIView
from rest_framework.response import Response
from rest_framework.views import APIView
from AXFREST.settings import ALIPAY_APPID, APP_PRIVATE_KEY, ALIPAY_PUBLIC... | null | 其他2/AXFREST全部代码APIVIEW形式实现/App/views.py | views.py | py | 15,532 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "rest_framework.views.APIView",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "App.models.MainWheel.objects.all",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "App.models.MainWheel.objects",
"line_number": 23,
"usage_type": "attribute"... |
355848816 | from django.contrib import admin
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='indexSB'),
path('settings/', views.settings, name='settings'),
path('settings/updateconf', views.updateconf, name='updateconf'),
path('updateBlacklistTable', views.updateBlacklistTa... | null | main/urls.py | urls.py | py | 644 | python | en | code | null | code-starcoder2 | 76 | [
{
"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",
... |
153495521 |
import pandas as pd
import argparse
import numpy as np
import random
def ConvertRaw2Tick(raw_df):
raw_df['AtBidOrAsk'] = (raw_df.Volume == raw_df.AskVolume).astype(np.int32) + 1
check = (raw_df.Volume != raw_df.AskVolume) & (raw_df.Volume != raw_df.BidVolume)
if check.any() == True:
print('Correct... | null | Raw2TickData.py | Raw2TickData.py | py | 1,455 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.int32",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "random.choice",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParse... |
558228826 | #!/usr/bin/python3
from movie_parsing import MakeTitleTraining,MakeFirstCharDistribution
from keras.models import Sequential, model_from_json
from keras.layers.core import Dense, Activation, Dropout
from keras.layers.recurrent import LSTM, GRU
from keras.layers.advanced_activations import PReLU, ELU, SReLU
from keras... | null | title_generator.py | title_generator.py | py | 1,985 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pickle.load",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "keras.models.model_from_json",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "training_functions.GenerateTitle",
"line_number": 38,
"usage_type": "call"
},
{
"api_nam... |
169536564 | from pprint import pprint
import logging
import voluptuous as vol
from typing import Any, Dict, Optional, List
from datetime import timedelta
from .smartApp import SmartApp
from .const import DOMAIN, DEVICE_TYPE_AC
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateEntity
from homeassistant.const im... | null | custom_components/panasonic_smart_app/climate.py | climate.py | py | 8,122 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "homeassistant.components.climate.const.SUPPORT_TARGET_TEMPERATURE",
"line_number": 48,
"usage_type":... |
646520820 | import pathlib
htm_list = []
for str_file in pathlib.Path("C:\Documents and Settings\Administrator\桌面").iterdir():
if pathlib.Path(str_file).suffix ==".htm":
htm_list.append(str_file)
for htm_file in htm_list:
assert isinstance(htm_file, pathlib.WindowsPath)
with open(htm_file.__str__(), "rb") as ... | null | scrap/add-gbk-meta-to-html.py | add-gbk-meta-to-html.py | py | 518 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pathlib.Path",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pathlib.WindowsPath",
"line_number": 9,
"usage_type": "attribute"
}
] |
140595082 | import os
# from data import common
from data import srdata
import random
import numpy as np
# import scipy.misc as misc
# import torch
# import torch.utils.data as data
def is_image_file(filename):
return any(filename.endswith(extension) for extension in [".png", ".jpg", ".jpeg", ".bmp"])
class LPT(srdata.SRD... | null | data/lpt.py | lpt.py | py | 4,041 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "data.srdata.SRData",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "data.srdata",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_... |
66545288 | import requests
proxies = {
'http': 'http://89.206.40.249:32894',
'https': '204.110.188.129:53281',
}
headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36"}
def main():
try:
response=requests.get(" https://... | null | Zero basis and 21 days to learn Python distribution crawler/5、Scrapy框架/中间件ip代理/ip获取及设置/代理小测试.py | 代理小测试.py | py | 507 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 10,
"usage_type": "call"
}
] |
29290614 | """
config module
"""
# coding: utf-8
import logging
import time
import os
from datetime import timedelta
class XConfig:
"""
youtube crawler config file
"""
USER_IDS_FILE = '/home/pj/datum/GraduationProject/dataset/xigua/user_ids.txt'
VIDEO_AVATAR_PATH = '/home/pj/datum/GraduationProject/dataset/... | null | config.py | config.py | py | 3,821 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.timedelta",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 85,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 85,
"usage_type": "attribute"
},
{
"api_name": "time.time",
"line_nu... |
194955694 | #####################
# CS 181, Spring 2016
# Homework 1, Problem 3
#
##################
import csv
import numpy as np
import matplotlib.pyplot as plt
csv_filename = 'congress-ages.csv'
times = []
ages = []
with open(csv_filename, 'r') as csv_fh:
# Parse as a CSV file.
reader = csv.reader(csv_fh)
# Sk... | null | Homework 1/linreg.py | linreg.py | py | 2,770 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "csv.reader",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line... |
284079049 | from django.urls import path
from students import views
app_name = 'students'
urlpatterns = [
path('hello-world/', views.hello_world, name='hello_world'),
path('list/', views.students, name='list'),
path('create/', views.create_student, name='create'),
path('edit/<int:pk>', views.edit_student, name='... | null | src/students/urls.py | urls.py | py | 555 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "students.views.hello_world",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "students.views",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.u... |
534625186 | import sys
import numpy as np
from PIL import Image
import PIL.ImageFont, PIL.ImageDraw
import os
from PIL.ImageQt import ImageQt
from PyQt5.uic.properties import QtGui
from matplotlib import pyplot as plt
from scipy import ndimage
from PyQt5 import QtCore
from PyQt5.QtCore import pyqtSlot
from PyQt5.QtGui import QI... | null | memeGenerator.py | memeGenerator.py | py | 5,154 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PyQt5.QtWidgets.QDialog",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "PyQt5.uic.loadUi",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "PIL.ImageFont.truetype",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "PIL.I... |
9146649 | import sys
from collections import deque
N=int(sys.stdin.readline().rstrip())
graph=[[] for _ in range(N)]
for _ in range(N-1):
a,b,val=map(int,sys.stdin.readline().rstrip().split())
graph[a-1].append([b-1,val])
graph[b-1].append([a-1,val])
def bfs(start,mode):
q=deque()
val=[-1]*N
val[start]=0... | null | 백준/기초2/트리1/트리의 지름.py | 트리의 지름.py | py | 656 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.stdin.readline",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "sys.stdin.readline",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"li... |
440337064 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import os
import sys
import datetime
import logging
from PyQt4 import QtGui, QtCore
from PyQt4.QtCore import QObject, pyqtSignal, pyqtSlot
"""
timer application (tea timer) written in pyqt
author: hgue
mail: web@b2.anyalias.com
date: 25.10.2016
"""
log = logging.getLog... | null | teatime.py | teatime.py | py | 8,008 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "PyQt4.QtGui.QWidget",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "PyQt4.QtGui",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "PyQt4.QtGui.QP... |
259049033 | #!/usr/bin/env python
# coding=utf-8
# -------------------------------------------
# File Name: preprocessing.py
# Written by Pierre_Hao
# Mail: hao.zhang@1000look.com
# Created Time: Thu 26 May 2016 01:40:37 PM CST
# Copyright (c) 2016 Nanjing Qingsou
# -------------------------------------------
"""
This file aims ... | null | python/Triplet_cls/src/preprocessing.py | preprocessing.py | py | 3,418 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "config.Params",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 60... |
495815505 | # !/usr/bin/env python
# -*- coding: utf-8 -*-
# Time : 2018/4/25 13:16
# Author : Richard
# File : views.py
from flask import jsonify, request, url_for, redirect, session, g, make_response
from app import app, models
from app.user import forms
from app.user.scraping import Scraping
@app.route('/')
def index... | null | team_plus - 副本/app/user/views.py | views.py | py | 4,857 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.session.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask.session",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "flask.redirect",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "flask.url_for",
"l... |
640175513 | #!/usr/bin/env python3
from pathlib import Path
p = Path(__file__).with_name("input.txt")
with p.open("r") as file:
terminal = file.read().split("$ ")
root = ""
file_system = {root: list()}
for line in terminal[1:]:
cmd = line.split()[0]
out = line.split()[1:]
if cmd == "cd":
# move to out... | null | 2022/Day07/7B.py | 7B.py | py | 1,551 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pathlib.Path",
"line_number": 5,
"usage_type": "call"
}
] |
274659613 | # coding=utf-8
#放置通用装饰器
from django.http import HttpResponse
import json
import hashlib
from bst_android_market.settings import ENVIRONMENT
from util.jsonresult import getResult
def json_response(func):
"""
A decorator thats takes a view response and turns it
into json. If a callback is added through GE... | null | util/decorators.py | decorators.py | py | 3,233 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.http.HttpResponse",
"line_number": 20,
"usage_type": "argument"
},
{
"api_name": "json.dumps",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "django.http.HttpResponse",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "json... |
645198807 | from myGym.envs.vision_module import VisionModule
import matplotlib.pyplot as plt
import pybullet as p
import time
import numpy as np
import pkg_resources
import cv2
import random
from scipy.spatial.distance import cityblock
import math
currentdir = pkg_resources.resource_filename("myGym", "envs")
class TaskModule():... | null | myGym/envs/task.py | task.py | py | 18,135 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pkg_resources.resource_filename",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "myGym.envs.vision_module.VisionModule",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 91,
"usage_type": "call"
},
{
"... |
180660195 | from django.contrib import admin
from .models import Servicio
class ServicioAdmin(admin.ModelAdmin):
list_display = [
'user',
'categoria',
'hora_inicio',
'tiempo_minutos',
'hora_final',
'estado',
'habitacion',
'created_by',
'valor_servicio',
... | null | dramorapp_servicios/admin.py | admin.py | py | 464 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.site.register",
"line_number": 21,
"usage_type": "call"
},... |
473911544 | # -*- coding: utf-8 -*-
"""
Created on Sat Jun 25 17:06:16 2016
@author: nick
"""
from scipy.stats import t
import numpy as np
class Solution():
def solve(self):
mean=4.6
n=20
var=2.2
ta=(mean-5)/var*np.sqrt(n)
accept=t.ppf(0.05,n-1)
boole... | null | 统计课/piano.py | piano.py | py | 395 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.sqrt",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "scipy.stats.t.ppf",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "scipy.stats.t",
"line_number": 16,
"usage_type": "name"
}
] |
536686640 | # -*- coding: utf-8 -*- #
# Copyright 2017 Google LLC. 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 requir... | null | google-cloud-sdk/lib/googlecloudsdk/command_lib/interactive/help_window.py | help_window.py | py | 3,872 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "prompt_toolkit.layout.controls.UIControl",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "prompt_toolkit.layout.controls",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "prompt_toolkit.layout.controls.UIContent",
"line_number": 40,
... |
195880340 | """
This file demonstrates two different styles of tests (one doctest and one
unittest). These will both pass when you run "manage.py test".
Replace these with more appropriate tests for your application.
"""
from django.test import TestCase
class AkismetTest(TestCase):
def test_spam(self):
request ... | null | myblog/antispam/tests.py | tests.py | py | 447 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.test.TestCase",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "utils.akismet_is_spam",
"line_number": 16,
"usage_type": "call"
}
] |
234301648 | # Copyright 2022 Huawei Technologies Co., Ltd
#
# 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 a... | null | community/cv/LR-EGAN/dataloader.py | dataloader.py | py | 11,263 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.set_option",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "scipy.io.loadmat",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.... |
418772491 | import argparse
import os
import sys
from coffea import processor, hist
from coffea.analysis_objects import JaggedCandidateArray
import matplotlib.pyplot as plt
import numpy as np
from lib_analysis import lepton_selection, jet_selection, jet_nohiggs_selection, get_leading_value, calc_dr
from definitions_analysis impo... | null | run_analysis.py | run_analysis.py | py | 17,736 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "coffea.processor.ProcessorABC",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "coffea.processor",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "coffea.processor.dict_accumulator",
"line_number": 16,
"usage_type": "call"
},
{
... |
101104589 | #!/usr/bin/env python
from matplotlib import pyplot
from attacks import readings_ks_attack, readings_simple_attack, readings_sophisticated_attack, readings_revised_ks_attack
from scipy.stats import bayes_mvs
from iterative_filter import exponential, reciprocal
import readings_generator
from robust_aggregate import rms... | null | ks_attack.py | ks_attack.py | py | 2,809 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "readings_generator.readings",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "robust_aggregate.rms_error",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "robust_aggregate.estimate",
"line_number": 27,
"usage_type": "call"
},
{
"... |
8359367 | import logging
import requests
from dateutil import parser
from lxml import etree
from . import TransportRTIProvider
from requests.exceptions import RequestException
from moxie.core.exceptions import ServiceUnavailable
from datetime import datetime
logger = logging.getLogger(__name__)
class ODSLiveBusRtiProvider(Tr... | null | moxie/transport/providers/odslive.py | odslive.py | py | 6,080 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "lxml.etree.Element",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"line_number": 71,
"usage_type": "name"
},
{
"api_name": "lxml.etree.SubElement... |
645700623 | import random
import torch
from transformers import BertTokenizer
from transformers import BertForSequenceClassification, AdamW
import numpy as np
import codecs
from tqdm import tqdm
from transformers import AdamW
import torch.nn as nn
from functions import *
import argparse
import heapq
def process_data(data_file_pa... | null | evaluate_rap_performance.py | evaluate_rap_performance.py | py | 7,962 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "random.seed",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "codecs.open",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "random.shuffle",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number":... |
143696217 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Purchase',
fields=[
('id', models.AutoField(ver... | null | purchase/migrations/0001_initial.py | 0001_initial.py | py | 868 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.CreateModel",
"line_number": 13,
"usage_type": "call"
},
... |
493600607 | """
印刷文字识别WebAPI接口调用示例接口文档(必看):https://doc.xfyun.cn/rest_api/%E5%8D%B0%E5%88%B7%E6%96%87%E5%AD%97%E8%AF%86%E5%88%AB.html
上传图片base64编码后进行urlencode要求base64编码和urlencode后大小不超过4M最短边至少15px,最长边最大4096px支持jpg/png/bmp格式
(Very Important)创建完webapi应用添加合成服务之后一定要设置ip白名单,找到控制台--我的应用--设置ip白名单,如何设置参考:http://bbs.xfyun.cn/forum.php?... | null | pc_tencent_ocr.py | pc_tencent_ocr.py | py | 2,438 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "time.time",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "base64.b64encode",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "hashlib.md5",
"line_number"... |
410648547 | from django.shortcuts import render, redirect
from django.core.mail import EmailMessage
from django.contrib import messages
from django.template.loader import get_template
from .forms import ContactForm
def contact(request):
form = ContactForm
if request.method == 'POST':
form = form(data=request.POS... | null | contact/views.py | views.py | py | 1,554 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "forms.ContactForm",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.template.loader.get_template",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "django.core.mail.EmailMessage",
"line_number": 30,
"usage_type": "call"
},
{
... |
652963916 | import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import DataLoader, TensorDataset
from torch.utils.data.dataset import random_split
import numpy as np
import matplotlib.pyplot as plt
import plotting.visualize as viz
from pathlib import Path
class NeuralNet:
def __init__(self, mod... | null | classes/neural_net.py | neural_net.py | py | 6,689 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.from_numpy",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "torch.from_numpy",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "torch.utils.data.TensorDataset",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "torc... |
394742170 | from django.core.cache import cache
from django.db import models
from django.db.models import Case, Q, When
from django.utils.translation import ugettext_lazy as _
from wagtail_localize.models import Language, Region
MATCH_HOSTNAME_PORT = 0
MATCH_HOSTNAME_DEFAULT = 1
MATCH_DEFAULT = 2
MATCH_HOSTNAME = 3
class Site... | null | wagtail_localize/experimental/sites/models.py | models.py | py | 7,540 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.models.Manager",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "django.db.models.Model",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_na... |
175093471 | from collections import deque
def deep_find(data, key):
deq = deque()
deq.append(data)
while len(deq) != 0:
d = deq.popleft()
if type(d) is dict:
for k in d.keys():
if k == key:
return d[k]
deq.append(d[k])
if type(d)... | null | week07/Dictionaries/dictionaries.py | dictionaries.py | py | 6,641 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.deque",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "collections.dequ... |
497929275 | # this file implements test case for tournament selection.
import pandas as pd
from Individual import individual
import Individual as id
import Evaluation
import Selection
import random
import Algorithms
import numpy as np
from sklearn.model_selection import train_test_split
from multiprocessing import Pool
# ---- Pa... | null | LGP/Test_FitnessCorrelation.py | Test_FitnessCorrelation.py | py | 3,229 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "random.shuffle",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Pool",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "Algorithms.Fitnes... |
350506306 | # -*- coding: utf-8 -*-
"""
Created on Tue Mar 22 12:48:29 2016
@author: peter
"""
from nipype.interfaces import ants
import os
rdir='/home/peter/Desktop/test/dummydata/norm_test/'
t1=rdir+'/brain_ss.nii'
template=rdir+'template_3mm_brain.nii'
mask=rdir+'mask.nii'
epi=rdir+'dz_strepi.nii'
os.chdir(rdir)
antsnorm=a... | null | norm_test.py | norm_test.py | py | 3,345 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.chdir",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "nipype.interfaces.ants.Registration",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "nipype.interfaces.ants",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "n... |
251942568 | from scipy.spatial import distance
from os import path
#reads txt file and saves in list by line, then in dictionary per line item
#the dictionary keys are values from the very first line
def readData(txtFile):
data=[]
dataM=[]
filePath=path.relpath(txtFile)
try:
for line in open(filePath):
... | null | old_code/funs.py | funs.py | py | 4,452 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.relpath",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "scipy.spatial.distance.euclidean",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "scipy.spatial.... |
213528008 | import json
import os
from mohawk import Sender
from requests import Session
class ApiClient:
def __init__(self, base_url, request_data, context):
self.base_url = base_url
self.request_data = request_data
self.context = context
self.session = Session()
self.gov_headers = {... | null | api_client/api_client.py | api_client.py | py | 3,789 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.Session",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_name": "json.dumps",
"lin... |
159625009 | # uncompyle6 version 3.7.4
# Python bytecode 3.6 (3379)
# Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04)
# [GCC 8.4.0]
# Embedded file name: build/bdist.macosx-10.15-x86_64/egg/xadmin/views/website.py
# Compiled at: 2020-02-22 05:09:52
# Size of source mod 2**32: 6531 bytes
from __future__ import absol... | null | pycfiles/xadmin_croxlink2-0.7.0.1-py3.6/website.cpython-36.py | website.cpython-36.py | py | 6,010 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.http.HttpRequest",
"line_number": 32,
"usage_type": "argument"
},
{
"api_name": "django.http.HttpResponseBadRequest",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "django.conf.settings",
"line_number": 36,
"usage_type": "argument"
},
... |
480269645 | from django.shortcuts import render, get_object_or_404, redirect
from django.contrib.auth import authenticate, login, logout
from .forms import UserForm, AnoncementVideosForm, AnoncementTextForm, ProfileForm, TokensSoldForm, SystemSettingsForm, StageSettingsForm
from django.conf import settings
from django.contrib.auth... | null | winto/apps/core/views.py | views.py | py | 33,550 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.shortcuts.get_object_or_404",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "models.Profile",
"line_number": 34,
"usage_type": "argument"
},
{
"api_name": "models.AnoncementVideo.objects.all",
"line_number": 36,
"usage_type": "call"
},
... |
543577355 | import open3d as o3d
import numpy as np
from icecream import ic
import copy
H = 720
W = 1280
def filter_nan_rows(arr):
valid_rows = (np.sum(np.isnan(arr), axis=1)==0)
return arr[valid_rows]
def extract_points_from_mask(points,mask):
# extracts points that are in the mask and are not nan
# points: l... | null | my_scripts/test_open3d.py | test_open3d.py | py | 9,051 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.sum",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.isnan",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "open3d.geometry.PointCloud",
... |
514600594 | from flask import Flask, render_template, request, session, redirect
app=Flask(__name__)
app.config["SECRET_KEY"] = "camelo"
class Pessoa:
def __init__(self,nome,endereco,telefone):
self.nome = nome
self.endereco = endereco
self.telefone = telefone
lista_de_pessoas=[Pessoa("Joao","Rua ... | null | servidor.py | servidor.py | py | 2,124 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "flask.render_t... |
90133548 |
"""Easy way to convert soft selection into skin weights.
Usage:
select verts and set soft selection tool to desired settings.
run command
"""
import maya.OpenMaya as om
import maya.cmds as cmds
def setWeight(jntName, skinCluster):
"""get soft selection and convert it into a list object"""
richList = om.MRichSel... | null | weights/softSelectionToWeight.py | softSelectionToWeight.py | py | 1,065 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "maya.OpenMaya.MRichSelection",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "maya.OpenMaya",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "maya.OpenMaya.MSelectionList",
"line_number": 15,
"usage_type": "call"
},
{
"api_name"... |
193598953 | #!/usr/bin/env python3
# encoding: utf-8
import argparse
import json
import requests
import os
import sys
import errno
import pprint
from operator import itemgetter
from itertools import groupby
from esnet.topology.today_to_devices import get_devices
from esnet.topology.today_to_isis_graph import get_isis_neighbors, ... | null | topo/topo.py | topo.py | py | 41,014 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pprint.PrettyPrinter",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 113,
"usage_type": "call"
},
{
"api_name": "esnet.topology.today_to_isis_graph.get_isis_neighbors",
"line_number": 147,
"usage_type": "... |
335782576 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
import datetime as dt
import matplotlib.pyplot as plt
data_datetime = []
data_candlestick = []
try:
f = open('HKEX.HSI.txt', 'r')
#data = f.read()
#print(data)
separator=" "
for line in f:
... | null | venv/main.py | main.py | py | 1,176 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.i... |
597893095 | import pytest
from lonely_robot import Robot, Asteroid, MissAsteroidError, RobotFallsFromAsteroidError
class TestRobotCreation:
def test_parameters(self):
x, y = 10, 15
asteroid = Asteroid(x, y)
direction = "E"
robot = Robot(x, y, asteroid, direction)
assert robot.x == 10... | null | lantern/tdd/test_lonely_robot_execution.py | test_lonely_robot_execution.py | py | 3,445 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "lonely_robot.Asteroid",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "lonely_robot.Robot",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pytest.raises",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "lonely_robot.Mi... |
218493747 | #!/usr/bin/env python
# coding: utf-8
#
# xiaoyu <xiaokong1937@gmail.com>
#
# 2014/02/18
#
"""
Tests for wechat backends.
Put this file to your/app/, serialize a `test_all.json` which include a
model and its instances and run
`python manage.py tests yourapp.WeChatTestCase`
WeixinMp is a model for your weixin article,... | null | wechat/tests.py | tests.py | py | 3,907 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.test.TestCase",
"line_number": 50,
"usage_type": "name"
},
{
"api_name": "django.conf.settings",
"line_number": 54,
"usage_type": "argument"
},
{
"api_name": "django.conf.settings",
"line_number": 55,
"usage_type": "argument"
},
{
"api_name":... |
102242615 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
from bs4 import BeautifulSoup
class Luoo:
def __init__(self):
self.url = 'http://www.luoo.net'
@staticmethod
def parser(url):
request = requests.get(url)
return BeautifulSoup(request.content, "lxml")
def new(self)... | null | nada/api.py | api.py | py | 5,043 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line... |
477825825 | """
CostSensitiveKNN Algorithm
"""
from KNN import KNN
from utils import Examples, TRAIN_PATH, TEST_PATH, CommitteeWrapper, insort, euclidean_distance
from ID3 import ID3ContinuousFeatures
BEST_LOSS_K = 1
BEST_BOUND = 0.056
""""""""""""""""""""""""""""""""""""""""""" CostSensitiveKNN """""""""""""""""""""""""""""""""... | null | CostSensitiveKNN.py | CostSensitiveKNN.py | py | 2,210 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "KNN.KNN",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "utils.Examples",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "utils.insort",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "utils.CommitteeWrapper",
"lin... |
148239044 | import os
import numpy as np
from montepython import io_mp
from montepython.likelihood_class import Likelihood
import scipy.constants as const
import sys
sys.path.append('.')
from . import scan_util as util
class bao_BOSS_DR12_Lya_cross(Likelihood):
# initialization routine
def __init__(self, path, data, com... | null | montepython/likelihoods/bao_BOSS_DR12_Lya_cross/__init__.py | __init__.py | py | 2,953 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "montepython.likelihood_class.Likelihood",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "m... |
457184672 | # -*- coding: utf-8 -*-
"""
Created on Sun Jun 19 10:58:54 2020
@author: KANITAN___
"""
import requests
import re
import datetime
import pandas as pd
import random
import time
import bilibili_detailpage as detail
import os
# 配置文件输出路径
out_dir=''
# in_file存放av号。内容以av开头,一行一个号,文件utf-8无BOM
in_file='av.txt'
def dateRange... | null | get_bilidanmu.py | get_bilidanmu.py | py | 3,999 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "datetime.timedelta",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "... |
475136568 | from telegram import ParseMode
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group
from main.utils import get_url
from ..utils import create_reply_markup, create_users_list
from .handlers import add_handlers, BasicBotHandler
User = get_user_model()
@add_handlers
class View... | null | bot/handlers/users.py | users.py | py | 7,312 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "handlers.BasicBotHandler",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.models.Group.objects.filter",
"line_number": 32,
"usage_t... |
420526146 |
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.lines as mlines
import numpy as np
import time
import sys
import os
import glob
import h5py
# option to import from github folder
sys.path.insert(0, '/n/coxfs01/cechavarria/repos/suite2p')
import suite2p
from suite2p import fig
class stat_file:
... | null | scenes/scripts/get_and_save_masks.py | get_and_save_masks.py | py | 14,199 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.insert",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "numpy.load",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "os.path.split",
"line_nu... |
587420611 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2020 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | null | sdk/examples/backup_vm.py | backup_vm.py | py | 13,987 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "time.time",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 167,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG"... |
388806321 | # import
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from time import sleep, strftime
from random import randint
import pandas as pd
# web driver
chromedriver_path = r'C:\Users\Vignesh Karunagaran\AppData\Local\Programs\Python\Python37-32\Chrome Driver\newDriver\chromedriver.exe' # ... | null | insta.py | insta.py | py | 7,120 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "selenium.webdriver",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "selenium.webd... |
466056731 | import numpy as np
import pandas as pd
from scipy import interpolate, ndimage, signal
import matplotlib.pyplot as plt
from enum import Enum
from typing import List, Iterable, Tuple, Any, Optional
# TODO: Filter the data so that outliers are deleted from rest data and are flagged in repetition data
# TODO: Make a par... | null | feature_eng_sbr.py | feature_eng_sbr.py | py | 55,641 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "enum.Enum",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "pandas.DataFrame",
"line_number": 1... |
369795452 | from tkinter import *
from PIL import Image, ImageTk
import random
import time
class Dice():
def __init__(self, window):
window.geometry("600x500")
window.resizable(0,0)
window.title("Dice")
window.config(bg='black')
global image1, image2, image3, image4, image5, image6, picl... | null | main.py | main.py | py | 1,470 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PIL.Image.open",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number"... |
631472314 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon May 18 21:43:18 2020
@author: corkep
"""
import os
from pathlib import Path
import sys
import importlib
import inspect
import re
import types
import argparse
from collections import Counter, namedtuple
import numpy as np
import scipy.integrate as integr... | null | bdsim/blockdiagram.py | blockdiagram.py | py | 49,894 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.Counter",
"line_number": 134,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 160,
"usage_type": "call"
},
{
"api_name": "types.SimpleNamespace",
"line_number": 197,
"usage_type": "call"
},
{
"api_name": "... |
54472868 | import sys
import os
from numpy import loadtxt
from collections import defaultdict
###############################################
class Node:
def __init__(self,node):
self.name=node
self.neighbors=defaultdict(dict)
self.rTable=defaultdict(dict)
def addRoute(self, route =[]):
d... | null | Simulator_Distance_Vector_Routing_Table/test3.py | test3.py | py | 3,235 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.defaultdict",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 83,
"usage_type": "call"
}
] |
48352839 | #
# Copyright (C) 2012-2020 Euclid Science Ground Segment
#
# This library is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 3.0 of the License, or (at your option)
# any later version.
#
#... | null | 0.1/InstallArea/x86_64-co7-gcc48-o2g/python/VIS_CTI_Toolbox/CTI_Arctic.py | CTI_Arctic.py | py | 11,975 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.exit",
"line_number": 130,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 156,
"usage_type": "call"
},
{
"api_name": "astropy.io.fits.Header",
"line_number": 174,
"usage_type": "call"
},
{
"api_name": "astropy.io.fits",
"li... |
198789487 | from pathlib import Path
import detectron2.utils.comm as comm
import torch
from detectron2.data import MetadataCatalog, build_detection_test_loader, DatasetCatalog
from detectron2.data import detection_utils as utils
from detectron2.engine import HookBase
from detectron2.utils.visualizer import Visualizer
class Pred... | null | src/hooks/PredictionVisualHook.py | PredictionVisualHook.py | py | 2,244 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "detectron2.engine.HookBase",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "detectron2.data.MetadataCatalog.get",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "detectron2.data.MetadataCatalog",
"line_number": 37,
"usage_type": "name"
... |
645261312 | import sys
import pandas as pd
import numpy as np
import os
import lightgbm as lgb
import joblib
import seaborn as sns
import matplotlib.pyplot as plt
import json
import importlib
args = sys.argv
day_number = int(args[1])
store_number = int(args[2])
class groupgby_dataset():
def __init__(self,category = None,cat... | null | FE_M5/lgb_predict.py | lgb_predict.py | py | 13,029 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "joblib.load",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "joblib.load",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_numbe... |
652603631 | from pandas.io.data import DataReader as DR
from datetime import datetime as dt
import pandas as pd
import pylab as p
#get data from yahoo
start = dt(2012, 5, 1)
end = dt(2015, 5, 1)
genting = DR("3182.KL", 'yahoo',start,end)
klse = DR("^KLSE",'yahoo',start,end)
#find and plot the 5-day moving average
G5DMA = pd.roll... | null | download_data.py | download_data.py | py | 612 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.datetime",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.io.data.DataReader",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.io.... |
293485514 | # Fitting data for einstein time Te. Univariate bimodal distribution. Fitting using statsmodels package
#Note: The data has been logged and scaled so that there are no negative days ie. all the data points are divided by the minimum value in the data set.
import numpy as np
from scipy import stats
import matplotlib.py... | null | tefit.py | tefit.py | py | 1,720 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "csv.reader",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.log",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "gmm.gmm",
"line_number": 34,
... |
222517151 | from machin.parallel.distributed import (
ElectionGroupSimple,
)
import pytest
import itertools
import multiprocessing as mp
# process number is 3
elect_group = None
def process_main(pipe):
while True:
func, args, kwargs = pipe.recv()
pipe.send(func(*args, **kwargs))
def processes():
m... | null | test/tes_sub_proc.py | tes_sub_proc.py | py | 2,104 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "multiprocessing.set_start_method",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Pipe",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Process",
"line_number": 22,
"usage_type": "call"
},
{
"api... |
604061497 | import os
import unittest
import tempfile
from dataserv_client import encryptedio
@unittest.skip("encryptedio broken")
class TestConfig(unittest.TestCase):
def test_roundtrip(self):
input_path = "tests/fixtures.json"
encrypted_path = tempfile.mktemp()
output_path = tempfile.mktemp()
... | null | tests/test_encryptedio.py | test_encryptedio.py | py | 791 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "unittest.TestCase",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "tempfile.mktemp",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "tempfile.mktemp",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "dataserv_client... |
66692981 | #!/usr/bin/env python
# coding: utf-8
# In[49]:
import numpy as np
import pandas as pd
from xgboost import XGBClassifier
from sklearn.model_selection import KFold
from sklearn.model_selection import GridSearchCV
from sklearn.metrics import accuracy_score
train = pd.read_csv('./titanic/train.csv')
test = pd.read_csv... | null | Titanic/Titanic_XGB.py | Titanic_XGB.py | py | 2,478 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "xgboost.XGBClassifier",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "pandas.DataFram... |
518248280 | from socket import *
import argparse
s = socket(AF_INET, SOCK_STREAM)
parser = argparse.ArgumentParser()
parser.add_argument('-s', default='localhost')
parser.add_argument('-p', type=int, default=2500)
args = parser.parse_args()
s.connect((args.s, args.p))
print('connected to ', args.s, args.p)
while True:
msg ... | null | Example/cmd_client.py | cmd_client.py | py | 521 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 6,
"usage_type": "call"
}
] |
631726768 | import maya.mel as mel
import maya.cmds as cmds
import glTools.utils.mesh
import glTools.utils.blendShape
import glTools.utils.dnpublish
def createSculptBase(rigMesh, baseMesh, prefix='sculpt'):
"""
"""
# Checks
if not glTools.utils.mesh.isMesh(rigMesh):
raise Exception('Invalid mesh! ("' + ri... | null | tools/correctiveSculpt.py | correctiveSculpt.py | py | 5,297 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "glTools.utils.mesh.utils.mesh.isMesh",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "glTools.utils.mesh.utils",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "glTools.utils.mesh",
"line_number": 12,
"usage_type": "name"
},
{
... |
207926818 | from datetime import datetime
from flask import Flask, redirect, url_for
from flask import jsonify
from flask import request
from cryptography.fernet import Fernet
from flask_jwt_extended import (
JWTManager, jwt_required, create_access_token,
jwt_refresh_token_required, create_refresh_token,
get_jwt_ide... | null | api/turn_data/app.py | app.py | py | 9,969 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "turn_data.models.User.query.get",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "turn_data.models.User.query",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "turn_data.models.User",
"line_number": 30,
"usage_type": "name"
},
{... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.