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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
258545811 | import sklearn
import json
import re
import numpy as np
from sklearn import svm
from sklearn.neighbors import KNeighborsClassifier
from sklearn.ensemble import RandomForestClassifier
import keras
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense, Dropout
from keras.opti... | null | fitAndTestSVM.py | fitAndTestSVM.py | py | 3,179 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "re.search",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_num... |
457282094 | from __future__ import print_function
import datetime
import ftplib
import sys
import time
class GetGBMData(object):
def __init__(self, trigger=None, daily=None):
self.ftp = ftplib.FTP('legacy.gsfc.nasa.gov', 'anonymous', 'crap@gmail.com')
if trigger is not None:
self._type = 'trig... | null | gbmgeometry/getgbmdata.py | getgbmdata.py | py | 6,194 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "ftplib.FTP",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "ftplib.error_perm",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "time.time",
"line_number": 185,
"usage_type": "call"
},
{
"api_name": "sys.stdout.flush",
"... |
542466557 | #!/usr/bin/env python3
import sys
import os
import re
import yaml
import pprint
import time
import datetime
from scapy.all import wrpcap
from scapy.utils import PcapWriter
from pcraft.Plugins import *
from pcraft.Functions import *
def print_loading_plugins(plugin):
print("Loading Plugin: %s" % plugin)
variable... | null | pcraft.py | pcraft.py | py | 8,257 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "re.compile",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 71,
... |
521258508 | from enum import Enum, auto
class TokenType(Enum):
# Single character tokens
LEFT_PAREN = auto()
RIGHT_PAREN = auto()
LEFT_BRACE = auto()
RIGHT_BRACE = auto()
COMMA = auto()
DOT = auto()
MINUS = auto()
PLUS = auto()
SEMICOLON = auto()
SLASH = auto()
STAR = auto()
# ... | null | scanner.py | scanner.py | py | 8,240 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "enum.Enum",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "enum.auto",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "enum.auto",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "enum.auto",
"line_number": 7,
"usa... |
165888573 | import socket
import json
import time
if __name__ == "__main__":
ip_port = ("127.0.0.1", 2280)
sock = socket.socket()
sock.connect(ip_port)
json_data = {"name":"test","type":"A","args":[1,2,3,4,5]}
while True:
buf = bytearray(json.dumps(json_data).encode())
buf.append(0)
s... | null | tests/catserver/client.py | client.py | py | 397 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "socket.socket",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 17,
"usage_type": "call"
}
] |
437801936 | # Import modul yang dibutuhkan
import cv2
from matplotlib import pyplot as plt
# Import gambar yang ingin dibaca
image = cv2.imread('image/5.jpg')
# Mengubah gambar ke grayscale
gray_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
# membuat histogram dari gambar grayscale
# mengkalkulasikan warna dari gam... | null | Tugas 1/1_grayscale_histogram.py | 1_grayscale_histogram.py | py | 728 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cv2.imread",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "cv2.calcHist",
"line... |
30055262 | # -*- coding: utf-8 -*-
"""
Created on Fri Mar 3 11:02:33 2017
@author: reyer
"""
# Whole Cell Simulation
from IPython import get_ipython
get_ipython().magic('reset -sf')
import math
import numpy as np
import pylab as py
import matplotlib as plt
import random
import time
class Gillespie():
start = time.t... | null | whole_cell_sim.py | whole_cell_sim.py | py | 12,995 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "IPython.get_ipython",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_nu... |
327808334 |
import face_recognition as fr
import os.path as pth
from bootstrap import *
class CompareFaces:
def __init__(self,knownImage):
self.__img1 = knownImage
def compareImages(self,img2):
# print(pth.isfile(self.__img1))
#
# if not pth.exists(self.__img1) or not pth.exists(self... | null | src/face_recognition/compare_faces.py | compare_faces.py | py | 922 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "face_recognition.load_image_file",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "face_recognition.load_image_file",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "face_recognition.face_encodings",
"line_number": 30,
"usage_type": "cal... |
267507000 | import itertools
import numpy as np
import matplotlib.pyplot as plt
from sklearn.metrics import precision_recall_curve
from sklearn.metrics import average_precision_score
from sklearn import svm, datasets
from sklearn.model_selection import train_test_split
from sklearn.metrics import confusion_matrix
from sklearn.prep... | null | metrics.py | metrics.py | py | 8,940 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.pyplot.cm",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "numpy.newaxis",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "matplo... |
542809398 | import discord
from discord.ext import commands
from config import settings
from lexicon_bot import forbidden_words, lex_bot
import random
from asyncio import sleep
from discord.utils import get
import requests
from bs4 import BeautifulSoup
intents = discord.Intents.default()
intents.members = True
bot = commands.Bot... | null | joy_bot_disc.py | joy_bot_disc.py | py | 7,158 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "discord.Intents.default",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "discord.Intents",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands.Bot",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": ... |
348198309 | # Flask.
from flask import (Flask, render_template, url_for, request, redirect, flash, jsonify)
from functools import wraps
app = Flask(__name__)
# SqlAlchemy.
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy import update
# Database.
from database_setup import Base, Restau... | null | DineExpress/app.py | app.py | py | 12,828 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.create_engine",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "database_setup.Base.metadata",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": ... |
542567170 | #!/usr/bin/env python
# -*- coding: utf-8; tab-width: 4; indent-tabs-mode: t -*-
#
# NetProfile: Access module - Models
# © Copyright 2013-2015 Alex 'Unik' Unigovsky
#
# This file is part of NetProfile.
# NetProfile is free software: you can redistribute it and/or
# modify it under the terms of the GNU Affero General P... | null | netprofile_access/netprofile_access/models.py | models.py | py | 23,574 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pyramid.i18n.TranslationStringFactory",
"line_number": 127,
"usage_type": "call"
},
{
"api_name": "netprofile_entities.models.EntityType.add_symbol",
"line_number": 129,
"usage_type": "call"
},
{
"api_name": "netprofile_entities.models.EntityType",
"line_number... |
308161621 | import logging
import os
import os.path
import sys
import unittest
from test.data import TEST_DATA_DIR
from typing import ClassVar
from urllib.request import url2pathname, urlopen
from rdflib import RDF, RDFS, BNode, Graph, Literal, Namespace, URIRef
from rdflib.exceptions import ParserError
from rdflib.plugins.parser... | null | test/test_w3c_spec/test_rdfxml_w3c.py | test_rdfxml_w3c.py | py | 8,229 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "rdflib.Graph",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "rdflib.BNode",
"line_number": 33,
"usage_type": "argument"
},
{
"api_name": "rdflib.Namespace",
... |
102186473 | # descriptive statistics
# Groupby
# correlations
# statistical corrlelations: pearsons, heatmaps
import seaborn as sns
import matplotlib.pyplot as plt
import scipy.stats as stats
import pandas as pd
# value_counts
# fwd 120
# rwd 76
# 4wd 9
def descriptive_statistics(df):
dr... | null | Exploratory_data_analysis.py | Exploratory_data_analysis.py | py | 2,777 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "seaborn.boxplot",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.show",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "seaborn.boxp... |
160344732 | import sys
import numpy as np
import pandas as pd
from sympy.stats import variance, Die, covariance, correlation, density
p = 1 / 36
XZ_joint = {
(1, 1): p, (1, 2): p, (1, 3): p, (1, 4): p, (1, 5): p, (1, 6): p,
(2, 1): p, (2, 2): p, (2, 3): p, (2, 4): p, (2, 5): p, (2, 6): p,
(3, 1): p, (3, 2): p, (3, 3):... | null | estimation/causal_inference/causal_inference_in_statistics/adding_discrete_rv.py | adding_discrete_rv.py | py | 6,969 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.abs",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 107,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 138,
"usage_type": "call"
},
{
"api_name": "sympy.stats.Die",
"line_n... |
632449381 | import psycopg2 as pg
import yaml
"""
port labeling function by using pandas cut
similar idea as to bucketizer but with no parallel processing
slower than bucketizer method, only for benchmarking
"""
def label_ports(rang):
"""
labels trips with starting and ending port names
automatically reads datafram... | null | tools/label_pandas.py | label_pandas.py | py | 2,467 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "yaml.load",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "psycopg2.connect",
"line_number": 20,
"usage_type": "call"
}
] |
253080116 | """
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
from mock import patch
from .models import *
from .views import *
import hashlib
MSG_TYPES_STANDARD =... | null | irc/tests.py | tests.py | py | 14,750 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.test.TestCase",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "mock.patch",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "hashlib.sha224",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "mock.patch",
"line... |
135879318 | # Unit: SIT384 - Cyber Security Analytics
# Task: Pass Task 7.1p
# Author: Justin Bland
# Date: 04/05/2020
# Imports Required
import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import make_blobs
from sklearn.cluster import KMeans
from scipy.cluster.hierarchy import ... | null | SIT384 - Data Analytics for Cyber Security/Task7-1P/7-1p.py | 7-1p.py | py | 2,462 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.random.seed",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "sklearn.datasets.make_blobs",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sklea... |
342851901 | #!/usr/bin/env python
# coding: utf-8
# # Aligning Data to Darwin Core
# ## Creating event core with an occurrence and extended measurement or fact extension using Python
#
# *Caution:* This notebook was created for the [IOOS DMAC Code Sprint](https://www.glos.us/code-sprint/) Biological Data Session.
# The data in ... | null | _build/jupyter_execute/content/Code Gallery/data_management_notebooks/2020-12-08-DataToDwC.py | 2020-12-08-DataToDwC.py | py | 14,140 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_csv",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "uuid.uuid4",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 95,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"line... |
562558818 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
batch_size = 200
learning_rate = 0.01
epochs = 10
# 训练数据
train_db = datasets.MNIST('../data', train=True, download=True,
transform=transforms.Compose([
... | null | pytorch/long/lesson32-Train-Val-Test-交叉验证/main.py | main.py | py | 3,649 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torchvision.datasets.MNIST",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torchvision.datasets",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.Compose",
"line_number": 13,
"usage_type": "call"
},
{
"ap... |
576593843 | from django.urls import path
from . import views
urlpatterns = [
path("", views.index, name="index"),
path("wiki/<str:title>", views.render_entry, name="entry"),
path("search", views.search, name="search"),
path("create_page", views.create_page, name="create_page"),
path("edit_page", views.edit_p... | null | Web 50 Wiki/encyclopedia/urls.py | urls.py | py | 400 | python | en | code | null | code-starcoder2 | 66 | [
{
"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",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
407507560 | # --------------------------------------------------------
#
# PYTHON PROGRAM DEFINITION
#
# The knowledge a computer has of Python can be specified in 3 levels:
# (1) Prelude knowledge --> The computer has it by default.
# (2) Borrowed knowledge --> The computer gets this knowledge from 3rd party libraries defined by ... | null | Big_Data/L15-25_Spark_Environment/Workspace/2_Spark_SQL/1_Creation_Operations/p04_DataFrame_to_RDD.py | p04_DataFrame_to_RDD.py | py | 5,675 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pyspark.sql.types.StructType",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pyspark.sql",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "pyspark.sql.types.StructField",
"line_number": 27,
"usage_type": "call"
},
{
"api_n... |
639781051 | """
Project Euler
Problem 32
We shall say that an n-digit number is pandigital if it makes use of all the digits 1
to n exactly once; for example, the 5-digit number, 15234, is 1 through 5 pandigital.
The product 7254 is unusual, as the identity, 39 × 186 = 7254, containing multiplicand,
multiplier, and product is ... | null | Python Scripts/32.py | 32.py | py | 4,578 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "re.match",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "itertools.permutations",
"line_number": 106,
"usage_type": "call"
},
{
"api_name": "itertools.permutations",
"line_number": 113,
"usage_type": "call"
},
{
"api_name": "timer.timer"... |
522185796 | # Copyright 2022 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 agreed to in writ... | null | batch/list/list_tasks.py | list_tasks.py | py | 1,455 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "google.cloud.batch_v1.BatchServiceClient",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "google.cloud.batch_v1",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "collections.abc.Iterable",
"line_number": 25,
"usage_type": "name"
},
... |
353684998 | import os
import cv2
import numpy as np
import tensorflow as tf
from utils import label_map_util
from tracker import *
NUMBER_OF_LEFT_MOTORS = 0
NUMBER_OF_LEFT_CARS = 0
NUMBER_OF_LEFT_BUSES = 0
NUMBER_OF_RIGHT_MOTORS = 0
NUMBER_OF_RIGHT_CARS = 0
NUMBER_OF_RIGHT_BUSES = 0
LIST_COUNTED = []
NUM_CLASSES = 3
labels_path ... | null | main.py | main.py | py | 6,767 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "utils.label_map_util.load_labelmap",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "utils.label_map_util",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "utils.label_map_util.convert_label_map_to_categories",
"line_number": 22,
"usage_... |
646801435 | # coding=utf-8
import re
import codecs
from config import PROJECT_ROOT
import os
def flat_line(line):
return re.sub('(\r\n|\n)', '', line).encode('UTF-8')
def rubbish_extract():
path = os.path.join(PROJECT_ROOT, 'data')
OUTFN = codecs.open(path + '/proj_content_bad_kw_sum.txt', 'w', 'utf-8')
fn = c... | null | util/str_util.py | str_util.py | py | 6,248 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "re.sub",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "config.PROJECT_ROOT",
"line_number": 14,
"usage_type": "argument"
},
{
"api_name": "os.path",
"line_numbe... |
563935807 | """
control.py
The Grid Control System
Hooks together the hardware interface, pattern modules, people tracking, and an
HTTP API for remote control.
"""
import sys
import time
try:
from queue import Empty
except ImportError:
from Queue import Empty
import signal
import logging
from multiprocessing import Mana... | null | control/thegrid/control.py | control.py | py | 5,529 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.basicConfig",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "multiprocessi... |
453474629 | from django.shortcuts import render
from django.shortcuts import HttpResponse
from Models import models
import json
'''创建工单'''
def edit(request):
if request.method == 'GET':
return render(request,'WorkOrder/edit.html')
else:
action = request.POST.get('action')
user_id = request.session.get("Login_UserId")
if... | null | WorkOrder/views.py | views.py | py | 10,591 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.shortcuts.render",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "Models.models.Base.objects.values",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "Models.models.Base",
"line_number": 14,
"usage_type": "attribute"
},
{
"... |
584888847 | import os
import json
import zipfile
import re
import glob
from elifetools import parseJATS as parser
import provider.s3lib as s3lib
from provider.article_structure import ArticleInfo
from provider.storage_provider import storage_context
from provider import article_processing
from provider.ftp import FTP
from activity... | null | activity/activity_PMCDeposit.py | activity_PMCDeposit.py | py | 11,523 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "activity.objects.Activity",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "os.sep",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "os.sep",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "os.sep",
"line_... |
25911614 | import cv2 as cv
import numpy as np
import matplotlib.pyplot as plt
PATH = 'D:\Projects\Oh\data\images\marker\\'
OUT_DIR = 'D:\Projects\Oh\data\images\marker\\result\\'
file_name = f'{PATH}IMG_5891-753374.jpg'
filter_area = True
area_min = 50; area_max = 1000
filter_circularity = True
circularity_min = 0.5; circulari... | null | detection/marker_detection.py | marker_detection.py | py | 2,650 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cv2.imread",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "cv2.medianBlur",
... |
159056724 | import argparse
import h5py
import numpy as np
import time
from LinearHM import LinearHM
from inference_strategies import *
from sklearn.metrics import r2_score
start_time = time.time()
################################
# PARSE COMMAND LINE ARGUMENTS #
################################
parser = argparse.ArgumentPars... | null | experiments/inference_script.py | inference_script.py | py | 5,506 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "time.time",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "LinearHM.LinearHM",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "LinearHM.LinearHM... |
81050456 | import json
import os
import networkx as nx
import numpy as np
import scipy.sparse as sp
import torch
def encode_onehot(labels):
classes = set(labels)
classes_dict = {c: np.identity(len(classes))[i, :] for i, c in
enumerate(classes)}
labels_onehot = np.array(list(map(classes_dict.get,... | null | pygcn/utils.py | utils.py | py | 5,749 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.identity",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.int32",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "numpy.genfromtxt",
"l... |
525438828 | # -*- coding: utf-8 -*-
import io, sys
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
if __name__ == '__main__':
col1 =[]
col2 =[]
result = ''
with open('col1.txt', mode='r', encoding='utf-8') as f:
col1.extend(f.readlines())
with open('col2.txt', mode='r', encoding='utf... | null | main4.py | main4.py | py | 547 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.stdout",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "io.TextIOWrapper",
"line_number": 3,
"usage_type": "call"
}
] |
232124313 | # coding: utf-8
import time
import random
import sys
from matplotlib import pyplot as plt
import logging
FORMAT = "%(asctime)-15s - %(message)s"
logging.basicConfig(format=FORMAT,filename='tp.log',level=logging.DEBUG)
def log(val):
logging.debug(val)
dump(val)
def performance(vector, algoritmo):
inicio =... | null | helpers.py | helpers.py | py | 3,317 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.basicConfig",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "logging.debug",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "time.time",
"l... |
314550945 | MAX_XGB_ROUNDS = 2175
OPTIMIZE_XGB_ROUNDS = True
XGB_LEARNING_RATE = 0.03
XGB_EARLY_STOPPING_ROUNDS = 100
import numpy as np
import pandas as pd
from xgboost import XGBClassifier
from sklearn.model_selection import train_test_split
from sklearn.model_selection import KFold
from sklearn.preprocessing import LabelEncod... | null | statoil/code/get_best_the1ow_xgb.py | get_best_the1ow_xgb.py | py | 8,204 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_json",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"li... |
773448 | # Homepage and license: https://github.com/gima/znc_msg2unix
# ZNC module that writes incoming messages on #channels to UNIX domain socket as JSON.
import os
import stat
import sys
import znc
import json
import socket
from datetime import datetime, timezone
def write(bytes, path):
with socket.socket(socket.AF_UNIX,... | null | msg2unix.py | msg2unix.py | py | 2,010 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "socket.socket",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "socket.AF_UNIX",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_STREAM",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "znc.Module"... |
489643487 | # np.median
# sys.getsizeof(data), time.perf_counter()
import numpy as np
from astropy.io import fits
import time,sys
def median_fits(files):
start = time.perf_counter()
list=[]
for i in range(len(files)):
list.append(fits.open(files[i])[0].data)
data=np.stack(list)
median=np.median(data,axis=0)
seconds... | null | DDA/W1/Median_cost.py | Median_cost.py | py | 894 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "time.perf_counter",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "astropy.io.fits.open",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "astropy.io.fits",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "numpy.stack",
... |
639532633 | #!/usr/bin/python3
import os
import time
from state import SharedState
from testutil import yellowprint, add_to_faillist, add_to_savefile, redprint
from util import IDError
import urlutil
import config
import requests
import json
from pyquery import PyQuery as pq
# used as the data folder name
task_name = "PlayDownl... | null | task_download_googleplay_userreview.py | task_download_googleplay_userreview.py | py | 4,733 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.join",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "config.here",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_n... |
199223283 | import cv2
import numpy as np
import tkinter
from tkinter import *
from tkinter import filedialog
def select_image():
path = filedialog.askopenfilename()
if len(path) > 0:
img = cv2.imread(path)
img = cv2.resize(img, None, fx=0.4, fy=0.4)
height, width, channels = img.shape
... | null | Shreyanshi Singh/Image.py | Image.py | py | 2,662 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tkinter.filedialog.askopenfilename",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "tkinter.filedialog",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "cv2.imread",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.re... |
87063769 | import datetime
from dataLayer.database_connection import Base, engine, Session
from dataLayer.entities.neural_network import NeuralNetwork
class NeuralNetworkRepository():
def get_all_not_completed(self):
Base.metadata.create_all(engine)
session = Session()
requests = session.query(Neur... | null | FaceRecognition/dataLayer/repositories/neural_network_repository.py | neural_network_repository.py | py | 1,493 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "dataLayer.database_connection.Base.metadata.create_all",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "dataLayer.database_connection.engine",
"line_number": 10,
"usage_type": "argument"
},
{
"api_name": "dataLayer.database_connection.Base.metadata",
... |
568693244 | import gym
from gym import spaces
import numpy as np
from os import path
import math
class FenceEscapeEnv(gym.Env):
metadata = {
'render.modes' : ['human', 'rgb_array'],
'video.frames_per_second' : 30
}
def __init__(self):
self.dt = 0.01
self.action_space = spaces.Box(-1, ... | null | gym/envs/classic_control/fence_escape.py | fence_escape.py | py | 2,204 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "gym.Env",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "gym.spaces.Box",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "gym.spaces",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "gym.spaces.Box",
"line_numb... |
587899793 | # give a graph graph
from __future__ import print_function
import sys
import cplex
from cplex.exceptions import CplexError
import networkx
# max weight stable set
# return a list of stable set of nodes with maximum weight
def weighted_stable_set(graph):
# LP Model:
## nodes
graph_obj=[]
graph_ub=[]
... | null | cplex_stableset/stablesetmip.py | stablesetmip.py | py | 2,770 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cplex.Cplex",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "cplex.exceptions.CplexError",
"line_number": 53,
"usage_type": "name"
}
] |
181533248 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import importlib
import datetime
import operator
import os
import re
try:
import simplejson as json
except ImportError:
import json
import sys
import xbmc
import xbmcaddon
import xbmcgui
from utils import kodiRPC
from utils import log
from utils import stringtofi... | null | default.py | default.py | py | 15,513 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "xbmcaddon.Addon",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "xbmc.translatePath",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "xbmc.translatePath",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "xbmc.translateP... |
124496588 | # -*- coding: utf-8 -*
import sys
import signal # signal 安全退出
from modules.BoardList import main as ModBoardList # Modules Board List
from modules.BoardSearch import main as ModBoardSearch # Modules Board Search
from modules.dcl import main as DCL # Modules RUN DCL !
from sty import fg, bg, ef, rs,Style, RgbFg # Font c... | null | main.py | main.py | py | 1,862 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.argv",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "signal.signal",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "signal.SIGINT",
"line_number... |
102778707 | # Copyright 2018 Deep Learning Service of Huawei Cloud. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | null | src/main/python/manifest.py | manifest.py | py | 8,305 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "field_name.single_lable",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "field_name.multi_lable",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "field_name.image_classification",
"line_number": 46,
"usage_type": "attribute"
... |
99070519 | import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
def create_trend_bar_age(ty_2016, ty_2017, export_figure=False):
c_1620=pd.concat((ty_2016, ty_2017), axis=0, ignore_index=True)
index_labels = {0: 'total youth',
1: 'opportunity youth',
2: 'work... | null | src/visualizations/graphs.py | graphs.py | py | 3,962 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.concat",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "seaborn.set",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "seaborn.catplot",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.savefig",
... |
641148402 | from datetime import datetime, timedelta
import pytz
TZ_IRKUTSK = pytz.timezone('Asia/Irkutsk')
def find_week():
now = datetime.now(TZ_IRKUTSK)
sep = datetime(now.year if now.month >= 9 else now.year - 1, 9, 1, tzinfo=TZ_IRKUTSK)
d1 = sep - timedelta(days=sep.weekday())
d2 = now - timedelta(days=no... | null | tg_bot/functions/find_week.py | find_week.py | py | 411 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pytz.timezone",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "datetime.datetime"... |
7610803 | #!/usr/bin/python
import urllib2
import csv
from datetime import datetime
from bs4 import BeautifulSoup
XML_URL = 'http://www.capitalbikeshare.com/data/stations/bikeStations.xml'
def parse_and_save(xml, csv_writer):
now = datetime.now()
data_soup = BeautifulSoup(xml, 'xml')
for station in data_soup.findA... | null | Databases/DataCollection/cron_job.py | cron_job.py | py | 785 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.datetime.now",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "urllib2.url... |
22117472 | """
a) Loads Image
b) Detect Keypoints & Descriptor
c) Matches
"""
import cv2
cv2.ocl.setUseOpenCL(False)
import numpy as np
import time
from pathlib import Path
#
# Load Images
rootPath = str(Path('../../').resolve())
im1 = cv2.imread(rootPath + '/images/5b0ea48b621ceba8a4c9f9b6_before.jpeg')
im2 = cv2... | null | test_script.py | test_script.py | py | 2,041 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cv2.ocl.setUseOpenCL",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.ocl",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_n... |
575760669 | import numpy as np
import cv2
import math
def cropImage(base,filename,filetype):
openfile=base+"/"+filename+"."+filetype
# Load an color image in grayscale
og_image = cv2.imread(openfile,0)
#cv2.imshow('Original sudoku',og_image)
#cv2.waitKey(0)
#cv2.destroyAllWindows()
blank_image = np... | null | sudoku/solver_logic/crop_sudoku.py | crop_sudoku.py | py | 10,618 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cv2.imread",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "cv2.GaussianBlur",
"line_n... |
604176886 | from django import forms
from .models import Post
from .widgets import TuiEditorWidget,CounterTextInput
class PostForm(forms.ModelForm):
class Meta:
model = Post
fields = ['title', 'text', 'photo', 'tags']
widgets = {
'title': CounterTextInput,
'text' : TuiEditorWidg... | null | blog/forms.py | forms.py | py | 333 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "models.Post",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "widgets.CounterText... |
439701694 | # vim: sw=4:ts=4:et:cc=120
import os, os.path
import datetime
import threading
import saq
from saq.collectors.hunter import HunterCollector, HuntManager, Hunt, open_hunt_db
from saq.collectors.test import CollectorBaseTestCase
from saq.constants import *
from saq.service import *
from saq.test import *
from saq.util ... | null | lib/saq/collectors/test_hunter.py | test_hunter.py | py | 6,947 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "saq.collectors.hunter.Hunt",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "saq.collectors.hunter.HunterCollector",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 33,
"usage_type": "call"
},
{
"api... |
142611852 | import sys
sys.path.append('/home/grad3/hongyi/rfcn_occ_tf/ivc_rfcn_occ')
from nets import net_factory
from train import train
from gibson import gibson_preprocess
import time
import os
import argparse
parser = argparse.ArgumentParser(description='Training args')
parser.add_argument('--resume', type=int, help='resum... | null | gibson/gibson_train.py | gibson_train.py | py | 2,560 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.append",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.environ",
... |
572264040 | # -*- coding: utf-8 -*-
# 当前 webapp 的应用骨架
import logging; logging.basicConfig(level=logging.INFO)
from asyncio import get_event_loop
from aiohttp import web
async def index(request):
return web.Response(body=b'<h1>welcome WebApp !</h1>', content_type='text/html')
async def init(loop):
app = web.Application(l... | null | www/app.py | app.py | py | 715 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.basicConfig",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "aiohttp.web.Response",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "aiohttp.web"... |
36649388 | """
Input pipeline for Emotion Classifier.
Load precomputed embeddings and labels for training,
development and testing sets. Then, build dataset API
and provide dataset initialization for different modes.
"""
import tensorflow as tf
import numpy as np
import sys
sys.path.extend(['..'])
from utils.utils import get_... | null | data_generators/generator_emotion_classifier.py | generator_emotion_classifier.py | py | 5,524 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.extend",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "numpy.load",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_numbe... |
458690470 | import pytest
from tests.helpers.kubernetes.utils import run_k8s_monitors_test
from tests.helpers.util import get_monitor_dims_from_selfdescribe, get_monitor_metrics_from_selfdescribe
pytestmark = [pytest.mark.collectd, pytest.mark.docker, pytest.mark.monitor_without_endpoints]
@pytest.mark.kubernetes
def test_dock... | null | tests/monitors/docker/docker_test.py | docker_test.py | py | 831 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pytest.mark",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "tests.helpers.kubernetes.utils.run_k8s_monitors_test",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "tests.helpers.util.get_monitor_metrics_from_selfdescribe",
"line_number"... |
91450825 | # coding:utf-8
import numpy as np
#from homework import conf_hw
import conf_hw
from sklearn.decomposition import PCA
import time
def loess(test_point, x_mat, y_mat):
m, n = x_mat.shape
weight_mat = np.mat(np.eye(m))
# tri-cube weight function
dists = []
for i in range(m):
diff_mat = test_p... | null | homework/loess.py | loess.py | py | 2,469 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.mat",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.eye",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.pinv",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"line_number... |
493970145 | # -*- coding: utf-8 -*-
import os
import random
import string
import sphinx
from sphinx.errors import SphinxError
from docutils import nodes
from docutils.parsers.rst import directives
from pkg_resources import parse_version
from sphinx.roles import XRefRole
from sphinxcontrib.needs.directives.need import Need, NeedD... | null | sphinxcontrib/needs/needs.py | needs.py | py | 15,708 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sphinx.__version__",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "pkg_resources.parse_version",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 38,
"usage_type": "call"
},
{
"api_name"... |
22895540 |
from pyquery import PyQuery # useful for scraping the HTML dom.
import json
import re
itemDB = json.load( open('items.json') )
#print(items)
def loopList(L, mobLevel, mobId, mobName):
drops = []
totalEarn = 0
rateTotal=0
for item in L:
if False:
print(' ')
for field,val in item.items():
... | null | trawl/parseData.py | parseData.py | py | 10,247 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "json.load",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 106,
"usage_type": "call"
},
{
"api_name": "pyquery.PyQuery",
"line_number": 123,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 218... |
13022530 | import pytest
from fastapi import status
from app.core.config import API_V1_STR
@pytest.mark.parametrize(
"api_method_name, api_function_name",
[
("mx_records", "get_mx_response"),
("a_records", "get_a_response"),
("aaaa_records", "get_aaaa_response"),
],
)
def test_get_records_wi... | null | app/api/api_v1/endpoints/test_dns_researcher.py | test_dns_researcher.py | py | 1,049 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "app.core.config.API_V1_STR",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "fastapi.status.HTTP_200_OK",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "fastapi.status",
"line_number": 25,
"usage_type": "name"
},
{
"api_nam... |
33333966 | import math
import collections
GoalPosition = collections.namedtuple('PositionsTuple',
['goal_x', 'goal_y'])
goal_positions_array = [
GoalPosition(3, 2),
GoalPosition(0, 0),
GoalPosition(1, 0),
GoalPosition(2, 0),
GoalPosition(3, 0),
GoalPosition(0, 1),
... | null | Heuristics/Heuristics.py | Heuristics.py | py | 986 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.namedtuple",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "math.floor",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 28,
"usage_type": "call"
}
] |
458420405 | import multiprocessing
import time
import threading
def run(name):
print('hello world! %s'%name)
t= threading.Thread(target=thread_run,)
t.start()
def thread_runinside(name):
print('你好! %s'%name)
def thread_run():
for i in range( 2 ):
t = threading.Thread( target=thread_runinside, arg... | null | Week10/多进程.py | 多进程.py | py | 560 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "threading.Thread",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "threading.get_ident",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "multiprocessing.... |
415968300 | from django.conf.urls import patterns, url
from hangers import views
urlpatterns = patterns('',
# /hangers/
url(r'^$', views.index, name='index'),
url(r'^systems/(?P<system_id>\d+)/$', views.system, name='system'),
url(r'^addsystem/$', views.add_system, name='add_system'), # add a new system
url(r'^deletesystem/(... | null | evelogistics/hangers/urls.py | urls.py | py | 1,340 | 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": 6,
"usage_type": "call"
},
{
"api_name": "hangers.views.index",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "... |
320227378 | import csv
import logging
from django.core.management.base import BaseCommand
from django.db import transaction
from ...models import Question
QUESTION = 'question'
ANSWER = 'answer'
DISTRACTOR = 'distractors'
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = 'Parse and load data into d... | null | assessments/management/commands/parse_data.py | parse_data.py | py | 2,571 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "csv.DictReader",
"line_number": 42,
"usage_type": "call"
},
{
"api_name... |
97404044 | """Translate phabricator macro names into unfurl-able URLs
Wants these environment variables:
PHAB_HOST -- the hostname where your phabricator lives
PHAB_API_TOKEN -- a valid api token for some phabricator bot account
PHAB_FILE_HOST -- hostname for instance of https://github.com/emarschner/phabricator-file-proxy
... | null | limbo/plugins/phab_macros.py | phab_macros.py | py | 3,043 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "phabricator.Phabricat... |
218376119 | from PIL import Image, ImageFilter
try:
original = Image.open("lelna.png")
img_filtromedia = original.filter(ImageFilter.BLUR)
original.show()
img_filtromedia.show()
img_filtromedia.save("lena_filromedia.png")
except:
print ("Não foi possível carregar a imagem selecionada.") | null | filtros/filtros_pillow/media.py | media.py | py | 306 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "PIL.Image.open",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "PIL.ImageFilter.BLUR",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "PIL.ImageFilter",
... |
571265745 | """Treadmill trace CLI."""
from __future__ import absolute_import
import json
import logging
import socket
import sys
import urllib
import websocket as ws_client
import click
from treadmill import cli
from treadmill import context
from treadmill import restclient
from treadmill.apptrace import (events, printer)
... | null | lib/python/treadmill/cli/trace.py | trace.py | py | 4,061 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "treadmill.context.GLOBAL.state_api",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "treadmill.context.GLOBAL",
"line_number": 63,
"usage_type": "attribute"
},
{
... |
437966806 | """Rate limiting primitives."""
import asyncio
import fractions
import functools
import re
from collections import deque
from time import time
from typing import Callable, Coroutine, Generator
RATE_MASK = re.compile('([0-9]+)/([0-9]*)([A-Za-z]+)')
TIME_QUANTITIES = ( # time quantities in the base unit
('s', 1), ... | null | aiothrottles/throttles.py | throttles.py | py | 8,197 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "re.compile",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "typing.Generator",
"line_number": 60,
"usage_type": "name"
},
{
"api_name": "typing.Coroutine",
"line_number": 60,
"usage_type": "name"
},
{
"api_name": "typing.Callable",
"l... |
108911978 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 2019/11/4
# @Anthor : phantomDai
"""
传统的蜕变测试技术:随机选择测试用例随机选择蜕变关系
"""
from myutl.Utl import Utl
from measure.F_time import Ftime
from measure.F2_time import F2time
from measure.F_Measure import F
from measure.F2_Measure import F2
from execute.utl.Utl import e... | null | AMT/experiment/scripts/grep_test_scripts-master/execute/AMT_MAPT_Plus_Random.py | AMT_MAPT_Plus_Random.py | py | 17,141 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "myutl.Utl.Utl",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "execute.utl.Utl.execute_utl",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "partition.allocation_testcases_4_partitions.get_partition_map",
"line_number": 40,
"usage_type"... |
140698049 | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
from statistics import mean
class Solution:
def averageOfLevels(self, root):
"""
:type root: TreeNode
:rtype: List[float]
... | null | 637/solution.py | solution.py | py | 507 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "statistics.mean",
"line_number": 17,
"usage_type": "call"
}
] |
582840698 | from django.conf.urls import url
from graph import views as graph_views
urlpatterns = [
url(r'^$', graph_views.IndexView.as_view()),
url(r'^privacy/$', graph_views.PrivacyView.as_view(), name="privacy"),
url(r'^facebook/posts/$', graph_views.PostListView.as_view(), name="facebook_posts"),
url(r'^faceb... | null | graph/urls.py | urls.py | py | 1,063 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "graph.views.IndexView.as_view",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "graph.views.IndexView",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_na... |
607601533 | import numpy as np
from numpy.random import choice
import torch
from torch import nn as nn
from rlkit.policies.base import ExplorationPolicy, Policy
from rlkit.torch.distributions import ReparamTanhMultivariateNormal
from rlkit.torch.distributions import ReparamMultivariateNormalDiag
from rlkit.torch.networks import ... | null | rlkit/torch/adapt_bc/policies.py | policies.py | py | 5,751 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rlkit.policies.base.Policy",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "rlkit.torch.networks.Mlp",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "rlkit.policies.base.ExplorationPolicy",
"line_number": 44,
"usage_type": "name"
},
... |
32012810 | #--------------------------------------------------------
# Tip
#--------------------------------------------------------
#Road coordinate : any point which is just on a road.
#Vehicle coordinate : Vehicle Back axle
#Calibration coordinate : Vehicle Front axle
#----------------------------------------------------... | null | Python/PerspectiveProjection/FreshmenHomeworks/shin.py | shin.py | py | 9,457 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "lxml.etree.parse",
"line_number": 93,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"line_number": 93,
"usage_type": "name"
},
{
"api_name": "math.radians",
"line_number": 100,
"usage_type": "call"
},
{
"api_name": "math.cos",
"line_number... |
223723477 | # -*- coding: utf-8 -*-
from web import RequestHandler, set_path
from tornado import gen
import datetime
from translation import _T
import redisutils
TEXT_FMT_NO_USERS = _T("{message}")
TEXT_FMT = _T("{message} Chúc mừng {users}")
USERS_FMT = _T("<font color='#FFFF00'>{username}</font> thắng <... | null | app/gameserver/messagehandler.py | messagehandler.py | py | 5,084 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "translation._T",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "translation._T",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "translation._T",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "web.RequestHandler",
... |
646830238 | """
This module is used to run experiments for reproduction of
the results in the dissertation.
"""
from collections import defaultdict
from functools import partial
import intent.commands.enrich
from intent.commands.extraction import extract_from_xigt
from intent.commands.filter import filter_corpus
from intent.comma... | null | intent/reproduction.py | reproduction.py | py | 19,664 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.addLevelName",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "intent.int... |
316806470 | #PROMYS Q2 A/B
import matplotlib.pyplot as graph
sequence = input("Iterate Sequence X or Y? ")
#Iterating Sequence x (2A)
def iterX():
while True:
StartingConds = input("Give Xn and Xn-1, real positive numbers, separated by a comma. ")
userRange = int(input("Give the number of iterations to iterate the ... | null | PROMYS2.py | PROMYS2.py | py | 2,724 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 92,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 92,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 93,
"usage_type": "call"
},
{
"api_name": "mat... |
212641947 | import redis
import numpy as np
import pdb
import json
import os
import sys
import operator
import logging
from datetime import datetime
import pickle
from scipy.spatial import distance
from sklearn.metrics.pairwise import euclidean_distances
from scipy.stats import entropy
from sklearn.preprocessing import normaliz... | null | src/16sigir-neuir/olderwork/simwordnormalize.py | simwordnormalize.py | py | 2,614 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "json.loaded",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "operator.itemgetter",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "logging.Formatter",
"l... |
504255867 | import vk_api
from vk_api import VkApi
import random
import requests
from vk_api.upload import VkUpload
from vk_api.utils import get_random_id
from vk_api.longpoll import VkLongPoll, VkEventType
from io import BytesIO
from vk_api.keyboard import VkKeyboard, VkKeyboardColor
def write_msg(user_id, message, random_id):
... | null | vk/app.py | app.py | py | 3,884 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "random.randint",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "vk_api.VkApi",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "vk_api.longpoll.VkLongPoll",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "requests.get",... |
321311760 | import numpy as np
from matplotlib import pyplot as plt
plt.rcParams['font.sans-serif']=['SimHei']
plt.rcParams['axes.unicode_minus'] = False
X = np.linspace(1, 10,endpoint=True)
Y1=1/X
plt.plot(X, Y1)
plt.xticks([]) # 去掉横坐标值
plt.yticks([]) # 去掉纵坐标值
plt.xlabel("人数",fontsize=15)
plt.ylabel("效度",fontsize=15)
plt.sho... | null | Yimiao.py | Yimiao.py | py | 355 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 5,
"usage_type": "attribute"
},
{
"ap... |
457604731 | # coding: utf-8
from django import template
from django.conf import settings
from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage
from codetrap.comments.forms import PostForm
from codetrap.comments.models import Thread
register = template.Library()
@register.inclusion_tag('comments/paginate.html'... | null | codetrap/comments/templatetags/comments.py | comments.py | py | 1,113 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.template.Library",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.conf.settings.COMMENTS_PAGINATION",
"line_number": 12,
"usage_type": "attribute"
},
{
... |
342544049 | from pyspark.sql import SparkSession
from pyspark.sql import Row
from pyspark.sql.types import TimestampType
from pyspark.sql.functions import window, unix_timestamp, col
from pyspark.sql.functions import monotonically_increasing_id
#Create a spark session
spark = SparkSession.builder .master("local[4]") .appN... | null | Sessionize_code.py | Sessionize_code.py | py | 5,265 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pyspark.sql.SparkSession.builder.master",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pyspark.sql.SparkSession",
"line_number": 8,
"usage_type": "n... |
377157409 | import logging
from PIL import Image, ImageGrab
import cv2
import numpy as np
import matplotlib.pyplot as plt
logger = logging.getLogger(__name__)
class ImageTest(object):
'''
classdocs
'''
def __init__(self):
'''
Constructor
'''
pass
def test(s... | null | aigame/utils/image.py | image.py | py | 3,821 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "PIL.ImageGrab.grab",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "PIL.ImageGrab",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "cv2.imread",
"l... |
577870969 | import datetime
import calendar
from twython import Twython
import pandas as pd
import json
import credentials
import sentimentModel
import azureDBconnections
def min(s,low):
if (low < s):
return low
else:
return s
def refreshDB(i):
CONSUMER_KEY= credentials.CONSUMER_KEY
CON... | null | Twitter program/script.py | script.py | py | 2,401 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "credentials.CONSUMER_KEY",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "credentials.CONSUMER_SECRET",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "twython.Twython",
"line_number": 20,
"usage_type": "call"
},
{
"ap... |
149685053 | #!/usr/bin/env python
from __future__ import print_function
import time
import io
import logging
import os
import sys
import gphoto2 as gp
def main():
logging.basicConfig(format='%(levelname)s: %(name)s: %(message)s', level=logging.ERROR)
gp.check_result(gp.use_python_logging())
camera = gp.check_result... | null | src/camera/camera-preview.py | camera-preview.py | py | 2,178 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.basicConfig",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.ERROR",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "gphoto2.check_result",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "gphoto2.u... |
515720672 | #!/usr/bin/env python
#
# __init__.py - fslpy tests
#
# Author: Paul McCarthy <pauldmccarthy@gmail.com>
#
"""Unit tests for ``fslpy``. """
import os
import sys
import glob
import shutil
import tempfile
import logging
import con... | null | tests/__init__.py | __init__.py | py | 8,012 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "logging.WARNING",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "tempfile.mkdtemp",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
... |
141348859 | import numpy as np
import matplotlib.pyplot as plt
x = np.array([1, 3, 5, 7], dtype = float)
y = np.array([-1, 4, -7, 9], dtype = float)
g = lambda x: x**3
discrete_l1 = np.dot(g(x), g(x))
discrete_l2 = np.dot(y, g(x))
alpha = discrete_l2/discrete_l1
plt.scatter(x,y, marker='o', color='r')
x_linspace = np.linspac... | null | interpolation/least_squares.py | least_squares.py | py | 388 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.array",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.dot",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.dot",
"line_number": 10,
... |
542710319 | # -*- coding: cp1252 -*-
# Import the package `numpy` under the abbreviated name `np`.
# NumPy provides class `ndarray` http://docs.scipy.org/doc/numpy/reference/arrays.ndarray.html
# which we use for vectors and matrices.
import numpy as np
# Import `linalg` from package `scipy`.
# `linalg` provides optimized algori... | null | python/buendelblock_2.py | buendelblock_2.py | py | 59,522 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "oriental.adjust.log.setLogFileName",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "oriental.adjust.log",
"line_number": 57,
"usage_type": "attribute"
},
{
"api_name": "oriental.adjust",
"line_number": 57,
"usage_type": "name"
},
{
"api_n... |
489507697 | # !/usr/bin/python
# encoding:utf-8
'''
解析Vedio to image
'''
import cv2
import uuid
import os
def parsingVedio(vedioPath, imgStorePath):
cap = cv2.VideoCapture(vedioPath)
print('vedio Open:', cap.isOpened())
frame_count = 1
wid = int(cap.get(3))
hei = int(cap.get(4))
framerate = int(cap.get(... | null | mobileNet/parsingVideo.py | parsingVideo.py | py | 1,278 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "uuid.uuid4",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "cv2.imwrite",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_numb... |
165827686 | # Create your views here.
from django.template import Context, loader
from django.http import HttpResponse
from django.shortcuts import get_object_or_404
from shop.models import *
def changeitemstock(request,itemID):
#myItem = Item.objects.get(id=itemID)
myItem = get_object_or_404(Item, id=itemID)
myItem... | null | shopping-lists/shop/views/item.py | item.py | py | 717 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.shortcuts.get_object_or_404",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.template.loader.get_template",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "django.template.loader",
"line_number": 19,
"usage_type": "name"
... |
500276648 | # Copyright 2018 The KaiJIN Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | null | tw/transform/augmenter/colorspace.py | colorspace.py | py | 3,600 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cv2.cvtColor",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "imgaug.augmenters.Augmenter",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "imgaug.augmenters",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "numpy... |
407468631 | import openpyxl
from openpyxl import cell
from openpyxl.styles import Alignment, PatternFill,Border , Side
wb = openpyxl.Workbook()
ws = wb.worksheets[0]
style_set= {'mediumDashDot', 'slantDashDot', 'dotted', 'dashDotDot', 'hair', 'medium', 'dashed',
'mediumDashDotDot', 'thick', 'double', 'thin', 'dashDot... | null | excel_text.py | excel_text.py | py | 553 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "openpyxl.Workbook",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "openpyxl.styles.Side",
"line_number": 12,
"usage_type": "call"
}
] |
187488196 | from django.conf.urls import url
from django.contrib.auth.views import login
from . import views
urlpatterns = [
url(r'^register/$', views.RegisterView.as_view(), name='register'),
url(r'^login/$', login, name='login'),
url(r'^profile/$', views.UserAccountView.as_view(), name='profile'),
url(r'^(?P<sl... | null | stendarr/apps/account/urls.py | urls.py | py | 480 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.views.login",
"line_number": 8,
"usage_type": "argument"
},
{
"api_na... |
350510144 | import boto3
import base64
from botocore.exceptions import ClientError
def lambda_handler(event, context):
authToken = event['authorizationToken']
secret_name = "snsmgmt/snsmgmtkey"
region_name = "us-east-1"
# Create a Secrets Manager client
session = boto3.session.Session()
client = ses... | null | Lambda/snsMgmtAuth.py | snsMgmtAuth.py | py | 3,042 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "boto3.session.Session",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "boto3.session",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "botocore.exceptions.ClientError",
"line_number": 21,
"usage_type": "name"
},
{
"api_name... |
276120594 | from django.shortcuts import render
from django.http import HttpResponse, HttpResponseRedirect
from django.template import loader
from django.shortcuts import render, get_object_or_404,redirect
from django.core.urlresolvers import reverse
from django.views import generic
from recruitPy.models import Candidate, Knowl... | null | recruitPy/views.py | views.py | py | 2,573 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.shortcuts.render",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "recruitPy.models.Knowledge.objects.all",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "recruitPy.models.Knowledge.objects",
"line_number": 31,
"usage_type": "att... |
360914115 | # Copyright (c) 2013 Huawei Technologies Co., Ltd.
# Copyright (c) 2012 OpenStack Foundation
# 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:/... | null | Cinder/Juno-eol/ssh_client.py | ssh_client.py | py | 95,658 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "kmc.kmc.kmc.API",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "kmc.kmc.kmc",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "kmc.kmc",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "kmc.kmc.kmc",
"line_numb... |
593152942 | import yaml
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import scoped_session, sessionmaker
def load_config():
config = {}
with open('config.yaml', 'r') as f:
config = yaml.safe_load(f)
return config
config = load_config()
engin... | null | reflection/database.py | database.py | py | 2,028 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "yaml.safe_load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.create_engine",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.scoped_session",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "... |
188645424 | from django.urls import path
from .views import SignInView, SignUpView, BlankPageView
app_name = "observe_login"
urlpatterns = [
path('signin/', SignInView.as_view(), name='signin'),
path('signup/', SignUpView.as_view(), name='signup'),
path('blank_page/', BlankPageView.as_view(), name='blank_page')
]
| null | database_session_sample/observe_login/urls.py | urls.py | py | 317 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "views.SignInView.as_view",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "views.SignInView",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.urls.p... |
421543822 | from datetime import datetime
import pymysql,random,time
# ALTER TABLE f_i1_iwala_trade_user PARTITION BY RANGE COLUMNS(stime)
# (
# PARTITION p20200326 VALUES LESS THAN ('2020-03-27'),
# PARTITION p20200327 VALUES LESS THAN ('2020-03-28')
# );
# pre = 'ALTER TABLE `f_i1_iwala_trade_user` PARTITION BY RANGE COLUMNS(`... | null | addPartion.py | addPartion.py | py | 4,006 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pymysql.connect",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.fromtimestamp",
"line_number": 85,
"usage_type": "call"
},
{
"api_name": "dateti... |
69055168 | """
Introduction:
Apply a multi task machine learning fro pre-trained BERT model
Author:
Chend
"""
import numpy as np
import torch
import torch.nn as nn
import torch.utils.data as Data
import random
import sys
import argparse
import time
import os
from sklearn import metrics
import sklearn.ensemble as ensembl... | null | lhx/res/10.7-1/files/ChenDdon/AGBTcode/acd9706/agbt_pro&multi_task_old_version.py | agbt_pro&multi_task_old_version.py | py | 23,801 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "fairseq.models.roberta.RobertaModel.from_pretrained",
"line_number": 93,
"usage_type": "call"
},
{
"api_name": "fairseq.models.roberta.RobertaModel",
"line_number": 93,
"usa... |
50917891 | from datetime import timedelta
import os
import sys
PROJECT_HOME = os.path.dirname(__file__)
DEBUG = False
JS_DEBUG = False
SECRET_KEY = ''
VERIFY_CERT = True # verify SSL certs during web service calls by requests, can be a path to a cert bundle
COLLECT_STATIC_ROOT = 'static/' # directory where static files shoul... | null | config.py | config.py | py | 3,441 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.dirname",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "datetime.timedelta",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"lin... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.