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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
41944513582 | # You are free to use, modify, copy, distribute the code.
# Please give a clap on medium, star on github, or share the article if you
# like.
# Created by Jonas, github.com/jkoendev
import time
import numpy as np
from matplotlib import pyplot as plt
def dpc_draw(tdata, X, x_min, x_max, p):
x0 = X[:,1];
# this ... | jkoendev/double-pendulum-on-cart | python/dpc_draw.py | dpc_draw.py | py | 2,238 | python | en | code | 11 | github-code | 97 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.show",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "m... |
36173212688 | import pymongo
import kafka
import json
import logging
class MongoConnection:
def __init__(self, mongo_server, mongo_port, mongo_db):
connection = pymongo.MongoClient(
mongo_server,
mongo_port,
)
self.db = connection[mongo_db]
def iterate_by_chunks(self,
... | longtruongv/BigData | kafka/mongo_source_kafka.py | mongo_source_kafka.py | py | 2,564 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "kafka.KafkaProducer",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "logging.info",
... |
25539416727 | from django.contrib import admin
from django.urls import path
from . import views
urlpatterns = [
path("", views.home, name = "core-home"),
path("about/", views.about, name = "core-about"),
path("item/", views.item_list, name = "item"),
path("<int:pk>/",views.detail, name="detail"),
path("detail/"... | ramirezj129/django_project | core/urls.py | urls.py | py | 650 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
10338708288 | import os
import sys
import json
from factories.log import create_logger
log = create_logger('users-api-configuration')
class Config(object):
DEBUG = False
VCAP_SERVICES = json.loads(os.getenv('VCAP_SERVICES', '{}'))
REDIS_SERVICE_NAME = os.getenv('REDIS_SERVICE_NAME', 'redis')
REDIS_HOST = os.gete... | hsdp/api-gateway-demo | product-api/application/config.py | config.py | py | 3,168 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "factories.log.create_logger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line... |
25802189426 | import os
from NN_Models import Reconnet as rnet
from NN_Models import Model_Manager as modelManager
from util import Image_Excel_Wrapper as wrapper
from util import Image_Processor as imp
#from optimization import Genome_Optimizer as gOpt
import numpy as np
def create_excel_files():
workingDirectory = ""
... | AechPro/Machine-Learning | Partners Healthcare/2016 Breast Cancer/dev/ReconNet/Top.py | Top.py | py | 4,757 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "os.walk",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "util.Image_Excel_Wrapper.cell_images_to_excel",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "util.Im... |
14418152463 | from datetime import date
class Goldfish:
def __init__(self , name , species):
self.name= name,
self.species= species,
self.date_added= date.today()
self.swimming= True
self.pond= True
goldie= Goldfish("Goldie", "fish")
# goldfishclass= Goldfish()
# print(goldfishclass.nam... | shanes96/critters_croquettes | Pond_Animals/goldfish.py | goldfish.py | py | 322 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "datetime.date.today",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 7,
"usage_type": "name"
}
] |
26005418875 | import discord
import yaml
from discord.ext import commands, tasks
config = yaml.safe_load(open("config/statusChangerConfig.yml", 'r', encoding="utf-8"))
interval = config.get("change-interval")
class StatusUpdater(commands.Cog):
"""Shows multiple different data in the bots status"""
def __init__(self, bot)... | Altoyda/WW7 | modules/statusChanger.py | statusChanger.py | py | 1,271 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "yaml.safe_load",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands.Cog",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "disc... |
30721828240 | #!/usr/bin/env ipython
"""
Script for BOT flat pairs (linearity and full-well) analysis.
"""
def flat_pairs_jh_task(det_name):
"""JH version of single sensor execution of the flat pairs task."""
import os
import glob
import siteUtils
import json
from bot_eo_analyses import make_file_prefix, glob... | lsst-camera-dh/EO-analysis-jobs | harnessed_jobs/flat_pairs_BOT/v0/flat_pairs_jh_task.py | flat_pairs_jh_task.py | py | 1,972 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "siteUtils.getRunNumber",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "bot_eo_analyses.make_file_prefix",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "siteUtils.getProcessName",
"line_number": 17,
"usage_type": "call"
},
{
"... |
30844831147 | import numpy as np
import re
from bucoffea.helpers import dasgowrapper, bucoffea_path
import os
import yaml
import socket
import subprocess
from collections import defaultdict
pjoin = os.path.join
def short_name(dataset):
_, name, conditions, _ = dataset.split("/")
# Remove useless info
name = name.replac... | bu-cms/bucoffea | bucoffea/execute/dataset_definitions.py | dataset_definitions.py | py | 6,184 | python | en | code | 8 | github-code | 97 | [
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "re.match",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 40,
"... |
109100922 | import pandas
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestRegressor
from sklearn.metrics import mean_squared_error
def createModels():
data = pandas.read_excel('data.xlsx')
xLabels = list(data.iloc[:, 0])
yLabels = list(data.iloc[:, 1])
features = data... | angelowilliams/reddit-user-politics | model.py | model.py | py | 954 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "pandas.read_excel",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sklearn.ensemble.RandomForestRegressor",
"line_number": 16,
"usage_type": "call... |
1594761014 | from datetime import datetime
from wanikani_api.models import Subject, Meaning, AuxiliaryMeaning, Reading
from typing import Callable, Iterator, List, Optional, Dict
from dataclasses import dataclass, asdict
import httpx
from httpx import Response
import urllib.parse
import re
import html
import glob
from os.path impor... | cemsity/wanikani_to_anki | wanikani_to_anki/Card.py | Card.py | py | 15,828 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "glob.glob",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "typing.Optional",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_num... |
32181992517 | # @Time : 2019/3/25 3:26 PM
# @Author : Kaishun Zhang
# @File : rnn-tensorflow.py
# @Function: 主要是RNN.ipynb进行一个对比
from keras.layers import Dense,Activation,SimpleRNN
from keras.models import Sequential
from keras.optimizers import Adam,SGD
from time import time
from tensorflow.examples.tutorials.mnist import inpu... | ICDI0906/MachineLearning | DL/RNN/rnn-tensorflow.py | rnn-tensorflow.py | py | 1,373 | python | en | code | 17 | github-code | 97 | [
{
"api_name": "tensorflow.examples.tutorials.mnist.input_data.read_data_sets",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tensorflow.examples.tutorials.mnist.input_data",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "keras.models.Sequential",
"line_... |
35597531172 | import cv2
# initialize the video camera (use 0 for the default camera)
cap = cv2.VideoCapture(0)
# Define the codec and create VideoWriter object
fourcc = cv2.VideoWriter_fourcc(*'XVID')
out = cv2.VideoWriter('tradevid.mp4', fourcc, 30.0, (640, 480))
while(True):
# Capture frame-by-frame
ret, frame = cap.re... | adithg/Whatdadogdoin | quicktest.py | quicktest.py | py | 650 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.VideoWriter_fourcc",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.VideoWriter",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
... |
32597575918 | #!/usr/bin/python3
import argparse
from lxml import etree
from pprint import pprint
#====================================
#====================================
if __name__=='__main__':
parser=argparse.ArgumentParser(description='XML Parser')
parser.add_argument('-menu','--menu',dest='menu',action='store_true',d... | phani150/important | python/xml_read.py | xml_read.py | py | 1,379 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "lxml.etree.parse",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "lxml.etree.xpath",... |
35043278186 | from django.contrib.auth.forms import PasswordResetForm, UserCreationForm
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django import forms
from django.utils.translation import ugettext_lazy as _
from stepping_out.auth.tokens import REGISTRATION_TIMEOUT_DAYS
from st... | melinath/stepping_out | auth/forms.py | forms.py | py | 3,484 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "django.contrib.auth.forms.PasswordResetForm",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.models.User.objects.filter",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.models.User.objects",
"line_nu... |
33897940827 | import numpy as np
import matplotlib.pyplot as plt
import os
import sys
from os import listdir
from os.path import isfile, join
PATH_TO_PROJECT = os.path.abspath(
os.path.join(os.path.dirname(__file__), '..'))
sys.path.append(PATH_TO_PROJECT)
def plot_n_examples(data_path, subset_name="training", n_examples=3, pl... | ReyesDeJong/Recurrent_parameter_estimation | visualizations/data_visual.py | data_visual.py | py | 2,527 | python | en | code | null | github-code | 97 | [
{
"api_name": "os.path.abspath",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9... |
31000245896 | from itertools import permutations
t = int(input())
for _ in range(t):
n = int(input())
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
neighbors = [[] for _ in range(n)]
nums = [_ for _ in range(1, len(a) + 1)]
p = permutations(nums, 2)
for u, v in p:
i... | lunalovecode/training-problems | unfinished-problems/strong_vertices.py | strong_vertices.py | py | 640 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "itertools.permutations",
"line_number": 11,
"usage_type": "call"
}
] |
11719665553 | from django.contrib import admin
from django.utils.html import format_html
from .models import TagAssociation
from .app_settings import mumble_active
class TagAssociationAdmin(admin.ModelAdmin):
list_display = ['tag', 'enabled', '_groups']
def _list_2_html_w_tooltips(self, my_items: list, max_items: int) -> ... | Solar-Helix-Independent-Transport/allianceauth-mumble-tagger | mumbletagger/admin.py | admin.py | py | 1,250 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.utils.html.format_html",
"line_number": 20,
"usage_type": "call"
},
{
... |
39882975627 | # code for sentiment analysis
from textblob import TextBlob
from textblob.sentiments import NaiveBayesAnalyzer
def getSentiments(text):
blob = TextBlob(text, analyzer=NaiveBayesAnalyzer())
print(blob.sentiment)
training_data = [('it is good 1', 'pos'), ('it is good 3', 'pos'),
('it is good... | maxazure/IT819 | code/naive-bayes/bayes-test.py | bayes-test.py | py | 528 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "textblob.TextBlob",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "textblob.sentiments.NaiveBayesAnalyzer",
"line_number": 8,
"usage_type": "call"
}
] |
71967561279 | import pathlib
import signal
import sqlite3
from datetime import datetime, timedelta, date
import pandas as pd
from rx.subject import Subject
from data_fetcher import DataFetcher
class BusinessHours:
def __init__(self, start_hour, end_hour):
self.start_hour = start_hour
self.end_hour = end_hour
... | maeglin89273/cmcsc-venue-activity-analysis-dashboard | data_service.py | data_service.py | py | 5,960 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "datetime.datetime.now",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "datetim... |
44256821446 | import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # to give away the GPU warning in TF
from pandas import read_csv
from matplotlib import pyplot as plt
import numpy as np
import copy
my_path = os.path.dirname(os.path.realpath(__file__)) #gets current path of the file
filename = my_path + "/data.csv" #gets path ... | graylevel255/Deep_Learning | Assign-2_AutoEncoders_and_RBM/Denoise_AutoEncoder/generate_noise.py | generate_noise.py | py | 2,396 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.environ",
"line_number": 2,
"usage_type": "attribute"
},
{
"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.realpath",
"lin... |
38333097160 | import tensorflow as tf
import click
import cv2
import numpy as np
import importlib
import time
from estimation.config import get_default_configuration
from estimation.coordinates import get_coordinates
from estimation.connections import get_connections
from estimation.estimators import estimate
from estimation.render... | michalfaber/tensorflow_Realtime_Multi-Person_Pose_Estimation | demo_video.py | demo_video.py | py | 3,827 | python | en | code | 210 | github-code | 97 | [
{
"api_name": "numpy.newaxis",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.convert_to_tensor",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "estimation.config.get_default_configuration",
"line_number": 23,
"usage_type": "call"
}... |
11473075901 | import numpy as np
import torch
import math
color_dict = {0: torch.tensor([0, 0, 0]),
1: torch.tensor([0, 125, 0]),
2: torch.tensor([150, 80, 0]),
3: torch.tensor([255, 255, 0]),
4: torch.tensor([100, 100, 100]),
5: torch.tensor([0, 255, 0]),
... | lacykaltgr/agriculture-image-processing | satellite_image_segmentation/src/utils.py | utils.py | py | 3,450 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "torch.tensor",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "torch.tensor",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.tensor",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.tensor",
"line_number":... |
26907421689 | from cerberus import Validator
from cerberus import TypeDefinition
class ParserModelType:
"""Defines a type for parser classes."""
name = None
is_model = False
func = None
def __init__(self, name):
self.name = name
if name.endswith('ModelElement'):
self.is_model = Tru... | sebastinas/logdata-anomaly-miner | source/root/usr/lib/logdata-anomaly-miner/aminer/ConfigValidator.py | ConfigValidator.py | py | 3,336 | python | en | code | null | github-code | 97 | [
{
"api_name": "cerberus.TypeDefinition",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "cerberus.TypeDefinition",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "cerberus.TypeDefinition",
"line_number": 56,
"usage_type": "call"
},
{
"api_name"... |
27261611216 | import re
import my_Selenium
from pyecharts.globals import ThemeType
from pyecharts import options as opts
from pyecharts.charts import *
import pandas as pd
def City(city):
#判断数据是否是需要统计的城市
list = ['河北', '山西', '辽宁', '吉林', '黑龙江', '江苏', '浙江', '安徽', '福建', '江西', '山东', '河南', '湖北', '湖南', '广东', '海南',
... | GoldenLandForever/032002539 | my_homework.py | my_homework.py | py | 4,890 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pandas.DataFrame",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pyecharts.options.InitOpts",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pyecharts.options",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "pyechar... |
35320783970 | from argparse import _VersionAction
from pstats import Stats
from django.shortcuts import render
from django.http import HttpResponse
from django.http.response import JsonResponse
from rest_framework.parsers import JSONParser
from rest_framework import status
from shinobiAPI.models import Nation
from shinobiAPI.seri... | kumarisonika/django-ninja-world | shinobiAPI/views/views_nation.py | views_nation.py | py | 2,324 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.http.HttpResponse",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "shinobiAPI.models.Nation.objects.all",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "shinobiAPI.models.Nation.objects",
"line_number": 22,
"usage_type": "attrib... |
22392428811 | # --------------------------------------------------------------------------------------------------
# Logging: add a logging file to code
# - prints out to console or file
# - helps to trace the code execution
# - logging level: DEBUG / INFO / WARNING / ERROR / CRITICAL
# - name: logging module gives it to the... | AmrGaafer/PythonLearning | 5.Modules/08.looging.py | 08.looging.py | py | 1,506 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "os.system",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
... |
26745521266 | # coding; utf-8
import logging
log = logging.getLogger(__name__)
import sqlalchemy
from sqlalchemy.sql import and_, or_, desc
from sqlalchemy.sql.expression import func
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.orm.relationships import RelationshipProperty
from sqlalchemy.orm.properties import Col... | pthorn/eor-rest | eor_rest/model.py | model.py | py | 5,971 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "config.config.sqlalchemy_session",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "config.config",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "sqlal... |
43578739698 | """
Given an array A of N elements. Find the majority element in the array.
A majority element in an array A of size N is an element that appears more
than N/2 times in the array.
Input:
The first line of the input contains T denoting the number of testcases.
The first line of the test case w... | jasonminhvuong/GeeksForGeeks | Arrays/majority_element.py | majority_element.py | py | 1,148 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "collections.Counter",
"line_number": 22,
"usage_type": "call"
}
] |
21781360347 | #!/usr/bin/python3
# Autor: Mateusz Adamowski
# Email: mateusz.adamowski@nlo.edu.pl
import sqlite3
import urllib.request
import os
URL = "https://github.com/mateusza2/2020-nlo-inf/raw/master/2021-05-20-sprawdzian/kandydaci.db"
BAZA = "kandydaci.db"
if not os.path.exists(BAZA):
print(f"Pobieram {URL}...")
ur... | nlo-edu-pl/2020-nlo-inf | 2021-05-20-sprawdzian/przyklad1.py | przyklad1.py | py | 1,301 | python | pl | code | 1 | github-code | 97 | [
{
"api_name": "os.path.exists",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "urllib.request.request.urlretrieve",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "urllib... |
27225013769 | # import required modules
from delivery_schedule import delivery_schedule
import math
from typing import List, Tuple
from tabulate import tabulate
# define function to extract stops from a schedule for a given day
def get_stops_from_schedule(schedule: dict, day: str) -> List[tuple]:
stops = []
# loo... | AyrtonBrooke/VanDelivery | main.py | main.py | py | 7,709 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "typing.List",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "math.sqrt",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "typing.Tuple",
"line_number": 65,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 65... |
11276990997 | import copy
import sys
from pprint import pprint
from django.apps import apps as django_apps
from django.core.exceptions import ObjectDoesNotExist
from django.utils.module_loading import import_module, module_has_submodule
class RegistryNotLoaded(Exception):
pass
class AlreadyRegisteredVisitSchedule(Exception)... | frdrckaman/edcs | edcs_visit_schedule/site_visit_schedules.py | site_visit_schedules.py | py | 8,883 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "pprint.pprint",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "django.core.exceptions.ObjectDoesNotExist",
"line_number": 197,
"usage_type": "name"
},
{
"api_name": "sys.stdout.write",
"line_number": 212,
"usage_type": "call"
},
{
"api_na... |
29930513589 | import unittest
from unittest import mock
from parameterFileParser import parse_pairwise_alignments, parse_param_file
from dotalignerWrapper import DotAlignerWrapper, DotAlignerGrouped
from collections import OrderedDict
class TestPairListParameters(unittest.TestCase):
def setUp(self):
self.file_conten... | xiuchengquek/DotalignerFurtherOptimization | src/dotalignerWrapper/test_parameterFileParser.py | test_parameterFileParser.py | py | 6,577 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "unittest.TestCase",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "unittest.mock.mock_open",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "unittest.mock",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "uni... |
73474258558 | import pandas as pd
import requests
from selenium import webdriver
import time
from selenium.webdriver.common.by import By
from bs4 import BeautifulSoup
from selenium.webdriver.firefox.options import Options
path = '파일 위치'
df = pd.read_csv(f'{path}/youtube_name.csv')
options = Options()
options.set_preference('int... | woals182/fancm | youtube/youtube_script/youtube_video_id.py | youtube_video_id.py | py | 1,533 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pandas.read_csv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.firefox.options.Options",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Firefox",
"line_number": 20,
"usage_type": "call"
},
{
... |
32711015950 | """Timeplus target sink class, which handles writing streams."""
from __future__ import annotations
from singer_sdk import PluginBase
from singer_sdk.sinks import BatchSink
from timeplus import Stream, Environment
import json
import datetime
class TimeplusSink(BatchSink):
"""Timeplus target sink class."""
... | timeplus-io/target-timeplus | target_timeplus/sinks.py | sinks.py | py | 4,229 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "singer_sdk.sinks.BatchSink",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "singer_sdk.PluginBase",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "timeplus.Environment",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": ... |
22024727372 | from shesha.supervisor.genericSupervisor import GenericSupervisor
from shesha.supervisor.components import AtmosCompass, DmCompass, RtcCompass, TargetCompass, TelescopeCompass, WfsCompass, CoronagraphCompass
from shesha.supervisor.optimizers import ModalBasis, Calibration, ModalGains
import numpy as np
import time
imp... | ANR-COMPASS/shesha | shesha/supervisor/compassSupervisor.py | compassSupervisor.py | py | 21,702 | python | en | code | 12 | github-code | 97 | [
{
"api_name": "shesha.supervisor.genericSupervisor.GenericSupervisor",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "shesha.supervisor.genericSupervisor.GenericSupervisor.__init__",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "shesha.supervisor.genericSup... |
41657560476 | import sqlite3
from SQLdatabase import SQLdatabase
import re
class Database:
def __init__(self):
self.years = list() # list for years
self.median = list() # list for median
self.upper = list()
self.lower = list()
self.SQ = SQLdatabase()
self.SQ.Table()
sel... | sora5801/Lab_1_v1.0 | test2.py | test2.py | py | 1,651 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "SQLdatabase.SQLdatabase",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "sqlite3.Error",
... |
9161354414 | from django.conf import settings
from rest_framework import serializers
from groups.models import Group
from userProfile.models import UserProfile
from users.serializers import ProfileSearchSerializer
class GroupSerializer(serializers.ModelSerializer):
class Meta:
model = Group
fields = '__all__... | Anjal132/newMeetingSpace | groups/serializers.py | serializers.py | py | 1,539 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "groups.models.Group",
"line_number": 12,
"usage_type": "name"
... |
3933013932 | '''
Until the definition of ``Client``, direct import from
https://github.com/dstndstn/astrometry.net/blob/master/net/client/client.py
(version: 2018-07-05 commit #26668f3)
with dropping support for python < 3.6.
Some tweak made in the definition of ``query_nova``.
'''
import os
import time
import base64
from urllib.... | ysBach/ysfitsutilpy | ysfitsutilpy/astrometry.py | astrometry.py | py | 22,496 | python | en | code | 5 | github-code | 97 | [
{
"api_name": "json.loads",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "email.mime.base.MIMEBase",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "email.mime.applic... |
23558438938 | import json
from typing import List, Optional
from fastapi import Depends, Form, HTTPException, Request, Response
from fastapi.responses import HTMLResponse, RedirectResponse
from fastapi.security import OAuth2PasswordRequestForm
from pydantic import BaseModel
from starlette.status import HTTP_302_FOUND
from easyauth... | codemation/easyauth | easyauth/api.py | api.py | py | 23,829 | python | en | code | 499 | github-code | 97 | [
{
"api_name": "pydantic.BaseModel",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "easyauth.models.Users.get",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "easyauth.models.Users",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "ea... |
44151900684 | # my solution
from collections import defaultdict
def solution(clothes):
table = defaultdict(list)
for cloth, name in clothes:
table[name].append(cloth)
n = len(table)
# 옷 종류의 개수. 최소1개부터 최대n개까지 착용가능
from itertools import combinations
res = 0
for i in range(1, n + 1):
comb ... | jiukeem/python_algorithm | 04_프로그래머스/lev2_위장.py | lev2_위장.py | py | 1,314 | python | ko | code | 25 | github-code | 97 | [
{
"api_name": "collections.defaultdict",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "itertools.combinations",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": ... |
32298851421 | import os
os.environ['R_HOME'] = 'C:\Program Files\R\R-4.2.0'
import numpy as np
from rpy2.robjects import r
import rpy2.robjects.numpy2ri
from rpy2 import robjects;
from rpy2.robjects.packages import importr
MARS = importr('earth');
import re;
rpy2.robjects.numpy2ri.activate()
def REarth(X,Y,M=1):
row,col=X.shape;... | K4RI/mirrors-digitbio-2022 | codes_sources/globe_v20220213/RFunctions.py | RFunctions.py | py | 3,381 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.environ",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "rpy2.robjects.packages.importr",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "rpy2.robjects.robjects.numpy2ri.activate",
"line_number": 13,
"usage_type": "call"
},
{... |
4622232281 | from datetime import datetime, timezone, timedelta
import numpy as np
import os
import io
import re
import math
import h5py
import hdf5plugin
import netCDF4
import tarfile
from scipy.interpolate import RectBivariateSpline
import psycopg
import subprocess
import urllib.request, urllib.error
import sys
from flask impo... | arodland/prop | ipe/ipe.py | ipe.py | py | 7,297 | python | en | code | 14 | github-code | 97 | [
{
"api_name": "datetime.timedelta",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "urllib.request.request.urlopen",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "... |
74468351358 | from bs4 import BeautifulSoup
from urllib.parse import urljoin
import time
import requests
links_list = ['rahvaraamat.ee/search/productList/en?offset=0&limit=10&searchTerm={}', 'bookvoed.ee/search?q={}&count=50#page-1', 'mnogoknig.ee/search/{}']
def createURL(keywordsList,urlExample): # returns a serach url with user... | jevgeni17/py-tools | priceChecker/checker.py | checker.py | py | 2,761 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "urllib.parse.urljoin",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "requests.get",
... |
21370134700 | from rest_framework.decorators import api_view
from rest_framework.response import Response
from designation.models import DesignationModel
from response import Response as ResponseData
from rest_framework import status
from subscription.models import SubscriptionModel
from subscription.serializers import AddSubscripti... | anirudh702/commdem_warriors_django | subscription/views.py | views.py | py | 7,810 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "subscription.serializers.AddSubscriptionSerializer",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "designation.models.DesignationModel.objects.using",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "designation.models.DesignationModel.objects"... |
5130230788 | import time
from telethon.errors import rpcbaseerrors
from userbot import LOGGER, LOGGER_GROUP, HELPER
from userbot.events import register
@register(outgoing=True, pattern="^.purge$")
async def fastpurger(purg):
""" For .purge command, purge all messages starting from the reply. """
if not purg.text[0].isal... | shivamkchoudhary/Maximus | userbot/modules/purge.py | purge.py | py | 5,188 | python | en | code | 6 | github-code | 97 | [
{
"api_name": "userbot.LOGGER",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "userbot.LOGGER_GROUP",
"line_number": 36,
"usage_type": "argument"
},
{
"api_name": "time.sleep",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "userbot.events.reg... |
34629233433 | # Importing Libraries
import numpy as np
import cv2
# Trained Classifier
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
eye_cascade = cv2.CascadeClassifier('haarcascade_eye_tree_eyeglasses.xml')
cap = cv2.VideoCapture('test.mp4')
while cap.isOpened():
ret, img = cap.read()
if re... | mclods/gods-eye | 25. face_detection/face_detection_eye.py | face_detection_eye.py | py | 980 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "cv2.CascadeClassifier",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.CascadeClassifier",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColo... |
9009643842 | import logging
import os
import re
import time
from datetime import datetime as dt
from xml.etree import ElementTree as ET
from s3_mysql_backup import DIR_CREATE_TIME_FORMAT, s3_bucket, mkdirs, TIMESTAMP_FORMAT, YMD_FORMAT
from tabulate import tabulate
from rrg.lib import archive
monthy_statement_ym_header = '%s/%s ... | fogcitymarathoner/sherees-commissions | rrg/xml_helpers.py | xml_helpers.py | py | 20,596 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.walk",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.strptime",
"l... |
20635969103 | import time
import json
import numpy as np
import csv
from utils import run_cmd
from params import WSK_CLI, COUCH_LINK
def invoke(function_id, param):
try:
cmd = '{} action invoke {} -b {} | grep -v "ok:"'.format(WSK_CLI, function_id, param)
response = str(run_cmd(cmd))
doc = json.loads(re... | IntelliSys-Lab/Freyr-openwhisk | agent/characterize_workloads.py | characterize_workloads.py | py | 4,697 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "params.WSK_CLI",
"line_number": 11,
"usage_type": "argument"
},
{
"api_name": "utils.run_cmd",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_nu... |
27995623495 | import pandas as pd
import torch
import torch.nn.functional as F
import numpy as np
import Func
import NetDefine
import matplotlib.pyplot as plt
if __name__ == '__main__':
df = pd.read_csv(r'D:\codeProject\PycharmProject\DNN_Infection\Dataset\test.csv',
names=['preg', 'plas', 'pres... | JasonK819/DNN_Infection | main.py | main.py | py | 1,739 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pandas.read_csv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "Func.Normalization",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "Func.Normalization",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "Func.Normalizat... |
27723083410 | """gateway_server URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
C... | harihasr/DigitalTwin | gateway_server/urls.py | urls.py | py | 2,786 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "rest_framework_swagger.views.get_swagger_view",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 27,
"usage_type": "attribut... |
40058089167 | import numpy as np
import torch
import torch.nn as nn
from waldo import WaldoDataset
from torch.utils.data.dataloader import DataLoader
from tqdm import tqdm, trange
from matplotlib import pyplot as plt
def patchify(images, n_patches):
# Batch, Color Channels, Height, Width
n, c, h, w = images.shape
... | vincent-uden/tif-360-vision-transformer | src/vit.py | vit.py | py | 7,177 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "torch.zeros",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.ones",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.sin",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line_number": 36,
... |
71034944640 | import os
import sys
import argparse
import numpy as np
import torch
import torch.nn as nn
import torch.multiprocessing as multiprocessing
import utils.Constant as CONSTANT
from collections import OrderedDict
from dataloader import Dataset
from evaluation import Evaluator
from utils import Config, Logger, ResultTable... | eunseongc/SpaDE | eval.py | eval.py | py | 4,024 | python | en | code | 18 | github-code | 97 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "utils.Config",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 57,
"usage_type": "attribute"
},
{
"api_name": "torch.device",
... |
32508746821 | #Image to pencil sketch
#Package installed: py-opencv
import cv2
image = cv2.imread("Anisha.jpg")
gray_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
inverted = 255-gray_image
blur = cv2.GaussianBlur(inverted, (121, 121), 0)
inverted_blur = 255-blur
sketch = cv2.divide(gray_image, inverted_blur, scale=256.... | AnishaMohandass/Python_experiments | Image_to_pencil_sketch.py | Image_to_pencil_sketch.py | py | 365 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "cv2.imread",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "cv2.GaussianBlur",
"... |
2506802876 | import json
import logging
from datetime import date
from deepdiff import DeepDiff
from django import forms
from django.utils import timezone
from trade_tariff_reference.tariff.models import GeographicalAreas
from .models import Agreement, ExtendedQuota
from .utils import get_initial_quotas
logger = logging.getLo... | uktrade/trade-tariff-reference | trade_tariff_reference/schedule/forms.py | forms.py | py | 7,110 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.forms.ModelForm",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "django.for... |
74500454399 | import os
from selenium import webdriver
import time
def file_upload_test(link):
try:
browser = webdriver.Chrome()
browser.get(link)
find_by_name(browser, "firstname", "Ivan")
find_by_name(browser, "lastname", "Ivanov")
find_by_name(browser, "email", "my.mail@post.ru")
upload_dutton = browser.find_eleme... | VadimToptunov/python_stepik_selenium_course | selenium_course/chapter2/lesson2_step8.py | lesson2_step8.py | py | 882 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path.abspath... |
30177130107 | from flask import Flask, render_template, flash, redirect
from .forms import EmailForm
import os
from . import emailHunter
from . import emailProspect
from urllib.parse import urlparse
from flask import jsonify, request
app = Flask(__name__)
app.config.update(dict(
SECRET_KEY= os.environ.get('SECRET_KEY'),
WT... | Breadware-Marketing/email-finder-generator | application/main.py | main.py | py | 1,666 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_... |
2341246777 | """
Functions used to make the dispersion relation plot.
You can find an example usage at the end of this file.
"""
import lsqfit as lsf
import numpy as np
import gvar as gv
import matplotlib.pyplot as plt
from matplotlib.ticker import MultipleLocator
from liblattice.general.constants import *
from liblattice.genera... | Greyyy-HJC/lattice_analysis_template | liblattice/preprocess/dispersion.py | dispersion.py | py | 4,584 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "gvar.BufferDict",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "gvar.gvar",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "lsqfit.nonlinear_fit",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"lin... |
4580954275 | import sys
from sklearn.base import BaseEstimator, TransformerMixin
import sqlite3
import pandas as pd
import re
from sklearn.model_selection import train_test_split, GridSearchCV
from sklearn.pipeline import Pipeline, FeatureUnion
from sklearn.feature_extraction.text import CountVectorizer, TfidfTransformer
from skle... | hedeya1980/Disaster-Response-Pipeline-Project | models/train_classifier.py | train_classifier.py | py | 7,084 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "nltk.download",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "nltk.download",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pandas.read_sql",
"li... |
29275590051 | # Copyright © 2019 Province of British Columbia
#
# 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 la... | bcgov/EPIC.track | epictrack-api/src/api/schemas/request/event_template_request.py | event_template_request.py | py | 2,482 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "base.RequestBodyParameterSchema",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "marshmallow.fields.Str",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "marshmallow.fields",
"line_number": 23,
"usage_type": "name"
},
{
"api_nam... |
15436236797 | from requests import get
def download(url, file_name):
with open(file_name, "wb") as file:
response = get(url)
file.write(response.content)
if __name__ == '__main__':
url = "https://www.google.com/url?sa=i&url=https%3A%2F%2Fdullyshin.github.io%2F2018%2F08%2F30%2FHTML-imgLink%2F&psig=AOvVaw2Am9... | wjsehdlf77/06.ARDUINO | mqtt python/requests_ex02.py | requests_ex02.py | py | 460 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 5,
"usage_type": "call"
}
] |
17705152233 | #https://arato.inf.unideb.hu/szathmary.laszlo/pmwiki/index.php?n=Py3.20120910a
from enum import Enum
class Direction(Enum):
MELY_MGHK = 'aáoóuú'
MAGAS_MGHK = 'eéiíöőüű'
MAGAS = 1
MELY = 2
VEGYES = 3
SEMMILYEN = 4
def hangrend(s):
mely = 0
magas = 0
masssalhangzo =... | offJUSTME/Szkriptnyelvek2020 | 9/high_deep_enum.py | high_deep_enum.py | py | 1,720 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "enum.Enum",
"line_number": 5,
"usage_type": "name"
}
] |
15351733060 | #author: Riley Doyle
#date: 7/16/20
#file: calc_CO2_loss_kLa
#status: working
import numpy as np
import matplotlib.pyplot as plt
from calc_Ks import *
from calc_alphas import *
def calc_CO2_loss_kLa (pK1, pK2, Kh, alk, d, colormap, PCO2, pHin, pHend, delpH, kLain, kLaend, delkLa):
L = np.array(['-', '--', '-.', ... | rkd006/Carbonate-Chemistry-Model | Python files/calc_CO2_loss_kLa.py | calc_CO2_loss_kLa.py | py | 1,002 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "numpy.array",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number"... |
39034256335 | from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function
import io
import os
import attr
import click
click.disable_unicode_literals_warning = True
from license_expression import Licensing
import saneyaml
from licensedcode import cache
from licensedcode imp... | SmartsYoung/FenixscanX | scanengine/etc/scripts/buildrules.py | buildrules.py | py | 9,418 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "click.disable_unicode_literals_warning",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "attr.ib",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "attr.ib",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "attr.ib",... |
15788190939 | import sqlalchemy as sqlalchemy
from db.utils import generic_query
import pandas as pd
def create_model(model_name: str, col: str, table: str) -> str:
existing_models = list(get_defined_models()["MODEL_NAME"])
model_iteration = 1
while model_name + str(model_iteration) in existing_models:
model_i... | Corner-Squad-Wizards/jotb-2023-hackathon | src/processing/utils.py | utils.py | py | 2,316 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "db.utils.generic_query",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.exc",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "db.utils.generic_query",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "sql... |
21130296909 | import flask
from werkzeug.test import Client
from werkzeug.wrappers import Response
from opentelemetry import trace as trace_api
from opentelemetry.instrumentation.flask import FlaskInstrumentor
from opentelemetry.test.wsgitestutil import WsgiTestBase
# pylint: disable=import-error
from .base_test import Instrumenta... | open-telemetry/opentelemetry-python-contrib | instrumentation/opentelemetry-instrumentation-flask/tests/test_automatic.py | test_automatic.py | py | 2,950 | python | en | code | 527 | github-code | 97 | [
{
"api_name": "base_test.InstrumentationTest",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "opentelemetry.test.wsgitestutil.WsgiTestBase",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "opentelemetry.instrumentation.flask.FlaskInstrumentor",
"line_numb... |
3655354861 | from django.contrib import auth
from django.contrib.auth.decorators import login_required, user_passes_test
from django.contrib.auth.models import User
from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage
from django.shortcuts import render
from django.http import HttpResponseRedirect
from django.ur... | liu33333/mapProject | mapProjectApp/views.py | views.py | py | 7,047 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 53,
"usage_type": "call"
},
{
"api_name"... |
16374931090 | import unittest
from unittest import mock
from parameterized import parameterized
from common.legacy_api.exceptions import RequestApiError, NoSessionError, NotEnoughPointsError
import common.legacy_api.features.interactions as module
class TestInteractionsAPI(unittest.TestCase):
def setUp(self) -> None:
... | AceFire2014/backend-live-snapshot | common/tests/legacy_api/features/test_interactions.py | test_interactions.py | py | 5,659 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "unittest.TestCase",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "common.legacy_api.features.interactions.InteractionsAPI",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "common.legacy_api.features.interactions",
"line_number": 11,
... |
8235208985 | import random
import numpy as np
import nltk
from nltk import word_tokenize
import torch
# from transformers import get_linear_schedule_with_warmup
# Run function `preprocessing_for_bert` on the train set and the validation set
def preprocessing_for_bert(data, tokenizer):
"""Perform required preprocessing steps fo... | changhorang/text_classification | utils.py | utils.py | py | 2,656 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "torch.tensor",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "torch.tensor",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "nltk.word_tokenize",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "nltk.word_tokenize",
... |
31662045028 | import torch
import torch.nn as nn
import torch.nn.functional as F
class SampaddingConv1D_BN(nn.Module):
def __init__(self,in_channels,out_channels,kernel_size):
super(SampaddingConv1D_BN, self).__init__()
self.padding = nn.ConstantPad1d((int((kernel_size-1)/2), int(kernel_size/2)), 0)
se... | temp20218/MRM2 | models/OS_CNNMRM2.py | OS_CNNMRM2.py | py | 3,140 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "torch.nn.Module",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "torch.nn.ConstantPad1d",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"li... |
36499329461 | import numpy as np
import argparse
import os
parser = argparse.ArgumentParser(description='data')
parser.add_argument('--file', type=str, default="Data")
parser.add_argument('--length', type=int, default=3)
parser.add_argument('--train_size', type=float, default=1e6)
parser.add_argument('--test_size', type=float, def... | guyuntian/CoT_benchmark | equation/data.py | data.py | py | 5,038 | python | en | code | 7 | github-code | 97 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "numpy.aran... |
22149446496 | import sys
import numpy as np
import matplotlib.pyplot as plt
import deepxde as dde
from deepxde.data.data import Data
from deepxde.data.sampler import BatchSampler
from deepxde.backend import tf
import keras.backend as K
from tensorflow import keras
from tensorflow.keras.layers import *
from tensorflow.keras.models im... | Jasiuk-Research-Group/ResUNet-DeepONet-Plasticity | ResUNet-DeepONet.py | ResUNet-DeepONet.py | py | 15,819 | python | en | code | 5 | github-code | 97 | [
{
"api_name": "tensorflow.config.set_soft_device_placement",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tensorflow.config",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.keras.regularizers.L2",
"line_number": 67,
"usage_type": "c... |
11999387891 | import datetime
import re
import calendar
from __future__ import division # da mi deljenje celih stevil vrne float
def decode_duration(duration=False):
years = months = days = 0
pattern = r"(\d{1,2})-(\d{1,2})-(\d{1,2})"
if duration:
m = re.match(pattern, duration)
if m:
g = m.g... | blazprog/codesnips | delovna_dobe/delovna_doba.py | delovna_doba.py | py | 8,001 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "re.match",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "calendar.isleap",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_numb... |
14654412510 | import time
from youtube_transcript_api import YouTubeTranscriptApi
from youtube_transcript_api.formatters import WebVTTFormatter
from .step import Step
from .step import StepException
class DownloadCaptions(Step):
def process(self, data, inputs, utils):
start = time.time()
for yt in data:
... | JiaLGuo/yt-concate | yt_concate/pipeline/steps/download_captions.py | download_captions.py | py | 1,181 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "step.Step",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "time.time",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "youtube_transcript_api.YouTubeTranscriptApi.get_transcript",
"line_number": 19,
"usage_type": "call"
},
{
"api... |
1334810263 | import pytest as pt
add_incompatible_paths = ["operator/add_bool_nil.lox",
"operator/add_bool_num.lox",
"operator/add_bool_string.lox",
"operator/add_nil_nil.lox",
"operator/add_num_nil.lox",
... | MtScience/PyLox | test/operator/test_operator.py | test_operator.py | py | 6,742 | python | en | code | 5 | github-code | 97 | [
{
"api_name": "pytest.raises",
"line_number": 137,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 135,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 135,
"usage_type": "attribute"
},
{
"api_name": "pytest.rais... |
42866965729 | import sys,getopt,threadpool,random,xlrd,os
sys.path.append('.')
sys.path.append('..')
from src.offer.baseInfoCollect.collect_email import EmailCollecter
from src.offer.baseInfoCollect.collect_browser import BrowserCollecter
from src.offer.baseInfoCollect.collect_identity_chinese import CollectCHAddr
from src.offer.bas... | vaststar/SideLine_Client | src/offer/baseInfoCollect/run.py | run.py | py | 5,117 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sys.path.append",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_numbe... |
38050649816 | # -*- coding: utf-8 -*-
import networkx as nx
import matplotlib.pyplot as plt
from collections import deque
from heapq import heappush, heappop
from itertools import count
#-----------------------------------------
# FILE DEDICATED TO PROTOTYPING FEATURES
#-----------------------------------------
def dijkstra(G, in... | henriquenovais/GraphPython | prtty.py | prtty.py | py | 8,533 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "heapq.heappush",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "heapq.heappop",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "itertools.count",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "networkx.NodeNotFound",
... |
33320787798 | __doc__ = """"""
__all__ = ["_Callback"]
from typing import TypeVar # TODO: For python 3.11, we can use typing.Self
from typing import Callable, Optional, Protocol, Union
import inspect
import itertools
import os
import pathlib
import matplotlib.pyplot as plt
SelfCallback = TypeVar("SelfCallback", bound="_Callback... | GazzolaLab/MiV-OS | miv/core/operator/callback.py | callback.py | py | 3,011 | python | en | code | 12 | github-code | 97 | [
{
"api_name": "typing.TypeVar",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "itertools.chain.from_iterable",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "itertools.chain",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "ite... |
34588789237 | import numpy as np
from skimage import morphology
import skimage.filters as filters
import glob
import os
import csv
import tqdm
import scipy.signal as sps
from bird import utils
from bird import signal_processing as sp
def preprocess_sound_file(filename, class_dir, noise_dir, segment_size_seconds):
""" Preproces... | johnmartinsson/bird-species-classification | bird/preprocessing.py | preprocessing.py | py | 8,947 | python | en | code | 112 | github-code | 97 | [
{
"api_name": "bird.utils.read_wave_file_not_normalized",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "bird.utils",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "numpy.zeros",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy... |
8347099530 | import torch
import torch.nn as nn
import torch.nn.functional as F
from domainbed.optimizers import get_optimizer
from domainbed.networks.ur_networks import URFeaturizer
from domainbed.lib import misc
from domainbed.algorithms import Algorithm
class ForwardModel(nn.Module):
"""Forward model is used to reduce gpu... | kakaobrain/miro | domainbed/algorithms/miro.py | miro.py | py | 4,382 | python | en | code | 79 | github-code | 97 | [
{
"api_name": "torch.nn.Module",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "torch.nn.Module",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"li... |
5124398792 | import sys
sys.path.insert(0, "./mmdetection")
import os
# Check Pytorch installation
import torch
import torchvision
print(torch.__version__, torch.cuda.is_available())
# Check mmcv installation
from mmcv.ops import get_compiler_version, get_compiling_cuda_version
print(get_compiling_cuda_version())
print(get_co... | DJAlexJ/Covid-Detection-Radiographs | script_mmdet.py | script_mmdet.py | py | 7,356 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sys.path.insert",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "torch.__version__",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.cuda.is_avai... |
38117730377 | import csv, re
from django.core.management import BaseCommand, CommandError
from django.utils import timezone
from ipdb import set_trace as trace
from datetime import date, timedelta
from simple_history.utils import update_change_reason
import openpyxl
from skimage import measure
import numpy as np
from uctovnictvo.mo... | enu-sav/enu_django | uctovnictvo/management/commands/import_nepritomnost.py | import_nepritomnost.py | py | 3,339 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.core.management.BaseCommand",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "openpyxl.load_workbook",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 28,
"usage_type": "call"
},
{
"api_name"... |
34952332022 | import music21
from midi2audio import FluidSynth
# from config import *
import os
class EditMid:
def __init__(self, input_name,
output_midi_folder='./edited_midi/', output_midi_name='output.mid',
output_flac_folder='./edited_flac/', output_flac_name='output.flac'):
self.... | WiktorJakobczyk/MusiColorAI | DetectColors/EditMid.py | EditMid.py | py | 2,681 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.path.exists",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_nu... |
18694854380 | import jieba
import numpy as np
import matplotlib.pyplot as plt
from wordcloud import WordCloud, ImageColorGenerator
from PIL import Image
basePath = r"D:/Xm/PyDataAnalysis/PyTextAnalysis/"
#1、读入txt文本数据
text = open(basePath + 'input/employeenotbook.txt','r').read()
#2、结巴分词,默认精确模式。可以添加自定义词典userdict.txt,然后jieba.load... | xuming1985/PyDataAnalysis | PyTextAnalysis/WordCloud.py | WordCloud.py | py | 1,850 | python | zh | code | 0 | github-code | 97 | [
{
"api_name": "jieba.cut",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "wordcloud.WordCloud",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_nu... |
16448876543 | import os
import time
import pydicom
from tkinter import filedialog as dialog
import tkinter as tk
from imgObject import imgObject
from math import floor,inf
import numpy as np
# Handler responsável por abrir os arquivos dicom
# e extrair as informações + imagens
def openDicomFiles(files,examName,quantity=None):
... | DaviCS93/T2Star | dicomHandler.py | dicomHandler.py | py | 1,305 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "math.floor",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pydicom.dcmread",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pydicom.dcmread",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_nu... |
72065137279 | import hypothesis.strategies as st
from tests.strategy.random import Random
from tests.strategy.finite_function import FiniteFunctionStrategies as FinFun
from tests.strategy.hypergraph import HypergraphStrategies as Hyp
class OpenHypergraphStrategies:
OpenHypergraph = None
@classmethod
@st.composite
... | statusfailed/open-hypergraphs | tests/strategy/open_hypergraph.py | open_hypergraph.py | py | 2,855 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "tests.strategy.random.Random",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "tests.strategy.hypergraph.HypergraphStrategies.objects",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tests.strategy.hypergraph.HypergraphStrategies",
"line_nu... |
70914792000 | # -*- coding: UTF-8 -*-
import networkx as nx
import numpy as np
import random
from collections import Counter
def edge_rank(graph):
'''
:return: edge selected ranked by edge betweenness centrality
'''
d = nx.edge_betweenness_centrality(graph)
rank_list = Counter(d).most_common()
edge_select ... | GalateaWang/S2GNs-master | Rank.py | Rank.py | py | 1,716 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "networkx.edge_betweenness_centrality",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "networkx.core_number",
"line_number": 25,
"usage_type": "call"
},
{
"api... |
23243165478 | # -*- coding: utf-8 -*-
"""
Created on Sun Nov 25 08:25:00 2018
@author: lotus
"""
import json
import itertools
import math
import pandas as pd
def getJSON(filePath):
with open(filePath, encoding='utf-8-sig') as f:
return json.load(f)
def writeJSON(filePath, obj):
with open(filePath... | arvindkalyan/ncbca_repo | nt history.py | nt history.py | py | 4,157 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "json.load",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_num... |
26333967454 | import asyncio
from datetime import timedelta, datetime
import pytest
from mock import patch
from typing import Any, Iterator
from server_utils import util
@pytest.fixture
def mock_start_time() -> datetime:
return datetime(2020, 5, 1)
@pytest.fixture
def mock_utc_now(mock_start_time: datetime) -> Iterator[dat... | Opentrons/opentrons | server-utils/tests/test_util.py | test_util.py | py | 2,428 | python | en | code | 363 | github-code | 97 | [
{
"api_name": "datetime.datetime",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "datetime.date... |
73110267199 | import os
import json
import csv
source_directory = "dataset/exist_stackexchange"
destination_directory = 'dataset/transfer_csv_stackexchange'
for filename in os.listdir(source_directory):
if filename.endswith(".json"):
filepath = os.path.join(source_directory, filename)
# read json
wit... | JiaqiFlora/DataMining_Final | transfer_exist_stackexchange.py | transfer_exist_stackexchange.py | py | 948 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.listdir",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 1... |
3099122077 | from django.urls import path
from . import views, api
urlpatterns = [
# views.py
path ('dashboard/', views.dashboard),
path('store/new/', views.create_store),
path('store/<int:store_id>/', views.read_store),
path('store/<int:store_id>/settings/', views.update_store),
path('store/<int:store_id>... | ngafar/catalogusto | apps/store/urls.py | urls.py | py | 1,089 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
30380007246 | # Andrew Lee Zupon
# LING 538 Fall 02017
# FINAL PROJECT LSTM TRAINING
# Python 3
##### IMPORT PACKAGES #####
import numpy as np
import pickle
import sys
from tqdm import tqdm
import dynet_config
dynet_config.set(
mem=4096,
autobatch=True, # utilize autobatching
random_seed=1978 # simp... | zupon/zupon_andrew_hw4 | hw3_files/docker_files/lstm_train.py | lstm_train.py | py | 9,455 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "dynet_config.set",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "dynet.ParameterCollection",
"line_number": 179,
"usage_type": "call"
},
{
"api_name": "dynet.LSTMBuilder",
"line_number": 210,
"usage_type": "call"
},
{
"api_name": "dynet.... |
417746137 | from datastore import *
from google.appengine.ext import ndb
import logging
from datetime import datetime
def calc_value(amount, time, roi):
return int(amount + (amount * (roi / 36500.0) * time))
def calc_recuuring_value(amount, time, roi, compounding_in_one_year=4):
total = 0
time_months = time/30
f... | dogen-z/dr-fin | lib/calculation.py | calculation.py | py | 7,165 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "datetime.datetime.now",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "google.appengine.ext.ndb.Key",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "... |
10066501759 | import os
import pytz
from datetime import datetime
from django import template
from django.utils import timezone
from django.core import exceptions
register = template.Library()
@register.filter
def filename(value):
"""
returns just the file name
"""
return os.path.basename(value.name)
@regist... | PaulleDemon/Email-automation | email_automation/templatetags/custom_tags.py | custom_tags.py | py | 1,107 | python | en | code | 14 | github-code | 97 | [
{
"api_name": "django.template.Library",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "os.path.basename",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
30508597283 | from __future__ import annotations
from romkit.models.machine import Machine
from romkit.util.dict_utils import slice_only
import json
from enum import Enum
from pathlib import Path
class MetadataModifier(Enum):
MERGE = '|'
REPLACE = '~'
# Represents a metadata database for a system
class Metadata:
def... | obrie/retrokit | lib/romkit/processing/metadata.py | metadata.py | py | 5,507 | python | en | code | 7 | github-code | 97 | [
{
"api_name": "enum.Enum",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "romkit.util.dict_utils.slice_only",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "json.get",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
... |
3418266292 | from bs4 import BeautifulSoup
from requests import get
class Scraper():
def __init__(self, link):
self.link = link
self.response = get(self.link, headers='Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36')
self.soup = ''
... | huzaifabaloch/Web-Crawling | Real Estate/real_estate/real_estate/spiders/page_scraper.py | page_scraper.py | py | 435 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 15,
"usage_type": "call"
}
] |
23280228379 | import os
from multiprocessing import Process, Queue
from tqdm import tqdm
from vi_news_crawler import *
ALL_CLASSES = [DanTriCrawler, DoiSongPhapLuatCrawler,
ThanhnienCrawler, TuoitreCrawler, VnExpressCrawler]
bar1 = tqdm()
bar2 = tqdm()
def write(queue):
while True:
crawler, category, ... | hieunguyen1053/vi-news-crawler | queue_run.py | queue_run.py | py | 1,050 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "tqdm.tqdm",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
... |
25163064286 | #!/usr/bin/env python3
""" Amazon SageMaker Debugger is an offering from AWS which helps you automate the debugging of machine learning training jobs.
This library powers Amazon SageMaker Debugger, and helps you develop better, faster and cheaper models by catching common errors quickly.
It allows you to save tensors f... | awslabs/sagemaker-debugger | setup.py | setup.py | py | 3,290 | python | en | code | 157 | github-code | 97 | [
{
"api_name": "compile_protobuf.compile_protobuf",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "setuptools.setup",
"line_number": 48,
"usage_type": "call"
},
{
"api_n... |
14777458451 | import json
import boto3
import os
def lambda_handler(event, context):
return {
"statusCode": 200,
"body": json.dumps({
"message": "********************************\n** Welcome to the BBS server. **\n********************************",
"cognito_client_id": os.environ['USER_PO... | oscar86hsu/NCTU_NP_BBS_Serverless | server/functions/hello_world/app.py | app.py | py | 422 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "json.dumps",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
}
] |
3876012908 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from .constants import VOLUME_CIPHER_KEY
from .index import IndexFile
from .crypto import chacha20_decrypt, \
get_stream_cryptor_iv
from .structs import PackedFile
from .util import CmdLineParser, \
ColoredFormatter, ShutdownHandl... | flatz/gt7tool | gt7tool/__main__.py | __main__.py | py | 8,060 | python | en | code | 11 | github-code | 97 | [
{
"api_name": "index.IndexFile",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "logging.info",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "crypto.get_stream_cryptor_iv",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "crypto.chac... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.