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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
474451690 | from collections import OrderedDict
from .models import GoodsChannel
def get_categories():
"""
获取商城商品分类菜单
:return:
"""
# 商品频道及分类菜单
# 使用有序字典保存类别的顺序
# categories = {
# 1: { # 组1
# 'channels': [{'id': 1, 'name': 'xxx', 'url': 'yyy'}, {}, {}],
# 'sub_cats': [{'... | null | meiduo_mall/meiduo_mall/apps/goods/utils.py | utils.py | py | 3,241 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "collections.OrderedDict",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "models.GoodsChannel.objects.order_by",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "models.GoodsChannel.objects",
"line_number": 26,
"usage_type": "attribute"
... |
322181877 | # Copyright 2022 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | null | tfx/dsl/input_resolution/ops/ops_utils.py | ops_utils.py | py | 3,948 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tfx.types.artifact",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "tfx.types",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "tfx.types.artifact",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "tfx.types",... |
590013784 | #number of points inside a quadrilateral
from math import sqrt,ceil,floor
from fractions import gcd
def inside(a,b,c,d):
#calculate area
area = (c*b+a*b+a*d+d*c)/2
bp = gcd(a,b)+gcd(b,c)+gcd(c,d)+gcd(d,a)
return area-bp/2+1
def sol(m):
count=0
for a in range(1,m+1):
for b in range(1,m... | null | Python/E504/E504/E504.py | E504.py | py | 560 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "fractions.gcd",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "math.ceil",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "math.floor",
"line_number": 19,
... |
585452927 | ##Patterns: B304
from Crypto.Cipher import ARC2
from Crypto.Cipher import ARC4
from Crypto.Cipher import Blowfish
from Crypto.Cipher import DES
from Crypto.Cipher import XOR
from Crypto.Hash import SHA
from Crypto import Random
from Crypto.Util import Counter
from cryptography.hazmat.primitives.ciphers import Cipher
f... | null | docs/multiple-tests/with-config/src/B304.py | B304.py | py | 2,238 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "Crypto.Random.new",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "Crypto.Random",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "Crypto.Cipher.ARC2.block_size",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "Cr... |
391835765 | import unittest
from typing import List
from .ds import TreeNode
from queue import Queue
class Solution(unittest.TestCase):
def rightSideView(self, root: TreeNode) -> List[int]:
"""
Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered fr... | null | src/main/python/binary_tree_right_side_view.py | binary_tree_right_side_view.py | py | 1,225 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "unittest.TestCase",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "ds.TreeNode",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "queue.Queue",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "queue.put",
"line_nu... |
265475322 | import time
from weakref import WeakKeyDictionary
from scrapy import signals, log
from scrapy.exceptions import NotConfigured
from scrapy.exporters import PythonItemExporter
from scrapy.http import Request
from scrapy.utils.request import request_fingerprint
from scrapy.exceptions import ScrapyDeprecationWarning
from s... | null | sh_scrapy/extension.py | extension.py | py | 2,674 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sh_scrapy.hsref.hsref",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "sh_scrapy.hsref",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "scrapy.exceptions.NotConfigured",
"line_number": 20,
"usage_type": "name"
},
{
"api_na... |
385530762 | # -------------------------------------------------------------
# proj: gan-stronomy
# file: opts.py
# authors: Mark Sabini, Zahra Abdullah, Darrith Phan
# desc: File containing all options pertaining to training
# -------------------------------------------------------------
import torch
import os
import util... | null | code/opts.py | opts.py | py | 1,412 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "torch.cuda",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "torch.FloatTe... |
86552622 | from __future__ import print_function, division
from future.utils import iteritems
from builtins import range
import json
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.utils import shuffle
from sklearn.manifold import TSNE
from sklearn.decomposition import TruncatedSVD, PCA, Kernel... | null | lecture_8.py | lecture_8.py | py | 3,078 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.getcwd",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "util.get_wikipedia_data",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_nu... |
651719991 | #!/usr/bin/env python
"""Functions for streamlining analysis."""
# Imports
from collections import defaultdict, Sequence, namedtuple
import functools
import itertools
import concurrent.futures as futures
import pandas as pd
import numpy as np
import statsmodels.formula.api as smf
import statsmodels
import munch
im... | null | src/crunchers/statsmodels_helpers/lazy_stats.py | lazy_stats.py | py | 14,903 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "crunchers.ipython_info",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "patsy.dmatrices",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "statsm... |
619528332 | # Copyright 2018 The Hypebot Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | null | hypebot/hypecore.py | hypecore.py | py | 11,507 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "typing.Union",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "typing.Text",
"line_number": 47,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 48,
"usage_type": "name"
},
{
"api_name": "typing.Text",
"line_number":... |
73506498 | import os
import numpy as np
import librosa as lb
from keras.models import load_model
import tkinter as tk
#%%
def predict():
filepath_prediction = 'C:\\Users\\Lakshminagaraj\\Documents\\Pramod\\ML project\\SplitOnSilenceFiles'
model_load_path = "C:\\Users\\Lakshminagaraj\\Documents\\Pramod\\ML projec... | null | prediction.py | prediction.py | py | 2,017 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.listdir",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "librosa.core.load",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "librosa.core",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "numpy.mean",
"line... |
560445574 | MODEL = 'BGRU_GA'
import numpy as np
from tensorflow import set_random_seed
np.random.seed(1234)
set_random_seed(12345)
import os, pickle
from keras import backend as K
from keras.utils.generic_utils import get_custom_objects
from LossHistory import LossHistory
from keras.layers import Dense, Input, Embedding, GRU, B... | null | model.py | model.py | py | 2,792 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.random.seed",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.set_random_seed",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "keras.bac... |
430825618 | from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
import sys
import os
import os.path
import pickle
import numpy as np
from collections import default... | null | main_gpyopt.py | main_gpyopt.py | py | 5,893 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "future.standard_library.install_aliases",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "future.standard_library",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "numpy.set_printoptions",
"line_number": 16,
"usage_type": "call"
},
{
... |
643699253 | # -*- coding: utf-8 -*-
"""
Created on Wed Mar 31 18:35:41 2021
@author: piyab
"""
import os
#os.chdir("D:/Saarland/NN TI/NNTI_WS2021_Project")
import torch
import torch.nn as nn
from torch.autograd import Variable
from torch.nn import functional as F
import numpy as np
import pandas as pd
import TASK_1.py
from Tas... | null | hindi_binary_classifier.py | hindi_binary_classifier.py | py | 3,312 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.DataFrame.from_csv",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 35,
"usage_type": "call"
},
... |
410881366 | import numpy as np
import dicom
import glob
from matplotlib import pyplot as plt
import os
import cv2
import mxnet as mx
import pandas as pd
from sklearn import cross_validation
inDir = 'C:/Users/SriPrav/Documents/R/19DSB2017'
resnet50Model = inDir + "/input/preModels/resnet-50"
Stage1SourceFolder = inDir + "/input/... | null | DSB2017/1000.FeatureExtraction_00_stg2.py | 1000.FeatureExtraction_00_stg2.py | py | 2,869 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "mxnet.model.FeedForward.load",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "mxnet.model",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "mxnet.gpu",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "mxnet.model.F... |
537395572 | import os.path
from sqlalchemy import Column, Integer, String, Sequence, ForeignKey, DateTime
from sqlalchemy.orm import sessionmaker, relationship
from sqlalchemy.ext.declarative import declarative_base
from .database import Base, engine
from . import app
import datetime
from flask_login import UserMixin
class Use... | null | arm/assets_bkup.py | assets_bkup.py | py | 7,209 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "database.Base",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "flask_login.UserMixin",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Inte... |
3206122 | from django.urls import path
from address_app import views
app_name = 'address'
urlpatterns = [
path('settle/',views.settle_accounts,name='settle'),
path('addresspg/',views.address_page,name='addresspg'),
path('addressok/',views.address_ok,name='addressok'),
path('ybaddress/',views.ybaddress,name='yba... | null | address_app/urls.py | urls.py | py | 330 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "address_app.views.settle_accounts",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "address_app.views",
"line_number": 7,
"usage_type": "name"
},
{
"api_name":... |
36093736 | from celery import shared_task
from django.core.mail import send_mail
# from settings import settings WRONG
from django.conf import settings
@shared_task(
autoretry_for=(Exception,),
retry_kwargs={
'max_retries': 5,
'default_retry_delay': 60,
},
)
def send_registration_email(body, email_... | null | app/accounts/tasks.py | tasks.py | py | 497 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.core.mail.send_mail",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.DEFAULT_FROM_EMAIL",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 20,
"usage_type": "name"
... |
400909341 | from django.conf.urls import url, include, patterns
from rest_framework import routers
urlpatterns = patterns('api.views',
url(r'^establecimiento/$','establecimiento' ),
url(r'^contratante/$','contratante' ),
url(r'^establecimientodetalle/(?P<id>\d+)/$','establecimientodetalle' ),
)
| null | api/urls.py | urls.py | py | 296 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.conf.urls.patterns",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "djan... |
83645527 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import functools
import subprocess
import time
from .core import core
from .targets import Target
from .option import is_option
from .variable import Variable
from .exceptions import (FaffError, RuleError)
# Error messages.
ENORMALISE = "rule `{}` argument `{}` unexpected ... | null | faff/rule.py | rule.py | py | 17,896 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "targets.Target",
"line_number": 85,
"usage_type": "argument"
},
{
"api_name": "option.is_option",
"line_number": 88,
"usage_type": "argument"
},
{
"api_name": "time.time",
"line_number": 122,
"usage_type": "call"
},
{
"api_name": "core.core.debug",
... |
186091510 | # -*- coding: UTF-8 -*-
"""
trytond_async.tasks
Implements the actual task runners.
Usual celery projects would have the method/functions which have the code
to run as tasks. However, the tryton inheritance and majority of tryton
code being in class and instance methods makes it hard for the patte... | null | tasks.py | tasks.py | py | 3,145 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "trytond.pool.Pool.database_list",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "trytond.pool.Pool",
"line_number": 41,
"usage_type": "name"
},
{
"api_name": "trytond.transaction.Transaction",
"line_number": 44,
"usage_type": "call"
},
{
... |
366095768 | import os
import sys
# Actually submit job to LAVA
SUBMIT = 1
def submit_testjob(jobdef):
import xmlrpc.client
import requests
from urllib.parse import urlsplit
via_squad = os.getenv("USE_QA_SERVER") == "1"
if via_squad:
lava_uri = os.getenv("LAVA_SERVER")
if "://" not in lava_... | null | lava_submit.py | lava_submit.py | py | 2,225 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.getenv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 22,
... |
566264816 | import redis
import json
"""
IPPool function:
1) insert_ip: insert a proxy ip into redis
2) get_random_key: get a random key from redis
3) delete_by_key: delete a proxy ip by key
"""
class IPPool(object):
def __init__(self):
self.__HOST = '127.0.0.1'
self.__PORT = 6379
self.__I... | null | db/redis.py | redis.py | py | 1,709 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "redis.Redis",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 25,
"usage_type": "call"
}
] |
221667612 | import numpy as np
import matplotlib.pyplot as plt
euclidean_distance = lambda data, point: np.sqrt(np.sum(np.power(data - point, 2), axis = 1).reshape((len(data), 1)))
def relative_neighborhood_graphs(data):
#debug:
#plt.gca().set_aspect('equal', adjustable='box')
#construct the complete Graph... | null | graph_theory/RNG.py | RNG.py | py | 2,027 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.sqrt",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.power",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.empty",
"line_number": 14,
... |
198197657 | """Process an html delicious export and import them into bookie"""
import codecs
from datetime import datetime
from BeautifulSoup import BeautifulSoup
from sys import argv
import urllib
DELAPI = 'http://127.0.0.1:6543/delapi/posts/add?'
def process(fname):
"""Given a file, process it"""
bmark_file = codecs.o... | null | Bookie/bookie/scripts/import_delicious.py | import_delicious.py | py | 1,390 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "codecs.open",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "BeautifulSoup.BeautifulSoup",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.fromtimestamp",
"line_number": 32,
"usage_type": "call"
},
{
"api_name"... |
260923416 | import time
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.common.exceptions import NoSuchElementException
import json
import os,sys
import CommonLibrary
import urllib.request
import zipcodes
import us
import requests
from bs4 import BeautifulSoup
home_path = os.path... | null | data_process/com.leafly/com.leafly.py | com.leafly.py | py | 15,962 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.abspath",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.realpath",
"lin... |
211436182 | import os
import random
from flask import Flask, request, abort
from linebot import (
LineBotApi, WebhookHandler
)
from linebot.exceptions import (
InvalidSignatureError
)
from linebot.models import (
MessageEvent, TextMessage, TextSendMessage, TemplateSendMessage, ButtonsTemplate, PostbackTempl... | null | app.py | app.py | py | 6,716 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "linebot.LineBotApi",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_... |
535837331 | import json
from annoying.decorators import render_to
from django.contrib import messages
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.core.urlresolvers import reverse
from django.shortcuts import redirect, get_object_or_404
import requests
from . import forms
from . import mo... | null | products/views.py | views.py | py | 2,970 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "json.loads",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "django.contrib.messages.info",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "django.contrib.m... |
11518226 | from django.shortcuts import render, redirect
from django.http import HttpResponse
from .models import Task
# Create your views here.
def index_form(request):
"""
main page
a list of tasks
"""
if request.method == "POST":
# check done form
done_id = request.POST.get("done", "")
... | null | todolist/myapp/views.py | views.py | py | 2,421 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "models.Task.objects.filter",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "models.Task.objects",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "models.Task",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "djang... |
507408094 | #!/usr/bin/python3
import tkinter as tk
from tkinter.filedialog import askopenfilenames
from PIL import Image
import re
import os
class Application(tk.Frame):
def __init__(self, parent):
tk.Frame.__init__(self, parent, background="red")
self.parent = parent
self.actions = [{"display_text":... | null | imagero.py | imagero.py | py | 9,401 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tkinter.Frame",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "tkinter.Frame.__init__",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tkinter.Frame",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "tkinter.F... |
316037642 | import logging
from celery.task import task
from report_metric import reporter
from report_metric import settings
logging.basicConfig(level=logging.DEBUG)
def setup_reporter(destination=None, source=None):
destination = destination or settings.get('METRICS_DESTINATION', 'librato')
source = source or settin... | null | src/report_metric/metric.py | metric.py | py | 2,404 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.basicConfig",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "report_metric.settings.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "repor... |
480371716 | from configparser import ConfigParser
from random import Random
from json import JSONEncoder
import paramiko
import os
import time
import eel
import json
import sys
class Eagle(object):
def __init__(self, config_filename, send_fn):
self.running = False
self.ssh = None
self.sftp = None
... | null | src/eagle.py | eagle.py | py | 4,878 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.sep.join",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.sep",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"li... |
151928741 | import ast
import io
import mimetypes
import re
import socket
import sys
import traceback
from pathlib import Path
WEBROOT = "webroot"
def response_ok(body=b"This is a minimal response", mimetype=b"text/plain"):
"""
returns a basic HTTP response
Ex:
response_ok(
b"<html><h1>Welcome:</h... | null | http_server.py | http_server.py | py | 5,944 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "re.match",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 110,
"usage_type": "call"
},
{
"api_name": "mimetypes.guess_type",
"line_number": 119,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_n... |
421865152 | from pyspark import SparkContext
from itertools import islice, combinations, tee
from operator import add
from sys import argv
from time import time
def basket_mapper(element):
comma_location = element.find(',')
return element[:comma_location], element[(comma_location+1):]
def read_baskets():
# Spark Co... | null | HW2/jacob_beaudin_task2.py | jacob_beaudin_task2.py | py | 9,145 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pyspark.SparkContext",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "itertools.islice",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_n... |
112345962 |
from TextToLif import TextToLif
import sys
sys.path.append('..')
from LifFileParser import LifFileParser
import corenlp
import json
"""
This is the wrapper of stanford corenlp functions that saves the result as the LIF format.
"""
class StanfordTokenizer:
def __init__(self, lif_string=""):
self.lif_parser = LifF... | null | HLAFeatureLibrary/Training/stanford_wrapper.py | stanford_wrapper.py | py | 3,724 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.path.append",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "LifFileParser.LifFileParser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "corenlp.clien... |
211228052 | import requests
from bs4 import BeautifulSoup
url = 'http://www.lazada.com.ph/apple-macbook-pro-mf839zpa-8gb-intel-core-i5-13-540573.html'
request = requests.get(url)
content = request.content
soup = BeautifulSoup(content, "html.parser")
element = soup.find("span", {"itemprop": "price", "id": "special_price_box"})
st... | null | src/app.py | app.py | py | 685 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 8,
"usage_type": "call"
}
] |
257900350 | from collections import namedtuple
TaskData = namedtuple('TaskData', (
# Time when the task was started
'startTime',
# Mesos' ID of the slave where task is being run
'slaveID',
# Mesos' ID of the executor running the task
'executorID'))
ResourceRequirement = namedtuple('ResourceRequirement', (... | null | src/toil/batchSystems/mesos/__init__.py | __init__.py | py | 934 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "collections.namedtuple",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 19,
"usage_type": "call"
}
] |
109328546 | """
基本语法练习
1. 规范格式
1.1 构建执行图
1.2 加载持久化模型,两种方式
2. 完成作业
2.1 变量作用域,变量定义规范,变量重用
2.2 模型训练:图构建,执行图
2.3 模型预测,pyplot画图
"""""
import numpy as np
import tensorflow as tf
from matplotlib import pyplot as plt
"""
** 【实际项目模板】 - 构建图和执行图 **
"""
# with tf.Graph().as_default():
# # 一、基于业务知识,构建执行图对象
# # 1. ... | null | 2019/AI/DeepLearning/TensorFlow/01_practice/03_basic_grammer.py | 03_basic_grammer.py | py | 12,858 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tensorflow.Graph",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "tensorflow.Variable",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "tensorflow.float32",
"line_number": 86,
"usage_type": "attribute"
},
{
"api_name": "numpy.ar... |
73396807 | import numpy as np
from numba import njit, float32
class WeightMetTrigger(object):
def __init__(self, **kwargs):
self.__dict__.update(kwargs)
def begin(self, event):
self.cats = sorted([nmu for nmu in self.correction_files.keys()])
self.bins = []
self.corr = []
self.cor... | null | sequence/Modules/WeightMetTrigger.py | WeightMetTrigger.py | py | 2,559 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.divide",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.zeros_like",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.divide",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.zeros_like",
"li... |
50700885 | #!/usr/bin/python3
import sys, json
from collections import defaultdict
# This script was designed to allow users to add TTP:keyword associations
# The input parameters for the script are as follows:
# - python add_user_keywords.py [enterprise|mobile] "Txxxx:keywords,to add,here:Txxxx:other,keywords to add,etc."
# - ... | null | add_user_keywords.py | add_user_keywords.py | py | 2,027 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number... |
484428340 | """
Copyright (c) 2014, Samsung Electronics Co.,Ltd.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and... | null | tests/test_cudnn.py | test_cudnn.py | py | 21,419 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "unittest.TestCase",
"line_number": 48,
"usage_type": "attribute"
},
{
"api_name": "logging.basicConfig",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 50,
"usage_type": "attribute"
},
{
"api_name": "os.envi... |
86173917 | import cv2
import numpy as np
image=cv2.imread('messi.jpg')
cv2.imshow("Original",image)
cv2.waitKey(0)
B,G,R=cv2.split(image)
# now creating zero matrix for extraction of RGB component seprately
zeros=np.zeros(image.shape[:2],dtype="uint8")
#for Blue Color
cv2.imshow("Blue",cv2.merge([B,zeros,zeros]))
cv2.waitKey(0)
... | null | open cv/7.How to extract RGB Color Space/rgb_cs.py | rgb_cs.py | py | 497 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.imread",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.split",
"line_number": 6,
... |
32693150 | # ~ OPEN SOURCE ~
# CODED BY FADIL YAZID
# FB : FADIL ID
import os
import sys
import time
import requests
def mulai():
print
print('\t\x1b[1;92m [ \x1b[1;97mSPAM SMS MAPCLUB \x1b[1;92m]\x1b[1;97m')
print('\t <~~~~~~~~~~~~~~~~~~>')
print('\t Author : Fadil ID')
print
print ('(... | null | spam.py | spam.py | py | 1,689 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "time.sleep",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 49,
... |
595872240 | from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^polls/$', 'polls.views.index'),
url(r'^polls/(?P<artistid>\d+)/song_view/$', 'polls.views.song_view'),
url(r'^poll... | null | mysite_hipopathy/mysite/urls.py | urls.py | py | 580 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.contrib.admin.autodiscover",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.conf.urls.patterns",
"line_number": 7,
"usage_type": "call"
},
{
"api... |
364668724 | import re
import requests
import csv
link = []
title = []
watchs = []
num = []
day = []
up_space = []
up_names = []
message = input("请输入想要搜索的内容:")
op = int(input("请问您想要爬取多少页呢?(至多50页)"))
for i in range(1,op+1):
try:
url = 'https://search.bilibili.com/all?keyword=' + str(message)+"&from_source... | null | spider/B站_re_csv.py | B站_re_csv.py | py | 2,532 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "re.S",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "re.findall",
"line_number": 22,... |
183828008 | # -*- coding: utf8 -*-
import json, requests
import datetime
train_text=""
final_count = 0
near_list = ['Chicago', 'Manchester', 'London', 'Liverpool', 'Oxford']
for k in range(len(near_list)):
# 버거 키워드로 검색 시 추천 식당받기
params = dict(
client_id='',
client_secret='',
v='20170801',
near = near_l... | null | Foursquare_API/get_res_reviews.py | get_res_reviews.py | py | 2,395 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": ... |
291849764 | import torch
import torchvision
import torch.nn as nn
import torch.optim as optim
import numpy as np
# from mat4py import loadmat
# #from torchsummary import summary
# from graphviz import Digraph
# from torchviz import make_dot
# from graphviz import Source
import time
HOME = 0
if torch.cuda.is_available() and HOME =... | null | model_gru_mimo_0.py | model_gru_mimo_0.py | py | 28,077 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "google.colab.drive.mount",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "goog... |
14336982 | import argparse
def printParsers(subparser_actions):
# but better save than sorry
for subparsers_action in subparsers_actions:
# get all subparsers and print help
for choice, subparser in subparsers_action.choices.items():
print("Subparser '{}'".format(choice))
print(subparser.format_help... | null | FF-Tool/src_core/parser.py | parser.py | py | 1,551 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "argparse._SubParsersAction",
"line_number": 35,
"usage_type": "attribute"
}
] |
493718179 | import random
import wikilocation
from wikipedia import wikipedia
def get_articles(lat, lon):
"""
:type lat: str
:type lon: str
:return: list of dicts representing articles
"""
# Use really large radius, in case very far away from somewhere.
# Results are sorted by distance and limited so... | null | model.py | model.py | py | 1,875 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "wikilocation.articles",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "wikilocation.articles",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "wikipedia.wikipedia.page",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "... |
189195499 | from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from rdmo.core.validators import UniqueURIValidator
class OptionSetUniqueURIValidator(UniqueURIValidator):
app_label = 'options'
model_name = 'optionset'
def get_uri(self, model, data):
ur... | null | rdmo/options/validators.py | validators.py | py | 999 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "rdmo.core.validators.UniqueURIValidator",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "rdmo.core.validators.UniqueURIValidator",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "django.core.exceptions.ValidationError",
"line_number": 24,
... |
337938218 | #necessary imports
import pandas_datareader as pdr
from pandas_datareader.data import DataReader as dr
import datetime as dt
from datetime import date
from yahoo_fin import stock_info as si
from yahoo_fin import options
import pandas as pd
import yfinance as yf
import numpy as np
import matplotlib.pyplot as plt
from mp... | null | build/lib/DeltaPI/Extension/DeltaHedgePi.py | DeltaHedgePi.py | py | 19,253 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas_datareader.data.DataReader",
"line_number": 88,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 89,
"usage_type": "call"
},
{
"api_name": "datetime.date.today",
"line_number": 91,
"usage_type": "call"
},
{
"api_name": "dat... |
491245277 | import os.path
import sqlite3
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from Bio import SeqIO
import pandas as pd
class Template:
"""PCR template.
Parameters
----------
seqrecord : Bio.SeqRecord
Mostly used with element in Bio.SeqIO.parse iterator.
Attributes
-----... | null | testprimer/pcr.py | pcr.py | py | 6,860 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "Bio.SeqRecord.SeqRecord",
"line_number": 31,
"usage_type": "argument"
},
{
"api_name": "Bio.Seq.Seq",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "Bio.SeqIO.parse",
"line_number": 206,
"usage_type": "call"
},
{
"api_name": "Bio.SeqIO",
... |
166017370 | import importlib
from typing import List
from django.conf import settings
from django.db.models import prefetch_related_objects
from rest_access_policy import AccessPolicyException
from rest_framework import permissions
class AccessPolicy(permissions.BasePermission):
statements = []
id = None
group_prefi... | null | rest_access_policy/access_policy.py | access_policy.py | py | 6,942 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "rest_framework.permissions.BasePermission",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.permissions",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 25,
"usage_type": "name"
},
{
... |
316333306 | import numpy as np
import matplotlib.pyplot as plt
from scipy.constants import c, mu_0, epsilon_0
class Gaussian(object):
def __init__(self, dt, center_wv, spread, pick_pos, dtype):
self.dt = dt
self.dtype = dtype
self.wvlenc = center_wv
self.spread = spread
... | null | pyctypes/FDTD.real.diel.CPML.MPI/source.py | source.py | py | 4,067 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "scipy.constants.c",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "numpy.pi",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "numpy.exp",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line_numbe... |
414349889 | '''
绘制灰度图的统计直方图
-----------------------
首先我们将图片读入为img, 然后转换为灰度图gray.
然后将gray 用numpy的ravel函数变为一维的扁平数组, 输入到plt.hist 中.
了解更多查看numpy.ravel -文档
最终我们得到灰度图的统计图.
'''
from matplotlib import pyplot as plt
import numpy as np
import cv2
# img = cv2.imread('little_chess.png')
img = cv2.imread('dao_roi.png... | null | TeachCode代码教学区/CH4_ROI颜色统计与图像二值化/CH4.2_DrawImgGrayscaleStat.py | CH4.2_DrawImgGrayscaleStat.py | py | 871 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.imread",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.his... |
633139889 | """
filesync.py
Copy files from an repo directory to an full environment. This script ties in
nicely to vim's plugin neomake which will call this script every time a file
saves. This script will copy an entire OpenNet copy over to an environment, or
just a single file.
"""
import shutil
from distutils import dir_ut... | null | environment_sync/src/filesync/filesync.py | filesync.py | py | 5,098 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.listdir",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number"... |
154353794 | from urllib.request import urlopen
from bs4 import BeautifulSoup
import datetime
import random
name = "Python blog tracker"
version = "0.1"
depends = ['beatifulsoup4']
waiter = True
def get_news():
url = "https://www.python.org/blogs/"
data = urlopen(url).read().decode('utf8')
bs = BeautifulSoup(data, fe... | null | newsportal/reporters/reporter_4.py | reporter_4.py | py | 981 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "d... |
143256848 | # -----------------------------------------------------------------------------
# Copyright (c) 2015, The Deblur 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 | deblur/test/test_workflow.py | test_workflow.py | py | 29,830 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "unittest.TestCase",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "tempfile.mkdtemp",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
... |
379273250 | #!/usr/bin/env python
# encoding: utf-8
'''
@author: toby
@license: (C) Copyright 2013-2017, Node Supply Chain Manager Corporation Limited.
@contact: hejunwang01@126.com
@software: pycharm
@file: logger.py
@time: 2020-11-18 23:20
@desc:
'''
# MNJUFOYUIBJAKWFG 邮箱pass
import os
import time
import threading
log_dir ... | null | flask-celery-hjw/log_pkg/mylogger.py | mylogger.py | py | 4,010 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "threading.Lock",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_nu... |
590642987 | """Greeter.
Usage:
basic.py hello <name>
basic.py goodbye <name>
basic.py (-h | --help)
Options:
-h --help Show this screen.
"""
from docopt import docopt
def hello(name):
print('Hello, {0}'.format(name))
def goodbye(name):
print('Goodbye, {0}'.format(name))
if __name__ == '__main__':
ar... | null | 019_CLI/docopt_test.py | docopt_test.py | py | 547 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "docopt.docopt",
"line_number": 23,
"usage_type": "call"
}
] |
44840318 | from flask import (
Blueprint, render_template, request, current_app, url_for, g, redirect
)
from main.web import db
from main.web.models import Dags
bp = Blueprint('dags', __name__, url_prefix='/dags')
@bp.route('/', methods=['GET', 'POST'])
def dags():
page = request.args.get('page', 1, type=int)
dags... | null | main/web/dags/dags.py | dags.py | py | 942 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Blueprint",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.request.args.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.request.args",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "flask.r... |
305767334 | # coding: utf-8
import flask
import requests
import auth
import config
import forms
import model
import util
from main import app
@app.route('/admin/newsletter/')
@auth.admin_required
def newsletter_list():
newsletter_dbs, cursors = model.NewsLetter.get_dbs(
order='-created',
prev_cursor=True,
)
... | null | main/control/newsletter.py | newsletter.py | py | 4,081 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "model.NewsLetter.get_dbs",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "model.NewsLetter",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "flask.render_template",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "... |
214940190 | import pyqtgraph as pg
from pyqtgraph.Qt import QtCore, QtGui
import numpy as np
import pandas as pd
from .base import WidgetBase
class MyViewBox(pg.ViewBox):
pass
class WaveformViewer(WidgetBase):
def __init__(self, spikesorter = None, parent=None):
WidgetBase.__init__(self, parent)
... | null | tridesclous/gui/waveformviewer.py | waveformviewer.py | py | 3,821 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pyqtgraph.ViewBox",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "base.WidgetBase",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "base.WidgetBase.__init__",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "base.... |
408651941 | from __future__ import print_function
from jsonschema import validate
import jsonschema
import json
import sys
'''
https://spacetelescope.github.io/understanding-json-schema/
http://code.activestate.com/recipes/579135-validate-data-easily-with-json-schema/
'''
'''
definitions
'''
# schema = {
# "$schema": "http:... | null | json/json_schema_verifier.py | json_schema_verifier.py | py | 2,211 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "jsonschema.validate",
"line_number": 102,
"usage_type": "call"
},
{
"api_name": "jsonschema.FormatChecker",
"line_number": 102,
"usage_type": "call"
},
{
"api_name": "jsonschema.exceptions",
"line_number": 103,
"usage_type": "attribute"
},
{
"api_na... |
518261651 | # -*- coding: utf-8 -*-
import json
import logging
import time
import threading
import zmq
from lucena.io2.networking import create_pipe
logger = logging.getLogger(__name__)
class Plugin(object):
def __init__(self, zmq_context):
self.zmq_context = zmq_context
self.poller = zmq.Poller()
... | null | lucena/plugins/plugin.py | plugin.py | py | 4,173 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "zmq.Poller",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "lucena.io2.networking.create_pipe",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "thread... |
175352133 | import os, zipfile, urllib.request
import re, lxml.etree
import numpy as np
from sklearn.utils import shuffle
from sklearn.feature_extraction.text import CountVectorizer
class TedData(object):
def __init__(self, vocab_size):
if not os.path.isfile('ted_en-20160408.zip'):
urllib.request.urlretrieve("https:/... | null | data.py | data.py | py | 4,148 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.isfile",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "urllib.request.request.urlretrieve",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "urllib... |
569578285 | import datetime
from django.db import models
from django.db.models import Subquery, OuterRef, F, ExpressionWrapper, Q, Sum, Avg, Count, Value, Func, \
Case, When, Prefetch
from django.db.models.functions import Coalesce, Greatest, Round
from django.utils import timezone
from django.core.exceptions import Validation... | null | svinbin/tours/models.py | models.py | py | 56,938 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.db.models.QuerySet",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "django.db.models.OuterRef",
"line_number": 20,
"usage_type": "call"
},
{
"api_nam... |
344846077 | import stk
import os
from collections import namedtuple
from os.path import join
import numpy as np
from ..._test_utilities import _test_dump_and_load, _compare_with_valid
test_dir = 'cof_topology_tests_output'
if not os.path.exists(test_dir):
os.mkdir(test_dir)
def _alignment(vertex, building_block, vertices,... | null | tests/molecular/topology_graphs/test_cof_topologies.py | test_cof_topologies.py | py | 10,920 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.exists",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.mkdir",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "stk.normalize_vector",
"line... |
446480223 | from PIL import ImageGrab, ImageOps
import pyautogui
import time
from numpy import *
class Coordinates:
replayBtn = (480, 238)
dino = (246, 405)
boxx = (255, 270)
duckBox = (270, 231)
# 1232 x to check
# 431 lowest point to check
def restartGame():
pyautogui.click(Coordinates.replayBtn)
... | null | dinobot.py | dinobot.py | py | 1,627 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pyautogui.click",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pyautogui.keyDown",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pyautogui.keyUp",
"l... |
211880163 | import importlib
import os
import sys
import typing as t
from decimal import Decimal
from functools import wraps
from dpath.util import get
from yaml import dump as dump_yaml
SHRED_DATA_FIELD_NAMES = (
'password',
'secret',
'pass',
'pwd',
'key',
'token',
'auth',
'cred',
)
def shred(k... | null | django_docker_helpers/utils.py | utils.py | py | 7,366 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "importlib.import_module",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "dpath.util.get",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "typing.Dict",
"line_number": 81,
"usage_type": "attribute"
},
{
"api_name": "typing.Tuple"... |
161834532 | # Use OpenCL To Add Two Random Arrays
import pyopencl as cl # Import the OpenCL GPU computing API
import numpy # Import Numpy number tools
context = cl.create_some_context() # Initialize the Context
queue = cl.CommandQueue(context) # Instantiate a Queue
a = numpy.random.rand(50000).astype(numpy.float32) # Creat... | null | 020_array_sum.py | 020_array_sum.py | py | 1,672 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pyopencl.create_some_context",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pyopencl.CommandQueue",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.random.rand",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "num... |
111753528 | #duckHacks 2019 Submission by Matthew De La Paz, Eugene Kozlakov, and David Carpenter
#Team Name: "Threat Level Onyx"
## Imports
from config import TOKEN
from googletrans import Translator
import googletrans
import ast
import discord
from discord.ext import commands
from discord.ext.commands import has_permissions
##... | null | main.py | main.py | py | 10,053 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "discord.ext.commands.Bot",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "googletrans.Translator",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "... |
608017954 | '''
Created on Oct 30, 2017
@author: matti
'''
import bclab
import logging
import time
import numpy as np
import base64
import threading
import sys
class StreamA(bclab.Producer, threading.Thread):
def __init__(self, logger, broker_address, broker_port, client_id, n_channels=50, rows_per_message=200, qos=1):
... | null | py/streama.py | streama.py | py | 2,245 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "bclab.Producer",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "threading.Thread",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "bclab.Producer.__init__",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "bcl... |
415897232 | import boto3
from json import loads, dumps
from boto3.dynamodb.conditions import Attr
def insert_policy(policy_name, policy_type, data_json):
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table("octopus_policy")
item = {"PolicyName": policy_name,
"Type": policy_type,
"Data... | null | src/lambda_manage_policy.py | lambda_manage_policy.py | py | 5,374 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "boto3.resource",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "boto3.resource",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "boto3.resource",
"line_nu... |
447032432 | import os
from discord_slash import SlashCommand
import discord
import keyFinder
from discord_slash.utils.manage_commands import create_option
import json
from urllib.request import Request, urlopen
import random
import InfoDataValues as IDV
try:
from dotenv import load_dotenv
load_dotenv(dotenv_path = os.path... | null | src/main.py | main.py | py | 6,268 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"l... |
239913287 | from django.conf.urls import url
from .views import *
urlpatterns = [
url(r'^profiles/$', index_view),
url(r'^login/$',login_view,name='login'),
url(r'^logout/$',logout_view,name='logout'),
url(r'^profiles/$',profiles_view,name='profiles'),
url(r'^my_profile/$',my_profile_view,name='my_profile'),
url(r'^regis... | null | users/urls.py | urls.py | py | 422 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.conf.urls.url",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.co... |
44090576 | from ursina import *
from ursina.prefabs.platformer_controller_2d import PlatformerController2d
app = Ursina()
window.title = 'Platformer'
window.color = color.gold
window.fullscreen = True
player = PlatformerController2d(
position = (-8, 0),
collider = 'box',
collision = True,
color... | null | urs/main.py | main.py | py | 1,318 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "ursina.prefabs.platformer_controller_2d.PlatformerController2d",
"line_number": 10,
"usage_type": "call"
}
] |
129547043 | import tkinter
from tkinter import *
from PIL import Image, ImageTk, ImageEnhance
def setupCanvas(imageName):
"Create canvas and load provided image"
try:
global im
im = Image.open(imageName)
canvas.image = ImageTk.PhotoImage(im)
canvas.create_image(0, 0, image=canvas.image, anchor="nw")
except:
print(... | null | ImageEditor.py | ImageEditor.py | py | 1,202 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "PIL.Image.open",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "PIL.ImageTk.PhotoImage",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "PIL.ImageTk",
"line... |
383830323 | # Copyright (c) ZenML GmbH 2021. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | null | examples/low_level_guide/chapter_4.py | chapter_4.py | py | 4,547 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "zenml.steps.base_step_config.BaseStepConfig",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "tensorflow.keras.datasets.mnist.load_data",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras",
"line_number": 43,
"usage_type":... |
117864208 | from nose.tools import set_trace, eq_
from . import DatabaseTest
from scripts import RedoOCLCForThreeMScript
from core.model import (
Identifier,
DataSource,
CoverageRecord,
)
class DummyCoverageProvider(object):
hit_count = 0
def ensure_coverage(self, identifier):
self.hit_count += 1
cla... | null | tests/test_scripts.py | test_scripts.py | py | 4,922 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "scripts.RedoOCLCForThreeMScript",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "core.model.DataSource.THREEM",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "core.model.DataSource",
"line_number": 23,
"usage_type": "name"
},
... |
10281447 | # flake8: noqa
from os import environ
from django.core.exceptions import ImproperlyConfigured
from bananas.url import database_conf_from_url
from .base import *
DATABASES = {
'default': database_conf_from_url(environ.get('DATABASE_URI'))
}
WWW_ROOT = environ.get('WWW_ROOT')
if not WWW_ROOT:
raise Improperl... | null | src/trak/settings/live.py | live.py | py | 734 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "bananas.url.database_conf_from_url",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "os.envir... |
62033484 | import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import yeast_dataset_folded as yemd
from solver_folded import Solver
import tensorflow as tf
tf.random.set_seed(1234)
import numpy as np
np.random.seed(1234)
import time
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-n", "--neighbors", dest... | null | oversampling/run_yeast_folded.py | run_yeast_folded.py | py | 2,548 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.environ",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.random.set_seed",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "tensorflow.random",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "numpy.... |
437687673 | # Copyright (c) 2015 VMware, 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 required by applicable law or agreed to in writi... | null | vmware_nsx/tests/unit/nsxlib/v3/test_qos_switching_profile.py | test_qos_switching_profile.py | py | 7,353 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "oslo_log.log.getLogger",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "oslo_log.log",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "vmware_nsx.tests.unit.nsxlib.v3.nsxlib_testcase.NsxClientTestCase",
"line_number": 29,
"usage_type": ... |
146552310 | #
# Python class file to manage archives
#
# Author: Kyle Manna < kmanna [at] fan [dot] tv >
import re
import os
import shutil
import logging
import tarfile
import subprocess
class ManifestArchive:
def __init__(self, filename):
self.filename = filename
base = os.path.basename(self.filename)
... | null | archives.py | archives.py | py | 1,987 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.basename",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.splitext",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_nu... |
646375541 | from django.db.models import Q
from django.test import Client, TestCase
from django.urls import reverse
from unittest.mock import Mock, patch
from app.models import Book
from app.tests.tests_utils import GoogleBookResponse
class TestViews(TestCase):
def setUp(self):
self.client = Client()
self.ad... | null | app/tests/test_views.py | test_views.py | py | 4,065 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.test.TestCase",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.test.Client",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.urls.reverse",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.ur... |
251873108 | import json
import utils.response as res
from config import dynamodb
def handler(event, context):
try:
# Get input from user.
path_parameters = event.get('pathParameters')
# Activity
activity = path_parameters.get('activity')
# Check if Null.
if (activity is None... | null | functions/activity.py | activity.py | py | 1,669 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "config.dynamodb.get_item",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "config.dynamodb",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "utils.response.build",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "utils.r... |
227745594 |
import argparse
import sys
import os
import pathlib
import tempfile
import numpy as np
import random
import torch
import torch.nn as nn
import torch.optim as optim
from pacman import init_env
from functools import reduce
from tqdm import tqdm
# Parse argument
parser = argparse.ArgumentParser(description='Training LS... | null | run_pacman.py | run_pacman.py | py | 22,417 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentDefaultsHelpFormatter",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "torch.device",
"line_number": 60,
"usage_type": "call"
},
{
"... |
596695232 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
"""
About: SF program for SFC gap time measurements
Email: xianglinks@gmail.com
"""
import binascii
import logging
import multiprocessing, threading
import socket
import struct
import sys
import time
import kodo
import json
from config import SRC_MAC, ... | null | sfc-ostack/demo/sfp/gap_sf_nc.py | gap_sf_nc.py | py | 22,269 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "binascii.unhexlify",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "config.SRC_MAC.replace",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "config.SRC_MAC",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "binascii.unh... |
453209211 | from django.shortcuts import render
from .escenas_youtube import escenas as escenas_youtube
from pulp.settings import STATIC_DIR
import os
from django.http import HttpResponse
from PIL import Image
n = len(escenas_youtube)
escenas = {
'col1': escenas_youtube[:round(n/3)],
'col2': escenas_youtube[round(n/3):rou... | null | website/views.py | views.py | py | 2,187 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "escenas_youtube.escenas",
"line_number": 8,
"usage_type": "argument"
},
{
"api_name": "escenas_youtube.escenas",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "escenas_youtube.escenas",
"line_number": 11,
"usage_type": "name"
},
{
"api_na... |
46425629 | # -*- coding: utf-8 -*-
"""Reads logs from a BigQuery table."""
import tempfile
from typing import Optional
from google.auth import exceptions as google_auth_exceptions
from google.cloud import bigquery # type: ignore
import google.cloud.exceptions
from dftimewolf.lib import module
from dftimewolf.lib.containers impo... | null | dftimewolf/lib/collectors/bigquery.py | bigquery.py | py | 2,737 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "dftimewolf.lib.module.BaseModule",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "dftimewolf.lib.module",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "dftimewolf.lib.state.DFTimewolfState",
"line_number": 20,
"usage_type": "name... |
300466291 | import cv2
import numpy as np
img = cv2.imread('images/gshock.jpg')
lap = cv2.Laplacian(img, cv2.CV_64F)
sobelx = cv2.Sobel(img, cv2.CV_64F, 1, 0, ksize=5)
sobely = cv2.Sobel(img, cv2.CV_64F, 0, 1, ksize=5)
edge = cv2.Canny(img, 100, 200)
cv2.imshow('ori', img)
cv2.imshow('lap', lap)
cv2.imshow('sx', sobelx)
cv2.im... | null | CV/opencv/edge.py | edge.py | py | 402 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.imread",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.Laplacian",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.CV_64F",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "cv2.Sobel",
"line_number": ... |
259982956 | from bottle import route,run,template,static_file
from markdown_converter import MarkdownConverter
from env import *
import posixpath
converter = MarkdownConverter()
@route('/<resource>')
def gfmize(resource):
html_file_name = markdown_root + resource
if (posixpath.splitext(resource)[1] == '.md'):
htm... | null | markdownserver/__init__.py | __init__.py | py | 537 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "markdown_converter.MarkdownConverter",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "posixpath.splitext",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "bottle.static_file",
"line_number": 13,
"usage_type": "call"
},
{
"api_nam... |
229022069 | import cv2
import numpy as np
import numba
from numba import cuda
from pypylon import pylon
import time
import os
KEYS = [ 'UL','UR', 'DL', 'DR']
#_______________________________________________________________________________________________________________________________________________
# ... | null | profilemeter_alpha/archive codes/perspective_calbration.py | perspective_calbration.py | py | 20,808 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pypylon.pylon.TlFactory.GetInstance",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pypylon.pylon.TlFactory",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "pypylon.pylon",
"line_number": 17,
"usage_type": "name"
},
{
"ap... |
333170670 | import config
import mysql.connector
import redis
import requests
import time
from flask import Flask, request, session, jsonify, redirect, abort
from flask_cors import CORS
app = Flask(__name__)
app.config['SECRET_KEY'] = config.SECRET_KEY
app.config['DEBUG'] = False
#CORS(app, supports_credentials=True)
r = redi... | null | backend/app.py | app.py | py | 4,316 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "config.SECRET_KEY",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "redis.Redis",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "config.redis",
"li... |
109846729 | import os
import json
import discord
ADMINS = {}
class EcosystemBots:
FullyAutomatedNutcracker = "FAN_"
def load_creds(is_debug, bot: str):
with open('config/creds.json') as fp:
creds = json.load(fp)
return creds[bot + "BETA_TOKEN"] if is_debug else creds[bot + "TOKEN"]
def load_admins()... | null | src/utils/common.py | common.py | py | 1,582 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "json.load",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "discord.User",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_nu... |
627716920 | # -*- coding: utf-8 -*-
# #############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | null | addons/comum/geral.py | geral.py | py | 41,282 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "openerp.osv.osv.except_osv",
"line_number": 101,
"usage_type": "call"
},
{
"api_name": "openerp.osv.osv",
"line_number": 101,
"usage_type": "name"
},
{
"api_name": "openerp.tools.translate._",
"line_number": 101,
"usage_type": "call"
},
{
"api_name"... |
166803375 | from docutils import nodes
from os.path import sep
def rcparam_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
rendered = nodes.Text('rcParams["{}"]'.format(text))
source = inliner.document.attributes['source'].replace(sep, '/')
rel_source = source.split('/doc/', 1)[1]
levels = r... | null | extraPackages/matplotlib-3.0.2/doc/sphinxext/custom_roles.py | custom_roles.py | py | 678 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "docutils.nodes.Text",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "docutils.nodes",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "os.path.sep",
"line_number": 8,
"usage_type": "argument"
},
{
"api_name": "docutils.nodes.refere... |
456176711 | #Author : Isanur Sardar
import requests
import csv
st_code = input('Write the station code with inverted comma')
url = 'http://emis.wbpcb.gov.in/airquality/JSP/aq/fetch_val_ajax.jsp'
myobj = {'stn_code': st_code,
'type': 'date'}
x = requests.post(url, data = myobj)
da = eval(x.text)
main = []
def boxx(x):
... | null | Air-Quality_Data_Crunching/main.py | main.py | py | 2,569 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.post",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 43,
"usage_type": "call"
}
] |
174160712 | # shows a user's playlists (need to be authenticated via oauth)
import pprint
import sys
import os
import subprocess
import datetime
import time
import spotipy
import spotipy.util as util
#from requests.exceptions import ConnectionError
username = "ADD YOUR USERNAME HERE"
FreshNewShit = "ADD ID OF YOUR PLAYLIST HERE"... | null | newSongs.py | newSongs.py | py | 3,914 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.argv",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "datetime.dateti... |
514509955 | from enum import Enum
from abc import ABC
from abc import abstractclassmethod
import numpy as np
class OPTION_TYPE(Enum):
CALL_OPTION = 'call'
PUT_OPTION = 'put'
class OptionPricingModel(ABC):
"""Abstract class defining interface for option pricing models."""
def price(self, option_type, *args, **... | null | options/models/base.py | base.py | py | 1,688 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "enum.Enum",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "abc.ABC",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "abc.abstractclassmethod",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "numpy.exp",
"line_number... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.