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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
411087691 | import glob
import os
import random
from config import HEIGHT, WIDTH, MINES, MODEL_DIR
def ask(question):
while True:
i = input(question + " [y/n] ")
if i and i in 'yY':
return True
if i and i in 'nN':
return False
def get_data_dir():
return os.path.join('data... | null | utils.py | utils.py | py | 1,013 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "config.HEIGHT",
"line_number": 17,
"usage_type": "argument"
},
{
"api_name": "config.WIDTH",
"line_... |
117688917 | import numpy as np
import itertools
x = 10
bal = np.linspace(-(x - 1), (x - 1), x)
for w in itertools.permutations(list(range(1, x + 1))):
moment = bal * np.array(w)
if np.sum(moment) == 0 and w[0] > w[x - 1]:
print(w)
| null | micro/balance.py | balance.py | py | 238 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.linspace",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "itertools.permutations",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_... |
636235373 | import datetime
from posixpath import join
from re import sub
import luigi
import os
from pathlib import PurePath,Path
from shelldon import shelldon
import audioread
from datetime import datetime
class QuizzrConfig(luigi.Config):
store_path = luigi.Parameter(default="{}/quizzr/processed_data".format(Path.home()))... | null | pipeline.py | pipeline.py | py | 5,871 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "luigi.Config",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "luigi.Parameter",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pathlib.Path.home",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
... |
542420291 | #!/usr/bin/env python3
import numpy as np
from copy import copy
from sequence import Sequence
from gates import Gate
from pulse import PulseShape
# add logger, to allow logging to Labber's instrument log
import logging
log = logging.getLogger('LabberDriver')
class Rabi(Sequence):
"""Sequence for driving Rabi o... | null | MultiQubit_PulseGenerator/sequence_builtin.py | sequence_builtin.py | py | 5,975 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sequence.Sequence",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "pulse.amplitude",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "sequence.Seq... |
462680469 | """ Tag resource for ActiveCampaign """
import typing
from django.http import Http404
from ..base_resource import Resource
class Tag(Resource):
"""A tag in ActiveCampaign. Allows to:
- Create a tag
- Find a tag by name
- Udate a tag
- Remove a tag
Check docs in:
https://developers.active... | null | active_campaign_api/resources/tag.py | tag.py | py | 1,665 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "base_resource.Resource",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "typing.Type",
"line_number": 52,
"usage_type": "attribute"
},
{
"api_name": "django.ht... |
559504778 | from abc import ABCMeta
from django.shortcuts import render, redirect
from .person_controller import Usuario, Admin
from .forms import ClienteForm, AdminForm
# Create your views here.
def crear_cliente(request):
if request.method == 'POST':
form = ClienteForm(request.POST)
print(">>", request)
... | null | poo/accounts/views.py | views.py | py | 2,987 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "forms.ClienteForm",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "person_controller.Usuario",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": ... |
518985304 | __author__ = 'john'
try:
from lib import jed_janelamensagem
except ImportError:
jed_janelamensagem = None
print('jed_janelamensagem não encontrada')
exit(1)
try:
from lib import jed_editardata
except ImportError:
jed_editardata = None
jed_janelamensagem.Menssagem.erro_msg(janela=None,
... | null | taxi/financeiro/cad_rateio_pagante.py | cad_rateio_pagante.py | py | 46,226 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "lib.jed_janelamensagem",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "lib.jed_editardata",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "lib.jed_janelamensagem.Menssagem.erro_msg",
"line_number": 14,
"usage_type": "call"
},
{
... |
536385059 | import re
from textblob import TextBlob
from textblob import Word
from collections import defaultdict
import math
test = {}
def token_stream(line):
#先变小写,然后名词变成单数
line=line.lower()
li=TextBlob(line).words.singularize()
li = ' '.join(li) # 列表变成 字符串
terms = re.findall(r'\w+',li, re.I) # 只匹配字符和数字
... | null | Ranked Retrieval Model/Ranked_index.py | Ranked_index.py | py | 8,587 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "textblob.TextBlob",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "re.I",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "textblob.Word",
"line_numb... |
84192005 | # -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import numpy as np
from scipy.optimize import curve_fit
from scipy import stats
import pandas
from lmfit import Model
data66 = []
mittelwerte_data66 = []
for i in range(0,210,10):
data66.append( np.genfromtxt('18_07_16_Kroner_Keppler/CCEL/{0}CCEL.txt'.format... | null | MasterPraktikum/Siliziumdetektor/Auswertung/Auswertung66.py | Auswertung66.py | py | 5,590 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.genfromtxt",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot"... |
566461474 | # === coding: utf=8 ===
from aip import AipOcr
import xlrd
import xlwt
import requests
import datetime
import time
from xlutils.copy import copy
from bs4 import BeautifulSoup
""" 读取excel文件 """
def read_excel():
workbook = xlrd.open_workbook(r"D:\Work\development\passioning\python.test\Crawler\originData.xls")
... | null | Python.Test/Crawler/Test.py | Test.py | py | 23,979 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "xlrd.open_workbook",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_nu... |
359242819 | # Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
# with the License. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "LICENSE.txt" file accom... | null | cli/src/pcluster/templates/cw_dashboard_builder.py | cw_dashboard_builder.py | py | 21,812 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.namedtuple",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "... |
321445795 | import sys
import ConfigParser
from os.path import expanduser
# Set system path
home = expanduser("~")
cfgfile = open(home + "\\STVTools.ini", 'r')
config = ConfigParser.ConfigParser()
config.read(home + "\\STVTools.ini")
# Master Path
syspath1 = config.get('SysDir','MasterPackage')
sys.path.append(syspath1)
# Built Pa... | null | CustomExtension.extension/STVTools.tab/MEP Tools.panel/Tools.stack3/Slope.pulldown/all.pushbutton/script.py | script.py | py | 2,271 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.expanduser",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "ConfigParser.ConfigParser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.path",... |
342044116 | #!/usr/bin/env python3
from matplotlib import use
use( 'agg' )
from astropy.io import fits
import matplotlib.pyplot as plt
import numpy as np
import h5py
import sys
import matplotlib.colors as mplc
import os
from matplotlib import cm
param_file = sys.argv[1]
N = int( sys.argv[2] )
ls = open( param_file ).readlines(... | null | add_hills.py | add_hills.py | py | 3,096 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.use",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.path.basename",
"lin... |
394854905 | #################
#### imports ####
#################
from flask import Flask, render_template, request, redirect, \
url_for, session, flash
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.exc import IntegrityError, InvalidRequestError
from flask_bcrypt import Bcrypt
import subprocess
import datetime
fr... | null | project/main.py | main.py | py | 5,799 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "flask_bcrypt.Bcrypt",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "flask.ses... |
175212481 | import plotly.plotly as py
import pandas as pd
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot
import plotly.graph_objs as go
import matplotlib.pyplot as plt
init_notebook_mode(connected=True)
df = pd.read_csv('2011_US_AGRI_Exports')
data = dict(type='choropleth',
locations=df... | null | dataSciencePackage/mapsPackage/UsAgriExport.py | UsAgriExport.py | py | 778 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "plotly.offline.init_notebook_mode",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "plotly.graph_objs.Figure",
"line_number": 19,
"usage_type": "call"
},
{
"api_name... |
500341420 | #!/usr/bin/env python
# -*- coding:gbk -*-
from typing import List
class TopologicalSort:
def sort(self, graphs: List[List[int]]) -> List[int]:
if not graphs:
return []
inDegrees = [0 for _ in range(len(graphs))]
for i, edge in enumerate(graphs):
for j, value in en... | null | 8.图/4.拓扑排序/0.邻接矩阵/TopologicalSort.py | TopologicalSort.py | py | 900 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.List",
"line_number": 7,
"usage_type": "name"
}
] |
601480933 | from bs4 import BeautifulSoup
from pprint import pprint
import json
import re
import time
import sys
# reads in cves, nvdJSON file, then tri
def find_those_dates(cvefile, jsonFile):
listofcves = [line.rstrip('\n') for line in open(cvefile)]
with open(jsonFile, 'r') as jfile:
nvd_database = json.load(j... | null | scripts/cve-parsing/cve_date_scripts/get-dates.py | get-dates.py | py | 1,249 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "json.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 36,
"usage_type": "attribute"
}
] |
42059821 | from basisopt.wrappers.wrapper import Wrapper
from basisopt.wrappers.dummy import DummyWrapper
from basisopt.exceptions import MethodNotAvailable
import logging
import colorlog
import os
try:
import dask
from basisopt.parallelise import *
_PARALLEL = True
except:
_PARALLEL = False
_BACKENDS = dict()
_... | null | basisopt/api.py | api.py | py | 4,636 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "basisopt.wrappers.dummy.DummyWrapper",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.warning",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "log... |
541603880 | import pandas as pd
from dao.basedao import BaseDAO
from utils import relative
def init_db(dao: BaseDAO):
dao.connect_to_database()
dao.drop_tables()
dao.create_tables()
dao.add_user("paj", "Paul", "Johnston", "123")
user_names = ["paj"]
dao.add_campus("Provo", "Utah", "BYU-Provo")
dao.ad... | null | Server/init_db.py | init_db.py | py | 3,428 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "dao.basedao.BaseDAO",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "dao.basedao.connect_to_database",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "dao.basedao",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "dao.base... |
583013365 | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html
from scrapy.exporters import JsonLinesItemExporter
from soufangwnag.items import NewHouseItem, SecondHandHouseItem
class So... | null | soufangwnag/soufangwnag/pipelines.py | pipelines.py | py | 1,071 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "scrapy.exporters.JsonLinesItemExporter",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "scrapy.exporters.JsonLinesItemExporter",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "soufangwnag.items.NewHouseItem",
"line_number": 20,
"usage_... |
2398593 | import numpy as np
import csv
from matplotlib import pyplot as plt
import math
#from scipy.special import exp10
## CUADRADOS MINIMOS
##Toma dos arreglos con los puntos de X y de Y respectivamente
##devuelve una tupla con la pendiente y la ordenada de la recta de regrecion
## necesita numpy como np
def LR(x,y):
A = n... | null | Informe/Python/AjusteLineal.py | AjusteLineal.py | py | 1,765 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.sum",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.average",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.power",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.average",
"line_number"... |
464858322 | from transformers import Trainer, TrainingArguments, AutoTokenizer, AutoModelForSequenceClassification
import torch
#(training_set -> text, label)
nb_samples_train = 10000
nb_samples_validation = 3000
train_set_ft_text = training_set['text'][:nb_samples_train]
train_set_ft_label = training_set['label'][:nb_samples... | null | transformer_impl.py | transformer_impl.py | py | 2,468 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "transformers.AutoTokenizer.from_pretrained",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "transformers.AutoTokenizer",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "transformers.AutoModelForSequenceClassification.from_pretrained",
"line... |
437205072 | import pandas as pd
import math, datetime
import numpy as np
from sklearn import preprocessing,svm, model_selection
from sklearn.linear_model import LinearRegression
import matplotlib.pyplot as plt
from matplotlib import style
import pickle
style.use("ggplot") # Choose the style
# Open the data
df = pd.read_csv("/ho... | null | MachineLearningFunctions/linearRegression.py | linearRegression.py | py | 2,570 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.style.use",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.style",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "pandas.read_csv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "math.ceil",
... |
358168037 | from collections import OrderedDict
from Tkinter import Frame
from ttk import *
def add_func_group(context, func, group):
"""
Function binding to context for on_call method
"""
context.funcgroup[group].append(func)
def set_update_func(context, func):
"""
Function binding to context for global... | null | sqlenergy/app/ViewModel.py | ViewModel.py | py | 4,294 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.OrderedDict",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 105,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 110,
"usage_type": "call"
},
{
"api_nam... |
164349382 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
import django.utils.timezone
import model_utils.fields
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODE... | null | euth/projects/migrations/0001_initial.py | 0001_initial.py | py | 1,809 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.swappable_dependency",
"line_number": 13,
"usage_type": "ca... |
577307168 | '''
Virtual Assistant Module
========================
>>> __version__ = 2.0.0
This is a virtual assistant module containing a `Assistant` class for making
Virtual assistant such as Tony Stark's Jarvis or Friday
Usage
------
>>> from assistant import *
>>> if __name__ == '__main__':
>>> jarv... | null | assistant.py | assistant.py | py | 25,425 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pyttsx3.init",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "win10toast.ToastNotifier",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "wolframalph... |
594005618 | from django.conf.urls import url, include
# from rest_framework import routers
from api import views
# Wire up our API using automatic URL routing.
# Additionally, we include login URLs for the browsable API.
urlpatterns = [
url(r'^api/terminals/$', views.TerminalList.as_view()),
url(r'^api/tickets/$', views.T... | null | eHall/api/urls.py | urls.py | py | 444 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "api.views.TerminalList.as_view",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "api.views.TerminalList",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_... |
134671082 | # Python Version: 2.7.12
#
# Author: Tanvir Khondakar
#
# Purpose: Creating a function that will figure out if a files was updated within the last
# 24 hours so it can be transfered to another folder.
# Import necessary libraries
import os
import datet... | null | Move_Files_Drill.py | Move_Files_Drill.py | py | 1,294 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.walk",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "datetime.date.today",
"line_num... |
67008176 | # Create your views here.
from django.http import HttpResponse
from django.shortcuts import render, redirect
from django.urls import register_converter
from . import converters
from .models import comment
def myyear(request, year):
return render(request, 'yearview.html')
# 输出电影评论的数据到模板上面
def movie_comment(reques... | null | week06/MyDjango/index/views.py | views.py | py | 898 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.shortcuts.render",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "models.comment.objects.filter",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "models.comment.objects",
"line_number": 15,
"usage_type": "attribute"
},
{
... |
154297943 | import logging
import os
import requests
GEOSERVER_BASE_URL = os.getenv('GEOSERVER_BASE_URL', 'http://localhost:8080/geoserver')
GEOSERVER_USERNAME = os.getenv('GEOSERVER_USERNAME', 'admin')
GEOSERVER_PASSWORD = os.getenv('GEOSERVER_PASSWORD', 'geoserver')
_log = logging.getLogger(__name__)
def create_workspace(... | null | temporary_mock_xterrain_api/geoserver.py | geoserver.py | py | 6,037 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.getenv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 12,... |
533639612 |
######## range
for i in [0,1,2,3,4,5]: print(i+1)
for i in range(6): print(i+1)
a = (i*2 for i in range(10000000))
## a, range are not a list!
next(a)
next(a)
################# slicing
names = ['Foo', 'Bar', 'Moooo', 'blah', 'eric']
# from index 2 to 4(not including)
names[2:4]
# place 2 from the end
names[-... | null | idiomatic/iterate.py | iterate.py | py | 1,273 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "itertools.product",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "itertools.permutations",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "itertools.combinations",
"line_number": 66,
"usage_type": "call"
}
] |
331325895 | from requests import Session
from requests.utils import default_headers
from RequestsLibrary.log import format_data_to_log_string_according_to_headers
def test_format_data_with_data_and_headers_none():
session = Session()
data = format_data_to_log_string_according_to_headers(session, None, None)
assert da... | null | utests/test_log.py | test_log.py | py | 953 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.Session",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "RequestsLibrary.log.format_data_to_log_string_according_to_headers",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "requests.Session",
"line_number": 13,
"usage_type": "ca... |
321750666 | #!/usr/bin/python3
"""
Contains a single function that reads in a list of integers (channel numbers),
and returns a list of the same integers whose order depends on whether or not
any of the channels are above 128.
"""
from astropy.io import fits as pyfits
import argparse
def sfreq(freqs):
if len(freqs) != 24:
... | null | scripts/reorder_chans.py | reorder_chans.py | py | 2,009 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "version.__version__",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "sys.exit",
... |
548935762 | import re
from types import GeneratorType
from collections.abc import Mapping
class Interpolator:
"""
Recursively interpolate variable placeholders in strings.
Strings can contain template place holders for other config keys. Placeholders
are enclosed with squiggly braces (``{{PLACEHOLDER}}``).
... | null | configdir/interpolator.py | interpolator.py | py | 2,877 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.compile",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "re.split",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "collections.abc.Mapping",
"line_number": 85,
"usage_type": "argument"
},
{
"api_name": "types.GeneratorType",... |
78795751 | import numpy as np
import h5py
import seaborn as sns
import matplotlib.pyplot as plt
from PlotModule import *
import os
FieldNM = os.environ.get('FieldNM')
file_id = os.environ.get('FILEID')
out_dir = os.environ.get('JOB_DIR')
plot_dir = os.environ.get('PLOT_DIR')
nr = 2000
dr = 1
r0 = 50
nr0 = int(r0/dr-1)
wn0 = 1
wn... | null | plot/plotVert.py | plotVert.py | py | 1,572 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.environ.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_num... |
88404848 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from django.conf.urls import url
from .views import *
urlpatterns=[
url(r'^$',index),
#第一个值的type id 的标号,第二个值是第几页,第三个值是排序的依据
url(r'^list(\d+)_(\d+)_(\d+)/$',goodlist),
url(r'^(\d+)/$', detail),
url(r'^search/$', MySearchView()),
]
app_name = 'pizzerias' | null | df_goods/urls.py | urls.py | py | 372 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.... |
62076589 | from odoo import models, fields, api
from odoo.exceptions import Warning
from odoo.tools import config
import logging
logger = logging.getLogger(__name__)
class woo_process_import_export(models.TransientModel):
_name = 'woo.process.import.export'
_description='woo.process.import.export'
instance_i... | null | woo_commerce_ept/wizard/woo_process_import_export.py | woo_process_import_export.py | py | 37,772 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "odoo.models.TransientModel",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "odoo.models",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "odoo.field... |
346252354 | from lbrynet.analytics import events
from twisted.trial import unittest
from tests import util
class EventsTest(unittest.TestCase):
def setUp(self):
util.resetTime(self)
self.event_generator = events.Events('any valid json datatype', 'lbry123', 'session456')
def test_heartbeat(self):
... | null | tests/unit/analytics/test_events.py | test_events.py | py | 1,296 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "twisted.trial.unittest.TestCase",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "twisted.trial.unittest",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "tests.util.resetTime",
"line_number": 10,
"usage_type": "call"
},
{
"ap... |
145988308 | from bs4 import BeautifulSoup
import requests
from csv import writer
response = requests.get('https://realpython.com/best-python-books/')
beauty = BeautifulSoup(response.text, 'html.parser')
books = beauty.find_all(class_='section3')
with open('books.csv', 'w') as csv_file:
csv_writer=writer(csv_file)
... | null | webScraper.py | webScraper.py | py | 657 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 11,
"usage_type": "call"
}
] |
71858893 | # MTCNN을 사용하기 위해 facenet_pytorch 설치
get_ipython().system('pip install ./facenet-pytorch-vggface2/facenet_pytorch-2.2.7-py3-none-any.whl')
import os
import glob
import json
import torch
import cv2
from PIL import Image
import numpy as np
import pandas as pd
from tqdm.notebook import tqdm
from facenet_pytorc... | null | VideoToImage.py | VideoToImage.py | py | 2,806 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "cv2.CAP_PROP_FRAME_COUNT",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "numpy.arange",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.lin... |
11811303 | from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
return '''
<h1>Hello, World!</h1>
<h2>Welcome to my self-hosted web application.</h2>
<p>Lorem Ipsum</p>
<p>Another paragraph</p>
'''
| null | weather_station/flask_thermometer/app.py | app.py | py | 235 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 3,
"usage_type": "call"
}
] |
137370250 | import json
import argparse
import os
from utils import *
from kafka import KafkaConsumer
def receive_message(consumer, kafka_message_key):
"""
Receive(Consume) messages from topic
:param consumer(KafkaConsumer): configured Kafka consumer to receive the messages
:param kafka_message_key(str): key of s... | null | consumer.py | consumer.py | py | 3,959 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.dirname",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 53,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "kafka.KafkaConsumer",
... |
237836318 | import torch
import torch.nn as nn
from torch.nn import init
import functools
import net.VGG19 as VGG19
from net.UNet.UNet import UNet
from net.HRNet.hrnet_relu import HighResolutionNet as HRNet_relu
from net.HRNet.hrnet_aspp_relu import HighResolutionNet as HRNet_aspp_relu
###########################################... | null | net/networks.py | networks.py | py | 5,385 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.nn.init.normal_",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "torch.nn.init",
"line_number": 56,
"usage_type": "name"
},
{
"api_name": "torch.nn.init.xavier_normal_",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "torc... |
283445342 | #!/usr/bin/evn python
#-*- coding: utf-8 -*-
#
from bs4 import BeautifulSoup
import urllib2
import codecs
import time
from mylog import MyLog as mylog
import resource
import random
import requests
class Item(object):
top_num = None #排名
score = None #打分
mvName = None #MV名字
singer = None #演唱者
r... | null | python_web_scrap/getTrendsMV.py | getTrendsMV.py | py | 3,946 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "mylog.MyLog",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "urllib2.Request",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "urllib2.ProxyHandler",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "urllib2.build_opener... |
417330223 |
from scrapy import Spider
from scrapy.spiders import CrawlSpider, Rule
from scrapy.selector import Selector
from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.linkextractors import LinkExtractor
import os
import scrapy
from scrapy.spidermid... | null | UW_System/All_UW_Campuses/All_UW_Campuses/spiders/specific_courses.py | specific_courses.py | py | 7,414 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "scrapy.Spider",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "scrapy.Request",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "w3lib.html.remove_tags",
"line_number": 100,
"usage_type": "call"
},
{
"api_name": "w3lib.html.... |
103453819 | # encoding: utf-8
'''
_______________________________________________
EKKO mantle set up tool
_______________________________________________
'''
import pymel.core as pm
import maya.mel as mel
import maya.cmds as cmds
#create 1 fixed set of bones, which will extend based on the character height
def mantleCreate(cha... | null | EKKO/mantle/Mantle_install_2018_01_31_1948.py | Mantle_install_2018_01_31_1948.py | py | 14,168 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pymel.core.currentTime",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pymel.core",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "pymel.core.currentTime",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pymel.core",... |
377700526 | """
Define the mnist linear kernel embedding classifier.
"""
import tensorflow as tf
import numpy as np
from .infer import clip_normalize as _clip_normalize
from .infer import classify as _classify
from .infer import decode_one_hot as _decode_one_hot
from .data_type_def import *
def weight_variable(shape):
initia... | null | cake/mnist_classifier.py | mnist_classifier.py | py | 18,703 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tensorflow.truncated_normal",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tensorflow.Variable",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tensorflow.constant",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "t... |
19504216 | # -*- coding: utf-8 -*-
from smtplib import SMTPException
from django import forms
from django.core.mail import EmailMessage
class ContactForm(forms.Form):
name = forms.CharField(
max_length=100,
required=True,
widget=forms.TextInput(attrs={'type': "text", 'class': "form-control", 'name'... | null | contact/forms.py | forms.py | py | 1,572 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.forms.Form",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.forms.CharField",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.forms... |
168567840 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.Create... | null | app01/migrations/0001_initial.py | 0001_initial.py | py | 9,812 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.swappable_dependency",
"line_number": 11,
"usage_type": "call... |
3697326 | import json
from . import ast_node
class AstNodeEncoder(json.JSONEncoder):
def default(self, object_):
if not isinstance(object_, ast_node.AstNode):
return json.JSONEncoder.default(self, object_)
encoded_object = {'type': object_.kind}
if len(object_.value) != 0:
e... | null | python_parser/parser/ast_node_encoder.py | ast_node_encoder.py | py | 487 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "json.JSONEncoder",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "json.JSONEncoder.default",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "json.JSONEncoder",
"line_number": 8,
"usage_type": "attribute"
}
] |
294839081 | import os
import sys
import unittest
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from scripts.generators import es_template
class TestGeneratorsEsTemplate(unittest.TestCase):
# dict_add_nested
def test_add_not_nested(self):
dict = {}
es_template.dict_add_nested(dict, ['le... | null | scripts/tests/test_es_template.py | test_es_template.py | py | 1,083 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": ... |
192022651 | import json
import requests
import time
import urllib
import dbBot
TOKEN_BOT = "472925886:AAHoewEo-y9D9wIaljXJllows3UNIPHOIao"
URL_BOT = "https://api.telegram.org/bot{}/".format(TOKEN_BOT)
DB = dbBot.DBBot()
CHAT = ""
def get_url(url):
response = requests.get(url)
content = response.content.decode("utf8")
return ... | null | bot/botTest.py | botTest.py | py | 2,986 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "dbBot.DBBot",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "dbBot.URL_API",
"line_number":... |
433607802 | from __future__ import annotations
from typing import Any, List
from sentry.services.hybrid_cloud.identity import APIIdentity, APIIdentityProvider, IdentityService
class DatabaseBackedIdentityService(IdentityService):
def close(self) -> None:
pass
def get_provider(
self,
*,
... | null | src/sentry/services/hybrid_cloud/identity/impl.py | impl.py | py | 2,346 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sentry.services.hybrid_cloud.identity.IdentityService",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "sentry.models.identity.IdentityProvider.objects.filter",
"line_number": 28,
... |
70503714 | import datetime
from django.shortcuts import get_object_or_404, render
from django.forms import ModelForm
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse_lazy
from django.utils.translation import ugettext_lazy as _
from django.views.generic import TemplateView
from django.util... | null | digitalglarus/views.py | views.py | py | 3,113 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.views.generic.View",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "membership.calendar.calendar.BookCalendar",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "django.http.JsonResponse",
"line_number": 27,
"usage_type": "call"
... |
427479726 | # -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | null | qtp_biom/summary.py | summary.py | py | 3,411 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "qiime2.Metadata",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame.from_dict",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "qiim... |
649550229 | """Run a single process concurrently across local CPUs."""
from datetime import datetime
# from concurrent.futures import ProcessPoolExecutor
from multiprocessing import Pool, cpu_count
import os
from bison.common.aggregate import Aggregator
from bison.common.annotate import Annotator
from bison.common.constants impor... | null | bison/tools/parallel.py | parallel.py | py | 6,127 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.exists",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "os.path.split",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number"... |
317481471 | import asyncio
import logging
from abc import ABCMeta
from datetime import timedelta
from typing import Optional
from discord.ext.commands import CogMeta as DPYCogMeta
from redbot.core import Config, commands
from .autorooms import AutoRooms
from .tempchannels import TempChannels
log = logging.getLogger("red.sinbadc... | null | roomtools/roomtools/__init__.py | __init__.py | py | 3,589 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands.CogMeta",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "abc.ABCMeta",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "autorooms.... |
321796733 | #!/usr/bin/env python
# coding: utf-8
# In[3]:
from mpl_toolkits.mplot3d import Axes3D #For Basic ploting
from sklearn.preprocessing import StandardScaler #Preprocessing
from sklearn import preprocessing # Preprocessing
from sklearn.naive_bayes import GaussianNB #import gaussian naive bayes model
from sklearn.tre... | null | file1.py | file1.py | py | 3,968 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "warnings.filterwarnings",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "panda... |
48777420 | import community
import graphviz
import pydot
import re
import math
import random
import networkx as nx
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import numpy as np
from scipy.spatial import Voronoi, voronoi_plot_2d
from random import uniform
from shapely import geometry
from shapely import ops
def co... | null | src/voronoi_new.py | voronoi_new.py | py | 10,866 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "networkx.Graph",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "networkx.drawing.nx_pydot.read_dot",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "networkx.drawing",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name"... |
498879483 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys, redis
def dump(server: str, port: str, db: str, data_file: str) -> int :
'''
从redis导出数据到csv文件
:param server:
:param port:
:param db:
:param data_file: csv文件,文件行格式如下
"user---[label1, label2, ... , labeln]"
:ret... | null | util/db/redis/dump_data.py | dump_data.py | py | 1,755 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "redis.StrictRedis",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 48,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_nu... |
490130545 | import numpy as np
import sys, os, os.path
import calendar
import rpy2.robjects as ro
import pickle
from rpy2.robjects import pandas2ri
import datetime
from pdb import set_trace as bp
import logging
logger = logging.getLogger(__name__)
online = False
if online:
input_dir = sys.argv[1]
output_dir = sys.argv[... | null | scoring.py | scoring.py | py | 4,927 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"lin... |
261869520 | import warnings
warnings.filterwarnings('ignore')
import numpy as np
import pandas as pd
from textblob import TextBlob
import torch
import spacy
from sklearn.metrics.pairwise import cosine_similarity as cosim
en_nlp = spacy.load('en_core_web_sm')
#loading the data
train = pd.read_json("dev-v2.0.json")
# pre-processin... | null | Appendices/ch4_preprocess.py | ch4_preprocess.py | py | 5,209 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "spacy.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.read_json",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
... |
21228667 | from sys import argv
import requests
from bs4 import BeautifulSoup
def get_name(sra="SRX3345278"):
resp = requests.get(
"https://www.ncbi.nlm.nih.gov/sra/?term={0}".format(sra))
soup = BeautifulSoup(resp.text, 'lxml')
info = soup.find('p', attrs={'class': 'details expand e-hidden'}).text
retur... | null | get_sra_description.py | get_sra_description.py | py | 480 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 14,
"usage_type": "argument"
},
{
"api_name": "sys.argv",
"line_number... |
294865546 | from sqlalchemy.orm import load_only
from common.libs.harri_db import db_session
from app_name.models.models import Bus
class BusRepository(object):
@staticmethod
def get_bus_by_id(bus_id, load_only_tuple):
if load_only_tuple == None:
query = db_session.query(Bus)
else:... | null | app_name/repositories/bus_repository.py | bus_repository.py | py | 620 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "common.libs.harri_db.db_session.query",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "app_name.models.models.Bus",
"line_number": 11,
"usage_type": "argument"
},
{
"api_name": "common.libs.harri_db.db_session",
"line_number": 11,
"usage_type": "... |
503254134 | #! /usr/bin/python3
import logging
import random
import threading
import time
logging.basicConfig(level=logging.DEBUG,
format='[%(levelname)s] (%(threadName)-10s) %(message)s',
)
serial_lock = threading.Lock()
def print_something(lock):
# threading.Timer(5, print_something... | null | master_unit/testscripts/threading_test.py | threading_test.py | py | 907 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.basicConfig",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "threading.Lock",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.debug",
... |
511197211 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 15 14:32:22 2018
@author: lasseguldener
"""
from __future__ import division
import pickle
import numpy as np
import csv
import scipy
import os
import math
import pandas as pd #makes it easy to store dictionaries in csv
from scipy.stats import nor... | null | random_sample_RT_analysis_mg_beh.py | random_sample_RT_analysis_mg_beh.py | py | 49,073 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.getcwd",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "numpy.nanmean",
"line_number": ... |
102657370 | import numpy as np
import tensorflow as tf
from tensorflow.compat.v1 import keras as k1
import tensorflow.keras.layers as layers
import tensorflow.keras.backend as K
from tensorflow.keras.models import Model
from tensorflow.keras.optimizers import Adam
from kapre.time_frequency import Melspectrogram
from kapre.utils im... | null | nn/model.py | model.py | py | 8,220 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tensorflow.keras.optimizers.Adam",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tensorflow.config.experimental.list_physical_devices",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "tensorflow.config",
"line_number": 25,
"usage_type"... |
60047340 | import numpy
import scipy
import scipy.linalg
from perspectivity import *
import cv2
"""
Based on pseudocode from the wikipedia article on RANSAC
Given data points, it estimates the proper perspective matrix P
so that x' = Px taking into account there can be inliers (who fit
the model pretty well) and outliers (who do... | null | image_mosaic/ransack.py | ransack.py | py | 4,916 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.inf",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "numpy.arange",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.random.shuffle",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"... |
465955950 | from flask import Flask
#set up database
from flask_sqlalchemy import SQLAlchemy
#this path module determines whether the databse does or doesnt exist
from os import path
from flask_login import LoginManager
#define new database object(gonna be used whenever we wanna add a user or basically anything)
db=SQLAlchemy()... | null | app/__init__.py | __init__.py | py | 1,622 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "views.views",
"line_number": 31,
"usage_type": "argument"
},
{
"api_name": "auth.auth",
... |
256806946 | from django.shortcuts import render
from django.http import Http404
from django.core.exceptions import ObjectDoesNotExist
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from .models import News
def show_news(request):
all_news = News.objects.all()
page = request.GET.get('page', 1)
... | null | patients_simple_site/news/views.py | views.py | py | 843 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "models.News.objects.all",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "models.News.objects",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "models.News",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.c... |
148633879 | from __future__ import (
absolute_import,
unicode_literals,
)
import unittest
from conformity import fields
import pytest
from pysoa.client.client import Client
from pysoa.client.middleware import ClientMiddleware
from pysoa.client.settings import ClientSettings
from pysoa.common.serializer import (
JSON... | null | tests/unit/common/test_settings.py | test_settings.py | py | 15,530 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pysoa.common.settings.Settings",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "conformity.fields.Integer",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "conformity.fields",
"line_number": 32,
"usage_type": "name"
},
{
"api_na... |
268109610 | #-*-coding: utf-8 -*-
import pymysql
import python.pssw
class Projekt:
def __init__(self):
passwd = python.pssw.password
self.conn = pymysql.connect('localhost','root',passwd,'projekt',charset ='utf8')
self.cursor = self.conn.cursor()
while(True):
wybor = input('(L)-Lo... | null | projekt.py | projekt.py | py | 4,348 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "python.pssw.pssw",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "python.pssw",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "pymysql.connect",
"line_number": 8,
"usage_type": "call"
}
] |
478884738 | ##################################
#encoding=utf8 #
#version =py27, py33 #
#author =sanhe #
#date =2014-10-29 #
# #
# (\ (\ #
# ( -.-)o I am a Rabbit! #
# o_(")(") #
# ... | null | HSH/OS/smtf.py | smtf.py | py | 4,403 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.isdir",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 60,
"usage_type": "attribute"
},
{
"api_name": "os.walk",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "os.path.getsize",
"line_number... |
331374797 | """Application and persistence management."""
# pylint: disable=no-member, import-error, no-init, too-few-public-methods
# pylint: disable=cyclic-import, no-name-in-module, invalid-name
from functools import lru_cache
from werkzeug.exceptions import NotFound
from flask_restful import reqparse
from flask_sqlalchemy ... | null | ersa_reporting/nova.py | nova.py | py | 10,425 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "ersa_reporting.create_logger",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "ersa_reporting.QueryResource",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "ersa_reporting.BaseIngestResource",
"line_number": 35,
"usage_type": "name"
}... |
51462803 | #!usr/bin/env python3
#-*- coding:utf-8 -*-
__author__ = 'yanqiong'
import asyncio
import os
import socket
import sys
from datetime import datetime
from urllib.parse import urlparse
import simplejson
from aiohttp import web
from tqsdk.account import TqAccount
from tqsdk.backtest import TqBacktest, TqReplay
from tqsd... | null | tqsdk/tqwebhelper.py | tqwebhelper.py | py | 17,118 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tqsdk.account.TqAccount",
"line_number": 36,
"usage_type": "argument"
},
{
"api_name": "tqsdk.account.TqAccount",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "tqsdk.sim.TqSim",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "t... |
162101321 | import torch
from torch import nn
from torch.nn import functional as F
from collections import OrderedDict
class Construct_Sequential(nn.Sequential):
def __init__(self, *args, **kwargs):
super(Construct_Sequential, self).__init__()
if len(args) == 1 and isinstance(args[0], OrderedDict):
... | null | test2.py | test2.py | py | 1,787 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.nn.Sequential",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "collections.OrderedDict",
"line_number": 9,
"usage_type": "argument"
},
{
"api_name": "torch.nn.L... |
359328662 | #!/usr/bin/python
import argparse
import os
import time
import pickle
import torch
import torch.nn as nn
import torch.optim as optim
from torchvision import datasets, transforms
from torch.autograd import Variable
import numpy as np
from core import model, utils, log
parser = argparse.ArgumentParser()
parser.add_argum... | null | train.py | train.py | py | 10,165 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "core.utils.standartize",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "core.uti... |
265987414 | import urllib.request, urllib.parse, urllib.error
from bs4 import BeautifulSoup
import ssl
CTX = ssl.create_default_context()
CTX.check_hostname = False
CTX.verify_mode = ssl.CERT_NONE
Pos = input('Position: ')
Count = input('Counter: ')
URL = input('URL: ')
def getURL(URL):
HTML = urllib.request.urlopen(URL, cont... | null | bs_links.py | bs_links.py | py | 511 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "ssl.create_default_context",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "ssl.CERT_NONE",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "urllib.request.request.urlopen",
"line_number": 14,
"usage_type": "call"
},
{
"api_na... |
37398000 |
import math
import json
import requests
from togglu.constants import REPORTS_URL
from togglu.timesheet import TimeEntries, TimeEntry
class ReportsRepository:
def __init__(self, base_url=REPORTS_URL, config=None):
self.base_url = base_url
self.config = config
def detailed_report(self, work... | null | togglu/reports_repository.py | reports_repository.py | py | 2,128 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "togglu.constants.REPORTS_URL",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "togglu.timesheet.TimeEntries",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "math.ceil",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "r... |
214087859 | """
练习1需求:
在员工列表中,查找删除薪资15000以内的所有员工
在员工列表中,查找删除部门编号是9005的所有员工
练习2需求:
在员工列表中,查找薪资最高的员工
在员工列表中,查找员工编号最大的员工
练习3需求:
在员工列表中,根据薪资升序排列
在员工列表中,根据员工编号升序排列
步骤
$1. 定义函数,完成需求.
x2. 将变化点定义为函数
将通用代码定义为函数
x3. 通用函数使用参数隔离变化点
$4... | null | month_01/teacher/day18/exercise01.py | exercise01.py | py | 2,776 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "common.iterable_tools.IterableHelper.delete_all",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "common.iterable_tools.IterableHelper",
"line_number": 64,
"usage_type": "name"
},
{
"api_name": "common.iterable_tools.IterableHelper.get_max",
"line_num... |
640022335 | #
# Updated query_data (per query statistics) script for SIGIR 2020.
# Updated by David Maxwell on 12-30-2019
#
import os
import sys
# As we are using ifind mashed into this repository, we need to add that to our path before we can import from it.
path_cwd = os.getcwd()
path_levelup = os.path.abspath(os.path.join(pat... | null | analysis/garbage/query_data.py | query_data.py | py | 27,782 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.getcwd",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_numbe... |
187182505 | from PIL import Image, ImageDraw
import os
from PyQt4 import QtCore, QtGui, QtDeclarative
import myUI
import sys
from PyQt4.QtNetwork import *
import threading
from PyQt4.QtGui import *
from PyQt4.QtCore import *
import re
import time
import numpy
import cv2
from subprocess import Popen, PIPE
# MAIN UI
app = QtGui.... | null | Converter.py | Converter.py | py | 13,636 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PyQt4.QtGui.QApplication",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "PyQt4.QtGui",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "sys.argv",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "PyQt4.QtGui.QWidge... |
208976595 | """The test for the geo rss events sensor platform."""
import unittest
from unittest import mock
from homeassistant.components import sensor
import homeassistant.components.geo_rss_events.sensor as geo_rss_events
from homeassistant.const import (
ATTR_FRIENDLY_NAME,
ATTR_ICON,
ATTR_UNIT_OF_MEASUREMENT,
... | null | tests/components/geo_rss_events/test_sensor.py | test_sensor.py | py | 6,238 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "homeassistant.components.sensor.DOMAIN",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "homeassistant.components.sensor",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "homeassistant.components.geo_rss_events.sensor.CONF_URL",
"line_n... |
30643941 | import logging
import httplib
import dpkt
import dns_service
LOGGER = logging.getLogger('fqrouter.%s' % __name__)
VER_DOMAIN = 'beta.android.ver.fqrouter.com'
def handle_latest(environ, start_response):
start_response(httplib.OK, [('Content-Type', 'text/plain')])
yield str(resolve_latest_version())
def r... | null | manager/version.py | version.py | py | 840 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "httplib.OK",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "dns_service.resolve",
"line_number": 19,
"usage_type": "call"
}
] |
295456858 | from sqlalchemy.orm.attributes import InstrumentedAttribute
class Repository(object):
def __init__(self, session, model_base, db_engine, entity_model):
self.DBEngine = db_engine
self.Session = session
self.ModelBase = model_base
self.ModelBase.metadata.create_all(self.DBEngine)
... | null | Laboratory4/src/LectureBot.Microservice.Main/dal/repository/Repository.py | Repository.py | py | 888 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sqlalchemy.orm.attributes.InstrumentedAttribute",
"line_number": 18,
"usage_type": "argument"
}
] |
339073801 | import pandas as pd
from pathlib import Path
import xlwings as xw
import tools
E_DRIVE = Path('E:\\stroke_data\\')
# load KORI_GRANT, excel will popup and ask for password
sheet = xw.Book(str(E_DRIVE/'KORI_GRANT.xlsx') ).sheets[0]
time_df = sheet['A27:AD311'].options(convert=pd.DataFrame,index=False,header=True).val... | null | deidentify_hosp_times.py | deidentify_hosp_times.py | py | 616 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pathlib.Path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "xlwings.Book",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "tools.get_hosp_keys",
... |
431869767 | import moviepy.editor as mp
from pydub import AudioSegment
import os
import vad as vd
import wit_speech_to_text as wst
import sys
import time
import svm_on_new_file as questions_svm
import list_all_classfied_sentences as list_sen
import search_for_relavant_questions as srq
import shutil
import split_audio as sa
import ... | null | questions_laugh_mood_pitch-2.py | questions_laugh_mood_pitch-2.py | py | 3,899 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "moviepy.editor.VideoFileClip",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "moviepy.editor",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "moviepy.editor.VideoFileClip",
"line_number": 20,
"usage_type": "call"
},
{
"api_name... |
249979651 | import argparse
import torch
from sal.utils.pytorch_fixes import *
from sal.utils.pytorch_trainer import *
from sal.saliency_model import SaliencyModel, SaliencyLoss, get_black_box_fn
from sal.datasets import imagenet_dataset
from sal.utils.resnet_encoder import resnet50encoder
from torchvision.models.resnet import res... | null | saliency_train.py | saliency_train.py | py | 5,617 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sal.datasets.imagenet_dataset",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "torch.unsqueeze",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "torch.cat",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "torchvision.m... |
25419897 | from django.urls import path
from rest_framework.urlpatterns import format_suffix_patterns
from user import views
app_name = 'users-api'
urlpatterns = [
path('', views.UserListAPIView.as_view(), name='list'),
path('login/', views.UserLoginAPIView.as_view(), name='login'),
path('register/', views.UserCreat... | null | server/user/urls.py | urls.py | py | 654 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "user.views.UserListAPIView.as_view",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "user.views.UserListAPIView",
"line_number": 8,
"usage_type": "attribute"
},
{
"... |
612306701 | #!/usr/bin/env python
'''
DAVID LETTIER
(C) 2015.
http://www.lettier.com/
Slackotron
'''
import time
import traceback
import threading
import logging
import slackotron_settings
import slack_service
import decorators
import utilities
from scribe import Scribe
from models import Channel
from models import Res... | null | thread_manager.py | thread_manager.py | py | 7,631 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.basicConfig",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "logging.WARNING",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "models.Channel.select",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "models... |
389804184 | #!/usr/bin/env python3
"""crawler.py
Author: Joseph Lin
E-mail: joseph.lin@aliyun.com
Social:
https://github.com/RDpWTeHM
https://blog.csdn.net/qq_29757283
Usage: $ python ./crawler.py
TODO:
N/A
Note:
N/A
"""
import os
import sys
import time
import logging
import signal
import atexit
import traceback
tr... | null | Crawler/crawler.py | crawler.py | py | 2,591 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "queue.Queue",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "logging.warning",
"line_numbe... |
495943455 | import json
import math
import os
import re
import subprocess
import pickle
import time
from collections import OrderedDict
from pathlib import Path
import sys
from scipy.special import softmax
from sklearn.metrics import *
sys.path.append("..")
import click
import h5py
import numpy as np
import torch
import torch.nn ... | null | exp/v2clean_new.py | v2clean_new.py | py | 18,587 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
635140932 | #!/usr/bin/env python
# coding: utf-8
#imports
import csv
import time
import sys
action = str(sys.argv[1])
technique = str(sys.argv[2])
dtype = str(sys.argv[3])
ipFilepath = str(sys.argv[4])
opFilepath = '../outputs/out.csv'
print("Action:",action)
print("Technique:",technique)
print("Datatype:",dtype)
print("Input... | null | A3-RLE.py | A3-RLE.py | py | 4,765 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.argv",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number"... |
471951331 | # -*- coding: utf-8 -*-
from django.shortcuts import get_object_or_404, render
from django.http import HttpResponseRedirect
from django.urls import reverse
from django.views import generic,View
from django.db.models import F
from django.utils import timezone
from django.forms.formsets import formset_factory
from org_h... | null | vote/views.py | views.py | py | 8,144 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.shortcuts.get_object_or_404",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "org_home.models.Categories",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "org_home.models",
"line_number": 25,
"usage_type": "name"
},
{
... |
149432773 | # Django settings for email_campaign_manager project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
#SESSION_EXPIRE_AT_BROWSER_CLOSE = True
#http://avivgr.blogspot.in/2009/05/how-to-add-remember-me-checkbox-to.html
#Path settings ] ---------
import os
PROJECT_DIR = os.path.dirname(os.path.abspath("settings.py"))
APAC_PRJ_DIR = o... | null | email_campaign_manager/settings.py | settings.py | py | 11,397 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.dirname",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line... |
178280687 | import pytest
from django.core.urlresolvers import reverse
from django.http.response import Http404
from django.utils import timezone
from ...factories import TaskUserFactory
from ...forms import TaskResetForm
from ...models import Task, TaskReset
from ...views import TaskResetView
from ..conftest import TASK_UUID, for... | null | ihavebeendays/tasks/tests/views/test_task_reset_view.py | test_task_reset_view.py | py | 3,064 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "forms.TaskResetForm",
"line_number": 18,
"usage_type": "argument"
},
{
"api_name": "factories.TaskUserFactory.create",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "factories.TaskUserFactory",
"line_number": 22,
"usage_type": "name"
},
{
... |
60389936 | import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
def main():
df = pd.read_csv("turnstile_data_master_with_weather.csv")
sun = df[df["rain"]==0]
rain = df[df["rain"]==1]
#plot
plt.figure()
plt.xlim([0,3000])
sun['ENTRIESn_hourly'].hist(bins=500, histtype='stepfill... | null | Intro to Data Science/Excercise_4_Histogram.py | Excercise_4_Histogram.py | py | 828 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "matplotlib.... |
108400453 | """
This module contains all the utility functions needed for the views of pc and rooms.
When defining a new function that should work for more than one view, please define it here!
"""
import datetime
from itertools import chain
from django.utils import timezone
import math
from rooms.models import Activity
from rest_... | null | core/utilities.py | utilities.py | py | 21,922 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.http.HttpResponse",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "rest_framework.renderers.JSONRenderer",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "math.pi",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_n... |
458319938 | from netpyne import specs
try:
from __main__ import cfg
except:
from cfgIP import cfg
import numpy as np
from itertools import product
simso, simtj, simxso, simxtj = cfg.simso, cfg.simtj, cfg.simxso, cfg.simxtj
freqs, npulsess, durs, amps, mttxss, mn1p8s, mn1p9s = cfg.freqs, cfg.npulsess, cfg.durs, cfg.amps,... | null | npIP.py | npIP.py | py | 5,084 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cfgIP.cfg.simso",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "cfgIP.cfg",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "cfgIP.cfg.simtj",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "cfgIP.cfg.simxso"... |
623664299 | # Copyright 2018,2019,2020,2021 Sony Corporation.
# Copyright 2021 Sony Group Corporation.
#
# 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
#... | null | compression/cifar10/factorized-layers/args.py | args.py | py | 3,819 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 68,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.