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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
127123857 | '''Most common words used in a text file.
I found this great snippet here:
https://python-forum.io/Thread-Python-word-counter-and-ranker
I added comments, ideas, PEP8.
For more snippets:
https://stevepython.wordpress.com/
This is similar, but better, than snippet 29.
'''
from collect... | null | Python-code-snippets-001-100/048-most common used words in text.py | 048-most common used words in text.py | py | 828 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "re.findall",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 22,
"usage_type": "call"
}
] |
376364173 | #Dependencies
import pandas as pd
from bs4 import BeautifulSoup
import requests
import pymongo
from splinter import Browser
from webdriver_manager.chrome import ChromeDriverManager
def scrape():
# Setup splinter
executable_path = {'executable_path': ChromeDriverManager().install()}
browser = Browser('chr... | null | Mission_to_Mars/scrape_mars.py | scrape_mars.py | py | 2,299 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "webdriver_manager.chrome.ChromeDriverManager",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "splinter.Browser",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 20,
"usage_type": "call"
},
{
"a... |
401192285 | from collections import deque
def operations(opr):
if opr[0]=="append":
d.append(opr[1])
elif opr[0]=="appendleft":
d.appendleft(opr[1])
elif opr[0]=="pop":
d.pop()
elif opr[0]=="popleft":
d.popleft()
else:
pass
if __name__ == "__main__":
... | null | Opr_deque.py | Opr_deque.py | py | 567 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.deque",
"line_number": 17,
"usage_type": "call"
}
] |
281852320 | '''
Created on Jun. 18, 2019
@author: KJNETHER
Gets the latest version from pypi and increments by 1
'''
import logging
import os
import re
import requests
import packaging.version
import bcdc2bcdc
import distlib.index
pkg_name = bcdc2bcdc.name
pkg_name = bcdc2bcdc.name.replace('_', '-')
if ('PKG_TYPE' in os.env... | null | version.py | version.py | py | 4,483 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "bcdc2bcdc.name",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "bcdc2bcdc.name.replace",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "bcdc2bcdc.name",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.env... |
474554008 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.conf.urls import patterns, include, url
urlpatterns = patterns('aluno.views',
url(r'^novo/$', 'aluno_novo', name='aluno_novo'),
url(r'^lista/$','aluno_lista', name='aluno_lista'),
url(r'^editar/(?P<aluno_id>\d+)/$', 'aluno_editar', name='aluno_editar'),
ur... | null | academia_app/aluno/urls.py | urls.py | py | 481 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.conf.urls.patterns",
"line_number": 6,
"usage_type": "call"
},
{
"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": "djan... |
628823670 | import os,sys
import utils
import cv2
import numpy as np
from common_flags import FLAGS
from keras.utils import plot_model
import cnn_models
import math
import tensorflow_probability as tfp
tfd = tfp.distributions
from keras import backend as K
TEST_PHASE=0
def central_image_crop(img, crop_height,crop_width):
"""
... | null | evaluate_UAVPatrolNet.py | evaluate_UAVPatrolNet.py | py | 13,440 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tensorflow_probability.distributions",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "common_flags.FLAGS.img_mode",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "common_flags.FLAGS",
"line_number": 28,
"usage_type": "name"
... |
12731654 | # -*- coding: utf-8 -*-
"""
Created on Fri Aug 14 22:18:10 2020
@author: Bolivar Roman
"""
import pandas as pd
import xlsxwriter
save_path = 'artwork_data.pickle'
df = pd.read_pickle(save_path)
sub_df = df.iloc[49980:50519,:].copy()
num_artistas = sub_df['artist'].value_counts()
range_cell = 'B2:B{}'.format(len(nu... | null | 03 - pandas/deber_grafico.py | deber_grafico.py | py | 828 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_pickle",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "xlsxwriter.Workbook",
"line_number": 19,
"usage_type": "call"
}
] |
281434653 | import typing
from .implementation import CopyWriteMetadataKey, Key, sfn, copy_write_metadata_sfn
def copy_sfn_event(
source_bucket: str, source_key: str,
destination_bucket: str, destination_key: str
) -> typing.MutableMapping[str, str]:
"""Returns the initial event object to start the s3-s3 cop... | null | dss/stepfunctions/s3copyclient/__init__.py | __init__.py | py | 1,196 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "implementation.Key.SOURCE_BUCKET",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "implementation.Key",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "implementation.Key.SOURCE_KEY",
"line_number": 13,
"usage_type": "attribute"
}... |
399986971 | from __future__ import absolute_import
import abc
import logging
import mimetypes
import os
import shutil
import string
import tempfile
import zipfile
from inspect import isclass
import six
import webob.exc
from markupsafe import escape
from galaxy import util
from galaxy.datatypes.metadata import MetadataElement #... | null | lib/galaxy/datatypes/data.py | data.py | py | 48,426 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "abc.ABCMeta",
"line_number": 51,
"usage_type": "attribute"
},
{
"api_name": "galaxy.datatypes.metadata.MetadataElement",
"line_number": 90,
"usage_type": "call"
},
{
"api_... |
297810792 | from __future__ import unicode_literals
import csv
import os
from django.conf import settings
from django.contrib.auth import models as admin_models
from django.core.exceptions import ValidationError
from django.db import models
from django.db.models import Avg, F
from django.utils import timezone
from register.email... | null | register/models.py | models.py | py | 11,142 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.join",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings.BASE_DIR",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "django.c... |
570813543 | import os
from six.moves import urllib
import json
import base64
import urllib.parse as parse
import boto3
from botocore.exceptions import ClientError
REPLYWORDS = [
'help',
'error'
]
BLOCK_REPLY_V2 = """
[
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "T... | null | lambda/lambda_function.py | lambda_function.py | py | 11,009 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ",
"line_number": 268,
"usage_type": "attribute"
},
{
"api_name": "six.moves.urllib.parse.urlencode",
"line_number": 270,
"usage_type": "call"
},
{
"api_name": "six.moves.urllib.parse",
"line_number": 270,
"usage_type": "attribute"
},
{
"a... |
501703121 | from sklearn.preprocessing import StandardScaler
def normalisation(trainData, testData, una):
scaler = StandardScaler()
if not isinstance(trainData[0], list):
# encode each sample into a list
trainData = [[d] for d in trainData]
testData = [[d] for d in testData]
unaDa... | null | examen_4/normalization_stuff.py | normalization_stuff.py | py | 1,896 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sklearn.preprocessing.StandardScaler",
"line_number": 5,
"usage_type": "call"
}
] |
206206544 | """
Pagination fields
"""
import warnings
from collections import OrderedDict
from rest_framework.pagination import LimitOffsetPagination, PageNumberPagination
from rest_framework.utils.urls import remove_query_param, replace_query_param
from rest_framework.views import Response
class JsonApiPageNumberPagination(Pag... | null | rest_framework_json_api/pagination.py | pagination.py | py | 5,815 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rest_framework.pagination.PageNumberPagination",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "rest_framework.utils.urls.replace_query_param",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "rest_framework.views.Response",
"line_number": 3... |
75617312 | import sys
sys.path.append('/Users/hsnu130427/BigdataCourse/Recommender/')
import pandas as pd
import numpy as np
from datetime import datetime
from sqlalchemy.sql import select
from db_setting import db_connection
from db_setting import data_config
from db_setting import orm
conn = db_connection.engine.connect()
'... | null | BigdataCourse/RecommenderSystem/db_setting/data_resource.py | data_resource.py | py | 2,832 | 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": "db_setting.db_connection.engine.connect",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "d... |
326713978 | import logging
import json
import time
import re
import boto3
from AWSIoTPythonSDK.MQTTLib import AWSIoTMQTTClient
from policy import myenforcer
myclientID = "basicPubSub"
host = "a357dlfn55njoi.iot.us-west-2.amazonaws.com"
mode = "both"
global client
global myclient
global client1
global groupLocation
global subGrou... | null | SmartCarController.py | SmartCarController.py | py | 13,108 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.basicConfig",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "boto3.client",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "boto3.client",
... |
340368739 | """proyectoweb URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-b... | null | AppDia/urls.py | urls.py | py | 1,764 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.urls.path",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "django.urls.path",... |
60421009 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Create rank plots from best table json files.
Author: Gertjan van den Burg
Copyright (c) 2020 - The Alan Turing Institute
License: See the LICENSE file.
"""
import argparse
from labella.timeline import TimelineTex
from labella.scale import LinearScale
from rank_co... | null | analysis/scripts/rank_plots.py | rank_plots.py | py | 3,817 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "rank_common.compute_ranks",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "labella.scale.LinearScale",
"line_number": 73,
"usage_type": "call"
},
{
"api_n... |
592320563 | from matplotlib import pyplot
import time
start_time = time.time()
from datetime import datetime
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
#from vaderSentiment_fr.vaderSentiment import SentimentIntensityAnalyzer
import elasticsearch
import matplotlib.pyplot as plt
from elasticsearch import... | null | back_up_file/main.py | main.py | py | 9,850 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "time.time",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "twitter.Api",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "elasticsearch.Elasticsearch",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "twitter.error.Twitte... |
41783896 | import sys
import os
from pyspark.streaming.context import StreamingContext
work_path = "/Users/Jason/Documents/Python/MyPython/Streaming"
sys.path.append(work_path)
# Spark session
from pyspark.sql import SparkSession
spark = SparkSession.builder.master("local[*]").appName("streaming_data").config("spark.sql.warehou... | null | Streaming/read_streamingdata.py | read_streamingdata.py | py | 1,854 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.append",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pyspark.sql.SparkSession.builder.master",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "p... |
519974910 | import jieba
import torch
import nlp.lang_translation.config as config
from nlp.lang_translation.data_utils import get_lang_dict
from nlp.lang_translation.seq2seq.models import EncoderRNN, AttDecoderRNN
device = torch.device('cpu')
def predict(input_tensor, words_len, encoder: EncoderRNN, decoder: AttDecoderRNN, ta... | null | nlp/lang_translation/evaluate.py | evaluate.py | py | 3,379 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.device",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "nlp.lang_translation.seq2seq.models.EncoderRNN",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "nlp.lang_translation.seq2seq.models.AttDecoderRNN",
"line_number": 11,
"usage_... |
192520978 | from kivy.graphics.vertex_instructions import Rectangle
from kivy.graphics import Color
from kivy.uix.label import Label
from kivy.core.window import Keyboard
from src.core.screen import Screen
from src.core.camera import OrthographicCamera
import random
class GameScreen(Screen):
def __init__(self, **kwargs):
... | null | excellent-exorcists/src/screens/game_screen.py | game_screen.py | py | 2,171 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "src.core.screen.Screen",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "src.core.camera.OrthographicCamera",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 23,
"usage_type": "call"
},
{
"api_name... |
87458555 | '''
Created on Nov 7, 2020
@author: Luis, carlos, yoshi, jack
'''
import cv2
import time
from face_detection import FaceDetector
# from motion_tracking import MotionTracker
# from multiprocessing import Process, Pipe
import numpy as np
from threading import Thread
# __init__ and the __call__ are the only methods tha... | null | main/capture_image.py | capture_image.py | py | 5,064 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "face_detection.FaceDetector",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "time.sl... |
332195789 | #!/usr/bin/env python
#-*- coding: utf-8 -*-
"""
.. topic:: post_analysis.py summary
Module that implements functions that create graphical output
given the standard stocatree outputs.
:Code: mature
:Documentation: mature
:Author: Thomas Cokelaer <Thomas.Cokelaer@sophia.inria.fr>
:Revision: $I... | null | src/openalea/stocatree/post_analysis.py | post_analysis.py | py | 2,005 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.loadtxt",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "pylab.datestr2num",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "pylab.num2date",
... |
389454215 | from flask import Flask,jsonify, Response
import math
import hashlib
#instantiate the Flask object
app = Flask(__name__)
@app.route("/")
def index():
return "Welcome to the Project 5 API"
# mb5 hash converter
@app.route('/md5/<string:input>', methods=['GET'])
def get_md5(input):
res = hashlib.md5(input.encode())
... | null | app.py | app.py | py | 938 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "hashlib.md5",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "math.factorial",
"line_numbe... |
643209980 | import torch
from scipy.integrate import ode
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
class TwoLayerNet(torch.nn.Module):
def __init__(self,D_in,H1):
super(TwoLayerNet, self).__init__()
# self.linear1 = torch.nn.Linear(D_in, H1)
# self.linear2 = torch.nn.... | null | test_4_10/nn_new_controller_symmetry.py | nn_new_controller_symmetry.py | py | 27,338 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.nn",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Linear",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Linear",
"lin... |
152700703 | from io import StringIO
from wsgiref.util import FileWrapper
from dicttoxml import dicttoxml
import json, time
from xml.dom.minidom import parseString
import urllib
from django.db import IntegrityError
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.http import HttpResponse
from dj... | null | src/apps/websites/utils.py | utils.py | py | 4,467 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "models.Website",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "models.Page",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "lib.crabler.httpalm.make_proper_url",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "lib.cr... |
28272029 | import os
import argparse
import traceback
from html.parser import HTMLParser
from urllib.parse import urlparse, urljoin, urlunparse
import requests
root_site_name = ''
root_path = ''
registered_tag_handlers = {}
processed = set()
args = None
class URL:
def __init__(self, url):
self.url = url.strip()
... | null | main.py | main.py | py | 12,003 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "urllib.parse.urlparse",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path.split",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 51,
"usage_type": "attribute"
},
{
"api_name": "os.path.splitext",
... |
328837502 | import os, math, random, engine,pyglet,time,interface
from random import randint
from pyglet.window import key,mouse
from pyglet import font
from game_objects import Player
from game_objects import Display_input
from game_objects import Game
dictionary = open('dictionary.txt').read().splitlines() #to utilize... | null | ali/main.py | main.py | py | 3,793 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "interface.width",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "interface.height",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pyglet.window.Window",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pygle... |
340410735 | # -*- coding: utf-8 -*-
import grokcore.viewlet as grok
from grokui.base import IGrokUIPluginInfo, GrokUIView, GrokUILayer, IUIPanel
from megrok.layout import Page
from zope.component import getUtilitiesFor
from zope.location import LocationProxy
from zope.schema.fieldproperty import FieldProperty
from zope.traversing... | null | grokui.base/branches/plugin-info/src/grokui/base/info.py | info.py | py | 1,303 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "grokcore.viewlet.templatedir",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "grokcore.viewlet",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "grokcore.viewlet.GlobalUtility",
"line_number": 14,
"usage_type": "attribute"
},
{
... |
193391371 | from django.shortcuts import get_object_or_404
from rest_framework import status
from rest_framework.response import Response
from rest_framework.views import APIView
from user_profile.models import UserProfile, DoctorProfile
from user_profile.serializers import (
UserProfileSerializer,
UserProfileSerializerUpd... | null | backend/user_profile/views/profile.py | profile.py | py | 2,461 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rest_framework.views.APIView",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "user_profile.models.UserProfile.objects.all",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "user_profile.models.UserProfile.objects",
"line_number": 24,
"us... |
261724525 | import pyb
from BME280 import BME280
import ujson
bme = BME280()
adcall = pyb.ADCAll(12, 0x70000)
vref = adcall.read_vref()
adc0 = pyb.ADC(pyb.Pin.board.A0)
adc1 = pyb.ADC(pyb.Pin.board.A1)
adc2 = pyb.ADC(pyb.Pin.board.A2)
adc3 = pyb.ADC(pyb.Pin.board.A3)
adc4 = pyb.ADC(pyb.Pin.board.A4)
adc5 = pyb.ADC(pyb.Pin.... | null | DAQ.py | DAQ.py | py | 1,459 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "BME280.BME280",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pyb.ADCAll",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pyb.ADC",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pyb.Pin",
"line_number": 10,
"... |
605353787 | import sys
import os
import configparser
current_path = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.join(current_path, '../'))
config = configparser.ConfigParser()
config.read(filenames=sys.argv[1])
for section in config.sections():
print()
print('[' + section + ']')
for key in con... | null | PNData/config.py | config.py | py | 379 | 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": "os.path.abspath",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"line... |
536150293 | import discord
from discord.ext import commands
# import json
from __main__ import send_cmd_help
from .cdtembed import CDTEmbed
from .cdtpagesmenu import PagesMenu
from .cdtdiagnostics import DIAGNOSTICS
from .utils import chat_formatting as chat
from .utils.dataIO import dataIO
basepath = "https://raw.git... | null | mcocMaps/mcocMaps.py | mcocMaps.py | py | 14,219 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cdtdiagnostics.DIAGNOSTICS",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "utils.dataIO.dataIO.load_json",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "utils.dataIO.dataIO",
"line_number": 25,
"usage_type": "name"
},
{
"api_... |
654135331 | """Contains the code for dealing with and defining atomium data dictionaries."""
from copy import deepcopy
from itertools import groupby
from .file import File
from ..models import *
from ..models.data import CODES, BONDS
def generate_higher_structures(models):
"""Takes a list of model dictionaries, and for each ... | null | atomium/files/data.py | data.py | py | 8,126 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "copy.deepcopy",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "file.File",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "itertools.groupby",
"line_n... |
45187264 | # -*- coding: utf-8 -*-
"""Get Wikidata xrefs.
Run with python -m pyobo.xrefdb.sources.wikidata
"""
import logging
from typing import Iterable, Tuple
import click
import pandas as pd
import requests
from ...cli_utils import verbose_option
from ...registries.registries import CURATED_REGISTRY_DATABASE
logger = log... | null | src/pyobo/xrefdb/sources/wikidata.py | wikidata.py | py | 2,106 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "registries.registries.CURATED_REGISTRY_DATABASE.items",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "registries.registries.CURATED_REGISTRY_DATABASE",
"line_number": 26,
... |
197845845 |
import json
import sys
import gzip
import matplotlib.pyplot as plt
import numpy as np
import math
import statistics
def mean_margin(data_list):
n = 0
mean = 0.0
stdev = 0.0
zstar = 1.645 # for 90% -- 1.96 # for 95%
margin = 0.0
n = len(data_list)
if (n == 1):
return data_list[0], 0
#end_if
mean = st... | null | process/zoomgraph_throughput.py | zoomgraph_throughput.py | py | 5,079 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "statistics.mean",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "statistics.stdev",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "gzip.open",
"line_numb... |
451285127 | #!/usr/bin/env python3
__author__ = 'wlu'
import sys
print(sys.path)
import subprocess
import hailtop.batch as hb
import argparse
import hail as hl
import logging
from google.cloud import storage
# from ccdg_qc.resources import *
logging.basicConfig(format="%(levelname)s (%(name)s %(lineno)s): %(message)s")
logger =... | null | scripts/final_subset/create_sample_subset.py | create_sample_subset.py | py | 8,521 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "logging.basicConfig",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
... |
324046158 | import torch
import cupy as cp
import numpy as np
import math
from .CustomKernel import CustomKernel
from ..util import get_absolute_path
class Top1SelectCuda(CustomKernel):
"""
tpb: threads per block, needs to be a power of 2 between 32 and 1024
queue_capacity: capacity of thread queue
buffer_size: num... | null | torchpq/kernels/Top1SelectCuda.py | Top1SelectCuda.py | py | 3,132 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "CustomKernel.CustomKernel",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "util.get_absolute_path",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "cupy.RawKernel",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "cupy.R... |
326492884 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch
__all__ = ['SparseConv2d', 'SparseLinear']
def reshape_tensor(matrix, m):
if matrix.shape[1] % m > 0:
# padding 0
mat = torch.cuda.FloatTensor(matrix.shape[0], matrix.shape[1] +
(m - matrix.shape... | null | src/vai_quantizer/vai_q_pytorch/pytorch_binding/pytorch_nndct/nn/modules/sparse_ops.py | sparse_ops.py | py | 4,440 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.cuda.FloatTensor",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.zeros_like",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "torch.min",
... |
363538941 | import torch
import torch.nn as nn
from copy import deepcopy
# from ..cell_operations import ResNetBasicblock
# from .search_cells import NAS201SearchCell as SearchCell
# from .genotypes import Structure
from cell_operations import OPS,ResNetBasicblock,NAS_BENCH_201
class NAS201SearchCell(nn.Module):
d... | null | search_cnn_nasbench_progressive/models.py | models.py | py | 4,506 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.nn.Module",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "copy.deepcopy",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.nn.ModuleDict",
"... |
89076789 | #!/usr/bin/env python
from easydict import EasyDict as edict
import os,sys,pickle
from os import path as osp
def inspect_config(config):
print("--")
for config_key,config_value in config.items():
if type(config_value) is edict or type(config_value) is dict:
print(config_key)
fo... | null | tools/fresh_analyze.py | fresh_analyze.py | py | 1,304 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "easydict.EasyDict",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "sys.argv",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "pickle.load",
"line_number": 25,
"usage_type": "call"
}
] |
320298800 | from django import forms
from .models import ImageRecord, MeasurementRecord, StrengthRecord, CardioRecord
class ImageRecordForm(forms.ModelForm):
class Meta:
model = ImageRecord
fields = [
'front_img',
'side_img',
'back_img',
]... | null | training/forms.py | forms.py | py | 3,695 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "models.ImageRecord",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.forms... |
470425367 | # -*- coding: utf-8 -*-
"""
This module contains various component features used by
HOD-style models of the galaxy-halo connection. For example,
the `~halotools.empirical_models.Kravtsov04Cens` class
governs the occupation statistics of a centrals-like population,
and so has a ``mean_occupation`` method.
A common... | null | halotools/empirical_models/hod_components.py | hod_components.py | py | 27,586 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "occupation_helpers.enforce_required_haloprops",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "occupation_helpers.count_haloprops",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "abc.abstractmethod",
"line_number": 59,
"usage_type": "n... |
3300671 | import scrapy
from ..items import Website
class DmozSpider(scrapy.Spider):
name = "dmoz"
allowed_domains = ["dmoz.org"]
start_urls = [
"http://www.dmoz.org/Computers/Programming/Languages/Python/Books/",
"http://www.dmoz.org/Computers/Programming/Languages/Python/Resources/",
]
d... | null | dirbot/spiders/dmoz.py | dmoz.py | py | 1,124 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "scrapy.Spider",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "items.Website",
"line_number": 25,
"usage_type": "call"
}
] |
176923333 | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
import requests
from bs4 import BeautifulSoup
import pandas as pd
import numpy as np
data =[]
for i in range(159):
proj = requests.get(f'https://surp-iitb.herokuapp.com/project.php?param={i+2101}')
soup = BeautifulSoup(proj.content, 'html.parser')
proj_id =... | null | Small projects/Scraped-surp-main/scrapedSURP.py | scrapedSURP.py | py | 1,185 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 49,
"usage_type": "call"
}
] |
294187356 | import json
from database_sanitizer.session import hash_text_to_ints
LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
DIGITS = '0123456789'
N_LETTERS = len(LETTERS)
N_DIGITS = len(DIGITS)
def sanitize_registration_number(value):
if not value:
return value
normalized = value.replace('-', '').replace(' ', '').... | null | sanitizers/parkkihubi.py | parkkihubi.py | py | 1,083 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "database_sanitizer.session.hash_text_to_ints",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 37,
"usage_type": "call"
}
] |
267467329 | import requests
from os import path
import csv
import time
##
def getsubinfo():
helper = {'STOPID':'https://api.umd.io/v1/bus/stops/',
'ROUTES':'https://api.umd.io/v1/bus/routes/',
'TIMES':'https://api.umd.io/v1/bus/routes/'}
for i in helper.keys():
print(i)
inner = input... | null | server_files/other/fulldata/subdata.py | subdata.py | py | 2,268 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.exists",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number":... |
96817741 | #coding=utf-8
import requests
from retrying import retry
from lxml import etree
import json
from queue import Queue
import threading
class QiuBai:
def __init__(self):
self.temp_url = "https://www.qiushibaike.com/8hr/page/{}/"
self.headers = {"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_1... | null | ch4/code/qiubai_queue.py | qiubai_queue.py | py | 3,790 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "queue.Queue",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "queue.Queue",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "queue.Queue",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number":... |
405503906 | from itertools import permutations
# global
ans_arr=[]
## gcd
def gcd(a, b):
if a < b:
a, b = b, a
y = a % b
if y == 0:
return b
else:
a, b = b, y
return gcd(a,b)
# prime
for j in range(int(input(""))):
group_arr = []
num_arr=[]
ipt=input("")
ipt_ar... | null | b573.排列組合、最大公因數.py | b573.排列組合、最大公因數.py | py | 763 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "itertools.permutations",
"line_number": 29,
"usage_type": "call"
}
] |
545593063 | #!/usr/bin/env python
"""
Usage:
salt-state-graph <inputfile> <outputfile>
A tool that ingests the YAML representing the Salt (show)lowstate (or
show_low_sls) for a single minion and produces a program written in DOT.
The tool is useful for visualising the dependency graph of a Salt states.
"""
from pydot import... | null | salt-state-graph.py | salt-state-graph.py | py | 4,894 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.stderr.write",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sys.stderr",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
... |
411785869 | from sklearn.feature_extraction.text import CountVectorizer
import jieba
#给出文档集,放在字符串列表中
corpus = [
"我是中国人,我爱中国",
"我是上海人",
"我住在上海松江大学城"
]
split_corpus = [] #初始化存储jieba分词后的列表
#循环为corpus中的每个字符串分词
for c in corpus:
#jieba分词后的字符串列表拼接为一个字符串,元素之间用空格分割
s = " ".join(jieba.lcut(c)) #将分词得到的列表
split_c... | null | 数据科学课本资料/例题源程序-学生/6-textbow.py | 6-textbow.py | py | 1,154 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "jieba.lcut",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sklearn.feature_extraction.text.CountVectorizer",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sklearn.feature_extraction.text.TfidfTransformer",
"line_number": 30,
"usage_t... |
574764873 | import random
import pymysql
class CommonUtility:
@staticmethod
def get_random_phone():
"""返回一个标准手机号的字符串"""
second = [3, 4, 5, 7, 8][random.randint(0, 4)]
third = {
3: random.randint(0, 9),
4: [5, 7, 9][random.randint(0, 2)],
5: [i for i in range(10)... | null | utility/common.py | common.py | py | 9,709 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "random.randint",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "random.randint",
"lin... |
459291710 | from google.cloud import vision
import os
import requests
from dotenv import load_dotenv
load_dotenv()
GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY")
# os.environ["GOOGLE_APPLICATION_CREDENTIALS"]="env/key.json"
# image_uri = 'gs://cloud-samples-data/vision/using_curl/shanghai.jpeg'
# client = vision.ImageAnnotatorClien... | null | app.py | app.py | py | 1,912 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 30,
"usage_type": "call"
}
] |
173714272 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import time
import logging
import psutil
import mozcrash
from mozprocess import ProcessHandler
from threading import Eve... | null | talos/talos_process.py | talos_process.py | py | 4,092 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.debug",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "psutil.TimeoutExpired",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "logging.debug",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "time.time",
... |
282935415 | #!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
"""Test A&AI VNF module."""
from unittest import mock
import pytest
from onapsdk.aai.business import ServiceInstance, VnfInstance
from onapsdk.so.deletion import VnfDeletionRequest
from onapsdk.so.instantiation import VfModuleInstantiation
from onapsdk.exc... | null | tests/test_aai_vnf.py | test_aai_vnf.py | py | 11,022 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "onapsdk.aai.business.ServiceInstance",
"line_number": 185,
"usage_type": "call"
},
{
"api_name": "onapsdk.aai.business.VnfInstance",
"line_number": 187,
"usage_type": "call"
},
{
"api_name": "unittest.mock.patch.object",
"line_number": 183,
"usage_type": "c... |
498938054 | '''
AI Fashion Coordinator
(Baseline For Fashion-How Challenge)
MIT License
Copyright (C) 2021, Integrated Intelligence Research Section, ETRI
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software wit... | null | requirement.py | requirement.py | py | 4,875 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.nn.Module",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "torch.nn.Parameter",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line... |
618950321 | import time
import argparse
import numpy as np
import sys
import os
from threading import Thread
import multiprocessing
import glob
import sounddevice as sd
import soundfile as sf
import pyrealsense2 as rs
import cv2
import json
import pdb
parser = argparse.ArgumentParser(description="")
parser.add_argument('--room... | null | record_video_audio_UM.py | record_video_audio_UM.py | py | 6,755 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "threading.Thread",
... |
104871832 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
#Edited from python-telegram-bot sample echo.py
import logging
import telegram
from telegram.error import NetworkError, Unauthorized
from time import sleep
import datetime
import time
import json
import sys
import os
def printWithTimeStamp(s):
ms=int(datetime.dateti... | null | yaowan.py | yaowan.py | py | 7,398 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.datetime.now",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "time.strftime",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "time.local... |
51654432 | from sense_hat import SenseHat
from datetime import datetime
import pytz
import os
import csv
import os
from dateutil.relativedelta import relativedelta
from data_types import Schedule
def main():
filename = get_data_file()
data = load_file(filename)
sense = SenseHat()
local_tz = pytz.timezone('Americ... | null | program.py | program.py | py | 1,792 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sense_hat.SenseHat",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pytz.timezone",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pytz.utc.localize",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pytz.utc",
"li... |
346213854 | from sqlalchemy import create_engine, select
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.sql.expression import null
from sqlalchemy.sql.schema import Column, ForeignKey, Sequence
from sqlalchemy.sql.sqltypes import DateTime, Integer, String
from sqlalchemy.sql import func
from sqlalchemy.orm... | null | selenium/beebom_selenium_scroll.py | beebom_selenium_scroll.py | py | 8,745 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sqlalchemy.orm.sessionmaker",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "connection.engine",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.chrome.options.Options",
"line_number": 44,
"usage_type": "call"
},
... |
24575371 | import pygame
from pytmx.util_pygame import load_pygame
size = 16
pygame.init()
class Map(object):
def __init__(self,filename):
self.filename = None
self.data = None
self.tile_size = (0,0)
self.right = []
self.left = []
self.events = []
self.catchable = {}
self.prevlevel = []
self.nextlevel = []
... | null | maps.py | maps.py | py | 7,842 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pygame.init",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pytmx.util_pygame.load_pygame",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "pytmx.util_pygame.load_pygame",
"line_number": 154,
"usage_type": "call"
}
] |
409850933 | import math
import defs
import pyglet
import queue
from api_handler import APIHandlerThread
from helper import cube_vertices, normalize, sectorize
from pyglet.window import key, mouse
from pyglet.gl import *
from model import Model
class Window(pyglet.window.Window):
def __init__(self, *args, **kwargs):
... | null | src/core/window.py | window.py | py | 16,232 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pyglet.window",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "defs.BRICK",
"line_number": 53,
"usage_type": "attribute"
},
{
"api_name": "defs.GRASS",
"line_number": 53,
"usage_type": "attribute"
},
{
"api_name": "defs.SAND",
"l... |
221909108 | #from KerasRFCN.Model.ResNet_dilated import ResNet_dilated
#cpu mode for test code
'''
import tensorflow as tf
import keras.backend.tensorflow_backend as KTF
KTF.set_session(tf.Session(config=tf.ConfigProto(device_count={'cpu':0})))
'''
import keras.backend as K
import numpy as np
import tensorflow as tf
from keras imp... | null | KerasRFCN/Model/RFCN.py | RFCN.py | py | 14,367 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "keras.layers.Input",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "keras.layers",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "keras.layers.Conv2D",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "keras.layers",
... |
307265328 | import numpy as np
from keras_xlnet.backend import keras
from keras_xlnet import PretrainedList, get_pretrained_paths
from keras_xlnet import Tokenizer
from sklearn.model_selection import train_test_split
from dataloader import load_data, get_X_array
from model import get_xlnet_model
from model_eval import model_eva... | null | src/xlnet/train_early_access.py | train_early_access.py | py | 1,229 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "keras_xlnet.get_pretrained_paths",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "keras_xlnet.PretrainedList.en_cased_base",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "keras_xlnet.PretrainedList",
"line_number": 19,
"usage_typ... |
589524444 | import logging
import os
from nameko import config
from nameko.extensions import DependencyProvider
from sendgrid import Mail, SendGridAPIClient
path = os.path.dirname(__file__)
"""
Currently this dependency uses HTML rather than templates but its pretty trivial
to add template support instead. (Templates are the t... | null | backend/dependencies/send_grid/provider.py | provider.py | py | 1,748 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.dirname",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sendgrid.SendGridAPIClie... |
442976449 | from PyQt5 import QtCore, QtGui, QtWidgets
#pylint: disable=no-name-in-module
from PyQt5.QtCore import QObject, pyqtSlot
from LogInService import LogInService
from LogInDialog import Ui_LogInDialog
from StudentController import StudentController
from TeacherController import TeacherController
from SysAdminController im... | null | LogInController.py | LogInController.py | py | 1,563 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "LogInDialog.Ui_LogInDialog",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "LogInService.LogInService",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 35,
"usage_type": "call"
},
{
"... |
201599042 | """Set up for XBlock SDK"""
from __future__ import absolute_import
import os
import os.path
from setuptools import setup
def find_package_data(pkg, data_paths):
"""Generic function to find package_data for `pkg` under `root`."""
data = []
for data_path in data_paths:
package_dir = pkg.replace(".... | null | setup.py | setup.py | py | 4,267 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.walk",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.relpath",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number"... |
61751367 | #!/usr/bin/env python
# coding=utf-8
import datetime
import connections
import models
__author__ = u'Ahmed Şeref GÜNEYSU'
def mongo_filler():
posts = connections.mongo.get_collection("post")
posts.remove()
for _ in xrange(100):
posts.insert_one(dict(
title=models.faker.sentence(),
... | null | helpers/__init__.py | __init__.py | py | 699 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "connections.mongo.get_collection",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "connections.mongo",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "models.faker.sentence",
"line_number": 16,
"usage_type": "call"
},
{
"api... |
137544098 | # This sample tests the assignment of callables
# that include type variables in the parameter and
# return types.
from typing import Any, Callable, Iterable, Sequence, TypeVar
_T = TypeVar("_T")
def my_min(__iterable: Iterable[_T]) -> _T:
...
a: Callable[[Sequence[float]], float] = my_min
b: Callable[[Seque... | null | packages/pyright-internal/src/tests/samples/callable2.py | callable2.py | py | 622 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "typing.TypeVar",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "typing.Iterable",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.Callable",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.Sequence",
"... |
257214447 | from scipy.integrate import dblquad
import math
import numpy as np
from scipy.interpolate import interp1d
"""
Integration linear and analytical integration (x*sin(x))
"""
p = []
for i in range(len(ang)-1):
slope = (relInt[i+1]-relInt[i])/(ang[i+1]-ang[i])
b = relInt[i]-slope*ang[i]
p.append((ang[i],ang[i+1],slop... | null | uvled/ledCustomIntegrate.py | ledCustomIntegrate.py | py | 1,395 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.array",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "math.pi",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "scipy.interpolate.interp1d",
... |
261978938 | '''
Copyright (C) 2016 CEDRIC LEPILLER
pitiwazou@gmail.com
Created by CEDRIC LEPILLER
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at... | null | All_In_One/addons/speedsculpt/__init__.py | __init__.py | py | 9,626 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "importlib.reload",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "bpy.utils.unregister_class",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "bpy.utils",
"line_number": 56,
"usage_type": "attribute"
},
{
"api_name": "bpy.utils.... |
481402930 | #!/usr/bin/env python3
"""
通过生成几个像素大小的图片理解图片在numpy数组中的存储
"""
import numpy as np
import cv2
from matplotlib import pyplot as plt
#填充4个3通道图片,大小为8x5像素
img1 = np.zeros((8, 5, 3), dtype='uint8')
img2 = np.zeros((8, 5, 3), dtype='uint8')
img3 = np.zeros((8, 5, 3), dtype='uint8')
img4 = np.zeros((8, 5, 3), dtype='uint8')
i... | null | opencv/sample.py | sample.py | py | 1,807 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.zeros",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": ... |
54708847 | from sklearn import svm
import numpy as np
import math
#from scipy.special import beta, betainc
from fns import load_sentiment_dataset
###########################################CARS DATASET: 398 obs. of 11 variables:
def compute_lppd(probs):
#probs is an array of shape data_size X no_samples (sampled parameter ... | null | test_WAIC_ovo.py | test_WAIC_ovo.py | py | 20,217 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.empty",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.log",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 21,
... |
258966882 | from .forms import Images
from django.shortcuts import render, redirect
from django.http import HttpResponse
import requests
def homepage(request):
if request.method == "POST":
form = Images(request.POST)
if form.is_valid():
form.save()
return redirect('home')
... | null | new/views.py | views.py | py | 765 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "forms.Images",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "forms.Images",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.... |
556023067 | #! /usr/bin/python -B
###############################################################
######## birdWatcher.py ########
######## Made by Thomas Roberts ########
######## 01/03/2016 ########
#######################################... | null | birdWater.py | birdWater.py | py | 2,033 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.datetime.now",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path"... |
457793463 | import cv2
from PIL import Image
import threading
from http.server import BaseHTTPRequestHandler, HTTPServer
from socketserver import ThreadingMixIn
from io import StringIO, BytesIO
import time
capture=None
class CamHandler(BaseHTTPRequestHandler):
def do_GET(self):
if self.path.endswith('.mjpg'):
se... | null | VideoHTTPStream.py | VideoHTTPStream.py | py | 2,069 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "http.server.BaseHTTPRequestHandler",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "cv2.cvtColor",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2RGB",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name":... |
418841999 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# OS : GNU/Linux Ubuntu 16.04 or later
# LANGUAGE : Python 3.5.2 or later
# AUTHOR : Klim V. O.
# DATE : 17.06.2020
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -... | null | espnet2/text/text_preparation/numbers_to_words_en.py | numbers_to_words_en.py | py | 3,247 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "inflect.engine",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": ... |
167950144 | import torch
import torch.nn as nn
from torch.utils.data import DataLoader
import torch.optim as optim
import argparse
from tensorboardX import SummaryWriter
import sys
import os
currentdir = os.path.dirname(os.path.realpath(__file__))
parentdir = os.path.dirname(os.path.dirname(currentdir))
sys.path.appe... | null | train/Empirical/train_trs.py | train_trs.py | py | 6,072 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.dirname",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"... |
248726205 | from angular_flask.models import CategorySource, CategoryDocument
from operator import itemgetter
from mongoengine import connect
import simplejson
import json
from campaign_competion_vw_golf_mercedes_a_class import get_specific_document_for_category_source_and_document_name, \
get_specific_information_of_category... | null | old/angular-flask/db_queries/newspaper_mileu_connection.py | newspaper_mileu_connection.py | py | 4,869 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "mongoengine.connect",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "angular_flask.models.CategorySource.objects",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "angular_flask.models.CategorySource",
"line_number": 19,
"usage_type... |
406817088 | import logging
logger = logging.getLogger(__name__)
from django.db import models
from audited_models.models import AuditedModel
from django.utils.translation import ugettext_lazy as _
class ApprovedCategoryManager(models.Manager):
"""Custom category manager that shows only approved records."""
def get_query_... | null | django_project/changes/models/category.py | category.py | py | 1,872 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "django.db.models.Manager",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.... |
240659642 | '''
灰度图也有3通道,将1通道转为3通道 其他两个通道为0
彩图也有4通道,将4通道转为3通达 多了alpha通道
'''
import tqdm
import imghdr
import os
from PIL import Image
# 通道转换
def change_image_channels(image, image_path):
# 4通道转3通道
if image.mode == 'RGBA':
print('image:',image,'image_path:',image_path)
r, g, b, a = image.split()
... | null | 1-》3,4-》3/1-3,4-3.py | 1-3,4-3.py | py | 1,388 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "PIL.Image.merge",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "os.remove",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 27,
... |
463981612 | # -*- coding: utf-8 -*-
"""
Created on Mon Dec 21 18:01:00 2020
@author: ink
"""
from __future__ import print_function
import os,json
import fiona
import cv2
import numpy as np
import pandas as pd
import rasterio
import rasterio.features
from affine import Affine
from shapely.geometry import shape
from shapely.geomet... | null | utils/maskimage.py | maskimage.py | py | 26,445 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.seterr",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "fiona.open",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "ogr.GetDriverByName",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_nu... |
182830648 | #!/usr/bin/env python3
import logging, logging.handlers, platform
import sys
import io
import os
def send_syslog(syslogserver,port,level, source_host, message):
logger = logging.getLogger(source_host)
syslog = logging.handlers.SysLogHandler(address=(syslogserver,port))
logger.addHa... | null | syslog_handler.py | syslog_handler.py | py | 986 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.handlers.SysLogHandler",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.handlers",
"line_number": 11,
"usage_type": "attribute"
}
] |
532706425 | from functools import partial
from django.contrib import messages as django_messages
import jinja2
from jingo import env
"""
This file was created because AMO wants to have multi-line messages including a
title and some content. Django's messages framework only takes a single string.
Importing this file should beha... | null | apps/amo/messages.py | messages.py | py | 2,100 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "jingo.env.get_template",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "jingo.env",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "jinja2.Markup",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "django.contrib.message... |
407103951 | from django.core.exceptions import ValidationError
import os
def validate_file_extension(value):
ext=os.path.splitext(value.name)[1]
valid_extension=[".pdf"]
valid_size= 5*1024*1024
if not ext.lower() in valid_extension:
raise ValidationError("Must be a pdf file.")
if value.s... | null | week_4/docucment_manager/doc_manage/validators.py | validators.py | py | 439 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.splitext",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.core.exceptions.ValidationError",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "dj... |
241352527 | import pickle
from keras.models import load_model
from keras.preprocessing.sequence import pad_sequences
from preprocessor import *
import numpy as np
import random
class ScorePrediction:
def __init__(self):
self.MAX_SEQUENCE_LENGTH = 500
def predict_aspect(self, review, aspect):
... | null | AspectScorePrediction/ScorePrediction.py | ScorePrediction.py | py | 1,456 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pickle.load",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "keras.models.load_model",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "keras.preprocessing.sequence.pad_sequences",
"line_number": 25,
"usage_type": "call"
},
{
"ap... |
177634533 | import numpy as np
import pickle
import fasttext
from collections import Counter
import re
from countryinfo import CountryInfo
import torchvision.transforms as transforms
from torchvision import models
import torch.utils.data as data
import torch.nn.functional as F
import torch.nn as nn
import torch
import pycountry
im... | null | geography_based.py | geography_based.py | py | 8,646 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pycountry.countries.search_fuzzy",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "pycountry.countries",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "torch.utils.data",
"line_number": 43,
"usage_type": "name"
},
{
"api_na... |
107023457 | # -*- coding: utf-8 -*-
from ..main import register_blueprint
from flask import Blueprint, request
from functools import wraps
BLUEPRINT = Blueprint('auth', __name__)
register_blueprint(BLUEPRINT)
def checkcaptcha(func):
@wraps(func)
def _checkcaptcha(*args, **kwargs):
response = request.form['g... | null | app/auth/core.py | core.py | py | 759 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Blueprint",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "main.register_blueprint",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.request.form",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "flask.... |
550148238 | # -*- coding: utf-8 -*-
# Copyright 2013 Mirantis, 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 requi... | null | nailgun/nailgun/test/unit/test_utils.py | test_utils.py | py | 18,921 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "nailgun.test.base.BaseIntegrationTest",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "nailgun.test.base",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "nailgun.utils.dict_merge",
"line_number": 48,
"usage_type": "call"
},
{
... |
634571318 | import urllib.request
import json
body = {'network': 'InceptionV1', 'layer': 'mixed4c', 'channel':511}
myurl = "http://localhost:5001/v1/jobs/"
req = urllib.request.Request(myurl)
req.add_header('Content-Type', 'application/json; charset=utf-8')
jsondata = json.dumps(body)
jsondataasbytes = jsondata.encode('utf-8')... | null | test_send.py | test_send.py | py | 502 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "urllib.request.request.Request",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "urllib.request",
"line_number": 8,
"usage_type": "name"
},
{
"api_name":... |
587745580 | import F_FinalPreprocess
import numpy as np
import cv2
import matplotlib.pyplot as plt
from scipy.spatial import ConvexHull
import glob
def MakeSharp(img):
clahe = cv2.createCLAHE(clipLimit=5, tileGridSize=(1,1))
lab = cv2.cvtColor(img, cv2.COLOR_BGR2LAB)
l, a, b = cv2.split(lab)
... | null | Experiments/AI Mridul/D_Split.py | D_Split.py | py | 3,555 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cv2.createCLAHE",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2LAB",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "cv2.split",
"... |
571238164 | # -*- coding=utf-8 -*-
# configparser 主要用来操作解析配置文件的模块
import configparser
config = configparser.ConfigParser() # 注意大小写
# 一,初始化实例
config.read('myconfig.ini') # 配置文件的路径
# ["config.ini"]
# 或者直接初始化字典,
parser = configparser.ConfigParser()
dictobj = {'section1':{'key1':'value1'},'section2':{'key2':'value2'},}
parser.re... | null | configparse.py | configparse.py | py | 1,500 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "configparser.ConfigParser",
"line_number": 11,
"usage_type": "call"
}
] |
11122548 | import json
import boto3
from collections import Counter
from random import randrange
client = boto3.client('lambda')
def lambda_handler(event, context):
if "operation" in event:
operation = event['operation']
else:
data = json.loads(event['body'])
operation = data['operation']
... | null | Assignment3/Assignment3-Worker-1.py | Assignment3-Worker-1.py | py | 2,373 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "boto3.client",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 24,... |
568673736 | """
Created on Sun Feb 14 11:15:19 2021
@author: mm18acd
"""
def label_unlabelled(test_df_filename, out_filename,text_col, label_col, max_len, tokenizer, model, metrics, description):
# filename is th ename of the file to write to
import pandas as pd
import numpy as np
from prepare_data impo... | null | label_unlabelled.py | label_unlabelled.py | py | 4,264 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_csv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.device",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "prepare_data.prepare_data",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "torch.utils.da... |
615948534 | from django.urls import path
from .views import (Login, Logout, user_follow, my_followers, update_profile, Signup, home, history_events, profile_page, detail_event, book_event, my_events, booked_events, public_events, no_access, create_event, update_event, delete_event)
from django.conf import settings
from django.conf... | null | events/urls.py | urls.py | py | 1,472 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "views.home",
"line_number": 7,
"usage_type": "argument"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "views.my_events",
"... |
484288923 | from typing import Dict
from .logger import AbstractLogger, PrintLogger
from .file_logger import FileLogger
from .wandb_logger import WandBLogger
known_loggers: Dict[str, AbstractLogger.__class__] = {
PrintLogger.name: PrintLogger,
WandBLogger.name: WandBLogger,
FileLogger.name: FileLogger
}
def create_... | null | logger/__init__.py | __init__.py | py | 660 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "typing.Dict",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "logger.AbstractLogger.__class__",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "logger.AbstractLogger",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "l... |
233684292 | """
Sanity testing of report and dwh installation
"""
import pytest
from art.test_handler.tools import polarion
from art.unittest_lib import (
testflow,
tier2,
)
from logging_base import LoggingTest
import config
@tier2
class TestApplicationSettings(LoggingTest):
"""
Test application setting of dwh... | null | art/tests/rhevmtests/integration/reports/logging/test_settings.py | test_settings.py | py | 1,550 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging_base.LoggingTest",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "art.unittest_lib.testflow.teardown",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "art.unittest_lib.testflow",
"line_number": 27,
"usage_type": "name"
},
{
... |
541931775 | #!/usr/bin/env python
"""
Script Header
$Id: cmPROV23974_3pcc_Macro_handling_of_firmware
Copyright (c) 2016-2017 Cisco Systems, Inc.
Name:
cmPROV23974_3pcc_Macro_handling_of_firmware.py
Purpose:
Check upgrade is successful with conditional Macro expression.
Author:
Yashashwini M B(ymuddena@cisco.com)
... | null | common/CFD/Provisioning/cmPROV23974_3pcc_Macro_handling_of_firmware.py | cmPROV23974_3pcc_Macro_handling_of_firmware.py | py | 2,904 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "tng_sl.contrib.setup_helper.SetupHelpersTestCase",
"line_number": 64,
"usage_type": "name"
},
{
"api_name": "tng.api",
"line_number": 64,
"usage_type": "attribute"
},
{
"a... |
261343240 | import os,sys
from django.core.wsgi import get_wsgi_application
os.environ['DJANGO_SETTINGS_MODULE'] = 'RbiCloud.settings'
application = get_wsgi_application()
import traceback
import sys
import datetime
from mpmath.calculus.optimization import Newton
from cloud import models
class Newton:
X = []
Y = []
... | null | cloud/regularverification/interpolation.py | interpolation.py | py | 19,738 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "django.core.wsgi.get_wsgi_application",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cloud.models.RwAssessment.objects.filter",
"line_number": 231,
"usage_type": "call"
... |
190120587 | # To set seed random number in order to reproducable results in keras
from numpy.random import seed
seed(4)
import tensorflow
tensorflow.random.set_seed(1234)
########################################
import pandas as pd
from pandas import *
import numpy as np
import random
import matplotlib.pyplot as plt
imp... | null | NN_onehot.py | NN_onehot.py | py | 6,522 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.random.seed",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "tensorflow.random.set_seed",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "tensorflow.random",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "skle... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.